Ticket #2839: confirm-wiki.patch
| File confirm-wiki.patch, 1.4 kB (added by eblot, 3 years ago) |
|---|
-
htdocs/js/trac.js
old new 126 126 addLinks(container.getElementsByTagName('h' + lvl)); 127 127 } 128 128 } 129 130 function confirmWiki() { 131 var comment = document.getElementById("comment"); 132 133 if ( comment.value == '' ) { 134 var force; 135 136 force = confirm('Comment field is empty.\n' + 137 'Are you sure to leave the modifications with no comments ?\n' + 138 '(Comments are useful to get a quick overview of the changes)'); 139 140 if ( force ) { 141 return true; 142 } 143 else { 144 comment.focus(); 145 146 return false; 147 } 148 149 } 150 151 return true; 152 } 153 -
templates/wiki.cs
old new 264 264 <input type="submit" name="save" value="Submit changes" disabled="disabled" /> 265 265 <?cs else ?> 266 266 <input type="submit" name="preview" value="Preview" accesskey="r" /> 267 <input type="submit" name="save" value="Submit changes" /> 267 <?cs if wiki.action == "preview" ?> 268 <input type="submit" name="save" value="Submit changes" onclick="return confirmWiki()"/> 269 <?cs /if ?> 268 270 <?cs /if ?> 269 271 <input type="submit" name="cancel" value="Cancel" /> 270 272 </div>
