xref: /plugin/publish/script.js (revision ff9bc75f95d3b96a66748a18884bf0b9fa97990c)
1//Autocomment for Approve Button
2function approval_checkbox(text) {
3  if(text == "") { return true; }
4  var cb=document.getElementById('approved');
5  if(cb == null) { return true; } //huh?
6  if(!cb.checked) { return true; } //this only fires on set
7  var sum=document.getElementById('edit__summary');
8  if(sum == null) { return true; } //huh?
9  if(sum.value != '') { return true; } // already set
10  sum.value = text;
11
12  // in case enforced Comments are installed
13  var btn = document.getElementById('edbtn__save');
14  if(btn == null) { return true; } //huh?
15  btn.className = 'button';
16  btn.disabled = false;
17
18  return true;
19}
20