includes/clientside/static/ajax.js
changeset 889 7e933a5c860b
parent 881 01810d32a0d6
child 903 b8db9a7946fc
equal deleted inserted replaced
888:35db370104ab 889:7e933a5c860b
   143   }
   143   }
   144   
   144   
   145   setTimeout(function()
   145   setTimeout(function()
   146     {
   146     {
   147       box.focus();
   147       box.focus();
   148     }, 200);
   148     }, ( aclDisableTransitionFX ? 200 : 750 ));
   149 }
   149 }
   150 
   150 
   151 window.ajaxRenameSubmit = function(obj)
   151 window.ajaxRenameSubmit = function(obj)
   152 {
   152 {
   153   var box = miniPromptGetParent(obj);
   153   var box = miniPromptGetParent(obj);
   154   if ( !box )
   154   if ( !box )
   155     return false;
   155     return false;
   156   
   156   
   157   var input = obj.getElementsByTagName('input')[0];
   157   var input = box.getElementsByTagName('input')[0];
   158   if ( !input )
   158   if ( !input )
   159     return false;
   159     return false;
       
   160     
   160   var newname = input.value;
   161   var newname = input.value;
   161   newname = trim(newname);
   162   newname = trim(newname);
   162   
   163   
   163   if ( newname.length < 1 )
   164   if ( newname.length < 1 )
   164   {
   165   {
   760     {
   761     {
   761       $('#theme-selector-inner .theme-selector-spinner').fadeOut(650);
   762       $('#theme-selector-inner .theme-selector-spinner').fadeOut(650);
   762       $('#theme-selector-body').animate({ width: 708 }, 600, function()
   763       $('#theme-selector-body').animate({ width: 708 }, 600, function()
   763         {
   764         {
   764           // avoiding jQuery's fade functions because they insist on toggling display as well
   765           // avoiding jQuery's fade functions because they insist on toggling display as well
   765           changeOpac(0, 'theme-selector-inner');
   766           if ( !aclDisableTransitionFX )
       
   767             changeOpac(0, 'theme-selector-inner');
   766           $('#theme-selector-inner').html('<h3></h3>');
   768           $('#theme-selector-inner').html('<h3></h3>');
   767           $('#theme-selector-inner > h3').text($lang.get('ajax_thmsel_lbl_choosetheme'));
   769           $('#theme-selector-inner > h3').text($lang.get('ajax_thmsel_lbl_choosetheme'));
   768           $('#theme-selector-inner').append('<ul></ul>');
   770           $('#theme-selector-inner').append('<ul></ul>');
   769           for ( var i = 0; i < data.length; i++ )
   771           for ( var i = 0; i < data.length; i++ )
   770           {
   772           {
   779           $('#theme-selector-inner').append('<span class="menuclear"></span>');
   781           $('#theme-selector-inner').append('<span class="menuclear"></span>');
   780           $('#theme-selector-inner').append('<div style="padding-top: 40px;"><a class="abutton abutton_green" style="font-size: larger;" href="#" onclick="ajaxChangeStyleClose(); return false;">' + $lang.get('etc_cancel') + '</a></div>');
   782           $('#theme-selector-inner').append('<div style="padding-top: 40px;"><a class="abutton abutton_green" style="font-size: larger;" href="#" onclick="ajaxChangeStyleClose(); return false;">' + $lang.get('etc_cancel') + '</a></div>');
   781           
   783           
   782           $('#theme-selector-body').animate({ height: $('#theme-selector-inner').height() + 30 }, 600, function()
   784           $('#theme-selector-body').animate({ height: $('#theme-selector-inner').height() + 30 }, 600, function()
   783             {
   785             {
   784               opacity('theme-selector-inner', 0, 100, 750);
   786               if ( !aclDisableTransitionFX )
       
   787                 opacity('theme-selector-inner', 0, 100, 750);
   785             });
   788             });
   786           
   789           
   787           $('#theme-selector-inner li a').click(function()
   790           $('#theme-selector-inner li a').click(function()
   788             {
   791             {
   789               var theme_id = $(this).attr('enano:theme_id');
   792               var theme_id = $(this).attr('enano:theme_id');
   793                   if ( data.length > 1 )
   796                   if ( data.length > 1 )
   794                   {
   797                   {
   795                     $('#theme-selector-inner').css('height', $('#theme-selector-inner').height()).fadeOut(600, function()
   798                     $('#theme-selector-inner').css('height', $('#theme-selector-inner').height()).fadeOut(600, function()
   796                     {
   799                     {
   797                       var div = document.createElement('div');
   800                       var div = document.createElement('div');
   798                       domObjChangeOpac(0, div);
   801                       if ( !aclDisableTransitionFX )
       
   802                         domObjChangeOpac(0, div);
   799                       
   803                       
   800                       $(div).attr('id', 'theme-selector-style-list').append('<h3></h3>');
   804                       $(div).attr('id', 'theme-selector-style-list').append('<h3></h3>');
   801                       $('h3', div).text($lang.get('ajax_thmsel_lbl_choosestyle'));
   805                       $('h3', div).text($lang.get('ajax_thmsel_lbl_choosestyle'));
   802                       
   806                       
   803                       for ( var i = 0; i < data.length; i++ )
   807                       for ( var i = 0; i < data.length; i++ )
   805                         $(div).append('<a class="abutton block stylebtn" id="stylebtn_' + i + '" enano:style_id="' + data[i] + '">' + themeid_to_title(data[i]) + '</a>');
   809                         $(div).append('<a class="abutton block stylebtn" id="stylebtn_' + i + '" enano:style_id="' + data[i] + '">' + themeid_to_title(data[i]) + '</a>');
   806                       }
   810                       }
   807                       
   811                       
   808                       $(div).append('<div style="padding-top: 40px;"><a class="abutton abutton_green" style="font-size: larger;" href="#" onclick="ajaxChangeStyleClose(); return false;">' + $lang.get('etc_cancel') + '</a></div>');
   812                       $(div).append('<div style="padding-top: 40px;"><a class="abutton abutton_green" style="font-size: larger;" href="#" onclick="ajaxChangeStyleClose(); return false;">' + $lang.get('etc_cancel') + '</a></div>');
   809                       
   813                       
   810                       changeOpac(0, 'theme-selector-style-list');
   814                       if ( !aclDisableTransitionFX )
       
   815                         changeOpac(0, 'theme-selector-style-list');
   811                       $(this).html(div).show();
   816                       $(this).html(div).show();
   812                       
   817                       
   813                       $('#theme-selector-body').animate({width: 300, height: $('#theme-selector-style-list').height() + 30}, 300, function()
   818                       $('#theme-selector-body').animate({width: 300, height: $('#theme-selector-style-list').height() + 30}, 300, function()
   814                         {
   819                         {
   815                           opacity('theme-selector-style-list', 0, 100, 500);
   820                           if ( !aclDisableTransitionFX )
       
   821                             opacity('theme-selector-style-list', 0, 100, 500);
   816                         });
   822                         });
   817                       
   823                       
   818                       $('.stylebtn').click(function()
   824                       $('.stylebtn').click(function()
   819                         {
   825                         {
   820                           ajaxChangeThemeSetLoading();
   826                           ajaxChangeThemeSetLoading();
   865   $('#theme-selector-inner').empty().html('<div class="theme-selector-spinner"></div>');
   871   $('#theme-selector-inner').empty().html('<div class="theme-selector-spinner"></div>');
   866 }
   872 }
   867 
   873 
   868 window.ajaxChangeThemeShowSuccess = function()
   874 window.ajaxChangeThemeShowSuccess = function()
   869 {
   875 {
       
   876   if ( aclDisableTransitionFX )
       
   877   {
       
   878     $('#theme-selector-inner').empty();
       
   879   }
       
   880   else
       
   881   {
       
   882     setTimeout(function()
       
   883       {
       
   884         $('#theme-selector-inner').empty();
       
   885       }, 10);
       
   886   }
       
   887   
   870   $('#theme-selector-body').animate({width: 400, height: 300 }, 600, function()
   888   $('#theme-selector-body').animate({width: 400, height: 300 }, 600, function()
   871       {
   889       {
   872         $('#theme-selector-inner').append('<img src="' + cdnPath + '/images/check-large.png" alt=" " style="display: block; margin: 15px auto;" />');
   890         $('#theme-selector-inner').append('<img src="' + cdnPath + '/images/check-large.png" alt=" " style="display: block; margin: 15px auto;" />');
   873         $('#theme-selector-inner').append('<h3>' + $lang.get('ajax_thmsel_msg_success') + '</h3>');
   891         $('#theme-selector-inner').append('<h3>' + $lang.get('ajax_thmsel_msg_success') + '</h3>');
   874         $('#theme-selector-inner').append('<div style="padding-top: 20px;"><a class="abutton abutton_green" style="font-size: larger;" href="#" onclick="window.location.reload(); return false;">' + $lang.get('ajax_thmsel_btn_reload') + '</a></div>');
   892         $('#theme-selector-inner').append('<div style="padding-top: 20px;"><a class="abutton abutton_green" style="font-size: larger;" href="#" onclick="window.location.reload(); return false;">' + $lang.get('ajax_thmsel_btn_reload') + '</a></div>');
   875         $('#theme-selector-inner').append('<div style="padding-top: 25px;"><a href="#" style="font-size: smaller;" onclick="ajaxChangeStyleClose(); return false;">' + $lang.get('ajax_thmsel_btn_close') + '</a><br /><small>' + $lang.get('ajax_thmsel_btn_close_hint') + '</small></div>');
   893         $('#theme-selector-inner').append('<div style="padding-top: 25px;"><a href="#" style="font-size: smaller;" onclick="ajaxChangeStyleClose(); return false;">' + $lang.get('ajax_thmsel_btn_close') + '</a><br /><small>' + $lang.get('ajax_thmsel_btn_close_hint') + '</small></div>');
   876         $('#theme-selector-inner').fadeIn();
   894         $('#theme-selector-inner').fadeIn();
   877       });
   895       });
   878   setTimeout(function()
       
   879     {
       
   880       $('#theme-selector-inner').empty();
       
   881     }, 10);
       
   882 }
   896 }
   883 
   897 
   884 window.ajaxChangeStyleClose = function()
   898 window.ajaxChangeStyleClose = function()
   885 {
   899 {
   886   setTimeout(function()
   900   setTimeout(function()
   888       enlighten(false, 'theme-selector-shade');
   902       enlighten(false, 'theme-selector-shade');
   889       $('#theme-selector-wrapper').fadeOut(500, function()
   903       $('#theme-selector-wrapper').fadeOut(500, function()
   890         {
   904         {
   891           $(this).remove();
   905           $(this).remove();
   892         });
   906         });
   893     }, 300);
   907     }, ( aclDisableTransitionFX ? 0 : 300));
   894   opacity('theme-selector-inner', 100, 0, 250);
   908   if ( !aclDisableTransitionFX )
       
   909     opacity('theme-selector-inner', 100, 0, 250);
   895 }
   910 }
   896 
   911 
   897 function themeid_to_title(id)
   912 function themeid_to_title(id)
   898 {
   913 {
   899   if ( typeof(id) != 'string' )
   914   if ( typeof(id) != 'string' )