includes/clientside/static/functions.js
changeset 699 c7d737202d59
parent 691 dab7850c098d
child 704 077887be639d
equal deleted inserted replaced
696:bd5069e1f19a 699:c7d737202d59
   152  */
   152  */
   153 
   153 
   154 function handle_invalid_json(response, customerror)
   154 function handle_invalid_json(response, customerror)
   155 {
   155 {
   156   load_component('messagebox');
   156   load_component('messagebox');
   157   load_component('SpryEffects');
   157   load_component('jquery');
       
   158   load_component('jquery-ui');
   158   load_component('fadefilter');
   159   load_component('fadefilter');
   159   load_component('flyin');
   160   load_component('flyin');
   160   load_component('l10n');
   161   load_component('l10n');
   161   
   162   
   162   darken(aclDisableTransitionFX);
   163   darken(aclDisableTransitionFX);
   293         parentdiv.parentNode.removeChild(parentdiv);
   294         parentdiv.parentNode.removeChild(parentdiv);
   294         enlighten(aclDisableTransitionFX);
   295         enlighten(aclDisableTransitionFX);
   295       }
   296       }
   296       else
   297       else
   297       {
   298       {
   298         var effect = new Spry.Effect.Blind(parentdiv, {
   299         $(parentdiv).hide("blind", {}, 1000, function()
   299             from: '100%',
   300           {
   300             to: '0%',
   301             parentdiv.parentNode.removeChild(parentdiv);
   301             duration: '1000'
   302               enlighten();
   302           });
   303           });
   303         var observer = {
       
   304           onPostEffect: function()
       
   305             {
       
   306               parentdiv.parentNode.removeChild(parentdiv);
       
   307               enlighten();
       
   308             }
       
   309           };
       
   310         effect.addObserver(observer);
       
   311         effect.start();
       
   312       }
   304       }
   313     }
   305     }
   314     panel.appendChild(closer);
   306     panel.appendChild(closer);
   315     
   307     
   316   //
   308   //
   331     body.appendChild(box);
   323     body.appendChild(box);
   332     
   324     
   333     
   325     
   334     // calculate position of the box
   326     // calculate position of the box
   335     // box should be exactly 640px high, 480px wide
   327     // box should be exactly 640px high, 480px wide
   336     var top = ( getHeight() / 2 ) - ( $(box).Height() / 2 ) + getScrollOffset();
   328     var top = ( getHeight() / 2 ) - ( $dynano(box).Height() / 2 ) + getScrollOffset();
   337     var left = ( getWidth() / 2 ) - ( $(box).Width() / 2 );
   329     var left = ( getWidth() / 2 ) - ( $dynano(box).Width() / 2 );
   338     console.debug('top = %d, left = %d', top, left);
   330     console.debug('top = %d, left = %d', top, left);
   339     box.style.top = top + 'px';
   331     box.style.top = top + 'px';
   340     box.style.left = left + 'px';
   332     box.style.left = left + 'px';
   341     
   333     
   342     // we have width and height, set display to none and reset opacity
   334     // we have width and height, set display to none and reset opacity
   350       box.style.display = 'none';
   342       box.style.display = 'none';
   351       domObjChangeOpac(100, box);
   343       domObjChangeOpac(100, box);
   352       
   344       
   353       setTimeout(function()
   345       setTimeout(function()
   354         {
   346         {
   355           (new Spry.Effect.Blind(box, {
   347           $(box).show("blind", {}, 1000);
   356               from: '0%',
       
   357               to: '100%',
       
   358               duration: 1000
       
   359             })).start();
       
   360         }, 1000);
   348         }, 1000);
   361     }
   349     }
   362   return false;
   350   return false;
   363 }
   351 }
   364 
   352 
   575 }
   563 }
   576 
   564 
   577 // draw a white ajax-ey "loading" box over an object
   565 // draw a white ajax-ey "loading" box over an object
   578 function whiteOutElement(el)
   566 function whiteOutElement(el)
   579 {
   567 {
   580   var top = $(el).Top();
   568   var top = $dynano(el).Top();
   581   var left = $(el).Left();
   569   var left = $dynano(el).Left();
   582   var width = $(el).Width();
   570   var width = $dynano(el).Width();
   583   var height = $(el).Height();
   571   var height = $dynano(el).Height();
   584   
   572   
   585   var blackout = document.createElement('div');
   573   var blackout = document.createElement('div');
   586   // using fixed here allows modal windows to be blacked out
   574   // using fixed here allows modal windows to be blacked out
   587   blackout.style.position = ( el.style.position == 'fixed' ) ? 'fixed' : 'absolute';
   575   blackout.style.position = ( el.style.position == 'fixed' ) ? 'fixed' : 'absolute';
   588   blackout.style.top = top + 'px';
   576   blackout.style.top = top + 'px';
   590   blackout.style.width = width + 'px';
   578   blackout.style.width = width + 'px';
   591   blackout.style.height = height + 'px';
   579   blackout.style.height = height + 'px';
   592   
   580   
   593   blackout.style.backgroundColor = '#FFFFFF';
   581   blackout.style.backgroundColor = '#FFFFFF';
   594   domObjChangeOpac(60, blackout);
   582   domObjChangeOpac(60, blackout);
   595   var background = ( $(el).Height() < 48 ) ? 'url(' + scriptPath + '/images/loading.gif)' : 'url(' + scriptPath + '/includes/clientside/tinymce/themes/advanced/skins/default/img/progress.gif)';
   583   var background = ( $dynano(el).Height() < 48 ) ? 'url(' + scriptPath + '/images/loading.gif)' : 'url(' + scriptPath + '/includes/clientside/tinymce/themes/advanced/skins/default/img/progress.gif)';
   596   blackout.style.backgroundImage = background;
   584   blackout.style.backgroundImage = background;
   597   blackout.style.backgroundPosition = 'center center';
   585   blackout.style.backgroundPosition = 'center center';
   598   blackout.style.backgroundRepeat = 'no-repeat';
   586   blackout.style.backgroundRepeat = 'no-repeat';
   599   blackout.style.zIndex = getHighestZ() + 2;
   587   blackout.style.zIndex = getHighestZ() + 2;
   600   
   588