tips:summary_enforcement
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tips:summary_enforcement [2009-02-28 16:47] – fixed broken 'caching' link efege | tips:summary_enforcement [2023-06-19 15:20] (current) – [Plugin available] asheenlevrai | ||
---|---|---|---|
Line 3: | Line 3: | ||
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" | ||
- | ===== Version Dependencies | + | ===== Description |
- | At the time of this writing, the current stable version of Dokuwiki ([[http:// | + | The enhancement is very simple. |
- | <code javascript> | + | * Provide a non-blank |
- | | + | |
- | | + | |
- | </ | + | |
- | to these lines: | + | The '' |
- | <code javascript> | + | It's possible to modify the code so that a summary |
- | addEvent(summary, | + | |
- | addEvent(summary, | + | |
- | </ | + | |
- | This fix has already been checked in and will appear in subsequent releases of Dokuwiki. | + | ===== Plugin available ===== |
- | ===== Description ===== | + | There' |
- | The enhancement is very simple. | + | NOTE: This plugin looks like it's no longer maintained by its author. |
- | * Provide a non-blank summary; or | + | ===== Dokuwiki 2011-11-10 “Angua” ===== |
- | * Check the "minor changes" | + | |
- | The '' | + | To install this enhancement, |
- | It's possible to modify | + | This code uses jQuery, which has been [[devel: |
+ | |||
+ | <file javascript script.js> | ||
+ | jQuery(document).ready(function() { | ||
+ | minSummaryLength = 15; | ||
+ | $editButton = jQuery("# | ||
+ | $minorEdit = jQuery("# | ||
+ | $summary | ||
+ | $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(" | ||
+ | } | ||
+ | } | ||
+ | </ | ||
- | ===== The Javascript | + | ===== Older Dokuwiki versions |
To install this enhancement, | To install this enhancement, | ||
Line 84: | Line 99: | ||
</ | </ | ||
- | ===== 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 228: | Line 243: | ||
--- // | --- // | ||
+ | |||
+ | I have an alternate version of the enforceSummary function which uses a popup instead | ||
+ | < | ||
+ | function enforceSummary() | ||
+ | { | ||
+ | var btn_save = document.getElementById(' | ||
+ | var summary_input = document.getElementById(' | ||
+ | var minoredit_input = document.getElementById(' | ||
+ | |||
+ | if(summary_input.value.replace(/ | ||
+ | { | ||
+ | btn_save.onclick=function(e) | ||
+ | { | ||
+ | alert(" | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | --- 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.1235836062.txt.gz · Last modified: 2009-09-17 18:05 (external edit)