themes/enanium/js/inlinerename.js
changeset 955 de4f81abc5e3
parent 921 a71de5e21423
child 958 3dafe0969e5a
equal deleted inserted replaced
954:995d36f39ba3 955:de4f81abc5e3
       
     1 // Sidebar collapse
       
     2 function enanium_toggle_sidebar_right()
       
     3 {
       
     4   if ( document.getElementById('enanium_sidebar_right').style.display == 'none' )
       
     5   {
       
     6     // show
       
     7     document.getElementById('enanium_sidebar_right').style.display = 'block';
       
     8     document.getElementById('enanium_sidebar_right_hidden').style.display = 'none';
       
     9     createCookie('right_sidebar', 'open', 365);
       
    10   }
       
    11   else
       
    12   {
       
    13     // hide
       
    14     document.getElementById('enanium_sidebar_right').style.display = 'none';
       
    15     document.getElementById('enanium_sidebar_right_hidden').style.display = 'block';
       
    16     createCookie('right_sidebar', 'collapsed', 365);
       
    17   }
       
    18 }
       
    19 
       
    20 addOnloadHook(function()
       
    21   {
       
    22     if ( readCookie('right_sidebar') == 'collapsed' )
       
    23     {
       
    24       document.getElementById('enanium_sidebar_right').style.display = 'none';
       
    25       document.getElementById('enanium_sidebar_right_hidden').style.display = 'block';
       
    26     }
       
    27   });
       
    28 
       
    29 // Inline rename
       
    30 
     1 function ajaxRenameInline()
    31 function ajaxRenameInline()
     2 {
    32 {
     3   if ( KILL_SWITCH || IE )
    33   if ( KILL_SWITCH || IE )
     4     return false;
    34     return false;
     5   // This trick is _so_ vBulletin...
    35   // This trick is _so_ vBulletin...
    74   //elem1.innerHTML = value;
   104   //elem1.innerHTML = value;
    75   elem1.style.display = 'block';
   105   elem1.style.display = 'block';
    76   document.onclick = null;
   106   document.onclick = null;
    77 }
   107 }
    78 
   108 
    79 addOnloadHook(function()
   109 if ( window.auth_rename )
    80   {
   110 {
    81     var h2 = document.getElementById('h2PageName');
   111   addOnloadHook(function()
    82     if ( h2 )
       
    83     {
   112     {
    84       h2.ondblclick = function()
   113       var h2 = document.getElementById('h2PageName');
       
   114       if ( h2 )
    85       {
   115       {
    86         ajaxRenameInline();
   116         h2.ondblclick = function()
       
   117         {
       
   118           ajaxRenameInline();
       
   119         }
    87       }
   120       }
    88     }
   121     });
    89   });
   122 }