Author: remi
Date: 2009-03-16 16:20:20 +0100 (Mon, 16 Mar 2009)
New Revision: 4090

Added:
   software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/web_gadget.xsl
Modified:
   software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/gadgets.xsl
Log:
* added a xsl file for the web gadgets
* added some links in the xsl of the gadgets informations

Modified: software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/gadgets.xsl
===================================================================
--- software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/gadgets.xsl 
2009-03-16 15:18:57 UTC (rev 4089)
+++ software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/gadgets.xsl 
2009-03-16 15:20:20 UTC (rev 4090)
@@ -54,6 +54,27 @@
                     <span style="font-weight:bold">TGF file : </span>
                     <xsl:value-of select="description/tgf_file"/>
                 </div>
+                <div 
style="margin-left:20px;font-size:10pt;background-color:#FFFFFF">
+                    <span style="font-weight:bold">Web Gadget : 
+                        <xsl:element name="a">
+                            <xsl:attribute name="href">
+                                <xsl:value-of 
select="description/web_gadget_url"/>
+                            </xsl:attribute>
+                            Show the Web Gadget
+                        </xsl:element>
+                    </span>
+                </div>
+                <div 
style="margin-left:20px;font-size:10pt;background-color:#FFFFFF">
+                    <span style="font-weight:bold">Google Gadget : 
+                        <xsl:element name="a">
+                            <xsl:attribute name="href">
+                                <xsl:value-of 
select="description/google_gadget_code"/>
+                            </xsl:attribute>
+                            Source Code
+                        </xsl:element>
+                    </span>
+                </div>
+                
             
             <div 
style="margin-left:0px;margin-bottom:1em;margin-top:1em;font-size:12pt;background-color:#FFFFFF;font-weight:bold">
                 Commands :

Added: software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/web_gadget.xsl
===================================================================
--- software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/web_gadget.xsl      
                        (rev 0)
+++ software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/web_gadget.xsl      
2009-03-16 15:20:20 UTC (rev 4090)
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns="http://www.w3.org/1999/xhtml";>
+    <head>
+    <script language="javascript">
+    <![CDATA[
+        function start()
+        {
+            var parametersString = "";
+            var command = "check";
+            var uuid = document.getElementById("uuid").value;
+            
+            var parameters = document.getElementsByTagName("input");
+            for (var i = 0; i < parameters.length; i++)
+            {
+                var param = parameters[i];
+                if (param.type != 'button')
+                {
+                    if (param.type == 'checkbox')
+                    {
+                        parametersString += param.name + '=' + param.checked + 
'|';
+                    }
+                    else
+                    {
+                        parametersString += param.name + '=' + param.value + 
'|';
+                    }
+                }
+            }
+            
+            parameters = document.getElementsByTagName("select");
+            for (var i = 0; i < parameters.length; i++)
+            {
+                var param = parameters[i];
+                parametersString += param.name + '=' + param.value + '|';
+            }
+            
+            var url = 
"http://127.0.0.1:270/gadget_framework/start_gadget_by_uuid?command=";;
+            url += command + "&uuid=" + uuid;
+            url += "&parameters=" + parametersString;
+            document.getElementById("fake_image").src = url + "#" + 
Math.random();
+        }
+        
+        function stop()
+        {
+            document.getElementById("fake_image").src = "#";
+            var uuid = document.getElementById("uuid").value;
+            var url = 
"http://127.0.0.1:270/gadget_framework/stop_gadget_by_uuid?";;
+            url += "uuid=" + uuid;
+            document.getElementById("fake_image").src = url + "#" + 
Math.random();
+        }
+    ]]>
+    </script>
+    </head>
+    <body>
+        <xsl:for-each select="root/data">
+            <!-- Show the gadget icon --> 
+            <div 
style="margin-left:0px;font-size:12pt;background-color:#FFFFFF">
+                <xsl:element name="img">
+                    <xsl:attribute name="src">
+                        <xsl:value-of select="description/icon_file"/>
+                    </xsl:attribute>
+                </xsl:element>
+            </div>
+            <div 
style="margin-left:0px;margin-bottom:1em;font-size:12pt;background-color:#FFFFFF">
+                <xsl:value-of select="description/description"/>
+            </div>
+            <!-- Show the Author --> 
+            <div 
style="margin-left:0px;font-size:10pt;background-color:#FFFFFF">
+                <span style="font-weight:bold">Author : </span>
+                <xsl:value-of select="description/author"/>
+            </div>
+            <!-- Show the Version --> 
+            <div 
style="margin-left:0px;margin-bottom:1em;font-size:10pt;background-color:#FFFFFF">
+                <span style="font-weight:bold">Version : </span>
+                <xsl:value-of select="description/version"/>
+            </div>
+            <!-- Gadget UUID --> 
+            <xsl:element name="input">
+                <xsl:attribute name="type">hidden</xsl:attribute>
+                <xsl:attribute name="id">uuid</xsl:attribute>
+                <xsl:attribute name="value">
+                    <xsl:value-of select="description/uuid"/>
+                </xsl:attribute>
+            </xsl:element>
+            <!-- A table for the parameters --> 
+            <table border="0" CELLPADDING="50">
+            <!-- For all parameters --> 
+            <xsl:for-each select="parameters/*">
+                <xsl:if test="category != 'internals'">
+                    <tr>
+                        <td>
+                            <xsl:value-of select="translated_name"/> : 
+                        </td>
+                        <td>
+                            <!-- Parameter is "string" then show it as "input" 
--> 
+                            <xsl:if test="type = 'string'">
+                                <xsl:element name="input">
+                                    <xsl:attribute 
name="type">text</xsl:attribute>
+                                    <xsl:attribute name="name">
+                                        <xsl:value-of select="name"/>
+                                    </xsl:attribute>
+                                    <xsl:attribute name="value">
+                                        <xsl:value-of select="default_value"/>
+                                    </xsl:attribute>
+                                    <xsl:attribute 
name="size">20</xsl:attribute>
+                                </xsl:element>
+                            </xsl:if>
+                            <!-- Parameter is "string" then show it as "input" 
--> 
+                            <xsl:if test="type = 'password'">
+                                <xsl:element name="input">
+                                    <xsl:attribute 
name="type">password</xsl:attribute>
+                                    <xsl:attribute name="name">
+                                        <xsl:value-of select="name"/>
+                                    </xsl:attribute>
+                                    <xsl:attribute name="value">
+                                        <xsl:value-of select="default_value"/>
+                                    </xsl:attribute>
+                                    <xsl:attribute 
name="size">20</xsl:attribute>
+                                </xsl:element>
+                            </xsl:if>
+                            <!-- Parameter is "boolean" then show it as 
"checkbox" --> 
+                            <xsl:if test="type = 'boolean'">
+                                <xsl:element name="input">
+                                    <xsl:attribute 
name="type">checkbox</xsl:attribute>
+                                    <xsl:attribute name="name">
+                                        <xsl:value-of select="name"/>
+                                    </xsl:attribute>
+                                    <xsl:attribute name="value">
+                                        <xsl:value-of select="default_value"/>
+                                    </xsl:attribute>
+                                </xsl:element>
+                            </xsl:if>
+                            <!-- Parameter is "enum" then show it as "input" 
--> 
+                            <xsl:if test="type = 'enum'">
+                                <xsl:element name="select">
+                                    <xsl:attribute name="name">
+                                        <xsl:value-of select="name"/>
+                                    </xsl:attribute>
+                                    <xsl:for-each select="enum_values/*">
+                                        <xsl:element name="option">
+                                            <xsl:attribute name="value">
+                                                <xsl:value-of select="."/>
+                                            </xsl:attribute>
+                                            <xsl:if test=". = 
../../default_value">
+                                                <xsl:attribute 
name="selected">true</xsl:attribute>
+                                            </xsl:if>
+                                            <xsl:value-of select="."/>
+                                        </xsl:element>
+                                    </xsl:for-each>
+                                </xsl:element>
+                            </xsl:if>
+                        </td>
+                    </tr>
+                </xsl:if>
+                <xsl:if test="category = 'internals'">
+                    <xsl:element name="input">
+                        <xsl:attribute name="type">hidden</xsl:attribute>
+                        <xsl:attribute name="name">
+                            <xsl:value-of select="name"/>
+                        </xsl:attribute>
+                        <xsl:attribute name="value">
+                            <xsl:value-of select="default_value"/>
+                        </xsl:attribute>
+                    </xsl:element>
+                </xsl:if>
+            </xsl:for-each>
+            <tr>
+                <td>
+                    <!-- Add the start button -->
+                    <xsl:element name="input">
+                        <xsl:attribute name="type">button</xsl:attribute>
+                        <xsl:attribute name="value">Start</xsl:attribute>
+                        <xsl:attribute 
name="onclick">javascript:start()</xsl:attribute>
+                        <xsl:attribute name="size">30</xsl:attribute>
+                    </xsl:element>
+                </td>
+                <td>
+                    <!-- Add the stop button -->
+                    <xsl:element name="input">
+                        <xsl:attribute name="type">button</xsl:attribute>
+                        <xsl:attribute name="value">Stop</xsl:attribute>
+                        <xsl:attribute 
name="onclick">javascript:stop()</xsl:attribute>
+                        <xsl:attribute name="size">30</xsl:attribute>
+                    </xsl:element>
+                </td>
+            </tr>
+            </table>
+        </xsl:for-each>
+        <!-- Fake image to execute the gadget --> 
+        <xsl:element name="img">
+            <xsl:attribute name="id">fake_image</xsl:attribute>
+            <xsl:attribute name="src"></xsl:attribute>
+            <xsl:attribute name="width">0</xsl:attribute>
+            <xsl:attribute name="height">0</xsl:attribute>
+        </xsl:element>
+    </body>
+</html>
\ No newline at end of file


Property changes on: 
software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/web_gadget.xsl
___________________________________________________________________
Name: svn:keywords
   + Id


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to