Attachment 'patch.diff'

Download

   1 diff -r 57536a4cb500 wiki/htdocs/common/js/common.js
   2 --- a/wiki/htdocs/common/js/common.js	Sun Dec 09 18:16:51 2007 +0100
   3 +++ b/wiki/htdocs/common/js/common.js	Sun Dec 09 19:46:26 2007 +0100
   4 @@ -168,6 +168,7 @@ function show_switch2gui() {
   5      }
   6  }
   7  
   8 +
   9  function toggleComments() {
  10      // Toggle visibility of every tag with class == *comment*
  11      var all = document.getElementsByTagName('*');
  12 @@ -183,6 +184,31 @@ function toggleComments() {
  13      }
  14  }
  15  
  16 +
  17 +function toggle_toggleComments() {
  18 +    // Disable menu item "ToggleComments" if no inline comments exist on a page
  19 +    var all = document.getElementsByTagName('*');
  20 +    var j = 0;
  21 +    for (i = 0; i < all.length; i++){
  22 +        el = all[i];
  23 +        if ( el.className.indexOf('comment') >= 0 ){
  24 +            j++;
  25 +        }
  26 +    }
  27 +    all = document.getElementsByTagName('*');
  28 +    for (i = 0; i < all.length; i++){
  29 +        el = all[i];
  30 +        if ( el.className.indexOf('toggleCommentsButton') >= 0 ){
  31 +            if ( j > 0 ) {
  32 +                el.parentNode.style.display = '';
  33 +            } else {
  34 +                el.parentNode.style.display = 'none';
  35 +            }
  36 +        }
  37 +    }
  38 +}
  39 +
  40 +
  41  function load() {
  42      // Do not name this "onload", it does not work with IE :-)
  43      // TODO: create separate onload for each type of view and set the
  44 @@ -200,6 +226,9 @@ function load() {
  45      
  46      // Editor stuff
  47      show_switch2gui();
  48 +
  49 +    // Disable menu item "ToggleComments" if no inline comments exist
  50 +    toggle_toggleComments();
  51  }
  52  
  53  

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2007-12-09 19:06:14, 1.5 KB) [[attachment:patch.diff]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.