includes/clientside/static/ajax.js
changeset 420 301f546688d1
parent 413 6607cd646d6d
child 430 ec90736b9cb9
equal deleted inserted replaced
419:b8b4e38825db 420:301f546688d1
    78  * @param string Custom error message. If omitted, the default will be shown.
    78  * @param string Custom error message. If omitted, the default will be shown.
    79  */
    79  */
    80 
    80 
    81 function handle_invalid_json(response, customerror)
    81 function handle_invalid_json(response, customerror)
    82 {
    82 {
    83   var mainwin = $('ajaxEditContainer').object;
    83   var mainwin = $dynano('ajaxEditContainer').object;
    84   mainwin.innerHTML = '';
    84   mainwin.innerHTML = '';
    85   
    85   
    86   // Title
    86   // Title
    87   var h3 = document.createElement('h3');
    87   var h3 = document.createElement('h3');
    88   h3.appendChild(document.createTextNode('The site encountered an error while processing your request.'));
    88   h3.appendChild(document.createTextNode('The site encountered an error while processing your request.'));
   134   a.onclick = function()
   134   a.onclick = function()
   135   {
   135   {
   136     var mb = new messagebox(MB_YESNO | MB_ICONEXCLAMATION, 'Do you really want to view this response as HTML?', 'If the response was changed during transmission to include malicious code, you may be allowing that malicious code to run by viewing the response as HTML. Only do this if you have reviewed the response text and have found no suspicious code in it.');
   136     var mb = new messagebox(MB_YESNO | MB_ICONEXCLAMATION, 'Do you really want to view this response as HTML?', 'If the response was changed during transmission to include malicious code, you may be allowing that malicious code to run by viewing the response as HTML. Only do this if you have reviewed the response text and have found no suspicious code in it.');
   137     mb.onclick['Yes'] = function()
   137     mb.onclick['Yes'] = function()
   138     {
   138     {
   139       var html = $('invalidjson_link').object._resp;
   139       var html = $dynano('invalidjson_link').object._resp;
   140       var win = window.open('about:blank', 'invalidjson_htmlwin', 'width=550,height=400,status=no,toolbars=no,toolbar=no,address=no,scroll=yes');
   140       var win = window.open('about:blank', 'invalidjson_htmlwin', 'width=550,height=400,status=no,toolbars=no,toolbar=no,address=no,scroll=yes');
   141       win.document.write(html);
   141       win.document.write(html);
   142     }
   142     }
   143     return false;
   143     return false;
   144   }
   144   }
   614 function ajaxChangeStyleComplete()
   614 function ajaxChangeStyleComplete()
   615 {
   615 {
   616   // IE <6 pseudo-compatibility
   616   // IE <6 pseudo-compatibility
   617   if ( KILL_SWITCH )
   617   if ( KILL_SWITCH )
   618     return true;
   618     return true;
   619   var theme = $('chtheme_sel_theme');
   619   var theme = $dynano('chtheme_sel_theme');
   620   var style = $('chtheme_sel_style');
   620   var style = $dynano('chtheme_sel_style');
   621   if ( !theme.object || !style.object )
   621   if ( !theme.object || !style.object )
   622   {
   622   {
   623     alert($lang.get('ajax_changestyle_pleaseselect_theme'));
   623     alert($lang.get('ajax_changestyle_pleaseselect_theme'));
   624     return true;
   624     return true;
   625   }
   625   }
  1174   {
  1174   {
  1175     if ( this.loaded )
  1175     if ( this.loaded )
  1176       return true;
  1176       return true;
  1177     var mydiv = document.getElementById('autoCaptcha');
  1177     var mydiv = document.getElementById('autoCaptcha');
  1178     var width = getWidth();
  1178     var width = getWidth();
  1179     var divw = $(mydiv).Width();
  1179     var divw = $dynano(mydiv).Width();
  1180     var left = ( width / 2 ) - ( divw / 2 );
  1180     var left = ( width / 2 ) - ( divw / 2 );
  1181     mydiv.style.left = left + 'px';
  1181     mydiv.style.left = left + 'px';
  1182     fly_in_top(mydiv, false, true);
  1182     fly_in_top(mydiv, false, true);
  1183     this.loaded = true;
  1183     this.loaded = true;
  1184   };
  1184   };