Changed animation on flying message boxes; bugfix for "Array" response in theme changer; added diff CSS to enano-shared; allowed spaces in username during install
authorDan
Mon, 02 Jul 2007 20:33:57 -0400
changeset 39 c83ff194977a
parent 38 ed06961e54dd
child 40 723bb7acf914
Changed animation on flying message boxes; bugfix for "Array" response in theme changer; added diff CSS to enano-shared; allowed spaces in username during install
includes/clientside/css/enano-shared.css
includes/clientside/static/flyin.js
includes/pageutils.php
install.php
themes/oxygen/css/bleu.css
--- a/includes/clientside/css/enano-shared.css	Mon Jul 02 15:17:54 2007 -0400
+++ b/includes/clientside/css/enano-shared.css	Mon Jul 02 20:33:57 2007 -0400
@@ -415,3 +415,10 @@
   background-repeat: no-repeat;
 }
 
+/* Tables where diffs are shown */
+table.diff, td.diff-otitle, td.diff-ntitle { background-color: white; }
+td.diff-addedline { background: #cfc; font-size: smaller; }
+td.diff-deletedline { background: #ffa; font-size: smaller; }
+td.diff-context { background: #eee; font-size: smaller; }
+span.diffchange { color: red; font-weight: bold; }
+
--- a/includes/clientside/static/flyin.js	Mon Jul 02 15:17:54 2007 -0400
+++ b/includes/clientside/static/flyin.js	Mon Jul 02 20:33:57 2007 -0400
@@ -11,6 +11,37 @@
 var FI_UP = 1;
 var FI_DOWN = 2;
 
+/**
+ * You can thank Robert Penner for the math used here. Ported from an ActionScript class.
+ * License: Modified BSD license <http://www.robertpenner.com/easing_terms_of_use.html>
+ */
+
+// Effects code - don't bother changing these formulas
+var Back = {
+  easeOut: function(t, b, c, d, s)
+  {
+    if (s == undefined) s = 1.70158;
+    return c * ( ( t=t/d-1 ) * t * ( ( s + 1 ) * t + s) + 1) + b;
+  },
+  easeIn: function (t, b, c, d, s)
+  {
+    if (s == undefined) s = 1.70158;
+    return c * ( t/=d ) * t * ( ( s + 1 ) * t - s) + b;
+  },
+  easeInOut: function (t, b, c, d, s)
+  {
+    if (s == undefined) s = 1.70158; 
+    if ((t /= d/2) < 1) 
+    {
+      return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
+    }
+    return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
+  }
+}
+
+// This should be set to the class name of the effect you want.
+var GlideEffect = Back;
+
 // Placeholder functions, to make organization a little easier :-)
 
 function fly_in_top(element, nofade, height_taken_care_of)
@@ -91,9 +122,40 @@
   
   var abs_dir = ( ( origin == FI_TOP && direction == FI_IN ) || ( origin == FI_BOTTOM && direction == FI_OUT ) ) ? FI_DOWN : FI_UP;
   
+  var diff_top = top - topi;
+  var diff_left = left - lefti;
+  
+  var frames = 100;
+  var timeout = 0;
+  var timerstep = 8;
+  
+  // cache element so it can be changed from within setTimeout()
+  var rand_seed = Math.floor(Math.random() * 1000000);
+  fly_in_cache[rand_seed] = element;
+  
+  for ( var i = 0; i < frames; i++ )
+  {
+    topc = GlideEffect.easeInOut(i, topi, diff_top, frames);
+    leftc = GlideEffect.easeInOut(i, lefti, diff_left, frames);
+    setTimeout('var o = fly_in_cache['+rand_seed+']; o.style.top=\''+topc+'px\'; o.style.left=\''+leftc+'px\';', timeout);
+    timeout += timerstep;
+    
+    var ratio = i / frames;
+    
+    if ( !nofade )
+    {
+      // handle fade
+      var opac_factor = ratio * 100;
+      if ( direction == FI_OUT )
+        opac_factor = 100 - opac_factor;
+      setTimeout('var o = fly_in_cache['+rand_seed+']; domObjChangeOpac('+opac_factor+', o);', timeout);
+    }
+    
+  }
+  
   /*
    * Framestepper parameters
-   */
+   * /
   
   // starting value for inertia
   var inertiabase = 1;
@@ -106,7 +168,7 @@
   
   /*
    * Timer parameters
-   */
+   * /
   
   // how long animation start is delayed, you want this at 0
   var timer = 0;
@@ -121,12 +183,6 @@
   
   // set element left pos, you can comment this out to preserve left position
   element.style.left = left + 'px';
-  element.style.top  = topi + 'px';
-  
-  if ( nofade )
-  {
-    domObjChangeOpac(100, element);
-  }
   
   // total distance to be traveled
   dist = abs(top - topi);
@@ -181,9 +237,12 @@
       break;
   }
   
-  //timer += timestep;
+  timer += timestep;
   setTimeout('delete(fly_in_cache['+rand_seed+']);', timer);
   return timer;
+  */
+  timeout += timerstep;
+  return timeout;
 }
 
 function abs(i)
--- a/includes/pageutils.php	Mon Jul 02 15:17:54 2007 -0400
+++ b/includes/pageutils.php	Mon Jul 02 20:33:57 2007 -0400
@@ -1366,7 +1366,7 @@
     }
     else
     {
-      return(Array('mode' => 'error', 'error' => $dir.' is not a dir'));
+      return($json->encode(Array('mode' => 'error', 'error' => $dir.' is not a dir')));
     }
     
     return $json->encode($list);
--- a/install.php	Mon Jul 02 15:17:54 2007 -0400
+++ b/install.php	Mon Jul 02 20:33:57 2007 -0400
@@ -754,7 +754,7 @@
       {
         var frm = document.forms.login;
         ret = true;
-        if(frm.admin_user.value.match(/^([A-z0-9_\-\.]+)$/g))
+        if(frm.admin_user.value.match(/^([A-z0-9 \-\.]+)$/g))
         {
           document.getElementById('s_user').src = 'images/good.gif';
         }
--- a/themes/oxygen/css/bleu.css	Mon Jul 02 15:17:54 2007 -0400
+++ b/themes/oxygen/css/bleu.css	Mon Jul 02 20:33:57 2007 -0400
@@ -249,13 +249,6 @@
 /* div#ajaxEditContainer             { overflow: auto; } /* Makes ajaxEditContainer scroll horizontally in firefox if the content is too wide - prevents that ugly clipping effect */
 div#ajaxEditContainer pre         { margin-left: 1em; background-color: #F8F8F8; border: 1px dashed #90B0D0; padding: 10px; overflow: auto; max-height: 150px; }
 
-/* Tables where diffs are shown */
-table.diff, td.diff-otitle, td.diff-ntitle { background-color: white; }
-td.diff-addedline { background: #cfc; font-size: smaller; }
-td.diff-deletedline { background: #ffa; font-size: smaller; }
-td.diff-context { background: #eee; font-size: smaller; }
-span.diffchange { color: red; font-weight: bold; }
-
 /* toolbar */
 div.toolbar {
   border-bottom: 1px solid #909090;