themes/oxygen/header.tpl
changeset 795 ca0c8fc8da6b
parent 744 fcaae08f41a2
child 1196 704ba4b9819b
equal deleted inserted replaced
794:720516162012 795:ca0c8fc8da6b
    85         textbox.type = 'text';
    85         textbox.type = 'text';
    86         textbox.value = name;
    86         textbox.value = name;
    87         textbox.id = 'pageheading';
    87         textbox.id = 'pageheading';
    88         textbox.size = name.length + 7;
    88         textbox.size = name.length + 7;
    89         textbox.onkeyup = function(e) { if(!e) return; if(e.keyCode == 13) ajaxRenameInlineSave(); if(e.keyCode == 27) ajaxRenameInlineCancel(); };
    89         textbox.onkeyup = function(e) { if(!e) return; if(e.keyCode == 13) ajaxRenameInlineSave(); if(e.keyCode == 27) ajaxRenameInlineCancel(); };
       
    90         textbox.oldname = name;
    90         elem.parentNode.insertBefore(textbox, elem);
    91         elem.parentNode.insertBefore(textbox, elem);
    91         document.onclick = ajaxRenameInlineCancel;
    92         document.onclick = ajaxRenameInlineCancel;
    92         
    93         
    93         load_component('l10n');
    94         load_component(['l10n', 'fadefilter', 'messagebox']);
    94         load_component('fadefilter');
    95         textbox.focus();
    95         load_component('messagebox');
    96         textbox.select();
    96       }
    97       }
    97       function ajaxRenameInlineSave()
    98       function ajaxRenameInlineSave()
    98       {
    99       {
    99         elem1 = document.getElementById('h2PageName');
   100         elem1 = document.getElementById('h2PageName');
   100         elem2 = document.getElementById('pageheading');
   101         elem2 = document.getElementById('pageheading');
   102         value = elem2.value;
   103         value = elem2.value;
   103         elem2.parentNode.removeChild(elem2); // just destroy the thing
   104         elem2.parentNode.removeChild(elem2); // just destroy the thing
   104         elem1.removeChild(elem1.firstChild);
   105         elem1.removeChild(elem1.firstChild);
   105         elem1.appendChild(document.createTextNode(value));
   106         elem1.appendChild(document.createTextNode(value));
   106         elem1.style.display = 'block';
   107         elem1.style.display = 'block';
   107         if(!value || value=='') return;
   108         if(!value || value=='' || value==elem2.oldname) return;
       
   109         setAjaxLoading();
   108         ajaxPost(stdAjaxPrefix+'&_mode=rename', 'newtitle='+ajaxEscape(value), function() {
   110         ajaxPost(stdAjaxPrefix+'&_mode=rename', 'newtitle='+ajaxEscape(value), function() {
   109           if ( ajax.readyState == 4 )
   111           if ( ajax.readyState == 4 )
   110           {
   112           {
       
   113             unsetAjaxLoading();
   111             var response = String(ajax.responseText);
   114             var response = String(ajax.responseText);
   112             if ( !check_json_response(response) )
   115             if ( !check_json_response(response) )
   113             {
   116             {
   114               handle_invalid_json(response);
   117               handle_invalid_json(response);
   115               return false;
   118               return false;
   167         <tr><td id="mdg-tl"></td><td id="mdg-top"></td><td id="mdg-tr"></td></tr>
   170         <tr><td id="mdg-tl"></td><td id="mdg-top"></td><td id="mdg-tr"></td></tr>
   168                                                                                   
   171                                                                                   
   169         <tr><td id="mdg-l"></td><td>
   172         <tr><td id="mdg-l"></td><td>
   170         <table border="0" width="100%" id="title" cellspacing="0" cellpadding="0">
   173         <table border="0" width="100%" id="title" cellspacing="0" cellpadding="0">
   171             <tr>
   174             <tr>
   172               <td id="mainhead"><h2><a href="{SCRIPTPATH}/{ADMIN_SID_QUES}">{SITE_NAME}</a></h2><h4>{SITE_DESC}</h4></td>
   175               <td id="mainhead">
       
   176                 <h2><a href="{SCRIPTPATH}/{ADMIN_SID_QUES}">{SITE_NAME}</a></h2>
       
   177                 <h4>{SITE_DESC}</h4>
       
   178               </td>
   173             </tr>            
   179             </tr>            
   174           </table>
   180           </table>
   175         </td><td id="mdg-r"></td></tr>
   181         </td><td id="mdg-r"></td></tr>
   176         
   182         
   177         <tr><td id="mdg-brl"></td><td style="background-color: #FFFFFF;"></td><td id="mdg-brr"></td></tr>
   183         <tr><td id="mdg-brl"></td><td style="background-color: #FFFFFF;"></td><td id="mdg-brr"></td></tr>
   197         <tr><td id="mdg-ml"></td><td style="background-color: #FFFFFF;">
   203         <tr><td id="mdg-ml"></td><td style="background-color: #FFFFFF;">
   198           <div class="pad"><div class="contentDiv">
   204           <div class="pad"><div class="contentDiv">
   199           <div style="float: right;">
   205           <div style="float: right;">
   200             <img alt=" " src="{CDNPATH}/images/spacer.gif" id="ajaxloadicon" />
   206             <img alt=" " src="{CDNPATH}/images/spacer.gif" id="ajaxloadicon" />
   201           </div>
   207           </div>
   202           <h2 <!-- BEGIN auth_rename --> ondblclick="ajaxRenameInline();" title="Double-click to rename this page" <!-- END auth_rename --> id="h2PageName">{PAGE_NAME}</h2>
   208           <h1 <!-- BEGIN auth_rename --> ondblclick="ajaxRenameInline();" title="{lang:onpage_btn_rename_inline}" <!-- END auth_rename --> id="h2PageName">{PAGE_NAME}</h1>
   203             <div id="ajaxEditContainer">
   209             <div id="ajaxEditContainer">