tips:summary_enforcement
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
tips:summary_enforcement [2011-03-09 22:45] – added version with popup 129.170.131.229 | tips:summary_enforcement [2016-03-07 14:20] – [Discussion] 147.65.4.95 | ||
---|---|---|---|
Line 2: | Line 2: | ||
This enhancement requires the user to either provide a summary or check "minor changes" | This enhancement requires the user to either provide a summary or check "minor changes" | ||
- | |||
- | |||
===== Description ===== | ===== Description ===== | ||
Line 16: | Line 14: | ||
It's possible to modify the code so that a summary is always required, as explained below. | It's possible to modify the code so that a summary is always required, as explained below. | ||
- | ===== The Javascript ===== | + | ===== Plugin available ===== |
+ | |||
+ | There' | ||
+ | |||
+ | ===== Dokuwiki 2011-11-10 “Angua” ===== | ||
+ | |||
+ | To install this enhancement, | ||
+ | |||
+ | This code uses jQuery, which has been [[devel: | ||
+ | |||
+ | <file javascript script.js> | ||
+ | jQuery(document).ready(function() { | ||
+ | minSummaryLength = 15; | ||
+ | $editButton = jQuery("# | ||
+ | $minorEdit = jQuery("# | ||
+ | $summary = jQuery("# | ||
+ | $summary.keyup(enforceSummary).focus(enforceSummary); | ||
+ | $minorEdit.change(enforceSummary); | ||
+ | enforceSummary(); | ||
+ | }); | ||
+ | function enforceSummary() { | ||
+ | if ($summary.val() && $summary.val().length < minSummaryLength && !$minorEdit.is(': | ||
+ | $summary.addClass(" | ||
+ | $editButton.attr(" | ||
+ | } else { | ||
+ | $summary.removeClass(" | ||
+ | $editButton.removeAttr(" | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Older Dokuwiki versions | ||
To install this enhancement, | To install this enhancement, | ||
Line 68: | Line 97: | ||
</ | </ | ||
- | ===== The CSS ===== | + | ==== The CSS ==== |
Most browsers will not give you a visual indication that the button is disabled; they just won't let you click on the button. | Most browsers will not give you a visual indication that the button is disabled; they just won't let you click on the button. | ||
Line 232: | Line 261: | ||
</ | </ | ||
--- James 2011/3/9 | --- James 2011/3/9 | ||
+ | |||
+ | Great plugin! | ||
+ | |||
+ | But right now Dokuwiki fills the "Edit Summary" | ||
+ | |||
+ | How do I disable this feature, to enforce a really meaningful summary? | ||
+ | |||
+ | --- Augusto 2016-03-07 | ||
+ |
tips/summary_enforcement.txt · Last modified: 2023-06-19 15:20 by asheenlevrai