Author: remi
Date: 2009-06-20 17:00:05 +0200 (Sat, 20 Jun 2009)
New Revision: 4843

Modified:
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl
Log:
* added javascript functions to show status states

Modified: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl
      2009-06-20 13:52:39 UTC (rev 4842)
+++ 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl
      2009-06-20 15:00:05 UTC (rev 4843)
@@ -12,10 +12,107 @@
         <script src="/data/web_interface/user_01/js/common.js" 
type="text/javascript"/>
         <script type="text/javascript" 
src="/data/web_interface/user_01/js/prototype.js"></script>
         <script type="text/javascript" 
src="/data/web_interface/user_01/js/lightbox.js"></script>
-        <script language="javascript"><![CDATA[]]></script>
+        <script language="javascript">
+        <![CDATA[
+            function initialization()
+            {
+                hideError();
+                showSoundOff();
+                showBatteryState("100");
+                showRadioOff();
+                showDongleOff();
+            }
+
+            function showError(message)
+            {
+                document.getElementById("notifyHintBottom").className = 
"notifyHintBottomError";
+                
document.getElementById("notifyHintErrorMessage").style.display = "";
+                
document.getElementById("notifyHintErrorMessage").firstChild.nodeValue = 
message;
+                document.getElementById("notifyBtnCloseError").style.display = 
"";
+            }
+
+            function hideError()
+            {
+                document.getElementById("notifyHintBottom").className = 
"notifyHintBottom";
+                
document.getElementById("notifyHintErrorMessage").style.display = "none";
+                document.getElementById("notifyBtnCloseError").style.display = 
"none";
+            }
+
+            function showSoundOn()
+            {
+                document.getElementById("statusBtnSoundOn").src = 
"/data/web_interface/user_01/img/status_btn_soundon_activate.png";
+                document.getElementById("statusBtnSoundOff").src = 
"/data/web_interface/user_01/img/status_btn_soundoff_enable.png";
+            }
+
+            function showSoundOff()
+            {
+                document.getElementById("statusBtnSoundOn").src = 
"/data/web_interface/user_01/img/status_btn_soundon_enable.png";
+                document.getElementById("statusBtnSoundOff").src = 
"/data/web_interface/user_01/img/status_btn_soundoff_activate.png";
+            }
+
+            function showBatteryState(state)
+            {
+                if (state == 'charge')
+                {
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_oncharge.png";
+                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "~";
+                }
+                else if (state == '0')
+                {
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_20.png";
+                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "0 %";
+                }
+                else if (state == '20')
+                {
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_20.png";
+                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "20 %";
+                }
+                else if (state == '40')
+                {
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_40.png";
+                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "40 %";
+                }
+                else if (state == '60')
+                {
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_60.png";
+                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "60 %";
+                }
+                else if (state == '80')
+                {
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_80.png";
+                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "80 %";
+                }
+                else
+                {
+                    document.getElementById("statusPicBattery").src = 
"/data/web_interface/user_01/img/status_battery_100.png";
+                    
document.getElementById("statusBatteryLabel").firstChild.nodeValue = "100 %";
+                }
+            }
+
+            function showRadioOn()
+            {
+                document.getElementById("statusRadioOnOff").src = 
"/data/web_interface/user_01/img/status_active_on.png";
+            }
+
+            function showRadioOff()
+            {
+                document.getElementById("statusRadioOnOff").src = 
"/data/web_interface/user_01/img/status_active_off.png";
+            }
+
+            function showDongleOn()
+            {
+                document.getElementById("statusDongleOnOff").src = 
"/data/web_interface/user_01/img/status_active_on.png";
+            }
+
+            function showDongleOff()
+            {
+                document.getElementById("statusDongleOnOff").src = 
"/data/web_interface/user_01/img/status_active_off.png";
+            }
+        ]]>
+        </script>
     </head>
 
-    <body bgcolor="#EFEFEF">
+    <body bgcolor="#EFEFEF" onLoad="initialization();">
         <!-- MAIN DIV FRAME -->
         <div style="position:absolute;
                     left:0px;
@@ -84,12 +181,12 @@
                     </div>
                     <!-- NOTIFIER HINT BOTTOM -->
                     <div class="notifyHintBottomError" id="notifyHintBottom">
-                        <span class="notifyHintErrorMessage" 
id="notifyHintErrorMessage">An error message</span>
+                        <span class="notifyHintErrorMessage" 
id="notifyHintErrorMessage"></span>
                         <!-- CLOSE ERROR HINT -->
                         <xsl:element name="a">
                             <xsl:attribute 
name="class">notifyBtnCloseError</xsl:attribute>
                             <xsl:attribute 
name="id">notifyBtnCloseError</xsl:attribute>
-                            <xsl:attribute name="onclick"></xsl:attribute>
+                            <xsl:attribute 
name="onclick">javascript:hideError();return false;</xsl:attribute>
                             <xsl:attribute name="href">#</xsl:attribute>
                         </xsl:element>
                     </div>
@@ -134,6 +231,7 @@
                 <xsl:element name="img">
                     <xsl:attribute 
name="class">statusBtnSoundOn</xsl:attribute>
                     <xsl:attribute name="id">statusBtnSoundOn</xsl:attribute>
+                    <xsl:attribute 
name="onclick">javascript:showSoundOn();return false;</xsl:attribute>
                     <xsl:attribute 
name="src">/data/web_interface/user_01/img/status_btn_soundon_enable.png</xsl:attribute>
                 </xsl:element>
                 <span class="statusBtnSoundOnLabel"><xsl:value-of 
select="root/translations/sound_on"/></span>
@@ -141,6 +239,7 @@
                 <xsl:element name="img">
                     <xsl:attribute 
name="class">statusBtnSoundOff</xsl:attribute>
                     <xsl:attribute name="id">statusBtnSoundOff</xsl:attribute>
+                    <xsl:attribute 
name="onclick">javascript:showSoundOff();return false;</xsl:attribute>
                     <xsl:attribute 
name="src">/data/web_interface/user_01/img/status_btn_soundoff_activate.png</xsl:attribute>
                 </xsl:element>
                 <span class="statusBtnSoundOffLabel"><xsl:value-of 
select="root/translations/sound_off"/></span>


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to