Enano CMS Project button can fade now
authorDan
Sat, 07 Jul 2007 22:54:20 -0400
changeset 53 3dea509d88ae
parent 52 10ed1f728bf3
child 54 84b56303cab5
Enano CMS Project button can fade now
includes/clientside/static/faders.js
includes/template.php
plugins/SpecialPageFuncs.php
--- a/includes/clientside/static/faders.js	Sat Jul 07 18:33:21 2007 -0400
+++ b/includes/clientside/static/faders.js	Sat Jul 07 22:54:20 2007 -0400
@@ -380,6 +380,32 @@
     }
 }
 
+var opacityDOMCache = new Object();
+function domOpacity(obj, opacStart, opacEnd, millisec) {
+    //speed for each frame
+    var speed = Math.round(millisec / 100);
+    var timer = 0;
+    
+    // unique ID for this animation
+    var uniqid = Math.floor(Math.random() * 1000000);
+    opacityDOMCache[uniqid] = obj;
+
+    //determine the direction for the blending, if start and end are the same nothing happens
+    if(opacStart > opacEnd) {
+        for(i = opacStart; i >= opacEnd; i--) {
+            setTimeout("var obj = opacityDOMCache["+uniqid+"]; domObjChangeOpac(" + i + ",obj)",(timer * speed));
+            timer++;
+        }
+    } else if(opacStart < opacEnd) {
+        for(i = opacStart; i <= opacEnd; i++)
+            {
+            setTimeout("var obj = opacityDOMCache["+uniqid+"]; domObjChangeOpac(" + i + ",obj)",(timer * speed));
+            timer++;
+        }
+    }
+    setTimeout("delete(opacityDOMCache["+uniqid+"]);",(timer * speed));
+}
+
 //change the opacity for different browsers
 function changeOpac(opacity, id) {
     var object = document.getElementById(id).style;
--- a/includes/template.php	Sat Jul 07 18:33:21 2007 -0400
+++ b/includes/template.php	Sat Jul 07 22:54:20 2007 -0400
@@ -23,6 +23,18 @@
   
   var $site_disabled = false;
   
+  /**
+   * One of the absolute best parts of Enano :-P
+   * @var string
+   */
+  
+  var $fading_button = '<a href="http://enanocms.org" onclick="window.open(this.href); return false;" style="text-align: center; margin: 0 auto; display: table; background-image: none;">
+                          <img alt="Powered by Enano CMS" style="border-width: 0; position: absolute;" 
+                               src="/images/about-powered-enano.png" id="enanoFader" onmouseover="domOpacity(this, 100, 0, 500);" 
+                               onmouseout="opacity(this.id, 0, 100, 500);" />
+                          <img alt="Powered by Enano CMS" style="border-width: 0px;" src="/images/about-powered-enano-hover.png" />
+                        </a>';
+  
   function __construct()
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
@@ -1369,7 +1381,6 @@
     // SourceForge/W3C buttons
     $ob = Array();
     $admintitle = ( $session->user_level >= USER_LEVEL_ADMIN ) ? 'title="You may disable this button in the admin panel under General Configuration."' : '';
-    if(getConfig('powered_btn') =='1') $ob[] = '<a style="text-align: center;" href="http://enanocms.org/" onclick="window.open(this.href);return false;"><img '.$admintitle.'  alt="Powered by Enano" src="'.scriptPath.'/images/about-powered-enano.png" onmouseover="this.src=\''.scriptPath.'/images/about-powered-enano-hover.png\';" onmouseout="this.src=\''.scriptPath.'/images/about-powered-enano.png\';" style="border-width: 0px;" width="88" height="31" /></a>';
     if(getConfig('sflogo_enabled')=='1')
     {
       $ob[] = '<a style="text-align: center;" href="http://sourceforge.net/" onclick="window.open(this.href);return false;"><img style="border-width: 0px;" alt="SourceForge.net Logo" src="http://sflogo.sourceforge.net/sflogo.php?group_id='.getConfig('sflogo_groupid').'&amp;type='.getConfig('sflogo_type').'" /></a>';
@@ -1388,7 +1399,7 @@
       eval($cmd);
     }
     
-    if(count($ob) > 0) $sb_links = '<div style="text-align: center; padding: 5px 0;">'.implode('<br />', $ob).'</div>';
+    if(count($ob) > 0) $sb_links = '<div style="text-align: center; padding: 5px 0;">'. ( ( getConfig('powered_btn') == '1' ) ? $this->fading_button : '' ) . implode('<br />', $ob).'</div>';
     else $sb_links = '';
     
     $this->sidebar_widget('Links', $sb_links);
--- a/plugins/SpecialPageFuncs.php	Sat Jul 07 18:33:21 2007 -0400
+++ b/plugins/SpecialPageFuncs.php	Sat Jul 07 22:54:20 2007 -0400
@@ -314,16 +314,16 @@
       </td></tr>
       <tr>
         <td class="row2" colspan="2">
-        <table border="0" style="margin: 0 auto; background: none; width: 100%;" cellpadding="5">
+          <table border="0" style="margin: 0 auto; background: none; width: 100%;" cellpadding="5">
             <tr>
-            <td style="text-align: center;">
+              <td style="text-align: center;">
                 <a href="http://enanocms.org/" onclick="window.open(this.href); return false;" style="background: none; padding: 0;">
-                  <img alt="Powered by Enano"
-                       src="<?php echo scriptPath; ?>/images/about-powered-enano.png"
-                       onmouseover="this.src='<?php echo scriptPath; ?>/images/about-powered-enano-hover.png';"
-                       onmouseout="this.src='<?php echo scriptPath; ?>/images/about-powered-enano.png';"
-                       style="border-width: 0px;" width="88" height="31" />
-                </a>
+                    <img alt="Powered by Enano"
+                         src="<?php echo scriptPath; ?>/images/about-powered-enano.png"
+                         onmouseover="this.src='<?php echo scriptPath; ?>/images/about-powered-enano-hover.png';"
+                         onmouseout="this.src='<?php echo scriptPath; ?>/images/about-powered-enano.png';"
+                         style="border-width: 0px;" width="88" height="31" />
+                  </a>
               </td>
               <td style="text-align: center;">
                 <a href="http://www.php.net/" onclick="window.open(this.href); return false;" style="background: none; padding: 0;">