includes/clientside/static/ajax.js
changeset 907 44851d7e9bda
parent 906 c949e82b8f49
child 946 ff58e1732482
equal deleted inserted replaced
906:c949e82b8f49 907:44851d7e9bda
    40     return true;
    40     return true;
    41   
    41   
    42   // touch this variable to allow it to be used in child functions
    42   // touch this variable to allow it to be used in child functions
    43   void(existing_level);
    43   void(existing_level);
    44   
    44   
       
    45   // require re-auth
       
    46   if ( auth_level <= USER_LEVEL_MEMBER )
       
    47   {
       
    48     load_component(['login', 'fadefilter', 'flyin', 'jquery', 'jquery-ui', 'crypto', 'messagebox']);
       
    49     ajaxDynamicReauth(function(key)
       
    50       {
       
    51         ajaxProtect(existing_level);
       
    52       }, user_level);
       
    53     
       
    54     return false;
       
    55   }
       
    56   
    45   load_component(['messagebox', 'jquery', 'jquery-ui', 'l10n', 'fadefilter', 'flyin']);
    57   load_component(['messagebox', 'jquery', 'jquery-ui', 'l10n', 'fadefilter', 'flyin']);
    46   
    58   
    47   // preload language
    59   // preload language
    48   $lang.get('meta_meta');
    60   $lang.get('meta_meta');
    49   
    61   
   310 window.ajaxDeletePage = function()
   322 window.ajaxDeletePage = function()
   311 {
   323 {
   312   // IE <6 pseudo-compatibility
   324   // IE <6 pseudo-compatibility
   313   if ( KILL_SWITCH )
   325   if ( KILL_SWITCH )
   314     return true;
   326     return true;
       
   327   
       
   328   // require re-auth
       
   329   if ( auth_level <= USER_LEVEL_MEMBER )
       
   330   {
       
   331     load_component(['login', 'fadefilter', 'flyin', 'jquery', 'jquery-ui', 'crypto', 'messagebox']);
       
   332     ajaxDynamicReauth(function(key)
       
   333       {
       
   334         ajaxDeletePage();
       
   335       }, user_level);
       
   336     
       
   337     return false;
       
   338   }
       
   339   
   315   load_component(['l10n', 'messagebox', 'jquery', 'jquery-ui', 'fadefilter', 'flyin']);
   340   load_component(['l10n', 'messagebox', 'jquery', 'jquery-ui', 'fadefilter', 'flyin']);
   316   
   341   
   317   // stage 1: prompt for reason and confirmation
   342   // stage 1: prompt for reason and confirmation
   318   miniPrompt(function(parent)
   343   miniPrompt(function(parent)
   319     {
   344     {
   702 window.ajaxClearLogs = function()
   727 window.ajaxClearLogs = function()
   703 {
   728 {
   704   // IE <6 pseudo-compatibility
   729   // IE <6 pseudo-compatibility
   705   if ( KILL_SWITCH )
   730   if ( KILL_SWITCH )
   706     return true;
   731     return true;
       
   732   
       
   733   // require re-auth
       
   734   if ( auth_level <= USER_LEVEL_MEMBER )
       
   735   {
       
   736     load_component(['login', 'fadefilter', 'flyin', 'jquery', 'jquery-ui', 'crypto', 'messagebox']);
       
   737     ajaxDynamicReauth(function(key)
       
   738       {
       
   739         ajaxClearLogs();
       
   740       }, user_level);
       
   741     
       
   742     return false;
       
   743   }
   707   
   744   
   708   load_component(['l10n', 'messagebox', 'flyin', 'fadefilter']);
   745   load_component(['l10n', 'messagebox', 'flyin', 'fadefilter']);
   709   
   746   
   710   miniPromptMessage({
   747   miniPromptMessage({
   711       title: $lang.get('ajax_clearlogs_confirm_title'),
   748       title: $lang.get('ajax_clearlogs_confirm_title'),