themes/oxygen/header.tpl
changeset 744 fcaae08f41a2
parent 650 e45183014778
child 795 ca0c8fc8da6b
equal deleted inserted replaced
743:0acb5d0f8328 744:fcaae08f41a2
    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         elem.parentNode.insertBefore(textbox, elem);
    90         elem.parentNode.insertBefore(textbox, elem);
    91         document.onclick = ajaxRenameInlineCancel;
    91         document.onclick = ajaxRenameInlineCancel;
       
    92         
       
    93         load_component('l10n');
       
    94         load_component('fadefilter');
       
    95         load_component('messagebox');
    92       }
    96       }
    93       function ajaxRenameInlineSave()
    97       function ajaxRenameInlineSave()
    94       {
    98       {
    95         elem1 = document.getElementById('h2PageName');
    99         elem1 = document.getElementById('h2PageName');
    96         elem2 = document.getElementById('pageheading');
   100         elem2 = document.getElementById('pageheading');
   100         elem1.removeChild(elem1.firstChild);
   104         elem1.removeChild(elem1.firstChild);
   101         elem1.appendChild(document.createTextNode(value));
   105         elem1.appendChild(document.createTextNode(value));
   102         elem1.style.display = 'block';
   106         elem1.style.display = 'block';
   103         if(!value || value=='') return;
   107         if(!value || value=='') return;
   104         ajaxPost(stdAjaxPrefix+'&_mode=rename', 'newtitle='+ajaxEscape(value), function() {
   108         ajaxPost(stdAjaxPrefix+'&_mode=rename', 'newtitle='+ajaxEscape(value), function() {
   105           if(ajax.readyState == 4) {
   109           if ( ajax.readyState == 4 )
   106             alert(ajax.responseText);
   110           {
       
   111             var response = String(ajax.responseText);
       
   112             if ( !check_json_response(response) )
       
   113             {
       
   114               handle_invalid_json(response);
       
   115               return false;
       
   116             }
       
   117             response = parseJSON(response);
       
   118             if ( response.success )
       
   119             {
       
   120               new MessageBox( MB_OK|MB_ICONINFORMATION, $lang.get('ajax_rename_success_title'), $lang.get('ajax_rename_success_body', { page_name_new: value }) );
       
   121             }
       
   122             else
       
   123             {
       
   124               alert(response.error);
       
   125             }
   107           }
   126           }
   108         });
   127         });
   109       }
   128       }
   110       function ajaxRenameInlineCancel(e)
   129       function ajaxRenameInlineCancel(e)
   111       {
   130       {