tux-droid-svn Mailing List for Tux Droid CE (Page 48)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
| 2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
| 2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: jerome <c2m...@c2...> - 2009-06-23 10:00:07
|
Author: jerome Date: 2009-06-23 11:59:15 +0200 (Tue, 23 Jun 2009) New Revision: 4857 Added: software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/en.wiki software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/es.wiki software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/fr.wiki software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/nl.wiki Removed: software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_en.wiki software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_es.wiki software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_fr.wiki software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_nl.wiki Log: * Renamed wiki help to match news criteria . Copied: software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/en.wiki (from rev 4846, software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_en.wiki) =================================================================== --- software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/en.wiki (rev 0) +++ software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/en.wiki 2009-06-23 09:59:15 UTC (rev 4857) @@ -0,0 +1,2 @@ += Synopsis = +This plugin lets Tux Droid start an external application. \ No newline at end of file Copied: software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/es.wiki (from rev 4846, software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_es.wiki) =================================================================== --- software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/es.wiki (rev 0) +++ software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/es.wiki 2009-06-23 09:59:15 UTC (rev 4857) @@ -0,0 +1,2 @@ += Synopsis = +Este plugin permite a Tux Droid lanzar una aplicacion externa. \ No newline at end of file Copied: software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/fr.wiki (from rev 4846, software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_fr.wiki) =================================================================== --- software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/fr.wiki (rev 0) +++ software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/fr.wiki 2009-06-23 09:59:15 UTC (rev 4857) @@ -0,0 +1,2 @@ += Synopsis = +Ce gadget permet à Tux Droid de lancer une application externe. \ No newline at end of file Deleted: software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_en.wiki =================================================================== --- software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_en.wiki 2009-06-23 09:58:56 UTC (rev 4856) +++ software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_en.wiki 2009-06-23 09:59:15 UTC (rev 4857) @@ -1,2 +0,0 @@ -= Synopsis = -This plugin lets Tux Droid start an external application. \ No newline at end of file Deleted: software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_es.wiki =================================================================== --- software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_es.wiki 2009-06-23 09:58:56 UTC (rev 4856) +++ software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_es.wiki 2009-06-23 09:59:15 UTC (rev 4857) @@ -1,2 +0,0 @@ -= Synopsis = -Este plugin permite a Tux Droid lanzar una aplicacion externa. \ No newline at end of file Deleted: software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_fr.wiki =================================================================== --- software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_fr.wiki 2009-06-23 09:58:56 UTC (rev 4856) +++ software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_fr.wiki 2009-06-23 09:59:15 UTC (rev 4857) @@ -1,2 +0,0 @@ -= Synopsis = -Ce gadget permet à Tux Droid de lancer une application externe. \ No newline at end of file Deleted: software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_nl.wiki =================================================================== --- software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_nl.wiki 2009-06-23 09:58:56 UTC (rev 4856) +++ software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_nl.wiki 2009-06-23 09:59:15 UTC (rev 4857) @@ -1,2 +0,0 @@ -= Synopsis = -Met deze gadget kan Tux Droid een externe applicatie opstarten. \ No newline at end of file Copied: software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/nl.wiki (from rev 4846, software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/help_nl.wiki) =================================================================== --- software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/nl.wiki (rev 0) +++ software_suite_v3/software/plugin/plugin-shortcut/trunk/plugin-shortcut/resources/nl.wiki 2009-06-23 09:59:15 UTC (rev 4857) @@ -0,0 +1,2 @@ += Synopsis = +Met deze gadget kan Tux Droid een externe applicatie opstarten. \ No newline at end of file |
|
From: JDM <c2m...@c2...> - 2009-06-22 16:08:28
|
Author: JDM Date: 2009-06-22 18:08:14 +0200 (Mon, 22 Jun 2009) New Revision: 4854 Added: software_suite_v3/smart-core/smart-api/cpp/ software_suite_v3/smart-core/smart-api/cpp/API/ software_suite_v3/smart-core/smart-api/cpp/API/TuxAPI.c software_suite_v3/smart-core/smart-api/cpp/API/TuxAPI.h software_suite_v3/smart-core/smart-api/cpp/Makefile software_suite_v3/smart-core/smart-api/cpp/README.TXT Log: * First release for C++ API Added: software_suite_v3/smart-core/smart-api/cpp/API/TuxAPI.c =================================================================== --- software_suite_v3/smart-core/smart-api/cpp/API/TuxAPI.c (rev 0) +++ software_suite_v3/smart-core/smart-api/cpp/API/TuxAPI.c 2009-06-22 16:08:14 UTC (rev 4854) @@ -0,0 +1,644 @@ +/* + * C++ TuxAPI + * + * An API written in C++ for the Tux Droid + * + * Joel Matteotti <joel.matteotti _AT_ free _DOT_ fr> + * + * Version 1.0.0 + * + * =============== GPL HEADER ===================== + * This file is part of C++ TuxAPI. + * + * C++ TuxAPI is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * C++ TuxAPI is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with "C++ TuxAPI". If not, see <http://www.gnu.org/licenses/>. + * + * ==================================================== + * + * TODO Code: + * + * - Complete the status part + * - Allow the use of sound_flash + * - Modify the 3 values of the TuxAPI_LEDS_INTENSITY_LEVEL enumeration + * - Rename all constant of TuxAPI_STATUS_REQUESTED for more short name + * + * ==================================================== + * + * More informations about the C++ API: http://bbs.tuxisalive.com/viewtopic.php?pid=678 + * + * +*/ + +#include <iostream> +#include <string.h> +#include <vector> +#include "TuxAPI.h" + +using namespace std; + +string ReplaceAllG(string strSrc, string strSearch, string strReplace){ + size_t start, end = 0, sizeSearch = strSearch.size(); + while((start = strSrc.find(strSearch, end))!=string::npos){ + end = start + sizeSearch; + strSrc.replace(start, sizeSearch, strReplace); + } + return strSrc; +} + +TuxAPI::TuxAPI(void) +{ +} + +//Interaction with the TuxHttp server +string TuxAPI::doUrlAction(TuxAPI_LEVEL level, string url) +{ + +#ifdef WIN32 + WSADATA WSAData; + WSAStartup(MAKEWORD(2,0), &WSAData); + + SOCKET sock; + SOCKADDR_IN sin; +#else + int sock; + struct sockaddr_in sin; +#endif + + char buffer[1024]; + + string srequete = "GET /"; + + switch(level) + { + case CLIENT_LEVEL_ANONYME: srequete += "-1"; + break; + case CLIENT_LEVEL_FREE: srequete += "0"; + break; + case CLIENT_LEVEL_RESTRICTED: srequete += "1"; + break; + case CLIENT_LEVEL_ROOT: srequete += "2"; + break; + } + + + srequete += url; + srequete += " HTTP/1.1\r\n"; + srequete += "\r\n"; + + //cout << srequete << endl; + + size_t requete_taille = srequete.size() + 1; + + char crequete[requete_taille]; + strncpy( crequete, srequete.c_str(), requete_taille ); + + int i = 0; + string source = ""; + + sock = socket(AF_INET, SOCK_STREAM, 0); + + sin.sin_addr.s_addr = inet_addr("127.0.0.1"); + sin.sin_port = 270; + sin.sin_family = AF_INET; + sin.sin_port = htons(270); + +#ifdef WIN32 + connect(sock, (SOCKADDR *)&sin, sizeof(sin)); // on se connecte sur le site web. +#else + connect(sock, (struct sockaddr *)&sin, sizeof(sin)); +#endif + + send(sock, crequete, strlen(crequete), 0); // on envoie la requ HTTP. + + do + { + i = recv(sock, buffer, sizeof(buffer), 0); // le buffer rp les donn res. + source += buffer; + } while (i != 0); + +#ifdef WIN32 + closesocket(sock); // on ferme le socket. + WSACleanup(); +#else + close(sock); +#endif + + return source; +} + +//Allow tux do an action with his motors +void TuxAPI::doMotorAction(TuxAPI_LEVEL level, TuxAPI_ACTION action) +{ + switch(action) + { + case FLIPPERS_UP: doUrlAction(level, "/flippers/up?"); + break; + case FLIPPERS_DOWN: doUrlAction(level, "/flippers/down?"); + break; + case MOUTH_OPEN: doUrlAction(level, "/mouth/open?"); + break; + case MOUTH_CLOSE: doUrlAction(level, "/mouth/close?"); + break; + case EYES_OPEN: doUrlAction(level, "/eyes/open?"); + break; + case EYES_CLOSE: doUrlAction(level, "/eyes/close?"); + break; + } +} + +//Allow rotate Tux left/right +void TuxAPI::DoRotorAction(TuxAPI_LEVEL level, TuxAPI_ACTION action, int rotation) +{ + char cmd[4096]; + + switch(action) + { + case ROTATE_LEFT: strcpy(cmd, "/spinning/left_on?count="); + break; + case ROTATE_RIGHT: strcpy(cmd, "spinning/right_on?count="); + break; + } + + + char _rotation[50]; + sprintf(_rotation, "%d", rotation); + strcat(cmd, _rotation); + + doUrlAction(level, cmd); +} + +void TuxAPI::DoLedsAction(TuxAPI_LEVEL level, TuxAPI_ACTION action, TuxAPI_LEDS leds) +{ + char cmd[4096]; + strcpy(cmd, "/leds/"); + + switch(action) + { + case LEDS_ON: strcat(cmd, "on?leds="); + break; + case LEDS_OFF: strcat(cmd, "off?leds="); + break; + } + + switch(leds) + { + case LED_BOTH: strcat(cmd, "LED_BOTH"); + break; + case LED_LEFT: strcat(cmd, "LED_LEFT"); + break; + case LED_RIGHT: strcat(cmd, "LED_RIGHT"); + break; + } + + if(action == LEDS_ON) + strcat(cmd, "&intensity=10.0"); + + doUrlAction(level, cmd); +} + +void TuxAPI::DoLedsAction(TuxAPI_LEVEL level, TuxAPI_ACTION action, TuxAPI_LEDS leds, double intensity) +{ + char cmd[4096]; + strcpy(cmd, "/leds/"); + + switch(action) + { + case LEDS_ON: strcat(cmd, "on?leds="); + break; + case LEDS_OFF: strcat(cmd, "off?leds="); + break; + } + + switch(leds) + { + case LED_BOTH: strcat(cmd, "LED_BOTH"); + break; + case LED_LEFT: strcat(cmd, "LED_LEFT"); + break; + case LED_RIGHT: strcat(cmd, "LED_RIGHT"); + break; + } + + + if(action == LEDS_ON) + { + strcat(cmd, "&intensity="); + char _intensity[50]; + sprintf(_intensity,"%.2f",(intensity+0.1)); + strcat(cmd, _intensity); + } + + doUrlAction(level, cmd); +} + +void TuxAPI::DoBlinkLedsAction(TuxAPI_LEVEL level, TuxAPI_LEDS leds, int count) +{ + char cmd[4096]; + strcpy(cmd, "/leds/blink/count?count="); + strcat(cmd, (char *)count); + strcat(cmd, "&delay=0.1"); + + switch(leds) + { + case LED_BOTH: strcat(cmd, "LED_BOTH"); + break; + case LED_LEFT: strcat(cmd, "LED_LEFT"); + break; + case LED_RIGHT: strcat(cmd, "LED_RIGHT"); + break; + } + + doUrlAction(level,cmd); +} + +void TuxAPI::DoBlinkLedsAction(TuxAPI_LEVEL level, TuxAPI_LEDS leds, int count, double delay) +{ + char cmd[4096]; + strcpy(cmd, "/leds/blink/count?count="); + strcat(cmd, (char *)count); + strcat(cmd, "&delay="); + + char _delay[50]; + sprintf(_delay, "%.2f",(delay+0.1)); + strcat(cmd, _delay); + + switch(leds) + { + case LED_BOTH: strcat(cmd, "LED_BOTH"); + break; + case LED_LEFT: strcat(cmd, "LED_LEFT"); + break; + case LED_RIGHT: strcat(cmd, "LED_RIGHT"); + break; + } + + doUrlAction(level,cmd); +} + + +void TuxAPI::DoSpeak(TuxAPI_LEVEL level, char *Text) +{ + char cmd[4096]; + strcpy(cmd,"/tts/speak?text="); + strcat(cmd,Text); + + string cmd_ = cmd; + cmd_ = ReplaceAllG(cmd_, " ", "%20"); + strcpy(cmd, cmd_.c_str()); + + + doUrlAction(level, cmd); +} + +void TuxAPI::DoSpeak(TuxAPI_LEVEL level, TuxAPI_SPEAK_LOCUTOR locutor, char *Text) +{ + char cmd[4096]; + strcpy(cmd, "/tts/locutor?name="); + + switch(locutor) + { + case Bruno: strcat(cmd, "Bruno"); + break; + case Julie: strcat(cmd, "Julie"); + break; + } + + doUrlAction(level, cmd); //set the locutor + + strcpy(cmd, "/tts/speak?text="); + strcat(cmd, Text); + + string cmd_ = cmd; + cmd_ = ReplaceAllG(cmd_, " ", "%20"); + strcpy(cmd, cmd_.c_str()); + + + doUrlAction(level, cmd); //speak +} + +void TuxAPI::DoSpeak(TuxAPI_LEVEL level, int pitch, char *Text) +{ + char cmd[4096]; + strcpy(cmd, "/tts/pitch?value="); + char _pitch[256]; + sprintf(_pitch, "%d", pitch); + strcat(cmd, _pitch); + + + doUrlAction(level, cmd); //set the pitch + + strcpy(cmd, "/tts/speak?text="); + strcat(cmd, Text); + + string cmd_ = cmd; + cmd_ = ReplaceAllG(cmd_, " ", "%20"); + strcpy(cmd, cmd_.c_str()); + + + doUrlAction(level, cmd); //speak +} + +void TuxAPI::DoSpeak(TuxAPI_LEVEL level, TuxAPI_SPEAK_LOCUTOR locutor, int pitch, char *Text) +{ + char cmd[4096]; + strcpy(cmd, "/tts/locutor?name="); + + switch(locutor) + { + case Bruno: strcat(cmd, "Bruno"); + break; + case Julie: strcat(cmd, "Julie"); + break; + } + + doUrlAction(level, cmd); //set the locutor + + strcpy(cmd, "/tts/pitch?value="); + char _pitch[256]; + sprintf(_pitch, "%d", pitch); + strcat(cmd, _pitch); + + + doUrlAction(level, cmd); //set the pitch + + strcpy(cmd, "/tts/speak?text="); + strcat(cmd, Text); + + string cmd_ = cmd; + cmd_ = ReplaceAllG(cmd_, " ", "%20"); + strcpy(cmd, cmd_.c_str()); + + + doUrlAction(level, cmd); //speak +} + +void TuxAPI::AttituneControl(TuxAPI_LEVEL level, TuxAPI_ACTION action, char *attitune) +{ + char cmd[8128]; + strcpy(cmd, "/attitune/"); + + switch(action) + { + case ATTITUNE_PLAY: + { + strcat(cmd, "load_and_play?path="); + strcat(cmd, attitune); + } + break; + case ATTITUNE_STOP: strcat(cmd, "stop?"); + break; + } + + doUrlAction(level,cmd); +} + +void TuxAPI::WavControl(TuxAPI_LEVEL level, TuxAPI_ACTION action, char *sound) +{ + char cmd[8128]; + strcpy(cmd, "/wav/"); + + switch(action) + { + case ATTITUNE_PLAY: + { + strcat(cmd, "play?path="); + strcat(cmd, sound); + } + break; + case ATTITUNE_STOP: strcat(cmd, "stop?"); + break; + } + + doUrlAction(level,cmd); +} + +int Split(vector<string>& vecteur, string chaine, char separateur) +{ + vecteur.clear(); + + string::size_type stTemp = chaine.find(separateur); + + while(stTemp != string::npos) + { + vecteur.push_back(chaine.substr(0, stTemp)); + chaine = chaine.substr(stTemp + 1); + stTemp = chaine.find(separateur); + } + + vecteur.push_back(chaine); + + return vecteur.size(); +} + +string TuxAPI::getRawStatus(TuxAPI_LEVEL level, TuxAPI_STATUS_REQUESTED status) +{ + char cmd[4096]; + strcpy(cmd, "/status/request_one?status_name="); + + switch(status) + { + case flippers_motor_on: strcat(cmd, "flippers_motor_on"); + break; + case flippers_position: strcat(cmd, "flippers_position"); + break; + + + case eyes_motor_on: strcat(cmd, "eyes_motor_on"); + break; + case eyes_position: strcat(cmd,"eyes_position"); + break; + case eyes_remaining_movements: strcat(cmd, "eyes_remaining_movements"); + break; + + case mouth_motor_on: strcat(cmd, "mouth_motor_on"); + break; + case mouth_position: strcat(cmd, "mouth_position"); + break; + case mouth_remaining_movements: strcat(cmd, "mouth_remaining_movements"); + break; + + case spin_left_motor_on: strcat(cmd, "spin_left_motor_on"); + break; + case spin_right_motor_on: strcat(cmd, "spin_right_motor_on"); + break; + case spinning_direction: strcat(cmd, "spinning_direction"); + break; + case spinning_remaining_movements: strcat(cmd, "spinning_remaining_movements"); + break; + + case right_led_state: strcat(cmd, "right_led_state"); + break; + case left_led_state: strcat(cmd, "left_led_state"); + break; + + + case light_level: strcat(cmd, "light_level"); + break; + case battery_state: strcat(cmd, "battery_state"); + break; + case battery_level: strcat(cmd, "battery_level"); + break; + case charger_state: strcat(cmd, "charger_state"); + break; + + } + + string data_raw = doUrlAction(level, cmd); + + vector<string> VecStr; + int s = Split(VecStr, data_raw, '>'); + + string data = VecStr[10]; + data = ReplaceAllG(data, "</value", ""); + + + return data; +} + + +//=============== PUBLIC =============== + +void TuxAPI::Flippers_Up(void) +{ + doMotorAction(CLIENT_LEVEL_FREE, FLIPPERS_UP); +} + +void TuxAPI::Flippers_Down(void) +{ + doMotorAction(CLIENT_LEVEL_FREE, FLIPPERS_DOWN); +} + +void TuxAPI::Mouth_Open(void) +{ + doMotorAction(CLIENT_LEVEL_FREE, MOUTH_OPEN); +} + +void TuxAPI::Mouth_Close(void) +{ + doMotorAction(CLIENT_LEVEL_FREE, MOUTH_CLOSE); +} + +void TuxAPI::Eyes_Open(void) +{ + doMotorAction(CLIENT_LEVEL_FREE, EYES_OPEN); +} + +void TuxAPI::Eyes_Close(void) +{ + doMotorAction(CLIENT_LEVEL_FREE, EYES_CLOSE); +} + +void TuxAPI::Rotation_Left(int rotation) +{ + DoRotorAction(CLIENT_LEVEL_FREE, ROTATE_LEFT, rotation); +} + +void TuxAPI::Rotation_Right(int rotation) +{ + DoRotorAction(CLIENT_LEVEL_FREE, ROTATE_RIGHT, rotation); +} + +void TuxAPI::Leds_On(void) +{ + DoLedsAction(CLIENT_LEVEL_FREE, LEDS_ON, LED_BOTH); +} + +void TuxAPI::Leds_On(TuxAPI_LEDS leds) +{ + DoLedsAction(CLIENT_LEVEL_FREE, LEDS_ON, leds); +} + +void TuxAPI::Leds_On(double intensity) +{ + DoLedsAction(CLIENT_LEVEL_FREE, LEDS_ON, LED_BOTH, intensity); +} + +void TuxAPI::Leds_On(TuxAPI_LEDS leds, double intensity) +{ + DoLedsAction(CLIENT_LEVEL_FREE, LEDS_ON, leds, intensity); +} + +void TuxAPI::Leds_Off(void) +{ + DoLedsAction(CLIENT_LEVEL_FREE, LEDS_OFF, LED_BOTH); +} + +void TuxAPI::Leds_Off(TuxAPI_LEDS leds) +{ + DoLedsAction(CLIENT_LEVEL_FREE, LEDS_OFF, leds); +} + +void TuxAPI::Leds_Blink(void) +{ + DoBlinkLedsAction(CLIENT_LEVEL_FREE, LED_BOTH, 1); +} + +void TuxAPI::Leds_Blink(TuxAPI_LEDS leds) +{ + DoBlinkLedsAction(CLIENT_LEVEL_FREE, leds, 1); +} + +void TuxAPI::Leds_Blink(TuxAPI_LEDS leds, int count) +{ + DoBlinkLedsAction(CLIENT_LEVEL_FREE, leds, count); +} + +void TuxAPI::Leds_Blink(TuxAPI_LEDS leds, int count, double delay) +{ + DoBlinkLedsAction(CLIENT_LEVEL_FREE, leds, count, delay); +} + +void TuxAPI::Speak(char *Text) +{ + DoSpeak(CLIENT_LEVEL_FREE, Text); +} + +void TuxAPI::Speak(TuxAPI_SPEAK_LOCUTOR locutor, char *Text) +{ + DoSpeak(CLIENT_LEVEL_FREE, locutor, Text); +} + +void TuxAPI::Speak(int pitch, char *Text) +{ + DoSpeak(CLIENT_LEVEL_FREE, pitch, Text); +} + +void TuxAPI::Speak(TuxAPI_SPEAK_LOCUTOR locutor, int pitch, char *Text) +{ + DoSpeak(CLIENT_LEVEL_FREE, locutor, pitch, Text); +} + +void TuxAPI::PlayAttitune(char *attitune) +{ + AttituneControl(CLIENT_LEVEL_FREE, ATTITUNE_PLAY, attitune); +} + +void TuxAPI::StopAttitune(void) +{ + AttituneControl(CLIENT_LEVEL_FREE, ATTITUNE_STOP, ""); +} + +void TuxAPI::PlayWav(char *sound) +{ + WavControl(CLIENT_LEVEL_FREE, WAV_PLAY, sound); +} + +void TuxAPI::StopWav(void) +{ + WavControl(CLIENT_LEVEL_FREE, WAV_STOP, ""); +} + +string TuxAPI::getStatus(TuxAPI_STATUS_REQUESTED status) +{ + return getRawStatus(CLIENT_LEVEL_FREE, status); +} Added: software_suite_v3/smart-core/smart-api/cpp/API/TuxAPI.h =================================================================== --- software_suite_v3/smart-core/smart-api/cpp/API/TuxAPI.h (rev 0) +++ software_suite_v3/smart-core/smart-api/cpp/API/TuxAPI.h 2009-06-22 16:08:14 UTC (rev 4854) @@ -0,0 +1,251 @@ +/* + * C++ TuxAPI + * + * An API written in C++ for the Tux Droid + * + * Joel Matteotti <joel.matteotti _AT_ free _DOT_ fr> + * + * Version 1.0.0 + * + * =============== GPL HEADER ===================== + * This file is part of C++ TuxAPI. + * + * C++ TuxAPI is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * C++ TuxAPI is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with "C++ TuxAPI". If not, see <http://www.gnu.org/licenses/>. + * + * ==================================================== + * +*/ + + +#include <iostream> +#include <string.h> + +#ifdef WIN32 +#include <winsock.h> +#else +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#endif + +using namespace std; + +enum TuxAPI_LEVEL +{ + CLIENT_LEVEL_ANONYME = -1, + CLIENT_LEVEL_FREE = 0, + CLIENT_LEVEL_RESTRICTED = 1, + CLIENT_LEVEL_ROOT = 2, +}; + +/// <summary> +/// All action can do Tux +/// </summary> +enum TuxAPI_ACTION +{ + FLIPPERS_UP = 1, + FLIPPERS_DOWN = 2, + + MOUTH_OPEN = 3, + MOUTH_CLOSE = 4, + + EYES_OPEN = 5, + EYES_CLOSE = 6, + + LEDS_ON = 7, + LEDS_OFF = 8, + + ROTATE_LEFT = 9, + ROTATE_RIGHT = 10, + + ATTITUNE_PLAY = 11, + ATTITUNE_STOP = 12, + + WAV_PLAY = 13, + WAV_STOP = 14, +}; + +/// <summary> +/// The TTS voice (TODO: Add others voices) +/// </summary> +enum TuxAPI_SPEAK_LOCUTOR +{ + Bruno = 0, + Julie = 1, +}; + +/// <summary> +/// //<<LED_BOTH|LED_RIGHT|LED_LEFT>> +/// </summary> +enum TuxAPI_LEDS +{ + LED_BOTH = 0, + LED_LEFT = 1, + LED_RIGHT = 2, +}; + +enum TuxAPI_STATUS_REQUESTED +{ + flippers_motor_on = 0, + flippers_position = 1, + flippers_remaining_movements = 2, + + eyes_motor_on = 3, + eyes_position = 4, + eyes_remaining_movements = 5, + + mouth_motor_on = 6, + mouth_position = 7, + mouth_remaining_movements = 8, + + spin_left_motor_on = 9, + spin_right_motor_on = 10, + spinning_direction = 11, + spinning_remaining_movements = 12, + + light_level = 13, + right_led_state = 14, + left_led_state = 15, + + battery_level = 16, + battery_state = 17, + charger_state = 18, + + //----------- + + /* TODO: modify the number of any status + descriptor_complete = 4, + radio_state = 5, + dongle_plug = 6, + + + connection_quality = 15, + + audio_flash_play = 16, + audio_general_play = 17, + + flash_programming_current_track = 18, + flash_programming_last_track_size = 19, + + tuxcore_symbolic_version = 20, + tuxaudio_symbolic_version = 21, + fuxusb_symbolic_version = 22, + fuxrf_symbolic_version = 23, + tuxrf_symbolic_version = 24, + driver_symbolic_version = 25, + + sound_reflash_begin = 26, + sound_reflash_end = 27, + sound_reflash_current_trac = 28, + + + left_wing_button = 34, + sound_flash_count = 35, + + osl_symbolic_version=38, + general_sound_state = 39, + wav_volume=40, + tts_volume=41, + tts_pitch=42, + tts_locutor=43, + wav_0_sound_state=44, + wav_0_pause_state=45, + wav_0_stop=46, + right_wing_button=47, + wav_1_sound_state=48, + wav_1_pause_state=49, + wav_1_stop=50, + wav_2_sound_state=51, + wav_2_pause_state=52, + wav_2_stop=53, + wav_3_sound_state=54, + wav_3_pause_state=55, + wav_3_stop=56, + tts_0_sound_state=57, + head_button=58, + tts_0_pause_state=59, + tts_0_stop=60, + tts_0_voice_loaded=61, + tts_0_speak_status=62, + tts_0_voice_list=63, + tts_wav_channel_start=64, + None=65, + remote_button=66,*/ +}; + +class TuxAPI +{ +private: + string doUrlAction(TuxAPI_LEVEL level, string url); + void doMotorAction(TuxAPI_LEVEL level, TuxAPI_ACTION action); + void DoRotorAction(TuxAPI_LEVEL level, TuxAPI_ACTION action, int rotation); + + void DoLedsAction(TuxAPI_LEVEL level, TuxAPI_ACTION action, TuxAPI_LEDS leds); + void DoLedsAction(TuxAPI_LEVEL level, TuxAPI_ACTION action, TuxAPI_LEDS leds, double intensity); + + void DoBlinkLedsAction(TuxAPI_LEVEL level, TuxAPI_LEDS leds, int count); + void DoBlinkLedsAction(TuxAPI_LEVEL level, TuxAPI_LEDS leds, int count, double delay); + + void DoSpeak(TuxAPI_LEVEL level, char *Text); + void DoSpeak(TuxAPI_LEVEL level, TuxAPI_SPEAK_LOCUTOR locutor, char *Text); + void DoSpeak(TuxAPI_LEVEL level, int pitch, char *Text); + void DoSpeak(TuxAPI_LEVEL level, TuxAPI_SPEAK_LOCUTOR locutor, int pitch, char *Text); + + void AttituneControl(TuxAPI_LEVEL level, TuxAPI_ACTION action, char *attitune); + + void WavControl(TuxAPI_LEVEL level, TuxAPI_ACTION action, char *sound); + + string getRawStatus(TuxAPI_LEVEL level, TuxAPI_STATUS_REQUESTED status); + +public: + TuxAPI(void); + void Flippers_Up(void); + void Flippers_Down(void); + void Mouth_Open(void); + void Mouth_Close(void); + void Eyes_Open(void); + void Eyes_Close(void); + void Rotation_Left(int rotation); + void Rotation_Right(int rotation); + void Leds_On(void); + void Leds_On(TuxAPI_LEDS leds); + void Leds_On(double intensity); + void Leds_On(TuxAPI_LEDS leds, double intensity); + void Leds_Off(void); + void Leds_Off(TuxAPI_LEDS leds); + + void Leds_Blink(void); + void Leds_Blink(TuxAPI_LEDS leds); + void Leds_Blink(TuxAPI_LEDS leds, int count); + void Leds_Blink(TuxAPI_LEDS leds, int count, double delay); + + void Speak(char *Text); + void Speak(TuxAPI_SPEAK_LOCUTOR locutor, char *Text); + void Speak(int pitch, char *Text); + void Speak(TuxAPI_SPEAK_LOCUTOR locutor, int pitch, char *Text); + + void PlayAttitune(char *attitune); + void StopAttitune(void); + + void PlayWav(char *sound); + void StopWav(void); + + string getStatus(TuxAPI_STATUS_REQUESTED status); + + + + + + +}; Added: software_suite_v3/smart-core/smart-api/cpp/Makefile =================================================================== --- software_suite_v3/smart-core/smart-api/cpp/Makefile (rev 0) +++ software_suite_v3/smart-core/smart-api/cpp/Makefile 2009-06-22 16:08:14 UTC (rev 4854) @@ -0,0 +1,12 @@ + +all: main.o API/TuxAPI.o + g++ -o TuxAPIDemo API/TuxAPI.o main.o + +main.o: main.c + g++ -o main.o -c main.c -I./API/ + +API/TuxAPI.o: API/TuxAPI.c + g++ -o API/TuxAPI.o -c API/TuxAPI.c -I./API/ + +clean: + rm -f main.o API/TuxAPI.o Added: software_suite_v3/smart-core/smart-api/cpp/README.TXT =================================================================== --- software_suite_v3/smart-core/smart-api/cpp/README.TXT (rev 0) +++ software_suite_v3/smart-core/smart-api/cpp/README.TXT 2009-06-22 16:08:14 UTC (rev 4854) @@ -0,0 +1,8 @@ + +The C++ API for Tux Droid have been compiled AND tested on: + +- Windows XP SP3 (compiled with Dev-CPP) +- Ubuntu 9.10 (compiled with G++) + + +For more informations and for help on the API: http://bbs.tuxisalive.com/viewtopic.php?pid=678 |
|
From: remi <c2m...@c2...> - 2009-06-22 14:43:27
|
Author: remi
Date: 2009-06-22 14:31:11 +0200 (Mon, 22 Jun 2009)
New Revision: 4848
Added:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/empty.png
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl
Log:
* added transparent image for gadget icons pre-loading
* updated css and js to work on IE8
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css 2009-06-22 07:52:28 UTC (rev 4847)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css 2009-06-22 12:31:11 UTC (rev 4848)
@@ -24,8 +24,8 @@
left:0px;
width:44px;
height:44px;
- margin-left:28px!important;
- /margin-left:14px;
+ margin-left:28px;
+ -margin-left:14px;
margin-top:17px;
display:table;
float:left;
@@ -313,8 +313,8 @@
left:0px;
width:24px;
height:24px;
- margin-left:64px!important;
- /margin-left:32px;
+ margin-left:64px;
+ -margin-left:32px;
margin-top:7px;
display:table;
float:left;
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/empty.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/empty.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js 2009-06-22 07:52:28 UTC (rev 4847)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js 2009-06-22 12:31:11 UTC (rev 4848)
@@ -354,6 +354,7 @@
}
else
{
+ httpRequest.onreadystatechange = stateChangeFunction;
httpRequest.onload = stateChangeFunction;
}
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-22 07:52:28 UTC (rev 4847)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl 2009-06-22 12:31:11 UTC (rev 4848)
@@ -40,6 +40,8 @@
var knowedGadget07Name = null;
var knowedGadget07Icon = null;
var knowedGadget07Uuid = null;
+ var emptyGadgetIcon = "/data/web_interface/user_01/img/empty.png";
+ var emptyGadgetName = " ";
function updateStates()
{
@@ -51,32 +53,71 @@
var states = requestData("/wi_user_01/get_states", {});
if (states != null)
{
+ if (!states.containsKey("data0"))
+ {
+ setTimeout("updateStates();", 500);
+ return;
+ }
dongleState = states.get("data0").get("dongleState");
radioState = states.get("data0").get("radioState");
batteryState = states.get("data0").get("batteryState");
soundState = states.get("data0").get("soundState");
- var gadgets = states.get("gadgets");
- updateCurrentGadget(gadgets.get("gadget_04_uuid"),
- gadgets.get("gadget_04_name"),
- gadgets.get("gadget_04_icon"));
- updateGadgetThumb01(gadgets.get("gadget_01_uuid"),
- gadgets.get("gadget_01_name"),
- gadgets.get("gadget_01_icon"));
- updateGadgetThumb02(gadgets.get("gadget_02_uuid"),
- gadgets.get("gadget_02_name"),
- gadgets.get("gadget_02_icon"));
- updateGadgetThumb03(gadgets.get("gadget_03_uuid"),
- gadgets.get("gadget_03_name"),
- gadgets.get("gadget_03_icon"));
- updateGadgetThumb05(gadgets.get("gadget_05_uuid"),
- gadgets.get("gadget_05_name"),
- gadgets.get("gadget_05_icon"));
- updateGadgetThumb06(gadgets.get("gadget_06_uuid"),
- gadgets.get("gadget_06_name"),
- gadgets.get("gadget_06_icon"));
- updateGadgetThumb07(gadgets.get("gadget_07_uuid"),
- gadgets.get("gadget_07_name"),
- gadgets.get("gadget_07_icon"));
+ var gadgets = null;
+ try
+ {
+ gadgets = states.get("gadgets");
+ }
+ catch (e)
+ {
+ gadgets = null;
+ }
+ if (gadgets != null)
+ {
+ if (gadgets.containsKey("gadget_04_uuid"))
+ {
+ updateCurrentGadget(gadgets.get("gadget_04_uuid"),
+ gadgets.get("gadget_04_name"),
+ gadgets.get("gadget_04_icon"));
+ updateGadgetThumb01(gadgets.get("gadget_01_uuid"),
+ gadgets.get("gadget_01_name"),
+ gadgets.get("gadget_01_icon"));
+ updateGadgetThumb02(gadgets.get("gadget_02_uuid"),
+ gadgets.get("gadget_02_name"),
+ gadgets.get("gadget_02_icon"));
+ updateGadgetThumb03(gadgets.get("gadget_03_uuid"),
+ gadgets.get("gadget_03_name"),
+ gadgets.get("gadget_03_icon"));
+ updateGadgetThumb05(gadgets.get("gadget_05_uuid"),
+ gadgets.get("gadget_05_name"),
+ gadgets.get("gadget_05_icon"));
+ updateGadgetThumb06(gadgets.get("gadget_06_uuid"),
+ gadgets.get("gadget_06_name"),
+ gadgets.get("gadget_06_icon"));
+ updateGadgetThumb07(gadgets.get("gadget_07_uuid"),
+ gadgets.get("gadget_07_name"),
+ gadgets.get("gadget_07_icon"));
+ }
+ else
+ {
+ updateCurrentGadget("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb01("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb02("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb03("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb05("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb06("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb07("0", emptyGadgetName, emptyGadgetIcon);
+ }
+ }
+ else
+ {
+ updateCurrentGadget("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb01("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb02("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb03("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb05("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb06("0", emptyGadgetName, emptyGadgetIcon);
+ updateGadgetThumb07("0", emptyGadgetName, emptyGadgetIcon);
+ }
}
if (batteryState != knowedBatteryState)
{
@@ -366,7 +407,7 @@
<div class="thumbnailBarGadgetFirstDiv">
<xsl:element name="img">
<xsl:attribute name="id">thumbnailBarGadgetIcon01</xsl:attribute>
- <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
<xsl:attribute name="height">44</xsl:attribute>
<xsl:attribute name="width">44</xsl:attribute>
</xsl:element>
@@ -375,7 +416,7 @@
<div class="thumbnailBarGadgetDiv">
<xsl:element name="img">
<xsl:attribute name="id">thumbnailBarGadgetIcon02</xsl:attribute>
- <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
<xsl:attribute name="height">44</xsl:attribute>
<xsl:attribute name="width">44</xsl:attribute>
</xsl:element>
@@ -384,7 +425,7 @@
<div class="thumbnailBarGadgetDiv">
<xsl:element name="img">
<xsl:attribute name="id">thumbnailBarGadgetIcon03</xsl:attribute>
- <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
<xsl:attribute name="height">44</xsl:attribute>
<xsl:attribute name="width">44</xsl:attribute>
</xsl:element>
@@ -393,7 +434,7 @@
<div class="thumbnailBarGadgetDivCenter">
<xsl:element name="img">
<xsl:attribute name="id">thumbnailBarGadgetIcon04</xsl:attribute>
- <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
<xsl:attribute name="height">70</xsl:attribute>
<xsl:attribute name="width">70</xsl:attribute>
</xsl:element>
@@ -402,7 +443,7 @@
<div class="thumbnailBarGadgetDivFift">
<xsl:element name="img">
<xsl:attribute name="id">thumbnailBarGadgetIcon05</xsl:attribute>
- <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
<xsl:attribute name="height">44</xsl:attribute>
<xsl:attribute name="width">44</xsl:attribute>
</xsl:element>
@@ -411,7 +452,7 @@
<div class="thumbnailBarGadgetDiv">
<xsl:element name="img">
<xsl:attribute name="id">thumbnailBarGadgetIcon06</xsl:attribute>
- <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
<xsl:attribute name="height">44</xsl:attribute>
<xsl:attribute name="width">44</xsl:attribute>
</xsl:element>
@@ -420,17 +461,17 @@
<div class="thumbnailBarGadgetDiv">
<xsl:element name="img">
<xsl:attribute name="id">thumbnailBarGadgetIcon07</xsl:attribute>
- <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
<xsl:attribute name="height">44</xsl:attribute>
<xsl:attribute name="width">44</xsl:attribute>
</xsl:element>
</div>
- <span class="thumbnailBarGadget01Name" id="thumbnailBarGadgetName01">Gadget</span>
- <span class="thumbnailBarGadget02Name" id="thumbnailBarGadgetName02">Gadget</span>
- <span class="thumbnailBarGadget03Name" id="thumbnailBarGadgetName03">Gadget</span>
- <span class="thumbnailBarGadget05Name" id="thumbnailBarGadgetName05">Gadget</span>
- <span class="thumbnailBarGadget06Name" id="thumbnailBarGadgetName06">Gadget</span>
- <span class="thumbnailBarGadget07Name" id="thumbnailBarGadgetName07">Gadget</span>
+ <span class="thumbnailBarGadget01Name" id="thumbnailBarGadgetName01"> . </span>
+ <span class="thumbnailBarGadget02Name" id="thumbnailBarGadgetName02"> . </span>
+ <span class="thumbnailBarGadget03Name" id="thumbnailBarGadgetName03"> . </span>
+ <span class="thumbnailBarGadget05Name" id="thumbnailBarGadgetName05"> . </span>
+ <span class="thumbnailBarGadget06Name" id="thumbnailBarGadgetName06"> . </span>
+ <span class="thumbnailBarGadget07Name" id="thumbnailBarGadgetName07"> . </span>
</div>
<!-- NEXT BUTTON -->
<xsl:element name="a">
@@ -455,13 +496,13 @@
<div class="notifyHintGadgetDiv">
<xsl:element name="img">
<xsl:attribute name="id">notifyHintGadgetIcon</xsl:attribute>
- <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
<xsl:attribute name="height">24</xsl:attribute>
<xsl:attribute name="width">24</xsl:attribute>
</xsl:element>
</div>
<!-- GADGET NAME -->
- <span class="notifyHintGadgetName" id="notifyHintGadgetName">My gadget</span>
+ <span class="notifyHintGadgetName" id="notifyHintGadgetName"> . </span>
<!-- CONFIGURE BUTTON -->
<xsl:element name="a">
<xsl:attribute name="class">notifyBtnConfigure</xsl:attribute>
|
|
From: remi <c2m...@c2...> - 2009-06-22 14:43:25
|
Author: remi
Date: 2009-06-22 14:33:42 +0200 (Mon, 22 Jun 2009)
New Revision: 4851
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/driver/TuxDriver.py
Log:
* little fixes
Modified: software_suite_v3/smart-core/smart-server/trunk/util/driver/TuxDriver.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/driver/TuxDriver.py 2009-06-22 12:33:12 UTC (rev 4850)
+++ software_suite_v3/smart-core/smart-server/trunk/util/driver/TuxDriver.py 2009-06-22 12:33:42 UTC (rev 4851)
@@ -603,7 +603,10 @@
if self.tux_driver_lib == None:
return
- self.tux_driver_lib.TuxDrv_ResetPositions()
+ try:
+ self.tux_driver_lib.TuxDrv_ResetPositions()
+ except:
+ pass
self.__logger.logDebug("Reset the motor positions.")
|
|
From: remi <c2m...@c2...> - 2009-06-22 14:43:01
|
Author: remi
Date: 2009-06-22 14:31:57 +0200 (Mon, 22 Jun 2009)
New Revision: 4849
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
Log:
* fixed a bug in the context rules
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py 2009-06-22 12:31:11 UTC (rev 4848)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py 2009-06-22 12:31:57 UTC (rev 4849)
@@ -516,7 +516,7 @@
self.__pguContextsMutex.release()
if self.getBackgroundPguContext() != None:
# If the context is exclusive then stop the background context
- if self.backgroundPguContextIsExclusive():
+ if pguContext.getPluginCommand().isExclusive():
try:
self.getBackgroundPguContext().stopExecution()
except:
|
|
From: remi <c2m...@c2...> - 2009-06-22 14:42:59
|
Author: remi
Date: 2009-06-22 14:33:12 +0200 (Mon, 22 Jun 2009)
New Revision: 4850
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
Log:
* fixed a bug with the default value of the radio state
* fixed a bug with empty gadgets data structure
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-06-22 12:31:57 UTC (rev 4849)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-06-22 12:33:12 UTC (rev 4850)
@@ -30,7 +30,7 @@
dongleState = "off"
state = eventsHandler.getEventHandler(ST_NAME_RADIO_STATE).getLastState()
if state == None:
- radioState = False
+ radioState = "off"
else:
if state[0]:
radioState = "on"
@@ -161,7 +161,9 @@
contentStruct = self.getDefaultContentStruct()
contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
contentStruct['root']['data'] = resourceWIUser01.getStates()
- contentStruct['root']['gadgets'] = resourceRobotContentInteractions.getPguContextsManager().getOnDemandDictForThumbnailBar()
+ gadgetsData = resourceRobotContentInteractions.getPguContextsManager().getOnDemandDictForThumbnailBar()
+ if gadgetsData != {}:
+ contentStruct['root']['gadgets'] = gadgetsData
return headersStruct, contentStruct
# Register the service into the resource
|
|
From: remi <c2m...@c2...> - 2009-06-22 14:42:59
|
Author: remi
Date: 2009-06-22 14:34:18 +0200 (Mon, 22 Jun 2009)
New Revision: 4852
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/interpreters/PluginInterpreter.py
Log:
* improved plugin start/stop methods
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/interpreters/PluginInterpreter.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/interpreters/PluginInterpreter.py 2009-06-22 12:33:42 UTC (rev 4851)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/interpreters/PluginInterpreter.py 2009-06-22 12:34:18 UTC (rev 4852)
@@ -27,6 +27,7 @@
self.__runMutex = threading.Lock()
self.__run = False
self.__process = None
+ self.__pid = None
self.__daemon = False
self.__onPluginStartedCallback = None
self.__onPluginStoppedCallback = None
@@ -185,6 +186,11 @@
stderr = subprocess.STDOUT,
cwd = self.__workingPath,
env = self.__shellEnv)
+ if os.name == 'nt':
+ self.__pid = self.__process._handle
+ else:
+ self.__pid = self.__process.pid
+ self.__setRun(True)
t = threading.Thread(target = self.__stdOutLoop)
t.start()
time.sleep(0.1)
@@ -199,11 +205,11 @@
if os.name == 'nt':
import win32api
try:
- win32api.TerminateProcess(int(self.__process._handle), -1)
+ win32api.TerminateProcess(int(self.__pid), -1)
except:
pass
else:
- os.system("kill -9 " + str(self.__process.pid))
+ os.system("kill -3 -15 -9 " + str(self.__pid))
if not self.__getRun():
return
if self.__daemon:
@@ -211,7 +217,7 @@
self.__process.stdin.write("STOP\n")
self.__process.stdin.flush()
except:
- return
+ pass
timeout = 5.0
while self.__process.poll() == None:
timeout -= 0.1
@@ -253,7 +259,6 @@
def __stdOutLoop(self):
"""Loop to handling the stdout messages.
"""
- self.__setRun(True)
if self.__onPluginStartedCallback != None:
self.__onPluginStartedCallback()
while self.__getRun():
|
|
From: remi <c2m...@c2...> - 2009-06-22 14:42:59
|
Author: remi
Date: 2009-06-22 14:35:10 +0200 (Mon, 22 Jun 2009)
New Revision: 4853
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/scheduler/Task.py
Log:
* added traceback report on task execution error
Modified: software_suite_v3/smart-core/smart-server/trunk/util/scheduler/Task.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/scheduler/Task.py 2009-06-22 12:34:18 UTC (rev 4852)
+++ software_suite_v3/smart-core/smart-server/trunk/util/scheduler/Task.py 2009-06-22 12:35:10 UTC (rev 4853)
@@ -231,8 +231,15 @@
arguments = self.__description.getArguments()
command(*arguments)
except:
- print "error"
- pass
+ import sys
+ import traceback
+ fList = traceback.format_exception(sys.exc_info()[0],
+ sys.exc_info()[1],
+ sys.exc_info()[2])
+ trace = ""
+ for line in fList:
+ trace += line
+ print trace
t = threading.Thread(target = async)
t.start()
return True
|
|
From: remi <c2m...@c2...> - 2009-06-22 07:52:38
|
Author: remi
Date: 2009-06-22 09:52:28 +0200 (Mon, 22 Jun 2009)
New Revision: 4847
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/player/mplayer/Mplayer.py
Log:
* updated kill command on Linux
Modified: software_suite_v3/smart-core/smart-server/trunk/util/player/mplayer/Mplayer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/player/mplayer/Mplayer.py 2009-06-21 18:15:21 UTC (rev 4846)
+++ software_suite_v3/smart-core/smart-server/trunk/util/player/mplayer/Mplayer.py 2009-06-22 07:52:28 UTC (rev 4847)
@@ -69,7 +69,7 @@
except:
pass
else:
- os.system("kill -9 " + str(self.__process.pid))
+ os.system("kill -3 -15 -9 " + str(self.__process.pid))
self.__setRun(False)
self.__process = None
time.sleep(0.25)
|
|
From: remi <c2m...@c2...> - 2009-06-21 18:15:31
|
Author: remi
Date: 2009-06-21 20:15:21 +0200 (Sun, 21 Jun 2009)
New Revision: 4846
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
Log:
* forgot to remove a debug line
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-06-21 18:11:24 UTC (rev 4845)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-06-21 18:15:21 UTC (rev 4846)
@@ -139,7 +139,6 @@
contentStruct['root']['language'] = language
self.haveXsl = True
self.xslPath = "/data/web_interface/%s/xsl/livewithtux.xsl" % skin
- resourceWIUser01.getStates()
return headersStruct, contentStruct
# Register the service into the resource
|
|
From: remi <c2m...@c2...> - 2009-06-21 18:11:31
|
Author: remi
Date: 2009-06-21 20:11:24 +0200 (Sun, 21 Jun 2009)
New Revision: 4845
Modified:
software_suite_v3/smart-core/smart-server/trunk/installer.nsi
Log:
* updated installer script (added "translation" directory)
Modified: software_suite_v3/smart-core/smart-server/trunk/installer.nsi
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/installer.nsi 2009-06-21 18:02:04 UTC (rev 4844)
+++ software_suite_v3/smart-core/smart-server/trunk/installer.nsi 2009-06-21 18:11:24 UTC (rev 4845)
@@ -80,6 +80,10 @@
SetOutPath "$TUXDROID_PATH\softwares\smart-server\util"
File /r /x *.pyc /x *.svn util\*
+ CreateDirectory "$TUXDROID_PATH\softwares\smart-server\translation"
+ SetOutPath "$TUXDROID_PATH\softwares\smart-server\translation"
+ File /r /x *.pyc /x *.svn translation\*
+
SetOutPath "$TUXDROID_PATH\bin"
File delphi_launchers\smart_server_start.exe
File delphi_launchers\smart_server_stop.exe
|
Author: remi
Date: 2009-06-21 20:02:04 +0200 (Sun, 21 Jun 2009)
New Revision: 4844
Added:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/hashtable.js
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl
software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
Log:
* Work on "Live with Tux" page
- Control of gadgets
- Thumbnail bar
- Status
- ...
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css 2009-06-20 15:00:05 UTC (rev 4843)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css 2009-06-21 18:02:04 UTC (rev 4844)
@@ -7,6 +7,8 @@
}
div.thumbnailBarView{
+ top:0px;
+ left:0px;
margin-left:10px;
margin-top:0px;
height:90px;
@@ -17,6 +19,159 @@
float:left;
}
+div.thumbnailBarGadgetFirstDiv{
+ top:0px;
+ left:0px;
+ width:44px;
+ height:44px;
+ margin-left:28px!important;
+ /margin-left:14px;
+ margin-top:17px;
+ display:table;
+ float:left;
+}
+
+.thumbnailBarGadget01Name{
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:80px;
+ height:14px;
+ margin-left:87px;
+ margin-top:84px;
+ display:table;
+ float:left;
+ line-height:14px;
+ font-size:11px;
+ color:#FFFFFF;
+ text-align:center;
+ text-decoration:none;
+ overflow:hidden;
+}
+
+.thumbnailBarGadget02Name{
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:80px;
+ height:14px;
+ margin-left:187px;
+ margin-top:84px;
+ display:table;
+ float:left;
+ line-height:14px;
+ font-size:11px;
+ color:#FFFFFF;
+ text-align:center;
+ text-decoration:none;
+ overflow:hidden;
+}
+
+.thumbnailBarGadget03Name{
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:80px;
+ height:14px;
+ margin-left:287px;
+ margin-top:84px;
+ display:table;
+ float:left;
+ line-height:14px;
+ font-size:11px;
+ color:#FFFFFF;
+ text-align:center;
+ text-decoration:none;
+ overflow:hidden;
+}
+
+.thumbnailBarGadget05Name{
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:80px;
+ height:14px;
+ margin-left:487px;
+ margin-top:84px;
+ display:table;
+ float:left;
+ line-height:14px;
+ font-size:11px;
+ color:#FFFFFF;
+ text-align:center;
+ text-decoration:none;
+ overflow:hidden;
+}
+
+.thumbnailBarGadget06Name{
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:80px;
+ height:14px;
+ margin-left:587px;
+ margin-top:84px;
+ display:table;
+ float:left;
+ line-height:14px;
+ font-size:11px;
+ color:#FFFFFF;
+ text-align:center;
+ text-decoration:none;
+ overflow:hidden;
+}
+
+.thumbnailBarGadget07Name{
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:80px;
+ height:14px;
+ margin-left:687px;
+ margin-top:84px;
+ display:table;
+ float:left;
+ line-height:14px;
+ font-size:11px;
+ color:#FFFFFF;
+ text-align:center;
+ text-decoration:none;
+ overflow:hidden;
+}
+
+div.thumbnailBarGadgetDivFift{
+ top:0px;
+ left:0px;
+ width:44px;
+ height:44px;
+ margin-left:43px;
+ margin-top:17px;
+ display:table;
+ float:left;
+}
+
+div.thumbnailBarGadgetDivCenter{
+ top:0px;
+ left:0px;
+ width:70px;
+ height:70px;
+ margin-left:43px;
+ margin-top:10px;
+ display:table;
+ float:left;
+}
+
+div.thumbnailBarGadgetDiv{
+ top:0px;
+ left:0px;
+ width:44px;
+ height:44px;
+ margin-left:56px;
+ margin-top:17px;
+ display:table;
+ float:left;
+}
+
div.frame01Top{
margin-top:0px;
font-family:Verdana, Bitstream Vera Sans;
@@ -153,12 +308,13 @@
overflow:hidden;
}
-img.notifyHintGadgetIcon{
+div.notifyHintGadgetDiv{
top:0px;
left:0px;
width:24px;
height:24px;
- margin-left:64px;
+ margin-left:64px!important;
+ /margin-left:32px;
margin-top:7px;
display:table;
float:left;
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js 2009-06-20 15:00:05 UTC (rev 4843)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js 2009-06-21 18:02:04 UTC (rev 4844)
@@ -248,6 +248,130 @@
/**
*
*/
+function requestData(url, values)
+{
+ var httpRequest = false;
+ var isIe = false;
+ var result = new Hashtable();
+ if (window.XMLHttpRequest)
+ { // Mozilla, Safari,...
+ httpRequest = new XMLHttpRequest();
+ if (httpRequest.overrideMimeType)
+ {
+ httpRequest.overrideMimeType('text/xml');
+ }
+ }
+ else
+ {
+ isIe = true;
+ if (window.ActiveXObject)
+ { // IE
+ try
+ {
+ httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
+ }
+ catch (e)
+ {
+ try
+ {
+ httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ catch (e){}
+ }
+ }
+ }
+ if (!httpRequest)
+ {
+ return null;
+ }
+ var data = "";
+ for (var property in values)
+ {
+ if (values.hasOwnProperty(property))
+ {
+ if (data.length > 0)
+ {
+ data += "&";
+ }
+ data += property + "=" + values[property];
+ }
+ }
+ httpRequest.open('POST', url, false);
+ var stateChangeFunction = function() {
+ if(httpRequest.readyState == 4)
+ {
+ if (httpRequest.status == 200)
+ {
+ try
+ {
+ var xmldoc = httpRequest.responseXML;
+ var root = xmldoc.getElementsByTagName('root').item(0);
+ var dataCount = 0;
+ var dataNodeName = "";
+ for (var iNode = 0; iNode < root.childNodes.length; iNode++)
+ {
+ var node = root.childNodes.item(iNode);
+ if (node.firstChild.nodeValue != null)
+ {
+ result.put(node.nodeName, node.firstChild.data);
+ }
+ else
+ {
+ var subDict = new Hashtable();
+ for (var jNode = 0; jNode < node.childNodes.length; jNode++)
+ {
+ var node1 = node.childNodes.item(jNode);
+ subDict.put(node1.nodeName, node1.firstChild.data);
+ }
+ if (node.nodeName == "data")
+ {
+ dataNodeName = "data" + dataCount;
+ dataCount++;
+ }
+ else
+ {
+ dataNodeName = node.nodeName;
+ }
+ result.put(dataNodeName, subDict);
+ }
+ }
+ result.put("dataCount", dataCount);
+ }
+ catch (e)
+ {
+ result = null;
+ }
+ }
+ else
+ {
+ result = null;
+ }
+ }
+ }
+ if (isIe)
+ {
+ httpRequest.onreadystatechange = stateChangeFunction;
+ }
+ else
+ {
+ httpRequest.onload = stateChangeFunction;
+ }
+
+ try
+ {
+ httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ httpRequest.send(data);
+ }
+ catch (e)
+ {
+ return null;
+ }
+ return result;
+}
+
+/**
+ *
+ */
function gotoLocation(url, values)
{
url += "?";
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/hashtable.js
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/hashtable.js (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/hashtable.js 2009-06-21 18:02:04 UTC (rev 4844)
@@ -0,0 +1,145 @@
+// Code from :
+// http://dev-for-fun.blogspot.com/2007/11/javascript-hashtable.html
+function Hashtable()
+{
+ this.clear = hashtable_clear;
+ this.containsKey = hashtable_containsKey;
+ this.containsValue = hashtable_containsValue;
+ this.get = hashtable_get;
+ this.isEmpty = hashtable_isEmpty;
+ this.keys = hashtable_keys;
+ this.put = hashtable_put;
+ this.remove = hashtable_remove;
+ this.size = hashtable_size;
+ this.toString = hashtable_toString;
+ this.values = hashtable_values;
+ this.hashtable = new Array();
+}
+
+function hashtable_clear()
+{
+ this.hashtable = new Array();
+}
+
+function hashtable_containsKey(key)
+{
+ var exists = false;
+
+ for (var i in this.hashtable)
+ {
+ if (i == key && this.hashtable[i] != null)
+ {
+ exists = true;
+ break;
+ }
+ }
+
+ return exists;
+}
+
+function hashtable_containsValue(value)
+{
+ var contains = false;
+
+ if (value != null)
+ {
+ for (var i in this.hashtable)
+ {
+ if (this.hashtable[i] == value)
+ {
+ contains = true;
+ break;
+ }
+ }
+ }
+
+ return contains;
+}
+
+function hashtable_get(key)
+{
+ return this.hashtable[key];
+}
+
+function hashtable_isEmpty()
+{
+ return (this.size == 0) ? true : false;
+}
+
+function hashtable_keys()
+{
+ var keys = new Array();
+
+ for (var i in this.hashtable)
+ {
+ if (this.hashtable[i] != null)
+ {
+ keys.push(i);
+ }
+ }
+
+ return keys;
+}
+
+function hashtable_put(key, value)
+{
+ if (key == null || value == null)
+ {
+ throw 'NullPointerException {' + key + '},{' + value + '}';
+ }
+ else
+ {
+ this.hashtable[key] = value;
+ }
+}
+
+function hashtable_remove(key)
+{
+ var rtn = this.hashtable[key];
+
+ this.hashtable[key] = null;
+
+ return rtn;
+}
+
+function hashtable_size()
+{
+ var size = 0;
+
+ for (var i in this.hashtable)
+ {
+ if (this.hashtable[i] != null)
+ size ++;
+ }
+
+ return size;
+}
+
+function hashtable_toString()
+{
+ var result = '';
+
+ for (var i in this.hashtable)
+ {
+ if (this.hashtable[i] != null)
+ {
+ result += '{' + i + '},{' + this.hashtable[i] + '}\n';
+ }
+ }
+ return result;
+}
+
+function hashtable_values()
+{
+ var values = new Array();
+
+ for (var i in this.hashtable)
+ {
+ if (this.hashtable[i] != null)
+ {
+ values.push(this.hashtable[i]);
+ }
+ }
+
+ return values;
+}
\ No newline at end of file
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 15:00:05 UTC (rev 4843)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/livewithtux.xsl 2009-06-21 18:02:04 UTC (rev 4844)
@@ -9,18 +9,123 @@
<html>
<head>
<LINK href="/data/web_interface/user_01/css/livewithtux.css" rel="stylesheet" type="text/css"/>
+ <script src="/data/web_interface/user_01/js/hashtable.js" type="text/javascript"/>
<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[
+ var knowedDongleState = "off";
+ var knowedRadioState = "off";
+ var knowedBatteryState = "0";
+ var knowedSoundState = "off";
+ var knowedGadget01Name = null;
+ var knowedGadget01Icon = null;
+ var knowedGadget01Uuid = null;
+ var knowedGadget02Name = null;
+ var knowedGadget02Icon = null;
+ var knowedGadget02Uuid = null;
+ var knowedGadget03Name = null;
+ var knowedGadget03Icon = null;
+ var knowedGadget03Uuid = null;
+ var knowedGadget04Name = null;
+ var knowedGadget04Icon = null;
+ var knowedGadget04Uuid = null;
+ var knowedGadget05Name = null;
+ var knowedGadget05Icon = null;
+ var knowedGadget05Uuid = null;
+ var knowedGadget06Name = null;
+ var knowedGadget06Icon = null;
+ var knowedGadget06Uuid = null;
+ var knowedGadget07Name = null;
+ var knowedGadget07Icon = null;
+ var knowedGadget07Uuid = null;
+
+ function updateStates()
+ {
+ var dongleState = "off";
+ var radioState = "off";
+ var batteryState = "0";
+ var soundState = "off";
+
+ var states = requestData("/wi_user_01/get_states", {});
+ if (states != null)
+ {
+ dongleState = states.get("data0").get("dongleState");
+ radioState = states.get("data0").get("radioState");
+ batteryState = states.get("data0").get("batteryState");
+ soundState = states.get("data0").get("soundState");
+ var gadgets = states.get("gadgets");
+ updateCurrentGadget(gadgets.get("gadget_04_uuid"),
+ gadgets.get("gadget_04_name"),
+ gadgets.get("gadget_04_icon"));
+ updateGadgetThumb01(gadgets.get("gadget_01_uuid"),
+ gadgets.get("gadget_01_name"),
+ gadgets.get("gadget_01_icon"));
+ updateGadgetThumb02(gadgets.get("gadget_02_uuid"),
+ gadgets.get("gadget_02_name"),
+ gadgets.get("gadget_02_icon"));
+ updateGadgetThumb03(gadgets.get("gadget_03_uuid"),
+ gadgets.get("gadget_03_name"),
+ gadgets.get("gadget_03_icon"));
+ updateGadgetThumb05(gadgets.get("gadget_05_uuid"),
+ gadgets.get("gadget_05_name"),
+ gadgets.get("gadget_05_icon"));
+ updateGadgetThumb06(gadgets.get("gadget_06_uuid"),
+ gadgets.get("gadget_06_name"),
+ gadgets.get("gadget_06_icon"));
+ updateGadgetThumb07(gadgets.get("gadget_07_uuid"),
+ gadgets.get("gadget_07_name"),
+ gadgets.get("gadget_07_icon"));
+ }
+ if (batteryState != knowedBatteryState)
+ {
+ knowedBatteryState = batteryState;
+ showBatteryState(batteryState);
+ }
+ if (soundState != knowedSoundState)
+ {
+ knowedSoundState = soundState;
+ if (soundState == "off")
+ {
+ showSoundOff();
+ }
+ else
+ {
+ showSoundOn();
+ }
+ }
+ if (radioState != knowedRadioState)
+ {
+ knowedRadioState = radioState;
+ if (radioState == "off")
+ {
+ showRadioOff();
+ }
+ else
+ {
+ showRadioOn();
+ }
+ }
+ if (dongleState != knowedDongleState)
+ {
+ knowedDongleState = dongleState;
+ if (dongleState == "off")
+ {
+ showDongleOff();
+ }
+ else
+ {
+ showDongleOn();
+ }
+ }
+ setTimeout("updateStates();", 500);
+ }
+
function initialization()
{
hideError();
- showSoundOff();
- showBatteryState("100");
- showRadioOff();
- showDongleOff();
+ updateStates();
}
function showError(message)
@@ -44,12 +149,22 @@
document.getElementById("statusBtnSoundOff").src = "/data/web_interface/user_01/img/status_btn_soundoff_enable.png";
}
+ function setSoundOn()
+ {
+ getRequest("/robot_content_interactions/unmute", {});
+ }
+
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 setSoundOff()
+ {
+ getRequest("/robot_content_interactions/mute", {});
+ }
+
function showBatteryState(state)
{
if (state == 'charge')
@@ -108,6 +223,125 @@
{
document.getElementById("statusDongleOnOff").src = "/data/web_interface/user_01/img/status_active_off.png";
}
+
+ function previousGadget()
+ {
+ getRequest("/robot_content_interactions/previous_gadget", {});
+ }
+
+ function nextGadget()
+ {
+ getRequest("/robot_content_interactions/next_gadget", {});
+ }
+
+ function startGadget()
+ {
+ getRequest("/robot_content_interactions/start_gadget", {});
+ }
+
+ function stopGadget()
+ {
+ getRequest("/robot_content_interactions/stop_gadget", {});
+ }
+
+ function updateCurrentGadget(uuid, name, icon)
+ {
+ if ((knowedGadget04Name != name) || (knowedGadget04Uuid != uuid))
+ {
+ knowedGadget04Name = name;
+ knowedGadget04Uuid = uuid;
+ knowedGadget04Icon = icon;
+ document.getElementById("notifyHintGadgetIcon").src = icon;
+ setpng(document.getElementById('notifyHintGadgetIcon'));
+ document.getElementById("thumbnailBarGadgetIcon04").src = icon;
+ setpng(document.getElementById('thumbnailBarGadgetIcon04'));
+ document.getElementById("notifyHintGadgetName").firstChild.nodeValue = name;
+ }
+ }
+
+ function updateGadgetThumb01(uuid, name, icon)
+ {
+ if ((knowedGadget01Name != name) || (knowedGadget01Uuid != uuid))
+ {
+ knowedGadget01Name = name;
+ knowedGadget01Uuid = uuid;
+ knowedGadget01Icon = icon;
+ document.getElementById("thumbnailBarGadgetIcon01").src = icon;
+ setpng(document.getElementById('thumbnailBarGadgetIcon01'));
+ if (name.length > 10) {name = name.slice(0, 8) + "...";}
+ document.getElementById("thumbnailBarGadgetName01").firstChild.nodeValue = name;
+ }
+ }
+
+ function updateGadgetThumb02(uuid, name, icon)
+ {
+ if ((knowedGadget02Name != name) || (knowedGadget02Uuid != uuid))
+ {
+ knowedGadget02Name = name;
+ knowedGadget02Uuid = uuid;
+ knowedGadget02Icon = icon;
+ document.getElementById("thumbnailBarGadgetIcon02").src = icon;
+ setpng(document.getElementById('thumbnailBarGadgetIcon02'));
+ if (name.length > 10) {name = name.slice(0, 8) + "...";}
+ document.getElementById("thumbnailBarGadgetName02").firstChild.nodeValue = name;
+ }
+ }
+
+ function updateGadgetThumb03(uuid, name, icon)
+ {
+ if ((knowedGadget03Name != name) || (knowedGadget03Uuid != uuid))
+ {
+ knowedGadget03Name = name;
+ knowedGadget03Uuid = uuid;
+ knowedGadget03Icon = icon;
+ document.getElementById("thumbnailBarGadgetIcon03").src = icon;
+ setpng(document.getElementById('thumbnailBarGadgetIcon03'));
+ if (name.length > 10) {name = name.slice(0, 8) + "...";}
+ document.getElementById("thumbnailBarGadgetName03").firstChild.nodeValue = name;
+ }
+ }
+
+ function updateGadgetThumb05(uuid, name, icon)
+ {
+ if ((knowedGadget05Name != name) || (knowedGadget05Uuid != uuid))
+ {
+ knowedGadget05Name = name;
+ knowedGadget05Uuid = uuid;
+ knowedGadget05Icon = icon;
+ document.getElementById("thumbnailBarGadgetIcon05").src = icon;
+ setpng(document.getElementById('thumbnailBarGadgetIcon05'));
+ if (name.length > 10) {name = name.slice(0, 8) + "...";}
+ document.getElementById("thumbnailBarGadgetName05").firstChild.nodeValue = name;
+ }
+ }
+
+ function updateGadgetThumb06(uuid, name, icon)
+ {
+ if ((knowedGadget06Name != name) || (knowedGadget06Uuid != uuid))
+ {
+ knowedGadget06Name = name;
+ knowedGadget06Uuid = uuid;
+ knowedGadget06Icon = icon;
+ document.getElementById("thumbnailBarGadgetIcon06").src = icon;
+ setpng(document.getElementById('thumbnailBarGadgetIcon06'));
+ if (name.length > 10) {name = name.slice(0, 8) + "...";}
+ document.getElementById("thumbnailBarGadgetName06").firstChild.nodeValue = name;
+ }
+ }
+
+ function updateGadgetThumb07(uuid, name, icon)
+ {
+ if ((knowedGadget07Name != name) || (knowedGadget07Uuid != uuid))
+ {
+ knowedGadget07Name = name;
+ knowedGadget07Uuid = uuid;
+ knowedGadget07Icon = icon;
+ document.getElementById("thumbnailBarGadgetIcon07").src = icon;
+ setpng(document.getElementById('thumbnailBarGadgetIcon07'));
+ if (name.length > 10) {name = name.slice(0, 8) + "...";}
+ document.getElementById("thumbnailBarGadgetName07").firstChild.nodeValue = name;
+ }
+ }
]]>
</script>
</head>
@@ -123,16 +357,85 @@
<!-- PREVIOUS BUTTON -->
<xsl:element name="a">
<xsl:attribute name="class">thumbnailBarBtnPrevious</xsl:attribute>
- <xsl:attribute name="onclick">javascript:showThumbnails(-1);return false;</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:previousGadget();return false;</xsl:attribute>
<xsl:attribute name="href">#</xsl:attribute>
</xsl:element>
<!-- THUMBNAIL BAR -->
<div class="thumbnailBarView">
+ <!-- THUMBNAIL 01 -->
+ <div class="thumbnailBarGadgetFirstDiv">
+ <xsl:element name="img">
+ <xsl:attribute name="id">thumbnailBarGadgetIcon01</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="height">44</xsl:attribute>
+ <xsl:attribute name="width">44</xsl:attribute>
+ </xsl:element>
+ </div>
+ <!-- THUMBNAIL 02 -->
+ <div class="thumbnailBarGadgetDiv">
+ <xsl:element name="img">
+ <xsl:attribute name="id">thumbnailBarGadgetIcon02</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="height">44</xsl:attribute>
+ <xsl:attribute name="width">44</xsl:attribute>
+ </xsl:element>
+ </div>
+ <!-- THUMBNAIL 03 -->
+ <div class="thumbnailBarGadgetDiv">
+ <xsl:element name="img">
+ <xsl:attribute name="id">thumbnailBarGadgetIcon03</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="height">44</xsl:attribute>
+ <xsl:attribute name="width">44</xsl:attribute>
+ </xsl:element>
+ </div>
+ <!-- THUMBNAIL 04 -->
+ <div class="thumbnailBarGadgetDivCenter">
+ <xsl:element name="img">
+ <xsl:attribute name="id">thumbnailBarGadgetIcon04</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="height">70</xsl:attribute>
+ <xsl:attribute name="width">70</xsl:attribute>
+ </xsl:element>
+ </div>
+ <!-- THUMBNAIL 05 -->
+ <div class="thumbnailBarGadgetDivFift">
+ <xsl:element name="img">
+ <xsl:attribute name="id">thumbnailBarGadgetIcon05</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="height">44</xsl:attribute>
+ <xsl:attribute name="width">44</xsl:attribute>
+ </xsl:element>
+ </div>
+ <!-- THUMBNAIL 06 -->
+ <div class="thumbnailBarGadgetDiv">
+ <xsl:element name="img">
+ <xsl:attribute name="id">thumbnailBarGadgetIcon06</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="height">44</xsl:attribute>
+ <xsl:attribute name="width">44</xsl:attribute>
+ </xsl:element>
+ </div>
+ <!-- THUMBNAIL 07 -->
+ <div class="thumbnailBarGadgetDiv">
+ <xsl:element name="img">
+ <xsl:attribute name="id">thumbnailBarGadgetIcon07</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="height">44</xsl:attribute>
+ <xsl:attribute name="width">44</xsl:attribute>
+ </xsl:element>
+ </div>
+ <span class="thumbnailBarGadget01Name" id="thumbnailBarGadgetName01">Gadget</span>
+ <span class="thumbnailBarGadget02Name" id="thumbnailBarGadgetName02">Gadget</span>
+ <span class="thumbnailBarGadget03Name" id="thumbnailBarGadgetName03">Gadget</span>
+ <span class="thumbnailBarGadget05Name" id="thumbnailBarGadgetName05">Gadget</span>
+ <span class="thumbnailBarGadget06Name" id="thumbnailBarGadgetName06">Gadget</span>
+ <span class="thumbnailBarGadget07Name" id="thumbnailBarGadgetName07">Gadget</span>
</div>
<!-- NEXT BUTTON -->
<xsl:element name="a">
<xsl:attribute name="class">thumbnailBarBtnNext</xsl:attribute>
- <xsl:attribute name="onclick">javascript:showThumbnails(1);return false;</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:nextGadget();return false;</xsl:attribute>
<xsl:attribute name="href">#</xsl:attribute>
</xsl:element>
</div>
@@ -149,11 +452,14 @@
<!-- NOTIFIER HINT CONTENT -->
<div class="notifyHintContent">
<!-- GADGET ICON -->
- <xsl:element name="img">
- <xsl:attribute name="class">notifyHintGadgetIcon</xsl:attribute>
- <xsl:attribute name="id">notifyHintGadgetIcon</xsl:attribute>
- <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
- </xsl:element>
+ <div class="notifyHintGadgetDiv">
+ <xsl:element name="img">
+ <xsl:attribute name="id">notifyHintGadgetIcon</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/notify_pic_tux_idle.png</xsl:attribute>
+ <xsl:attribute name="height">24</xsl:attribute>
+ <xsl:attribute name="width">24</xsl:attribute>
+ </xsl:element>
+ </div>
<!-- GADGET NAME -->
<span class="notifyHintGadgetName" id="notifyHintGadgetName">My gadget</span>
<!-- CONFIGURE BUTTON -->
@@ -167,14 +473,14 @@
<!-- START BUTTON -->
<xsl:element name="a">
<xsl:attribute name="class">notifyBtnStartStop</xsl:attribute>
- <xsl:attribute name="onclick"></xsl:attribute>
+ <xsl:attribute name="onclick">javascript:startGadget();return false;</xsl:attribute>
<xsl:attribute name="href">#</xsl:attribute>
<xsl:value-of select="root/translations/start"/>
</xsl:element>
<!-- STOP BUTTON -->
<xsl:element name="a">
<xsl:attribute name="class">notifyBtnStartStop</xsl:attribute>
- <xsl:attribute name="onclick"></xsl:attribute>
+ <xsl:attribute name="onclick">javascript:stopGadget();return false;</xsl:attribute>
<xsl:attribute name="href">#</xsl:attribute>
<xsl:value-of select="root/translations/stop"/>
</xsl:element>
@@ -231,7 +537,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="onclick">javascript:setSoundOn();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>
@@ -239,7 +545,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="onclick">javascript:setSoundOff();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>
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py 2009-06-20 15:00:05 UTC (rev 4843)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py 2009-06-21 18:02:04 UTC (rev 4844)
@@ -359,6 +359,8 @@
self.__loopThread = None
self.__onDemandList = []
self.__onDemandIndex = 0
+ self.__onDemandDictForThumbnailBar = {}
+ self.__onDemandDictForThumbnailBarMutex = threading.Lock()
self.__lastRunStopActionTime = time.time()
self.__lastRunStopActionTimeMutex = threading.Lock()
@@ -366,6 +368,7 @@
"""
"""
self.__onDemandList.append(ugc)
+ self.computeOnDemandDictForThumbnailBar()
def removeOnDemand(self, ugc):
"""
@@ -373,6 +376,7 @@
for odUgc in self.__onDemandList:
if odUgc == ugc:
self.__onDemandList.remove(ugc)
+ self.computeOnDemandDictForThumbnailBar()
return
def __speakOnDemand(self):
@@ -399,6 +403,7 @@
self.__onDemandIndex += 1
if self.__onDemandIndex >= len(self.__onDemandList):
self.__onDemandIndex = 0
+ self.computeOnDemandDictForThumbnailBar()
resourceTuxDriver.playSound(11, 100.0)
self.__speakOnDemand()
@@ -408,9 +413,45 @@
self.__onDemandIndex -= 1
if self.__onDemandIndex < 0:
self.__onDemandIndex = len(self.__onDemandList) - 1
+ self.computeOnDemandDictForThumbnailBar()
resourceTuxDriver.playSound(11, 100.0)
self.__speakOnDemand()
+ def computeOnDemandDictForThumbnailBar(self):
+ """
+ """
+ self.__onDemandDictForThumbnailBarMutex.acquire()
+ self.__onDemandDictForThumbnailBar = {}
+ if len(self.__onDemandList) == 0:
+ self.__onDemandDictForThumbnailBarMutex.release()
+ return
+ maxListSize = len(self.__onDemandList)
+ minIdx = 0
+ maxIdx = maxListSize - 1
+ centerIdx = self.__onDemandIndex
+ def fillByIndex(rel, number):
+ currIdx = (centerIdx + rel) % maxListSize
+ ugc = self.__onDemandList[currIdx]
+ self.__onDemandDictForThumbnailBar["gadget_%.2d_name" % number] = ugc.getDescription().getName()
+ self.__onDemandDictForThumbnailBar["gadget_%.2d_uuid" % number] = ugc.getDescription().getUuid()
+ self.__onDemandDictForThumbnailBar["gadget_%.2d_icon" % number] = "/%s/icon.png" % ugc.getParentGadget().getDescription().getUuid()
+ fillByIndex(-3, 1)
+ fillByIndex(-2, 2)
+ fillByIndex(-1, 3)
+ fillByIndex(0, 4)
+ fillByIndex(1, 5)
+ fillByIndex(2, 6)
+ fillByIndex(3, 7)
+ self.__onDemandDictForThumbnailBarMutex.release()
+
+ def getOnDemandDictForThumbnailBar(self):
+ """
+ """
+ self.__onDemandDictForThumbnailBarMutex.acquire()
+ result = self.__onDemandDictForThumbnailBar
+ self.__onDemandDictForThumbnailBarMutex.release()
+ return result
+
def __setStarted(self, value):
"""
"""
@@ -445,12 +486,15 @@
def mute(self):
"""
"""
- pass
+ self.stop()
+ resourceTuxDriver.playSound(12, 100.0)
+ self.__contextBtStandby("remote", ("K_STANDBY", 0.0))
def unmute(self):
"""
"""
- pass
+ resourceTuxDriver.playSound(12, 100.0)
+ self.start()
def __executionLoop(self):
"""
@@ -731,6 +775,49 @@
self.__setLastRunStopActionTime()
ugc.start(ugc.getDefaultRunCommandName())
+ def startCurrentGadget(self):
+ """
+ """
+ if not self.isStarted():
+ return
+ # Return if foreground context exists
+ if self.getForegroundPguContext() != None:
+ if self.getForegroundPguContext().executionIsStarted():
+ return
+ # Else return if background context exists
+ if self.getBackgroundPguContext() != None:
+ if self.getBackgroundPguContext().executionIsStarted():
+ return
+ # Else load current selected on demand gadget
+ if len(self.__onDemandList) > 0:
+ ugc = self.__onDemandList[self.__onDemandIndex]
+ self.__setLastRunStopActionTime()
+ t = threading.Thread(target = ugc.start, args = (ugc.getDefaultRunCommandName(),))
+ t.start()
+
+ def stopCurrentGadget(self):
+ """
+ """
+ if not self.isStarted():
+ return
+ # Abort foreground context if exists
+ if self.getForegroundPguContext() != None:
+ if self.getForegroundPguContext().executionIsStarted():
+ if not self.__checkLastRunStopActionTime():
+ return
+ self.getForegroundPguContext().stopExecution()
+ return
+ # Else abort background context if exists
+ if self.getBackgroundPguContext() != None:
+ if self.getBackgroundPguContext().executionIsStarted():
+ # Exception for plugins commands with attribute "allUserButtons"
+ if self.backgroundPguContextNeedAllUserButtons():
+ return
+ if not self.__checkLastRunStopActionTime():
+ return
+ self.getBackgroundPguContext().stopExecution()
+ return
+
def __contextLTPrevious(self, eventName, *args):
"""
"""
@@ -742,6 +829,18 @@
return
self.__onDemandPrevious()
+ def previousGadget(self):
+ """
+ """
+ if not self.isStarted():
+ return
+ if self.getForegroundPguContext() != None:
+ return
+ if self.getBackgroundPguContext() != None:
+ if self.getBackgroundPguContext().executionIsStarted():
+ return
+ self.__onDemandPrevious()
+
def __contextRBNext(self, eventName, *args):
"""
"""
@@ -753,16 +852,25 @@
return
self.__onDemandNext()
+ def nextGadget(self):
+ """
+ """
+ if not self.isStarted():
+ return
+ if self.getForegroundPguContext() != None:
+ return
+ if self.getBackgroundPguContext() != None:
+ if self.getBackgroundPguContext().executionIsStarted():
+ return
+ self.__onDemandNext()
+
def __contextBtMute(self, eventName, *args):
"""
"""
if self.isStarted():
- self.stop()
- resourceTuxDriver.playSound(12, 100.0)
- self.__contextBtStandby("remote", ("K_STANDBY", 0.0))
+ self.mute()
else:
- resourceTuxDriver.playSound(12, 100.0)
- self.start()
+ self.unmute()
def __contextBtStandby(self, eventName, *args):
"""
@@ -911,3 +1019,139 @@
"resourceRobotContentInteractions")
# Register the resource into the resources manager
resourcesManager.addResource(resourceRobotContentInteractions)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "mute".
+# ------------------------------------------------------------------------------
+class TDSServiceRobotContentInteractionsMute(TDSService):
+
+ def configure(self):
+ self.parametersDict = {}
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = True
+ self.name = "mute"
+ self.comment = "Mute Tux Droid."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ resourceRobotContentInteractions.getPguContextsManager().mute()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceRobotContentInteractions.addService(TDSServiceRobotContentInteractionsMute)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "unmute".
+# ------------------------------------------------------------------------------
+class TDSServiceRobotContentInteractionsUnmute(TDSService):
+
+ def configure(self):
+ self.parametersDict = {}
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = True
+ self.name = "unmute"
+ self.comment = "Unmute Tux Droid."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ resourceRobotContentInteractions.getPguContextsManager().unmute()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceRobotContentInteractions.addService(TDSServiceRobotContentInteractionsUnmute)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "next_gadget".
+# ------------------------------------------------------------------------------
+class TDSServiceRobotContentInteractionsNextGadget(TDSService):
+
+ def configure(self):
+ self.parametersDict = {}
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = True
+ self.name = "next_gadget"
+ self.comment = "Go to next gadget."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ t = threading.Thread(target = resourceRobotContentInteractions.getPguContextsManager().nextGadget)
+ t.start()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceRobotContentInteractions.addService(TDSServiceRobotContentInteractionsNextGadget)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "previous_gadget".
+# ------------------------------------------------------------------------------
+class TDSServiceRobotContentInteractionsPreviousGadget(TDSService):
+
+ def configure(self):
+ self.parametersDict = {}
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = True
+ self.name = "previous_gadget"
+ self.comment = "Go to previous gadget."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ t = threading.Thread(target = resourceRobotContentInteractions.getPguContextsManager().previousGadget)
+ t.start()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceRobotContentInteractions.addService(TDSServiceRobotContentInteractionsPreviousGadget)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "start_gadget".
+# ------------------------------------------------------------------------------
+class TDSServiceRobotContentInteractionsStartGadget(TDSService):
+
+ def configure(self):
+ self.parametersDict = {}
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = True
+ self.name = "start_gadget"
+ self.comment = "Start the current gadget."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ t = threading.Thread(target = resourceRobotContentInteractions.getPguContextsManager().startCurrentGadget)
+ t.start()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceRobotContentInteractions.addService(TDSServiceRobotContentInteractionsStartGadget)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "stop_gadget".
+# ------------------------------------------------------------------------------
+class TDSServiceRobotContentInteractionsStopGadget(TDSService):
+
+ def configure(self):
+ self.parametersDict = {}
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = True
+ self.name = "stop_gadget"
+ self.comment = "Stop the current gadget."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ t = threading.Thread(target = resourceRobotContentInteractions.getPguContextsManager().stopCurrentGadget)
+ t.start()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceRobotContentInteractions.addService(TDSServiceRobotContentInteractionsStopGadget)
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-06-20 15:00:05 UTC (rev 4843)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-06-21 18:02:04 UTC (rev 4844)
@@ -19,6 +19,56 @@
self.fileName = RESOURCE_FILENAME
self.translations = Translation("wi_user")
+ def getStates(self):
+ state = eventsHandler.getEventHandler(ST_NAME_DONGLE_PLUG).getLastState()
+ if state == None:
+ dongleState = "off"
+ else:
+ if state[0]:
+ dongleState = "on"
+ else:
+ dongleState = "off"
+ state = eventsHandler.getEventHandler(ST_NAME_RADIO_STATE).getLastState()
+ if state == None:
+ radioState = False
+ else:
+ if state[0]:
+ radioState = "on"
+ else:
+ radioState = "off"
+ state = eventsHandler.getEventHandler(ST_NAME_BATTERY_LEVEL).getLastState()
+ if state == None:
+ batteryState = "0"
+ else:
+ rndVal = int(state[0] / 240) * 240
+ if rndVal <= 4800:
+ batteryState = "0"
+ elif rndVal == 5040:
+ batteryState = "20"
+ elif rndVal == 5280:
+ batteryState = "40"
+ elif rndVal == 5520:
+ batteryState = "60"
+ elif rndVal == 5760:
+ batteryState = "80"
+ else:
+ batteryState = "100"
+ state = eventsHandler.getEventHandler(ST_NAME_CHARGER_STATE).getLastState()
+ if state != None:
+ if state[0] != "UNPLUGGED":
+ batteryState = "charge"
+ state = resourceRobotContentInteractions.getPguContextsManager().isStarted()
+ if state:
+ soundState = "on"
+ else:
+ soundState = "off"
+ result = {}
+ result['dongleState'] = dongleState
+ result['radioState'] = radioState
+ result['batteryState'] = batteryState
+ result['soundState'] = soundState
+ return result
+
# Create an instance of the resource
resourceWIUser01 = TDSResourceWIUser01("resourceWIUser01")
# Register the resource into the resources manager
@@ -59,7 +109,7 @@
# Register the service into the resource
resourceWIUser01.addService(TDSServiceWIUser01Index)
# Bind the resource index url to this service
-resourcesManager.addBinding("user", "wi_user_01", "index", "skin=user_01&language=en&menu=livewithtux")
+resourcesManager.addBinding("user", "wi_user_01", "index", "skin=user_01&language=fr&menu=livewithtux")
resourcesManager.addBinding("user/index", "wi_user_01", "index", "skin=user_01&language=en&menu=livewithtux")
# ------------------------------------------------------------------------------
@@ -89,7 +139,31 @@
contentStruct['root']['language'] = language
self.haveXsl = True
self.xslPath = "/data/web_interface/%s/xsl/livewithtux.xsl" % skin
+ resourceWIUser01.getStates()
return headersStruct, contentStruct
# Register the service into the resource
resourceWIUser01.addService(TDSServiceWIUser01LiveWithTux)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "get_states".
+# ------------------------------------------------------------------------------
+class TDSServiceWIUser01GetStates(TDSService):
+
+ def configure(self):
+ self.parametersDict = {}
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = False
+ self.name = "get_states"
+ self.comment = "Get Tux Droid and gadget states."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ contentStruct['root']['data'] = resourceWIUser01.getStates()
+ contentStruct['root']['gadgets'] = resourceRobotContentInteractions.getPguContextsManager().getOnDemandDictForThumbnailBar()
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceWIUser01.addService(TDSServiceWIUser01GetStates)
|
|
From: remi <c2m...@c2...> - 2009-06-20 15:00:21
|
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>
|
|
From: remi <c2m...@c2...> - 2009-06-20 14:19:10
|
Author: remi Date: 2009-06-20 15:47:22 +0200 (Sat, 20 Jun 2009) New Revision: 4840 Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumbnailbar_btn_next_activate.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumbnailbar_btn_next_enable.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumbnailbar_btn_previous_activate.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumbnailbar_btn_previous_enable.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumbnailbar_view.png Removed: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_next_activate.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_next_enable.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_previous_activate.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_previous_enable.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_view.png Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_bottom.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_content.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_btn_soundoff_activate.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_btn_soundoff_enable.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_btn_soundon_activate.png software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_btn_soundon_enable.png Log: * updated some images Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_bottom.png =================================================================== (Binary files differ) Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/notify_hint_content.png =================================================================== (Binary files differ) Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_btn_soundoff_activate.png =================================================================== (Binary files differ) Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_btn_soundoff_enable.png =================================================================== (Binary files differ) Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_btn_soundon_activate.png =================================================================== (Binary files differ) Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/status_btn_soundon_enable.png =================================================================== (Binary files differ) Copied: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumbnailbar_btn_next_activate.png (from rev 4829, software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_next_activate.png) =================================================================== (Binary files differ) Copied: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumbnailbar_btn_next_enable.png (from rev 4829, software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_next_enable.png) =================================================================== (Binary files differ) Copied: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumbnailbar_btn_previous_activate.png (from rev 4829, software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_previous_activate.png) =================================================================== (Binary files differ) Copied: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumbnailbar_btn_previous_enable.png (from rev 4829, software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_previous_enable.png) =================================================================== (Binary files differ) Copied: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumbnailbar_view.png (from rev 4829, software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_view.png) =================================================================== (Binary files differ) Deleted: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_next_activate.png =================================================================== (Binary files differ) Deleted: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_next_enable.png =================================================================== (Binary files differ) Deleted: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_previous_activate.png =================================================================== (Binary files differ) Deleted: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_btn_previous_enable.png =================================================================== (Binary files differ) Deleted: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/thumnailbar_view.png =================================================================== (Binary files differ) |
Author: remi
Date: 2009-06-20 15:48:28 +0200 (Sat, 20 Jun 2009)
New Revision: 4841
Added:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/lightbox.js
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/prototype.js
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/alert.xsl
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/parameter.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/plugin_gadget_common.xsl
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/menu.css
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
Log:
* added page "live with tux"
* added js scripts for lightbox
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/livewithtux.css 2009-06-20 13:48:28 UTC (rev 4841)
@@ -0,0 +1,432 @@
+*:focus {
+ outline: none;
+}
+
+*::-moz-focus-inner {
+ border: none;
+}
+
+div.thumbnailBarView{
+ margin-left:10px;
+ margin-top:0px;
+ height:90px;
+ width:700px;
+ font-family:Verdana, Bitstream Vera Sans;
+ background-image:url(/data/web_interface/user_01/img/thumbnailbar_view.png);
+ display:table;
+ float:left;
+}
+
+div.frame01Top{
+ margin-top:0px;
+ font-family:Verdana, Bitstream Vera Sans;
+ background-image:url(/data/web_interface/user_01/img/frame_01_top.png);
+ background-repeat:no-repeat;
+ height:10px;
+ width:855px;
+ overflow: hidden;
+}
+
+div.frame01TopSpace{
+ margin-top:15px;
+ font-family:Verdana, Bitstream Vera Sans;
+ background-image:url(/data/web_interface/user_01/img/frame_01_top.png);
+ background-repeat:no-repeat;
+ height:10px;
+ width:855px;
+ overflow: hidden;
+}
+
+div.frame01Middle{
+ font-family:Verdana, Bitstream Vera Sans;
+ display:table;
+ background-image:url(/data/web_interface/user_01/img/frame_01_middle.png);
+ background-repeat:repeat;
+ height:1px;
+ width:855px;
+}
+
+div.frame01MiddleNotify{
+ font-family:Verdana, Bitstream Vera Sans;
+ display:table;
+ background-image:url(/data/web_interface/user_01/img/frame_01_middle.png);
+ background-repeat:repeat;
+ height:315px;
+ width:855px;
+}
+
+div.frame01Bottom{
+ margin-top:0px;
+ font-family:Verdana, Bitstream Vera Sans;
+ background-image:url(/data/web_interface/user_01/img/frame_01_bottom.png);
+ background-repeat:no-repeat;
+ height:20px;
+ width:855px;
+ overflow: hidden;
+}
+
+.thumbnailBarBtnPrevious{
+ top:0px;
+ left:0px;
+ width:20px;
+ height:32px;
+ margin-left:47px;
+ margin-top:29px;
+ display:table;
+ line-height:32px;
+ float:left;
+ background-image:url(/data/web_interface/user_01/img/thumbnailbar_btn_previous_enable.png);
+}
+
+.thumbnailBarBtnPrevious:hover{
+ background-image:url(/data/web_interface/user_01/img/thumbnailbar_btn_previous_activate.png);
+}
+
+.thumbnailBarBtnNext{
+ top:0px;
+ left:0px;
+ width:20px;
+ height:32px;
+ margin-left:10px;
+ margin-top:29px;
+ display:table;
+ line-height:32px;
+ float:left;
+ background-image:url(/data/web_interface/user_01/img/thumbnailbar_btn_next_enable.png);
+}
+
+.thumbnailBarBtnNext:hover{
+ background-image:url(/data/web_interface/user_01/img/thumbnailbar_btn_next_activate.png);
+}
+
+img.notifyTuxIdle{
+ top:0px;
+ left:0px;
+ width:330px;
+ height:298px;
+ margin-left:47px;
+ margin-top:10px;
+ display:table;
+ float:left;
+}
+
+div.notifyHintContainer{
+ margin-left:0px;
+ margin-top:50px;
+ height:235px;
+ width:430px;
+ font-family:Verdana, Bitstream Vera Sans;
+ display:table;
+ float:left;
+}
+
+div.notifyHintContent{
+ margin-left:0px;
+ margin-top:0px;
+ height:187px;
+ width:430px;
+ font-family:Verdana, Bitstream Vera Sans;
+ background-image:url(/data/web_interface/user_01/img/notify_hint_content.png);
+ display:table;
+ float:left;
+}
+
+div.notifyHintBottom{
+ margin-left:0px;
+ margin-top:0px;
+ height:8px;
+ width:430px;
+ font-family:Verdana, Bitstream Vera Sans;
+ background-image:url(/data/web_interface/user_01/img/notify_hint_bottom.png);
+ display:table;
+ overflow:hidden;
+}
+
+div.notifyHintBottomError{
+ margin-left:0px;
+ margin-top:0px;
+ height:48px;
+ width:430px;
+ font-family:Verdana, Bitstream Vera Sans;
+ background-image:url(/data/web_interface/user_01/img/notify_hint_bottom_error.png);
+ display:table;
+ overflow:hidden;
+}
+
+img.notifyHintGadgetIcon{
+ top:0px;
+ left:0px;
+ width:24px;
+ height:24px;
+ margin-left:64px;
+ margin-top:7px;
+ display:table;
+ float:left;
+}
+
+.notifyHintGadgetName{
+ top:0px;
+ left:0px;
+ width:157px;
+ height:24px;
+ margin-left:8px;
+ margin-top:6px;
+ display:table;
+ line-height:24px;
+ float:left;
+ font-size:11px;
+ color:#FFFFFF;
+ font-weight:bold;
+ overflow:hidden;
+}
+
+.notifyBtnConfigure{
+ top:0px;
+ left:0px;
+ width:25px;
+ height:24px;
+ margin-left:0px;
+ margin-top:7px;
+ display:table;
+ line-height:24px;
+ float:left;
+ background-image:url(/data/web_interface/user_01/img/notify_btn_configure_enable.png);
+}
+
+.notifyBtnConfigure:hover{
+ background-image:url(/data/web_interface/user_01/img/notify_btn_configure_activate.png);
+}
+
+.notifyBtnStartStop{
+ top:0px;
+ left:0px;
+ width:65px;
+ height:24px;
+ margin-left:5px;
+ margin-top:7px;
+ display:table;
+ line-height:24px;
+ float:left;
+ font-size:11px;
+ color:#FFFFFF;
+ font-weight:bold;
+ text-align:center;
+ text-decoration:none;
+ background-image:url(/data/web_interface/user_01/img/notify_btn_startstop_enable.png);
+}
+
+.notifyBtnStartStop:hover{
+ background-image:url(/data/web_interface/user_01/img/notify_btn_startstop_activate.png);
+}
+
+.notifyHintErrorMessage{
+ top:0px;
+ left:0px;
+ width:307px;
+ height:20px;
+ margin-left:93px;
+ margin-top:12px;
+ line-height:20px;
+ display:table;
+ float:left;
+ font-size:11px;
+ color:#FF6D00;
+}
+
+.notifyBtnCloseError{
+ top:0px;
+ left:0px;
+ width:20px;
+ height:20px;
+ margin-left:0px;
+ margin-top:14px;
+ display:table;
+ float:left;
+ line-height:20px;
+ background-image:url(/data/web_interface/user_01/img/notify_btn_closeerror_enable.png);
+}
+
+.notifyBtnCloseError:hover{
+ background-image:url(/data/web_interface/user_01/img/notify_btn_closeerror_activate.png);
+}
+
+div.statusFrame{
+ margin-top:0px;
+ font-family:Verdana, Bitstream Vera Sans;
+ background-image:url(/data/web_interface/user_01/img/status_frame.png);
+ background-repeat:no-repeat;
+ height:50px;
+ width:855px;
+ overflow: hidden;
+}
+
+div.statusFrameBottomSpace{
+ margin-top:0px;
+ height:5px;
+}
+
+.statusViewTitle{
+ top:0px;
+ left:0px;
+ width:67px;
+ height:32px;
+ margin-left:10px;
+ margin-top:8px;
+ display:table;
+ line-height:32px;
+ float:left;
+ font-size:12px;
+ color:#FFFFFF;
+ text-align:center;
+ font-weight:bold;
+ overflow:hidden;
+}
+
+img.statusPicRadio{
+ top:0px;
+ left:0px;
+ width:51px;
+ height:32px;
+ margin-left:0px;
+ margin-top:9px;
+ display:table;
+ float:left;
+}
+
+img.statusActiveOnOff{
+ top:0px;
+ left:0px;
+ width:18px;
+ height:32px;
+ margin-left:0px;
+ margin-top:9px;
+ display:table;
+ float:left;
+}
+
+img.statusPicDongle{
+ top:0px;
+ left:0px;
+ width:62px;
+ height:32px;
+ margin-left:0px;
+ margin-top:9px;
+ display:table;
+ float:left;
+}
+
+img.statusPicBattery{
+ top:0px;
+ left:0px;
+ width:32px;
+ height:32px;
+ margin-left:331px;
+ margin-top:9px;
+ display:table;
+ float:left;
+}
+
+.statusBatteryLabel{
+ top:0px;
+ left:0px;
+ width:54px;
+ height:32px;
+ margin-left:0px;
+ margin-top:8px;
+ display:table;
+ line-height:32px;
+ float:left;
+ font-size:12px;
+ color:#FFFFFF;
+ text-align:center;
+ font-weight:bold;
+ overflow:hidden;
+}
+
+img.statusBtnSoundOn{
+ top:0px;
+ left:0px;
+ width:101px;
+ height:32px;
+ margin-left:0px;
+ margin-top:9px;
+ display:table;
+ float:left;
+}
+
+.statusBtnSoundOnLabel{
+ top:0px;
+ left:0px;
+ width:70px;
+ height:32px;
+ margin-left:-70px;
+ margin-top:8px;
+ display:table;
+ float:left;
+ line-height:32px;
+ font-size:11px;
+ color:#FFFFFF;
+ text-align:center;
+ font-weight:bold;
+ overflow:hidden;
+}
+
+img.statusBtnSoundOff{
+ top:0px;
+ left:0px;
+ width:102px;
+ height:32px;
+ margin-left:0px;
+ margin-top:9px;
+ display:table;
+ float:left;
+}
+
+.statusBtnSoundOffLabel{
+ top:0px;
+ left:0px;
+ width:70px;
+ height:32px;
+ margin-left:-75px;
+ margin-top:8px;
+ display:table;
+ float:left;
+ line-height:32px;
+ font-size:11px;
+ color:#FFFFFF;
+ text-align:center;
+ font-weight:bold;
+ overflow:hidden;
+}
+
+.leightbox {
+ color: #333;
+ display: none;
+ position: absolute;
+ top: 25%;
+ left: 25%;
+ width: 50%;
+ height: 50%;
+ padding: 1em;
+ border: 1em solid #B8B8B8;
+ background-color: white;
+ text-align: left;
+ z-index:1001;
+ overflow: auto;
+}
+
+#overlay{
+ display:none;
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:855px;
+ height:535px;
+ z-index:1000;
+ background-color:#000000;
+ -moz-opacity: 0.7;
+ opacity:.70;
+ filter: alpha(opacity=70);
+}
+
+.lightbox[id]{ /* IE6 and below Can't See This */ position:fixed; }#overlay[id]{ /* IE6 and below Can't See This */ position:fixed; }
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/menu.css
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/menu.css 2009-06-20 13:47:22 UTC (rev 4840)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/menu.css 2009-06-20 13:48:28 UTC (rev 4841)
@@ -3,15 +3,32 @@
left:0px;
top:0px;
width:855px;
- height:25px;
+ height:535px;
display:table;
- margin-top:85px;
+ margin-top:65px;
margin-left:50px;
margin-right:50px;
background-color:#EFEFEF;
color:#EFEFEF;
+ z-index:1001;
+ overflow:hidden;
}
+iframe.ContentIFrame{
+ left:0px;
+ top:0px;
+ width:100%;
+ height:535px;
+ display:table;
+ margin-top:0px;
+ margin-left:0px;
+ margin-right:0px;
+ background-color:#EFEFEF;
+ color:#EFEFEF;
+ z-index:1001;
+ overflow:hidden;
+}
+
a.menuLeftEnable{
float:left;
margin-top:0px;
@@ -106,4 +123,18 @@
color:white;
font-weight:bold;
text-align:center;
-}
\ No newline at end of file
+}
+
+#overlay{
+ display:none;
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:100%;
+ height:100%;
+ z-index:1000;
+ background-color:#000000;
+ -moz-opacity: 0.7;
+ opacity:.70;
+ filter: alpha(opacity=70);
+}
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/lightbox.js
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/lightbox.js (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/lightbox.js 2009-06-20 13:48:28 UTC (rev 4841)
@@ -0,0 +1,184 @@
+/*
+Created By: Chris Campbell
+Website: http://particletree.com
+Date: 2/1/2006
+
+Adapted By: Simon de Haan
+Website: http://blog.eight.nl
+Date: 21/2/2006
+
+Inspired by the lightbox implementation found at http://www.huddletogether.com/projects/lightbox/
+And the lightbox gone wild by ParticleTree at http://particletree.com/features/lightbox-gone-wild/
+
+*/
+
+/*-------------------------------GLOBAL VARIABLES------------------------------------*/
+
+var detect = navigator.userAgent.toLowerCase();
+var OS,browser,version,total,thestring;
+
+/*-----------------------------------------------------------------------------------------------*/
+
+//Browser detect script origionally created by Peter Paul Koch at http://www.quirksmode.org/
+
+function getBrowserInfo() {
+ if (checkIt('konqueror')) {
+ browser = "Konqueror";
+ OS = "Linux";
+ }
+ else if (checkIt('safari')) browser = "Safari"
+ else if (checkIt('omniweb')) browser = "OmniWeb"
+ else if (checkIt('opera')) browser = "Opera"
+ else if (checkIt('webtv')) browser = "WebTV";
+ else if (checkIt('icab')) browser = "iCab"
+ else if (checkIt('msie')) browser = "Internet Explorer"
+ else if (!checkIt('compatible')) {
+ browser = "Netscape Navigator"
+ version = detect.charAt(8);
+ }
+ else browser = "An unknown browser";
+
+ if (!version) version = detect.charAt(place + thestring.length);
+
+ if (!OS) {
+ if (checkIt('linux')) OS = "Linux";
+ else if (checkIt('x11')) OS = "Unix";
+ else if (checkIt('mac')) OS = "Mac"
+ else if (checkIt('win')) OS = "Windows"
+ else OS = "an unknown operating system";
+ }
+}
+
+function checkIt(string) {
+ place = detect.indexOf(string) + 1;
+ thestring = string;
+ return place;
+}
+
+/*-----------------------------------------------------------------------------------------------*/
+
+Event.observe(window, 'load', initialize, false);
+Event.observe(window, 'load', getBrowserInfo, false);
+Event.observe(window, 'unload', Event.unloadCache, false);
+
+var lightbox = Class.create();
+
+lightbox.prototype = {
+
+ yPos : 0,
+ xPos : 0,
+
+ initialize: function(ctrl) {
+ this.content = ctrl.rel;
+ Event.observe(ctrl, 'click', this.activate.bindAsEventListener(this), false);
+ ctrl.onclick = function(){return false;};
+ },
+
+ // Turn everything on - mainly the IE fixes
+ activate: function(){
+ if (browser == 'Internet Explorer'){
+ this.getScroll();
+ this.prepareIE('100%', 'hidden');
+ this.setScroll(0,0);
+ this.hideSelects('hidden');
+ }
+ this.displayLightbox("block");
+ },
+
+ // Ie requires height to 100% and overflow hidden or else you can scroll down past the lightbox
+ prepareIE: function(height, overflow){
+ bod = document.getElementsByTagName('body')[0];
+ bod.style.height = height;
+ bod.style.overflow = overflow;
+
+ htm = document.getElementsByTagName('html')[0];
+ htm.style.height = height;
+ htm.style.overflow = overflow;
+ },
+
+ // In IE, select elements hover on top of the lightbox
+ hideSelects: function(visibility){
+ selects = document.getElementsByTagName('select');
+ for(i = 0; i < selects.length; i++) {
+ selects[i].style.visibility = visibility;
+ }
+ },
+
+ // Taken from lightbox implementation found at http://www.huddletogether.com/projects/lightbox/
+ getScroll: function(){
+ if (self.pageYOffset) {
+ this.yPos = self.pageYOffset;
+ } else if (document.documentElement && document.documentElement.scrollTop){
+ this.yPos = document.documentElement.scrollTop;
+ } else if (document.body) {
+ this.yPos = document.body.scrollTop;
+ }
+ },
+
+ setScroll: function(x, y){
+ window.scrollTo(x, y);
+ },
+
+ displayLightbox: function(display){
+ $('overlay').style.display = display;
+ parent.top.document.getElementById('overlay').style.display = display;
+ $(this.content).style.display = display;
+ if(display != 'none') this.actions();
+ },
+
+ // Search through new links within the lightbox, and attach click event
+ actions: function(){
+ lbActions = document.getElementsByClassName('lbAction');
+
+ for(i = 0; i < lbActions.length; i++) {
+ Event.observe(lbActions[i], 'click', this[lbActions[i].rel].bindAsEventListener(this), false);
+ lbActions[i].onclick = function(){return false;};
+ }
+
+ },
+
+ // Example of creating your own functionality once lightbox is initiated
+ deactivate: function(){
+ if (browser == "Internet Explorer"){
+ this.setScroll(0,this.yPos);
+ this.prepareIE("auto", "auto");
+ this.hideSelects("visible");
+ }
+
+ this.displayLightbox("none");
+ }
+}
+
+/*-----------------------------------------------------------------------------------------------*/
+
+// Onload, make all links that need to trigger a lightbox active
+function initialize(){
+ addLightboxMarkup();
+ lbox = document.getElementsByTagName('a');
+ for(i = 0; i < lbox.length; i++)
+ {
+ if (lbox[i].name == 'lbOn')
+ {
+ valid = new lightbox(lbox[i]);
+ }
+ }
+}
+
+// Add in markup necessary to make this work. Basically two divs:
+// Overlay holds the shadow
+// Lightbox is the centered square that the content is put into.
+function addLightboxMarkup() {
+
+ bod = document.getElementsByTagName('body')[0];
+
+ overlay = document.createElement('div');
+ overlay.id = 'overlay';
+
+ bod.appendChild(overlay);
+
+ bodParent = window.top.document.getElementsByTagName('body')[0];
+ overlay = window.top.document.createElement('div');
+ overlay.id = 'overlay';
+
+ bodParent.appendChild(overlay);
+}
\ No newline at end of file
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/prototype.js
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/prototype.js (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/prototype.js 2009-06-20 13:48:28 UTC (rev 4841)
@@ -0,0 +1,1785 @@
+/* Prototype JavaScript framework, version 1.4.0
+ * (c) 2005 Sam Stephenson <sa...@co...>
+ *
+ * THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff
+ * against the source tree, available from the Prototype darcs repository.
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ *
+ * For details, see the Prototype web site: http://prototype.conio.net/
+ *
+/*--------------------------------------------------------------------------*/
+
+var Prototype = {
+ Version: '1.4.0',
+ ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
+
+ emptyFunction: function() {},
+ K: function(x) {return x}
+}
+
+var Class = {
+ create: function() {
+ return function() {
+ this.initialize.apply(this, arguments);
+ }
+ }
+}
+
+var Abstract = new Object();
+
+Object.extend = function(destination, source) {
+ for (property in source) {
+ destination[property] = source[property];
+ }
+ return destination;
+}
+
+Object.inspect = function(object) {
+ try {
+ if (object == undefined) return 'undefined';
+ if (object == null) return 'null';
+ return object.inspect ? object.inspect() : object.toString();
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+}
+
+Function.prototype.bind = function() {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function() {
+ return __method.apply(object, args.concat($A(arguments)));
+ }
+}
+
+Function.prototype.bindAsEventListener = function(object) {
+ var __method = this;
+ return function(event) {
+ return __method.call(object, event || window.event);
+ }
+}
+
+Object.extend(Number.prototype, {
+ toColorPart: function() {
+ var digits = this.toString(16);
+ if (this < 16) return '0' + digits;
+ return digits;
+ },
+
+ succ: function() {
+ return this + 1;
+ },
+
+ times: function(iterator) {
+ $R(0, this, true).each(iterator);
+ return this;
+ }
+});
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0; i < arguments.length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) {}
+ }
+
+ return returnValue;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var PeriodicalExecuter = Class.create();
+PeriodicalExecuter.prototype = {
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.callback();
+ } finally {
+ this.currentlyExecuting = false;
+ }
+ }
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+function $() {
+ var elements = new Array();
+
+ for (var i = 0; i < arguments.length; i++) {
+ var element = arguments[i];
+ if (typeof element == 'string')
+ element = document.getElementById(element);
+
+ if (arguments.length == 1)
+ return element;
+
+ elements.push(element);
+ }
+
+ return elements;
+}
+Object.extend(String.prototype, {
+ stripTags: function() {
+ return this.replace(/<\/?[^>]+>/gi, '');
+ },
+
+ stripScripts: function() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ },
+
+ extractScripts: function() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
+ var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ },
+
+ evalScripts: function() {
+ return this.extractScripts().map(eval);
+ },
+
+ escapeHTML: function() {
+ var div = document.createElement('div');
+ var text = document.createTextNode(this);
+ div.appendChild(text);
+ return div.innerHTML;
+ },
+
+ unescapeHTML: function() {
+ var div = document.createElement('div');
+ div.innerHTML = this.stripTags();
+ return div.childNodes[0] ? div.childNodes[0].nodeValue : '';
+ },
+
+ toQueryParams: function() {
+ var pairs = this.match(/^\??(.*)$/)[1].split('&');
+ return pairs.inject({}, function(params, pairString) {
+ var pair = pairString.split('=');
+ params[pair[0]] = pair[1];
+ return params;
+ });
+ },
+
+ toArray: function() {
+ return this.split('');
+ },
+
+ camelize: function() {
+ var oStringList = this.split('-');
+ if (oStringList.length == 1) return oStringList[0];
+
+ var camelizedString = this.indexOf('-') == 0
+ ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1)
+ : oStringList[0];
+
+ for (var i = 1, len = oStringList.length; i < len; i++) {
+ var s = oStringList[i];
+ camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
+ }
+
+ return camelizedString;
+ },
+
+ inspect: function() {
+ return "'" + this.replace('\\', '\\\\').replace("'", '\\\'') + "'";
+ }
+});
+
+String.prototype.parseQuery = String.prototype.toQueryParams;
+
+var $break = new Object();
+var $continue = new Object();
+
+var Enumerable = {
+ each: function(iterator) {
+ var index = 0;
+ try {
+ this._each(function(value) {
+ try {
+ iterator(value, index++);
+ } catch (e) {
+ if (e != $continue) throw e;
+ }
+ });
+ } catch (e) {
+ if (e != $break) throw e;
+ }
+ },
+
+ all: function(iterator) {
+ var result = true;
+ this.each(function(value, index) {
+ result = result && !!(iterator || Prototype.K)(value, index);
+ if (!result) throw $break;
+ });
+ return result;
+ },
+
+ any: function(iterator) {
+ var result = true;
+ this.each(function(value, index) {
+ if (result = !!(iterator || Prototype.K)(value, index))
+ throw $break;
+ });
+ return result;
+ },
+
+ collect: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ results.push(iterator(value, index));
+ });
+ return results;
+ },
+
+ detect: function (iterator) {
+ var result;
+ this.each(function(value, index) {
+ if (iterator(value, index)) {
+ result = value;
+ throw $break;
+ }
+ });
+ return result;
+ },
+
+ findAll: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ grep: function(pattern, iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ var stringValue = value.toString();
+ if (stringValue.match(pattern))
+ results.push((iterator || Prototype.K)(value, index));
+ })
+ return results;
+ },
+
+ include: function(object) {
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw $break;
+ }
+ });
+ return found;
+ },
+
+ inject: function(memo, iterator) {
+ this.each(function(value, index) {
+ memo = iterator(memo, value, index);
+ });
+ return memo;
+ },
+
+ invoke: function(method) {
+ var args = $A(arguments).slice(1);
+ return this.collect(function(value) {
+ return value[method].apply(value, args);
+ });
+ },
+
+ max: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ value = (iterator || Prototype.K)(value, index);
+ if (value >= (result || value))
+ result = value;
+ });
+ return result;
+ },
+
+ min: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ value = (iterator || Prototype.K)(value, index);
+ if (value <= (result || value))
+ result = value;
+ });
+ return result;
+ },
+
+ partition: function(iterator) {
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ ((iterator || Prototype.K)(value, index) ?
+ trues : falses).push(value);
+ });
+ return [trues, falses];
+ },
+
+ pluck: function(property) {
+ var results = [];
+ this.each(function(value, index) {
+ results.push(value[property]);
+ });
+ return results;
+ },
+
+ reject: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ sortBy: function(iterator) {
+ return this.collect(function(value, index) {
+ return {value: value, criteria: iterator(value, index)};
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ },
+
+ toArray: function() {
+ return this.collect(Prototype.K);
+ },
+
+ zip: function() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (typeof args.last() == 'function')
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ iterator(value = collections.pluck(index));
+ return value;
+ });
+ },
+
+ inspect: function() {
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
+ }
+}
+
+Object.extend(Enumerable, {
+ map: Enumerable.collect,
+ find: Enumerable.detect,
+ select: Enumerable.findAll,
+ member: Enumerable.include,
+ entries: Enumerable.toArray
+});
+var $A = Array.from = function(iterable) {
+ if (!iterable) return [];
+ if (iterable.toArray) {
+ return iterable.toArray();
+ } else {
+ var results = [];
+ for (var i = 0; i < iterable.length; i++)
+ results.push(iterable[i]);
+ return results;
+ }
+}
+
+Object.extend(Array.prototype, Enumerable);
+
+Array.prototype._reverse = Array.prototype.reverse;
+
+Object.extend(Array.prototype, {
+ _each: function(iterator) {
+ for (var i = 0; i < this.length; i++)
+ iterator(this[i]);
+ },
+
+ clear: function() {
+ this.length = 0;
+ return this;
+ },
+
+ first: function() {
+ return this[0];
+ },
+
+ last: function() {
+ return this[this.length - 1];
+ },
+
+ compact: function() {
+ return this.select(function(value) {
+ return value != undefined || value != null;
+ });
+ },
+
+ flatten: function() {
+ return this.inject([], function(array, value) {
+ return array.concat(value.constructor == Array ?
+ value.flatten() : [value]);
+ });
+ },
+
+ without: function() {
+ var values = $A(arguments);
+ return this.select(function(value) {
+ return !values.include(value);
+ });
+ },
+
+ indexOf: function(object) {
+ for (var i = 0; i < this.length; i++)
+ if (this[i] == object) return i;
+ return -1;
+ },
+
+ reverse: function(inline) {
+ return (inline !== false ? this : this.toArray())._reverse();
+ },
+
+ shift: function() {
+ var result = this[0];
+ for (var i = 0; i < this.length - 1; i++)
+ this[i] = this[i + 1];
+ this.length--;
+ return result;
+ },
+
+ inspect: function() {
+ return '[' + this.map(Object.inspect).join(', ') + ']';
+ }
+});
+var Hash = {
+ _each: function(iterator) {
+ for (key in this) {
+ var value = this[key];
+ if (typeof value == 'function') continue;
+
+ var pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+ },
+
+ keys: function() {
+ return this.pluck('key');
+ },
+
+ values: function() {
+ return this.pluck('value');
+ },
+
+ merge: function(hash) {
+ return $H(hash).inject($H(this), function(mergedHash, pair) {
+ mergedHash[pair.key] = pair.value;
+ return mergedHash;
+ });
+ },
+
+ toQueryString: function() {
+ return this.map(function(pair) {
+ return pair.map(encodeURIComponent).join('=');
+ }).join('&');
+ },
+
+ inspect: function() {
+ return '#<Hash:{' + this.map(function(pair) {
+ return pair.map(Object.inspect).join(': ');
+ }).join(', ') + '}>';
+ }
+}
+
+function $H(object) {
+ var hash = Object.extend({}, object || {});
+ Object.extend(hash, Enumerable);
+ Object.extend(hash, Hash);
+ return hash;
+}
+ObjectRange = Class.create();
+Object.extend(ObjectRange.prototype, Enumerable);
+Object.extend(ObjectRange.prototype, {
+ initialize: function(start, end, exclusive) {
+ this.start = start;
+ this.end = end;
+ this.exclusive = exclusive;
+ },
+
+ _each: function(iterator) {
+ var value = this.start;
+ do {
+ iterator(value);
+ value = value.succ();
+ } while (this.include(value));
+ },
+
+ include: function(value) {
+ if (value < this.start)
+ return false;
+ if (this.exclusive)
+ return value < this.end;
+ return value <= this.end;
+ }
+});
+
+var $R = function(start, end, exclusive) {
+ return new ObjectRange(start, end, exclusive);
+}
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')},
+ function() {return new XMLHttpRequest()}
+ ) || false;
+ },
+
+ activeRequestCount: 0
+}
+
+Ajax.Responders = {
+ responders: [],
+
+ _each: function(iterator) {
+ this.responders._each(iterator);
+ },
+
+ register: function(responderToAdd) {
+ if (!this.include(responderToAdd))
+ this.responders.push(responderToAdd);
+ },
+
+ unregister: function(responderToRemove) {
+ this.responders = this.responders.without(responderToRemove);
+ },
+
+ dispatch: function(callback, request, transport, json) {
+ this.each(function(responder) {
+ if (responder[callback] && typeof responder[callback] == 'function') {
+ try {
+ responder[callback].apply(responder, [request, transport, json]);
+ } catch (e) {}
+ }
+ });
+ }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+ onCreate: function() {
+ Ajax.activeRequestCount++;
+ },
+
+ onComplete: function() {
+ Ajax.activeRequestCount--;
+ }
+});
+
+Ajax.Base = function() {};
+Ajax.Base.prototype = {
+ setOptions: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ parameters: ''
+ }
+ Object.extend(this.options, options || {});
+ },
+
+ responseIsSuccess: function() {
+ return this.transport.status == undefined
+ || this.transport.status == 0
+ || (this.transport.status >= 200 && this.transport.status < 300);
+ },
+
+ responseIsFailure: function() {
+ return !this.responseIsSuccess();
+ }
+}
+
+Ajax.Request = Class.create();
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
+ initialize: function(url, options) {
+ this.transport = Ajax.getTransport();
+ this.setOptions(options);
+ this.request(url);
+ },
+
+ request: function(url) {
+ var parameters = this.options.parameters || '';
+ if (parameters.length > 0) parameters += '&_=';
+
+ try {
+ this.url = url;
+ if (this.options.method == 'get' && parameters.length > 0)
+ this.url += (this.url.match(/\?/) ? '&' : '?') + parameters;
+
+ Ajax.Responders.dispatch('onCreate', this, this.transport);
+
+ this.transport.open(this.options.method, this.url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous) {
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
+ }
+
+ this.setRequestHeaders();
+
+ var body = this.options.postBody ? this.options.postBody : parameters;
+ this.transport.send(this.options.method == 'post' ? body : null);
+
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ setRequestHeaders: function() {
+ var requestHeaders =
+ ['X-Requested-With', 'XMLHttpRequest',
+ 'X-Prototype-Version', Prototype.Version];
+
+ if (this.options.method == 'post') {
+ requestHeaders.push('Content-type',
+ 'application/x-www-form-urlencoded');
+
+ /* Force "Connection: close" for Mozilla browsers to work around
+ * a bug where XMLHttpReqeuest sends an incorrect Content-length
+ * header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType)
+ requestHeaders.push('Connection', 'close');
+ }
+
+ if (this.options.requestHeaders)
+ requestHeaders.push.apply(requestHeaders, this.options.requestHeaders);
+
+ for (var i = 0; i < requestHeaders.length; i += 2)
+ this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState != 1)
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ header: function(name) {
+ try {
+ return this.transport.getResponseHeader(name);
+ } catch (e) {}
+ },
+
+ evalJSON: function() {
+ try {
+ return eval(this.header('X-JSON'));
+ } catch (e) {}
+ },
+
+ evalResponse: function() {
+ try {
+ return eval(this.transport.responseText);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ respondToReadyState: function(readyState) {
+ var event = Ajax.Request.Events[readyState];
+ var transport = this.transport, json = this.evalJSON();
+
+ if (event == 'Complete') {
+ try {
+ (this.options['on' + this.transport.status]
+ || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(transport, json);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if ((this.header('Content-type') || '').match(/^text\/javascript/i))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + event] || Prototype.emptyFunction)(transport, json);
+ Ajax.Responders.dispatch('on' + event, this, transport, json);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ /* Avoid memory leak in MSIE: clean up the oncomplete event handler */
+ if (event == 'Complete')
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
+ }
+});
+
+Ajax.Updater = Class.create();
+
+Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
+ initialize: function(container, url, options) {
+ this.containers = {
+ success: container.success ? $(container.success) : $(container),
+ failure: container.failure ? $(container.failure) :
+ (container.success ? null : $(container))
+ }
+
+ this.transport = Ajax.getTransport();
+ this.setOptions(options);
+
+ var onComplete = this.options.onComplete || Prototype.emptyFunction;
+ this.options.onComplete = (function(transport, object) {
+ this.updateContent();
+ onComplete(transport, object);
+ }).bind(this);
+
+ this.request(url);
+ },
+
+ updateContent: function() {
+ var receiver = this.responseIsSuccess() ?
+ this.containers.success : this.containers.failure;
+ var response = this.transport.responseText;
+
+ if (!this.options.evalScripts)
+ response = response.stripScripts();
+
+ if (receiver) {
+ if (this.options.insertion) {
+ new this.options.insertion(receiver, response);
+ } else {
+ Element.update(receiver, response);
+ }
+ }
+
+ if (this.responseIsSuccess()) {
+ if (this.onComplete)
+ setTimeout(this.onComplete.bind(this), 10);
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create();
+Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
+ initialize: function(container, url, options) {
+ this.setOptions(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = (this.options.decay || 1);
+
+ this.updater = {};
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(request) {
+ if (this.options.decay) {
+ this.decay = (request.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = request.responseText;
+ }
+ this.timer = setTimeout(this.onTimerEvent.bind(this),
+ this.decay * this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+document.getElementsByClassName = function(className, parentElement) {
+ var children = ($(parentElement) || document.body).getElementsByTagName('*');
+ return $A(children).inject([], function(elements, child) {
+ if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
+ elements.push(child);
+ return elements;
+ });
+}
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Element) {
+ var Element = new Object();
+}
+
+Object.extend(Element, {
+ visible: function(element) {
+ return $(element).style.display != 'none';
+ },
+
+ toggle: function() {
+ for (var i = 0; i < arguments.length; i++) {
+ var element = $(arguments[i]);
+ Element[Element.visible(element) ? 'hide' : 'show'](element);
+ }
+ },
+
+ hide: function() {
+ for (var i = 0; i < arguments.length; i++) {
+ var element = $(arguments[i]);
+ element.style.display = 'none';
+ }
+ },
+
+ show: function() {
+ for (var i = 0; i < arguments.length; i++) {
+ var element = $(arguments[i]);
+ element.style.display = '';
+ }
+ },
+
+ remove: function(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ },
+
+ update: function(element, html) {
+ $(element).innerHTML = html.stripScripts();
+ setTimeout(function() {html.evalScripts()}, 10);
+ },
+
+ getHeight: function(element) {
+ element = $(element);
+ return element.offsetHeight;
+ },
+
+ classNames: function(element) {
+ return new Element.ClassNames(element);
+ },
+
+ hasClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ return Element.classNames(element).include(className);
+ },
+
+ addClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ return Element.classNames(element).add(className);
+ },
+
+ removeClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ return Element.classNames(element).remove(className);
+ },
+
+ // removes whitespace-only text node children
+ cleanWhitespace: function(element) {
+ element = $(element);
+ for (var i = 0; i < element.childNodes.length; i++) {
+ var node = element.childNodes[i];
+ if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+ Element.remove(node);
+ }
+ },
+
+ empty: function(element) {
+ return $(element).innerHTML.match(/^\s*$/);
+ },
+
+ scrollTo: function(element) {
+ element = $(element);
+ var x = element.x ? element.x : element.offsetLeft,
+ y = element.y ? element.y : element.offsetTop;
+ window.scrollTo(x, y);
+ },
+
+ getStyle: function(element, style) {
+ element = $(element);
+ var value = element.style[style.camelize()];
+ if (!value) {
+ if (document.defaultView && document.defaultView.getComputedStyle) {
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css.getPropertyValue(style) : null;
+ } else if (element.currentStyle) {
+ value = element.currentStyle[style.camelize()];
+ }
+ }
+
+ if (window.opera && ['left', 'top', 'right', 'bottom'].include(style))
+ if (Element.getStyle(element, 'position') == 'static') value = 'auto';
+
+ return value == 'auto' ? null : value;
+ },
+
+ setStyle: function(element, style) {
+ element = $(element);
+ for (name in style)
+ element.style[name.camelize()] = style[name];
+ },
+
+ getDimensions: function(element) {
+ element = $(element);
+ if (Element.getStyle(element, 'display') != 'none')
+ return {width: element.offsetWidth, height: element.offsetHeight};
+
+ // All *Width and *Height properties give 0 on elements with display none,
+ // so enable the element temporarily
+ var els = element.style;
+ var originalVisibility = els.visibility;
+ var originalPosition = els.position;
+ els.visibility = 'hidden';
+ els.position = 'absolute';
+ els.display = '';
+ var originalWidth = element.clientWidth;
+ var originalHeight = element.clientHeight;
+ els.display = 'none';
+ els.position = originalPosition;
+ els.visibility = originalVisibility;
+ return {width: originalWidth, height: originalHeight};
+ },
+
+ makePositioned: function(element) {
+ element = $(element);
+ var pos = Element.getStyle(element, 'position');
+ if (pos == 'static' || !pos) {
+ element._madePositioned = true;
+ element.style.position = 'relative';
+ // Opera returns the offset relative to the positioning context, when an
+ // element is position relative but top and left have not been defined
+ if (window.opera) {
+ element.style.top = 0;
+ element.style.left = 0;
+ }
+ }
+ },
+
+ undoPositioned: function(element) {
+ element = $(element);
+ if (element._madePositioned) {
+ element._madePositioned = undefined;
+ element.style.position =
+ element.style.top =
+ element.style.left =
+ element.style.bottom =
+ element.style.right = '';
+ }
+ },
+
+ makeClipping: function(element) {
+ element = $(element);
+ if (element._overflow) return;
+ element._overflow = element.style.overflow;
+ if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden')
+ element.style.overflow = 'hidden';
+ },
+
+ undoClipping: function(element) {
+ element = $(element);
+ if (element._overflow) return;
+ element.style.overflow = element._overflow;
+ element._overflow = undefined;
+ }
+});
+
+var Toggle = new Object();
+Toggle.display = Element.toggle;
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.Insertion = function(adjacency) {
+ this.adjacency = adjacency;
+}
+
+Abstract.Insertion.prototype = {
+ initialize: function(element, content) {
+ this.element = $(element);
+ this.content = content.stripScripts();
+
+ if (this.adjacency && this.element.insertAdjacentHTML) {
+ try {
+ this.element.insertAdjacentHTML(this.adjacency, this.content);
+ } catch (e) {
+ if (this.element.tagName.toLowerCase() == 'tbody' || this.element.tagName.toLowerCase() == 'tr') {
+ this.insertContent(this.contentFromAnonymousTable());
+ } else {
+ throw e;
+ }
+ }
+ } else {
+ this.range = this.element.ownerDocument.createRange();
+ if (this.initializeRange) this.initializeRange();
+ this.insertContent([this.range.createContextualFragment(this.content)]);
+ }
+
+ setTimeout(function() {content.evalScripts()}, 10);
+ },
+
+ contentFromAnonymousTable: function() {
+ var div = document.createElement('div');
+ div.innerHTML = '<table><tbody>' + this.content + '</tbody></table>';
+ return $A(div.childNodes[0].childNodes[0].childNodes);
+ }
+}
+
+var Insertion = new Object();
+
+Insertion.Before = Class.create();
+Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {
+ initializeRange: function() {
+ this.range.setStartBefore(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.parentNode.insertBefore(fragment, this.element);
+ }).bind(this));
+ }
+});
+
+Insertion.Top = Class.create();
+Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
+ initializeRange: function() {
+ this.range.selectNodeContents(this.element);
+ this.range.collapse(true);
+ },
+
+ insertContent: function(fragments) {
+ fragments.reverse(false).each((function(fragment) {
+ this.element.insertBefore(fragment, this.element.firstChild);
+ }).bind(this));
+ }
+});
+
+Insertion.Bottom = Class.create();
+Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {
+ initializeRange: function() {
+ this.range.selectNodeContents(this.element);
+ this.range.collapse(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.appendChild(fragment);
+ }).bind(this));
+ }
+});
+
+Insertion.After = Class.create();
+Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
+ initializeRange: function() {
+ this.range.setStartAfter(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.parentNode.insertBefore(fragment,
+ this.element.nextSibling);
+ }).bind(this));
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Element.ClassNames = Class.create();
+Element.ClassNames.prototype = {
+ initialize: function(element) {
+ this.element = $(element);
+ },
+
+ _each: function(iterator) {
+ this.element.className.split(/\s+/).select(function(name) {
+ return name.length > 0;
+ })._each(iterator);
+ },
+
+ set: function(className) {
+ this.element.className = className;
+ },
+
+ add: function(classNameToAdd) {
+ if (this.include(classNameToAdd)) return;
+ this.set(this.toArray().concat(classNameToAdd).join(' '));
+ },
+
+ remove: function(classNameToRemove) {
+ if (!this.include(classNameToRemove)) return;
+ this.set(this.select(function(className) {
+ return className != classNameToRemove;
+ }).join(' '));
+ },
+
+ toString: function() {
+ return this.toArray().join(' ');
+ }
+}
+
+Object.extend(Element.ClassNames.prototype, Enumerable);
+var Field = {
+ clear: function() {
+ for (var i = 0; i < arguments.length; i++)
+ $(arguments[i]).value = '';
+ },
+
+ focus: function(element) {
+ $(element).focus();
+ },
+
+ present: function() {
+ for (var i = 0; i < arguments.length; i++)
+ if ($(arguments[i]).value == '') return false;
+ return true;
+ },
+
+ select: function(element) {
+ $(element).select();
+ },
+
+ activate: function(element) {
+ element = $(element);
+ element.focus();
+ if (element.select)
+ element.select();
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var Form = {
+ serialize: function(form) {
+ var elements = Form.getElements($(form));
+ var queryComponents = new Array();
+
+ for (var i = 0; i < elements.length; i++) {
+ var queryComponent = Form.Element.serialize(elements[i]);
+ if (queryComponent)
+ queryComponents.push(queryComponent);
+ }
+
+ return queryComponents.join('&');
+ },
+
+ getElements: function(form) {
+ form = $(form);
+ var elements = new Array();
+
+ for (tagName in Form.Element.Serializers) {
+ var tagElements = form.getElementsByTagName(tagName);
+ for (var j = 0; j < tagElements.length; j++)
+ elements.push(tagElements[j]);
+ }
+ return elements;
+ },
+
+ getInputs: function(form, typeName, name) {
+ form = $(form);
+ var inputs = form.getElementsByTagName('input');
+
+ if (!typeName && !name)
+ return inputs;
+
+ var matchingInputs = new Array();
+ for (var i = 0; i < inputs.length; i++) {
+ var input = inputs[i];
+ if ((typeName && input.type != typeName) ||
+ (name && input.name != name))
+ continue;
+ matchingInputs.push(input);
+ }
+
+ return matchingInputs;
+ },
+
+ disable: function(form) {
+ var elements = Form.getElements(form);
+ for (var i = 0; i < elements.length; i++) {
+ var element = elements[i];
+ element.blur();
+ element.disabled = 'true';
+ }
+ },
+
+ enable: function(form) {
+ var elements = Form.getElements(form);
+ for (var i = 0; i < elements.length; i++) {
+ var element = elements[i];
+ element.disabled = '';
+ }
+ },
+
+ findFirstElement: function(form) {
+ return Form.getElements(form).find(function(element) {
+ return element.type != 'hidden' && !element.disabled &&
+ ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
+ });
+ },
+
+ focusFirstElement: function(form) {
+ Field.activate(Form.findFirstElement(form));
+ },
+
+ reset: function(form) {
+ $(form).reset();
+ }
+}
+
+Form.Element = {
+ serialize: function(element) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ var parameter = Form.Element.Serializers[method](element);
+
+ if (parameter) {
+ var key = encodeURIComponent(parameter[0]);
+ if (key.length == 0) return;
+
+ if (parameter[1].constructor != Array)
+ parameter[1] = [parameter[1]];
+
+ return parameter[1].map(function(value) {
+ return key + '=' + encodeURIComponent(value);
+ }).join('&');
+ }
+ },
+
+ getValue: function(element) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ var parameter = Form.Element.Serializers[method](element);
+
+ if (parameter)
+ return parameter[1];
+ }
+}
+
+Form.Element.Serializers = {
+ input: function(element) {
+ switch (element.type.toLowerCase()) {
+ case 'submit':
+ case 'hidden':
+ case 'password':
+ case 'text':
+ return Form.Element.Serializers.textarea(element);
+ case 'checkbox':
+ case 'radio':
+ return Form.Element.Serializers.inputSelector(element);
+ }
+ return false;
+ },
+
+ inputSelector: function(element) {
+ if (element.checked)
+ return [element.name, element.value];
+ },
+
+ textarea: function(element) {
+ return [element.name, element.value];
+ },
+
+ select: function(element) {
+ return Form.Element.Serializers[element.type == 'select-one' ?
+ 'selectOne' : 'selectMany'](element);
+ },
+
+ selectOne: function(element) {
+ var value = '', opt, index = element.selectedIndex;
+ if (index >= 0) {
+ opt = element.options[index];
+ value = opt.value;
+ if (!value && !('value' in opt))
+ value = opt.text;
+ }
+ return [element.name, value];
+ },
+
+ selectMany: function(element) {
+ var value = new Array();
+ for (var i = 0; i < element.length; i++) {
+ var opt = element.options[i];
+ if (opt.selected) {
+ var optValue = opt.value;
+ if (!optValue && !('value' in opt))
+ optValue = opt.text;
+ value.push(optValue);
+ }
+ }
+ return [element.name, value];
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var $F = Form.Element.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.TimedObserver = function() {}
+Abstract.TimedObserver.prototype = {
+ initialize: function(element, frequency, callback) {
+ this.frequency = frequency;
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ }
+}
+
+Form.Element.Observer = Class.create();
+Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.Observer = Class.create();
+Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = function() {}
+Abstract.EventObserver.prototype = {
+ initialize: function(element, callback) {
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ if (this.element.tagName.toLowerCase() == 'form')
+ this.registerFormCallbacks();
+ else
+ this.registerCallback(this.element);
+ },
+
+ onElementEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ },
+
+ registerFormCallbacks: function() {
+ var elements = Form.getElements(this.element);
+ for (var i = 0; i < elements.length; i++)
+ this.registerCallback(elements[i]);
+ },
+
+ registerCallback: function(element) {
+ if (element.type) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
+ break;
+ case 'password':
+ case 'text':
+ case 'textarea':
+ case 'select-one':
+ case 'select-multiple':
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
+ break;
+ }
+ }
+ }
+}
+
+Form.Element.EventObserver = Class.create();
+Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.EventObserver = Class.create();
+Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+if (!window.Event) {
+ var Event = new Object();
+}
+
+Object.extend(Event, {
+ KEY_BACKSPACE: 8,
+ KEY_TAB: 9,
+ KEY_RETURN: 13,
+ KEY_ESC: 27,
+ KEY_LEFT: 37,
+ KEY_UP: 38,
+ KEY_RIGHT: 39,
+ KEY_DOWN: 40,
+ KEY_DELETE: 46,
+
+ element: function(event) {
+ return event.target || event.srcElement;
+ },
+
+ isLeftClick: function(event) {
+ return (((event.which) && (event.which == 1)) ||
+ ((event.button) && (event.button == 1)));
+ },
+
+ pointerX: function(event) {
+ return event.pageX || (event.clientX +
+ (document.documentElement.scrollLeft || document.body.scrollLeft));
+ },
+
+ pointerY: function(event) {
+ return event.pageY || (event.clientY +
+ (document.documentElement.scrollTop || document.body.scrollTop));
+ },
+
+ stop: function(event) {
+ if (event.preventDefault) {
+ event.preventDefault();
+ event.stopPropagation();
+ } else {
+ event.returnValue = false;
+ event.cancelBubble = true;
+ }
+ },
+
+ // find the first node with the given tagName, starting from the
+ // node the event was triggered on; traverses the DOM upwards
+ findElement: function(event, tagName) {
+ var element = Event.element(event);
+ while (element.parentNode && (!element.tagName ||
+ (element.tagName.toUpperCase() != tagName.toUpperCase())))
+ element = element.parentNode;
+ return element;
+ },
+
+ observers: false,
+
+ _observeAndCache: function(element, name, observer, useCapture) {
+ if (!this.observers) this.observers = [];
+ if (element.addEventListener) {
+ this.observers.push([element, name, observer, useCapture]);
+ element.addEventListener(name, observer, useCapture);
+ } else if (element.attachEvent) {
+ this.observers.push([element, name, observer, useCapture]);
+ element.attachEvent('on' + name, observer);
+ }
+ },
+
+ unloadCache: function() {
+ if (!Event.observers) return;
+ for (var i = 0; i < Event.observers.length; i++) {
+ Event.stopObserving.apply(this, Event.observers[i]);
+ Event.observers[i][0] = null;
+ }
+ Event.observers = false;
+ },
+
+ observe: function(element, name, observer, useCapture) {
+ var element = $(element);
+ useCapture = useCapture || false;
+
+ if (name == 'keypress' &&
+ (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
+ || element.attachEvent))
+ name = 'keydown';
+
+ this._observeAndCache(element, name, observer, useCapture);
+ },
+
+ stopObserving: function(element, name, observer, useCapture) {
+ var element = $(element);
+ useCapture = useCapture || false;
+
+ if (name == 'keypress' &&
+ (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
+ || element.detachEvent))
+ name = 'keydown';
+
+ if (element.removeEventListener) {
+ element.removeEventListener(name, observer, useCapture);
+ } else if (element.detachEvent) {
+ element.detachEvent('on' + name, observer);
+ }
+ }
+});
+
+/* prevent memory leaks in IE */
+Event.observe(window, 'unload', Event.unloadCache, false);
+var Position = {
+ // set to true if needed, warning: firefox performance problems
+ // NOT neeeded for page scrolling, only if draggable contained in
+ // scrollable elements
+ includeScrollOffsets: false,
+
+ // must be called before calling withinIncludingScrolloffset, ever...
[truncated message content] |
|
From: remi <c2m...@c2...> - 2009-06-20 14:18:56
|
Author: remi
Date: 2009-06-20 15:52:39 +0200 (Sat, 20 Jun 2009)
New Revision: 4842
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/translation/wi_user/default.pot
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
Log:
* added some translations
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:48:28 UTC (rev 4841)
+++ 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)
@@ -71,13 +71,15 @@
<xsl:element name="a">
<xsl:attribute name="class">notifyBtnStartStop</xsl:attribute>
<xsl:attribute name="onclick"></xsl:attribute>
- <xsl:attribute name="href">#</xsl:attribute>Start
+ <xsl:attribute name="href">#</xsl:attribute>
+ <xsl:value-of select="root/translations/start"/>
</xsl:element>
<!-- STOP BUTTON -->
<xsl:element name="a">
<xsl:attribute name="class">notifyBtnStartStop</xsl:attribute>
<xsl:attribute name="onclick"></xsl:attribute>
- <xsl:attribute name="href">#</xsl:attribute>Stop
+ <xsl:attribute name="href">#</xsl:attribute>
+ <xsl:value-of select="root/translations/stop"/>
</xsl:element>
</div>
<!-- NOTIFIER HINT BOTTOM -->
@@ -97,7 +99,7 @@
<!-- STATUS VIEW -->
<div class="statusFrame">
<!-- STATUS VIEW TITLE -->
- <span class="statusViewTitle">Status</span>
+ <span class="statusViewTitle"><xsl:value-of select="root/translations/status"/></span>
<!-- STATUS PIC RADIO -->
<xsl:element name="img">
<xsl:attribute name="class">statusPicRadio</xsl:attribute>
@@ -134,14 +136,14 @@
<xsl:attribute name="id">statusBtnSoundOn</xsl:attribute>
<xsl:attribute name="src">/data/web_interface/user_01/img/status_btn_soundon_enable.png</xsl:attribute>
</xsl:element>
- <span class="statusBtnSoundOnLabel">Sound on</span>
+ <span class="statusBtnSoundOnLabel"><xsl:value-of select="root/translations/sound_on"/></span>
<!-- STATUS BTN SOUND OFF -->
<xsl:element name="img">
<xsl:attribute name="class">statusBtnSoundOff</xsl:attribute>
<xsl:attribute name="id">statusBtnSoundOff</xsl:attribute>
<xsl:attribute name="src">/data/web_interface/user_01/img/status_btn_soundoff_activate.png</xsl:attribute>
</xsl:element>
- <span class="statusBtnSoundOffLabel">Sound off</span>
+ <span class="statusBtnSoundOffLabel"><xsl:value-of select="root/translations/sound_off"/></span>
</div>
</div>
<!-- EXAMPLE OF LIGHTBOX -->
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-06-20 13:48:28 UTC (rev 4841)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-06-20 13:52:39 UTC (rev 4842)
@@ -21,3 +21,9 @@
msgid "sound_off"
msgstr ""
+
+msgid "start"
+msgstr ""
+
+msgid "stop"
+msgstr ""
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-06-20 13:48:28 UTC (rev 4841)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-06-20 13:52:39 UTC (rev 4842)
@@ -21,3 +21,9 @@
msgid "sound_off"
msgstr "Sound off"
+
+msgid "start"
+msgstr "Start"
+
+msgid "stop"
+msgstr "Stop"
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-06-20 13:48:28 UTC (rev 4841)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-06-20 13:52:39 UTC (rev 4842)
@@ -21,3 +21,9 @@
msgid "sound_off"
msgstr "Sound off"
+
+msgid "start"
+msgstr "Start"
+
+msgid "stop"
+msgstr "Stop"
|
|
From: remi <c2m...@c2...> - 2009-06-19 13:19:07
|
Author: remi
Date: 2009-06-19 14:50:24 +0200 (Fri, 19 Jun 2009)
New Revision: 4839
Added:
software_suite_v3/smart-core/smart-server/trunk/translation/
software_suite_v3/smart-core/smart-server/trunk/translation/Translation.py
software_suite_v3/smart-core/smart-server/trunk/translation/__init__.py
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
software_suite_v3/smart-core/smart-server/trunk/util/i18n/I18n.py
Log:
* Added a translation system for the web interfaces
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl 2009-06-19 12:07:29 UTC (rev 4838)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl 2009-06-19 12:50:24 UTC (rev 4839)
@@ -108,31 +108,31 @@
<xsl:attribute name="class">menuLeftEnable</xsl:attribute>
<xsl:attribute name="id">menuLeft</xsl:attribute>
<xsl:attribute name="onclick">javascript:gotoMenu('livewithtux');return false;</xsl:attribute>
- <xsl:attribute name="href"></xsl:attribute>Live with Tux
+ <xsl:attribute name="href"></xsl:attribute><xsl:value-of select="root/translations/live_with_tux"/>
</xsl:element>
<xsl:element name="a">
<xsl:attribute name="class">menuCenterEnable</xsl:attribute>
<xsl:attribute name="id">menuCenter1</xsl:attribute>
<xsl:attribute name="onclick">javascript:gotoMenu('gadgets');return false;</xsl:attribute>
- <xsl:attribute name="href"></xsl:attribute>Gadgets
+ <xsl:attribute name="href"></xsl:attribute><xsl:value-of select="root/translations/gadgets"/>
</xsl:element>
<xsl:element name="a">
<xsl:attribute name="class">menuCenterEnable</xsl:attribute>
<xsl:attribute name="id">menuCenter2</xsl:attribute>
<xsl:attribute name="onclick">javascript:gotoMenu('attitunes');return false;</xsl:attribute>
- <xsl:attribute name="href"></xsl:attribute>Attitunes
+ <xsl:attribute name="href"></xsl:attribute><xsl:value-of select="root/translations/attitunes"/>
</xsl:element>
<xsl:element name="a">
<xsl:attribute name="class">menuCenterEnable</xsl:attribute>
<xsl:attribute name="id">menuCenter3</xsl:attribute>
<xsl:attribute name="onclick">javascript:gotoMenu('tools');return false;</xsl:attribute>
- <xsl:attribute name="href"></xsl:attribute>Tools
+ <xsl:attribute name="href"></xsl:attribute><xsl:value-of select="root/translations/tools"/>
</xsl:element>
<xsl:element name="a">
<xsl:attribute name="class">menuRightEnable</xsl:attribute>
<xsl:attribute name="id">menuRight</xsl:attribute>
<xsl:attribute name="onclick">javascript:gotoMenu('online');return false;</xsl:attribute>
- <xsl:attribute name="href"></xsl:attribute>Online
+ <xsl:attribute name="href"></xsl:attribute><xsl:value-of select="root/translations/online"/>
</xsl:element>
</div>
<div class="ContentView" id="ContentView">
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-06-19 12:07:29 UTC (rev 4838)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-06-19 12:50:24 UTC (rev 4839)
@@ -2,6 +2,8 @@
# Resource : Web Interface - User 01.
# ==============================================================================
+from translation.Translation import Translation
+
# ------------------------------------------------------------------------------
# Declaration of the resource "wi_user_01".
# ------------------------------------------------------------------------------
@@ -15,6 +17,7 @@
self.name = "wi_user_01"
self.comment = "Resource to manage the web interface - user 01."
self.fileName = RESOURCE_FILENAME
+ self.translations = Translation("wi_user")
# Create an instance of the resource
resourceWIUser01 = TDSResourceWIUser01("resourceWIUser01")
@@ -45,6 +48,7 @@
skin = parameters['skin']
menu = parameters['menu']
contentStruct['root']['data'] = {}
+ contentStruct['root']['translations'] = resourceWIUser01.translations.getTranslations(language)
contentStruct['root']['skin'] = skin
contentStruct['root']['menu'] = menu
contentStruct['root']['language'] = language
Added: software_suite_v3/smart-core/smart-server/trunk/translation/Translation.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/Translation.py (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/Translation.py 2009-06-19 12:50:24 UTC (rev 4839)
@@ -0,0 +1,50 @@
+# Copyright (C) 2009 C2ME Sa
+# Remi Jocaille <rem...@c2...>
+# Distributed under the terms of the GNU General Public License
+# http://www.gnu.org/copyleft/gpl.html
+
+import os
+
+from util.i18n.I18n import I18n
+
+# Default list of the supported language.
+SUPPORTED_LANGUAGES_LIST = ["en", "fr", "nl", "es", "it", "pt", "ar", "da",
+ "de", "no", "sv",]
+
+class Translation(object):
+ """
+ """
+
+ def __init__(self, name):
+ """
+ """
+ self.__i18nList = {}
+ self.__updateI18nList(name)
+
+ def __updateI18nList(self, name):
+ """
+ """
+ mPath, mFile = os.path.split(__file__)
+ fullPath = os.path.join(mPath, name)
+ self.__i18nList = {}
+ for language in SUPPORTED_LANGUAGES_LIST:
+ i18n = I18n()
+ i18n.setPoDirectory(fullPath)
+ i18n.setLocale(language)
+ i18n.update()
+ if i18n.getDictionnary() == {}:
+ self.__i18nList[language] = self.__i18nList["en"]
+ else:
+ self.__i18nList[language] = i18n
+
+ def getTranslations(self, language):
+ """
+ """
+ if not self.__i18nList.has_key(language):
+ language = "en"
+ return self.__i18nList[language].getDictionnary()
+
+ def getMsgIDList(self):
+ """
+ """
+ return self.__i18nList.keys()
Added: software_suite_v3/smart-core/smart-server/trunk/translation/__init__.py
===================================================================
Added: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-06-19 12:50:24 UTC (rev 4839)
@@ -0,0 +1,14 @@
+msgid "live_with_tux"
+msgstr ""
+
+msgid "gadgets"
+msgstr ""
+
+msgid "attitunes"
+msgstr ""
+
+msgid "tools"
+msgstr ""
+
+msgid "online"
+msgstr ""
Added: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-06-19 12:50:24 UTC (rev 4839)
@@ -0,0 +1,14 @@
+msgid "live_with_tux"
+msgstr "Live with Tux"
+
+msgid "gadgets"
+msgstr "Gadgets"
+
+msgid "attitunes"
+msgstr "attitunes"
+
+msgid "tools"
+msgstr "Tools"
+
+msgid "online"
+msgstr "Online"
Added: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-06-19 12:50:24 UTC (rev 4839)
@@ -0,0 +1,14 @@
+msgid "live_with_tux"
+msgstr "Vivre avec Tux"
+
+msgid "gadgets"
+msgstr "Gadgets"
+
+msgid "attitunes"
+msgstr "Attitunes"
+
+msgid "tools"
+msgstr "Outils"
+
+msgid "online"
+msgstr "En ligne"
Modified: software_suite_v3/smart-core/smart-server/trunk/util/i18n/I18n.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/i18n/I18n.py 2009-06-19 12:07:29 UTC (rev 4838)
+++ software_suite_v3/smart-core/smart-server/trunk/util/i18n/I18n.py 2009-06-19 12:50:24 UTC (rev 4839)
@@ -24,8 +24,8 @@
"""Constructor of the class.
"""
self.__locale = locale.getdefaultlocale()[0]
- if self.__locale == None:
- self.__locale = "en_US"
+ if self.__locale == None:
+ self.__locale = "en_US"
self.__language = self.__locale.split("_")[0]
self.__country = self.__locale.split("_")[1]
self.__poDirectory = None
@@ -73,6 +73,15 @@
self.__locale = "%s_%s" % (self.__language, self.__country)
# --------------------------------------------------------------------------
+ # Get the translation dictionnary.
+ # --------------------------------------------------------------------------
+ def getDictionnary(self):
+ """Get the translation dictionnary.
+ @return: A dictionnary.
+ """
+ return self.__data
+
+ # --------------------------------------------------------------------------
# Translate a message.
# --------------------------------------------------------------------------
def tr(self, message, *arguments):
|
|
From: jerome <c2m...@c2...> - 2009-06-19 12:07:36
|
Author: jerome
Date: 2009-06-19 14:07:29 +0200 (Fri, 19 Jun 2009)
New Revision: 4838
Added:
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/en.po
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/fr.po
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_en.html
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_fr.html
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_nl.html
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/nl.po
Log:
* Added translated files.
Added: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/en.po
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/en.po (rev 0)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/en.po 2009-06-19 12:07:29 UTC (rev 4838)
@@ -0,0 +1,79 @@
+
+msgid ""
+msgstr "Project-Id-Version: PACKAGE VERSION\nReport-Msgid-Bugs-To: \nPOT-Creation-Date: 2009-06-19 13:54+0200\nPO-Revision-Date: 2009-06-19 13:55+0200\nLast-Translator: jerome <jer...@ky...>\nLanguage-Team: LANGUAGE <LL...@li...>\nLanguage: en\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\nPlural-Forms: nplurals=2; plural=(n != 1);\nX-Generator: Pootle 1.2.1\n"
+
+msgid "Facebook Gadget"
+msgstr "Facebook Gadget"
+
+msgid "The Facebook gadget will notify you of any updates on your Facebook account."
+msgstr "The Facebook gadget will notify you of any updates on your Facebook account."
+
+msgid "Login"
+msgstr "Login"
+
+msgid "Password"
+msgstr "Password"
+
+msgid "Check number of messages"
+msgstr "Check number of messages"
+
+msgid "Check friend requests"
+msgstr "Check friend requests"
+
+msgid "Check group invites"
+msgstr "Check group invites"
+
+msgid "Check event invites"
+msgstr "Check event invites"
+
+msgid "Check pokes"
+msgstr "Check pokes"
+
+msgid "Check your facebook account"
+msgstr "Check your facebook account"
+
+msgid "You have {0} new messages"
+msgstr "You have {0} new messages"
+
+msgid "You have one new message"
+msgstr "You have one new message"
+
+msgid "You have {0} friend requests"
+msgstr "You have {0} friend requests"
+
+msgid "You have one friend request"
+msgstr "You have one friend request"
+
+msgid "From {0}"
+msgstr "From {0}"
+
+msgid "You have {0} group invites"
+msgstr "You have {0} group invites"
+
+msgid "You have one group invite"
+msgstr "You have one group invite"
+
+msgid "to {0}"
+msgstr "to {0}"
+
+msgid "You have {0} event invites"
+msgstr "You have {0} event invites"
+
+msgid "You have one event invite"
+msgstr "You have one event invite"
+
+msgid "You have {0} pokes"
+msgstr "You have {0} pokes"
+
+msgid "You have one poke"
+msgstr "You have one poke"
+
+msgid "I must be connected to access your facebook account."
+msgstr "I must be connected to access your facebook account."
+
+msgid "I cannot get connected to your facebook account."
+msgstr "I cannot get connected to your facebook account."
+
+msgid "I'm retrieving your account informations"
+msgstr "I'm retrieving your account informations"
+
Added: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/fr.po
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/fr.po (rev 0)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/fr.po 2009-06-19 12:07:29 UTC (rev 4838)
@@ -0,0 +1,79 @@
+
+msgid ""
+msgstr "Project-Id-Version: PACKAGE VERSION\nReport-Msgid-Bugs-To: \nPOT-Creation-Date: 2009-06-19 13:54+0200\nPO-Revision-Date: 2009-06-19 13:56+0200\nLast-Translator: jerome <jer...@ky...>\nLanguage-Team: LANGUAGE <LL...@li...>\nLanguage: fr\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\nPlural-Forms: nplurals=2; plural=(n > 1);\nX-Generator: Pootle 1.2.1\n"
+
+msgid "Facebook Gadget"
+msgstr "Gadget Facebook"
+
+msgid "The Facebook gadget will notify you of any updates on your Facebook account."
+msgstr "Le gadget Facebook vous notifiera des mises à jour sur votre compte."
+
+msgid "Login"
+msgstr "Login"
+
+msgid "Password"
+msgstr "Mot de passe"
+
+msgid "Check number of messages"
+msgstr "Vérifier le nombre de messages"
+
+msgid "Check friend requests"
+msgstr "Vérifier les demandes d'amis"
+
+msgid "Check group invites"
+msgstr "Vérifier les invitations aux groupes"
+
+msgid "Check event invites"
+msgstr "Vérifier les invitations aux évènements"
+
+msgid "Check pokes"
+msgstr "Vérifier les pokes"
+
+msgid "Check your facebook account"
+msgstr "Vérifie votre compte Facebook"
+
+msgid "You have {0} new messages"
+msgstr "Vous avez {0} nouveaux messages"
+
+msgid "You have one new message"
+msgstr "Vous avez un nouveau message"
+
+msgid "You have {0} friend requests"
+msgstr "Vous avez {0} demandes d'ajout d'amis"
+
+msgid "You have one friend request"
+msgstr "Vous avez une demande d'ajout d'ami"
+
+msgid "From {0}"
+msgstr "De {0}"
+
+msgid "You have {0} group invites"
+msgstr "Vous avez {0} invitations à rejoindre un groupe"
+
+msgid "You have one group invite"
+msgstr "Vous avez une invitation à rejoindre un groupe"
+
+msgid "to {0}"
+msgstr "à {0}"
+
+msgid "You have {0} event invites"
+msgstr "Vous avez {0} invitations à un évènement"
+
+msgid "You have one event invite"
+msgstr "Vous avez une invitation à un évnement"
+
+msgid "You have {0} pokes"
+msgstr "Vous avez {0} pokes"
+
+msgid "You have one poke"
+msgstr "Vous avez un poke"
+
+msgid "I must be connected to access your facebook account."
+msgstr "Je dois être connecté pour accéder à votre compte Facebook"
+
+msgid "I cannot get connected to your facebook account."
+msgstr "Je ne peux pas me connecter à votre compte Facebook"
+
+msgid "I'm retrieving your account informations"
+msgstr "Je recherche vos informations"
+
Added: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_en.html
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_en.html (rev 0)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_en.html 2009-06-19 12:07:29 UTC (rev 4838)
@@ -0,0 +1,18 @@
+<html>
+ <body>
+ <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
+ The Facebook gadget will make Tux Droid connect to your Facebook and check<br>
+ for any updates. Drag and drop the gadget into your favorites to activate it.<br>
+ For more information about Facebook, visit <a href="http://www.facebook.com"> www.facebook.com</a><br>
+ <br>
+ After entering your login and password in the configuration, there are several<br>
+ functions available :<br>
+ - Check number of messages : will give the number of private messages you received<br>
+ - Check friend requests : will give the number and name of waiting friend requests<br>
+ - Check group invites : will give the number and name of received group invites<br>
+ - Check event invites : Will give the number and name of received event invites<br>
+ - Check pokes : Will report the number of received pokes.<br>
+ </font>
+ </body>
+ </html>
+
\ No newline at end of file
Added: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_fr.html
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_fr.html (rev 0)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_fr.html 2009-06-19 12:07:29 UTC (rev 4838)
@@ -0,0 +1,18 @@
+<html>
+ <body>
+ <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
+ Le gadget Facebook connectera Tux Droid à votre compte Facebook et Vérifiera <br>
+ vos mises à jour. Copiez-Collez ce gadget dans mes favoris pour l'activer.<br>
+ Pour plus d'informations à propos de Facebook, visitez <a href="http://www.facebook.com"> www.facebook.com</a><br>
+ <br>
+ Après avoir entré votre login et votre mot de passe dans la configuration, voici quelques<br>
+ fonctions disponibles :<br>
+ - Vérifier le nombre de messages : Vous donnera le nombre de messages privés que vous avez reçus.<br>
+ - Vérifier les invitations comme amis : Vous donnera le nombre de requêtes d'amis dont vous disposez<br>
+ - Vérifier les invitations aux groupes : Vous donnera le nombre d'invitations aux groupes que l'on vous a envoyées.<br>
+ - Vérifier les invitations aux évements : Vous donnera le nombres d'invitations à des évènements que l'on vous a envoyées.<br>
+ - Vérifier les pokes : Vous donnera le nombre de pokes que l'on vous a envoyés.<br>
+ </font>
+ </body>
+ </html>
+
\ No newline at end of file
Added: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_nl.html
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_nl.html (rev 0)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help_nl.html 2009-06-19 12:07:29 UTC (rev 4838)
@@ -0,0 +1,18 @@
+<html>
+ <body>
+ <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
+ Met de Facebook gadget kan Tux Droid jouw facebook checken voor updates.<br>
+ Sleep de gadget in je favorieten om die te activeren.<br>
+ Voor meer informatie over Facebook, surf naar <a href="http://www.facebook.com"> www.facebook.com</a><br>
+ <br>
+ Nadat je jouw Facebook login en wachtwoord hebt ingegeven kan je verschillende<br>
+ opties aanpassen :<br>
+ - Check aantal berichten : Zal het aantal binnengekomen privéberichten checken<br>
+ - Check vriendschapsverzoeken : Zal het aantal vriendschapsverzoeken opvragen en de naam weergeven<br>
+ - Check groepsuitnodigingen : Zal het aantal en de naam van de binnengekomen groepsuitnodigingen weergeven<br>
+ Check eventuitnodigingen : Zal het aantal en de de naam van uitnodiging voor een event weergeven<br>
+ - Check porren : Zal het aantal ontvangen porren weergeven.<br>
+ </font>
+ </body>
+ </html>
+
\ No newline at end of file
Added: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/nl.po
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/nl.po (rev 0)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/nl.po 2009-06-19 12:07:29 UTC (rev 4838)
@@ -0,0 +1,79 @@
+
+msgid ""
+msgstr "Project-Id-Version: PACKAGE VERSION\nReport-Msgid-Bugs-To: \nPOT-Creation-Date: 2009-06-19 13:54+0200\nPO-Revision-Date: 2009-06-19 13:56+0200\nLast-Translator: Sebastiaan Vanpoucke <se...@ky...>\nLanguage-Team: LANGUAGE <LL...@li...>\nLanguage: nl\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\nPlural-Forms: nplurals=2; plural=(n != 1);\nX-Generator: Pootle 1.2.1\n"
+
+msgid "Facebook Gadget"
+msgstr "Facebook Gadget"
+
+msgid "The Facebook gadget will notify you of any updates on your Facebook account."
+msgstr "De Facebook gadget zal je verwittigen wanneer je updates hebt op je Facebook account."
+
+msgid "Login"
+msgstr "Login"
+
+msgid "Password"
+msgstr "Wachtwoord"
+
+msgid "Check number of messages"
+msgstr "Check aantal berichten"
+
+msgid "Check friend requests"
+msgstr "Check vriendschapsverzoeken"
+
+msgid "Check group invites"
+msgstr "Check groepsuitnodigingen"
+
+msgid "Check event invites"
+msgstr "Check eventuitnodigingen"
+
+msgid "Check pokes"
+msgstr "Check porren"
+
+msgid "Check your facebook account"
+msgstr "Controleer je faceboek account"
+
+msgid "You have {0} new messages"
+msgstr "Je hebt {0} nieuwe berichten"
+
+msgid "You have one new message"
+msgstr "Je hebt 1 nieuw bericht"
+
+msgid "You have {0} friend requests"
+msgstr "Je hebt {0} vriendschapsverzoeken"
+
+msgid "You have one friend request"
+msgstr "Je hebt 1 vriendschapsverzoek"
+
+msgid "From {0}"
+msgstr "Van {0}"
+
+msgid "You have {0} group invites"
+msgstr "Je hebt {0} groepsuitnodigingen"
+
+msgid "You have one group invite"
+msgstr "Je hebt 1 groepsuitnodging"
+
+msgid "to {0}"
+msgstr "voor {0}"
+
+msgid "You have {0} event invites"
+msgstr "Je hebt {0} eventuitnodigingen"
+
+msgid "You have one event invite"
+msgstr "Je hebt 1 eventuitnodiging"
+
+msgid "You have {0} pokes"
+msgstr "Je hebt {0} porren"
+
+msgid "You have one poke"
+msgstr "Je hebt 1 por"
+
+msgid "I must be connected to access your facebook account."
+msgstr "Ik moet connectie hebben om toegang te krijgen op je feesboek account."
+
+msgid "I cannot get connected to your facebook account."
+msgstr "Ik kan geen connectie maken met je feesboek account."
+
+msgid "I'm retrieving your account informations"
+msgstr "Ik ben je account informatie aan het opvragen"
+
|
|
From: jerome <c2m...@c2...> - 2009-06-19 11:50:49
|
Author: jerome Date: 2009-06-19 13:50:39 +0200 (Fri, 19 Jun 2009) New Revision: 4837 Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot Log: * Added Forgot parameters. Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot =================================================================== --- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot 2009-06-19 10:56:55 UTC (rev 4836) +++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot 2009-06-19 11:50:39 UTC (rev 4837) @@ -4,6 +4,12 @@ msgid "The Facebook gadget will notify you of any updates on your Facebook account." msgstr "" +msgid "Login" +msgstr "" + +msgid "Password" +msgstr "" + msgid "Check number of messages" msgstr "" |
|
From: jerome <c2m...@c2...> - 2009-06-19 10:57:03
|
Author: jerome
Date: 2009-06-19 12:56:55 +0200 (Fri, 19 Jun 2009)
New Revision: 4836
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.xml
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html
Log:
* Updated strings.
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot 2009-06-19 10:52:41 UTC (rev 4835)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot 2009-06-19 10:56:55 UTC (rev 4836)
@@ -4,19 +4,19 @@
msgid "The Facebook gadget will notify you of any updates on your Facebook account."
msgstr ""
-msgid "Give messages count"
+msgid "Check number of messages"
msgstr ""
-msgid "Give friend requests"
+msgid "Check friend requests"
msgstr ""
-msgid "Give group invites"
+msgid "Check group invites"
msgstr ""
-msgid "Give event invites"
+msgid "Check event invites"
msgstr ""
-msgid "Give pokes count"
+msgid "Check pokes"
msgstr ""
msgid "Check your facebook account"
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.xml
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.xml 2009-06-19 10:52:41 UTC (rev 4835)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.xml 2009-06-19 10:56:55 UTC (rev 4836)
@@ -29,31 +29,31 @@
<parameter
category="Gadget parameters"
name="notifyEmail"
- description="Give messages count"
+ description="Check number of messages"
type="boolean"
defaultValue="true" />
<parameter
category="Gadget parameters"
name="showFriendRequests"
- description="Give friend requests"
+ description="Check friend requests"
type="boolean"
defaultValue="true" />
<parameter
category="Gadget parameters"
name="showGroupsInvites"
- description="Give group invites"
+ description="Check group invites"
type="boolean"
defaultValue="true" />
<parameter
category="Gadget parameters"
name="showEventsInvites"
- description="Give event invites"
+ description="Check event invites"
type="boolean"
defaultValue="true" />
<parameter
category="Gadget parameters"
name="showPokes"
- description="Give pokes count"
+ description="Check pokes"
type="boolean"
defaultValue="true" />
</parameters>
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html 2009-06-19 10:52:41 UTC (rev 4835)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html 2009-06-19 10:56:55 UTC (rev 4836)
@@ -7,7 +7,7 @@
<br>
After entering your login and password in the configuration, there are several<br>
functions available :<br>
-- Check number of private messages : will give the number of private messages you received<br>
+- Check number of messages : will give the number of private messages you received<br>
- Check friend requests : will give the number and name of waiting friend requests<br>
- Check group invites : will give the number and name of received group invites<br>
- Check event invites : Will give the number and name of received event invites<br>
|
|
From: jerome <c2m...@c2...> - 2009-06-19 10:53:06
|
Author: jerome Date: 2009-06-19 12:52:41 +0200 (Fri, 19 Jun 2009) New Revision: 4835 Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html Log: * Added facebook portal link. * Removed a '<br>'. Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html =================================================================== --- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html 2009-06-19 10:36:12 UTC (rev 4834) +++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html 2009-06-19 10:52:41 UTC (rev 4835) @@ -3,8 +3,8 @@ <font size="2" face="Verdana, Arial, Helvetica, sans-serif"> The Facebook gadget will make Tux Droid connect to your Facebook and check<br> for any updates. Drag and drop the gadget into your favorites to activate it.<br> -For more information about Facebook, visit www.facebook.com<br> -<br> <br> +For more information about Facebook, visit <a href="http://www.facebook.com"> www.facebook.com</a><br> +<br> After entering your login and password in the configuration, there are several<br> functions available :<br> - Check number of private messages : will give the number of private messages you received<br> |
Author: remi
Date: 2009-06-19 12:36:12 +0200 (Fri, 19 Jun 2009)
New Revision: 4834
Added:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/menu.css
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/menu_center_enable.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/menu_left_enable.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/menu_right_enable.png
Log:
* updated 3 images
* added menu interface (http://127.0.0.1:270/user/)
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/menu.css
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/menu.css (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/menu.css 2009-06-19 10:36:12 UTC (rev 4834)
@@ -0,0 +1,109 @@
+div.ContentView{
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:855px;
+ height:25px;
+ display:table;
+ margin-top:85px;
+ margin-left:50px;
+ margin-right:50px;
+ background-color:#EFEFEF;
+ color:#EFEFEF;
+}
+
+a.menuLeftEnable{
+ float:left;
+ margin-top:0px;
+ width:171px;
+ height:65px;
+ display:table;
+ line-height:58px;
+ text-decoration:none;
+ background-image:url(/data/web_interface/user_01/img/menu_left_enable.png);
+ font-size:14px;
+ font-family:Verdana, Bitstream Vera Sans;
+ color:white;
+ font-weight:bold;
+ text-align:center;
+}
+
+a.menuLeftActivate{
+ float:left;
+ margin-top:0px;
+ width:171px;
+ height:65px;
+ display:table;
+ line-height:58px;
+ text-decoration:none;
+ background-image:url(/data/web_interface/user_01/img/menu_left_activate.png);
+ font-size:14px;
+ font-family:Verdana, Bitstream Vera Sans;
+ color:white;
+ font-weight:bold;
+ text-align:center;
+}
+
+a.menuCenterEnable{
+ float:left;
+ margin-top:0px;
+ width:171px;
+ height:65px;
+ display:table;
+ line-height:58px;
+ text-decoration:none;
+ background-image:url(/data/web_interface/user_01/img/menu_center_enable.png);
+ font-size:14px;
+ font-family:Verdana, Bitstream Vera Sans;
+ color:white;
+ font-weight:bold;
+ text-align:center;
+}
+
+a.menuCenterActivate{
+ float:left;
+ margin-top:0px;
+ width:171px;
+ height:65px;
+ display:table;
+ line-height:58px;
+ text-decoration:none;
+ background-image:url(/data/web_interface/user_01/img/menu_center_activate.png);
+ font-size:14px;
+ font-family:Verdana, Bitstream Vera Sans;
+ color:white;
+ font-weight:bold;
+ text-align:center;
+}
+
+a.menuRightEnable{
+ float:left;
+ margin-top:0px;
+ width:171px;
+ height:65px;
+ display:table;
+ line-height:58px;
+ text-decoration:none;
+ background-image:url(/data/web_interface/user_01/img/menu_right_enable.png);
+ font-size:14px;
+ font-family:Verdana, Bitstream Vera Sans;
+ color:white;
+ font-weight:bold;
+ text-align:center;
+}
+
+a.menuRightActivate{
+ float:left;
+ margin-top:0px;
+ width:171px;
+ height:65px;
+ display:table;
+ line-height:58px;
+ text-decoration:none;
+ background-image:url(/data/web_interface/user_01/img/menu_right_activate.png);
+ font-size:14px;
+ font-family:Verdana, Bitstream Vera Sans;
+ color:white;
+ font-weight:bold;
+ text-align:center;
+}
\ No newline at end of file
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/menu_center_enable.png
===================================================================
(Binary files differ)
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/menu_left_enable.png
===================================================================
(Binary files differ)
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/menu_right_enable.png
===================================================================
(Binary files differ)
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/js/common.js 2009-06-19 10:36:12 UTC (rev 4834)
@@ -0,0 +1,278 @@
+/**
+ *
+ */
+function fillHelpBox()
+{
+ document.getElementById("helpBox").innerHTML = Wiky.toHtml(document.getElementById("req_helpContent").value);
+}
+
+/**
+ *
+ */
+function setpng(img)
+{
+ if (document.all && (IEver=parseFloat(navigator.appVersion.split("MSIE")[1])) && (IEver>=5.5) && (IEver<7) && document.body.filters && img)
+ {
+ var imgName = img.src.toUpperCase();
+ if (imgName.substring(imgName.length-3,imgName.length) == "PNG")
+ {
+ img.outerHTML= "<span "+(img.id?"id='"+img.id+"' ":"")+(img.className?"class='"+img.className+"' ":"")+(img.title?"title=\""+img.title+"\" ":"")
+ +"style=\"width:"+img.width+"px;height:"+img.height+"px;"+(img.align=="left"?"float:left;":(img.align=="right"?"float:right;":""))
+ +(img.parentElement.href?"cursor:hand;":"")+"display:inline-block;"+img.style.cssText+";"
+ +"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"',sizingMethod='scale');\"></span>";
+ }
+ }
+}
+
+/**
+ *
+ */
+function formatValue(value)
+{
+ value = value.replace(/(\r?\n)/g, '[RETURN]');
+ value = value.replace('/\&/g', '&&');
+ value = value.replace(/\|/g, '[PIPE]');
+ value = value.replace(/\=/g, '[EQUAL]');
+ value = value.replace(/\&/g, '[AMP]');
+ return value;
+}
+
+/**
+ *
+ */
+function computeParameters()
+{
+ var result = '';
+ var elements = document.getElementsByTagName('input');
+ for (var i = 0; i < elements.length; i++)
+ {
+ var element = elements[i];
+ if (element.id.indexOf('req_', 0) == 0)
+ {
+ if (element.type == 'checkbox')
+ {
+ result += element.id + '=' + element.checked + '|';
+ }
+ else if (element.type == 'radio')
+ {
+ if (element.checked)
+ {
+ result += element.id + '=' + formatValue(element.value) + '|';
+ }
+ }
+ else
+ {
+ result += element.id + '=' + formatValue(element.value) + '|';
+ }
+ }
+ }
+ var elements = document.getElementsByTagName('select');
+ for (var i = 0; i < elements.length; i++)
+ {
+ var element = elements[i];
+ if (element.id.indexOf('req_', 0) == 0)
+ {
+ result += element.id + '=' + formatValue(element.value) + '|';
+ }
+ }
+ var helptext = "";
+ if (document.getElementById("req_helpContent") != null)
+ {
+ helptext = document.getElementById("req_helpContent").value;
+ }
+ result += 'req_helpContent=' + formatValue(helptext) + '|';
+ return result;
+}
+
+/**
+ *
+ */
+function postRequest(url, values)
+{
+ var httpRequest = false;
+ var isIe = false;
+ var result = new Array(false, "");
+ if (window.XMLHttpRequest)
+ { // Mozilla, Safari,...
+ httpRequest = new XMLHttpRequest();
+ if (httpRequest.overrideMimeType)
+ {
+ httpRequest.overrideMimeType('text/xml');
+ }
+ }
+ else
+ {
+ isIe = true;
+ if (window.ActiveXObject)
+ { // IE
+ try
+ {
+ httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
+ }
+ catch (e)
+ {
+ try
+ {
+ httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ catch (e){}
+ }
+ }
+ }
+ if (!httpRequest)
+ {
+ alert('Cannot create XMLHTTP instance');
+ return result;
+ }
+ var data = "";
+ for (var property in values)
+ {
+ if (values.hasOwnProperty(property))
+ {
+ if (data.length > 0)
+ {
+ data += "&";
+ }
+ data += property + "=" + values[property];
+ }
+ }
+ httpRequest.open('POST', url, false);
+ var stateChangeFunction = function() {
+ if(httpRequest.readyState == 4)
+ {
+ if (httpRequest.status == 200)
+ {
+ result[0] = true;
+ result[1] = httpRequest.responseText;
+ }
+ }
+ }
+ if (isIe)
+ {
+ httpRequest.onreadystatechange = stateChangeFunction;
+ }
+ else
+ {
+ httpRequest.onload = stateChangeFunction;
+ }
+
+ try
+ {
+ httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ httpRequest.send(data);
+ }
+ catch (e)
+ {
+ return result;
+ }
+ return result;
+}
+
+/**
+ *
+ */
+function getRequest(url, values)
+{
+ var httpRequest = false;
+ var isIe = false;
+ var result = false;
+ if (window.XMLHttpRequest)
+ { // Mozilla, Safari,...
+ httpRequest = new XMLHttpRequest();
+ if (httpRequest.overrideMimeType)
+ {
+ httpRequest.overrideMimeType('text/xml');
+ }
+ }
+ else
+ {
+ isIe = true;
+ if (window.ActiveXObject)
+ { // IE
+ try
+ {
+ httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
+ }
+ catch (e)
+ {
+ try
+ {
+ httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ catch (e){}
+ }
+ }
+ }
+ if (!httpRequest)
+ {
+ alert('Cannot create XMLHTTP instance');
+ return result;
+ }
+ url += "?rndTag=" + Math.random() ;
+ for (var property in values)
+ {
+ if (values.hasOwnProperty(property))
+ {
+ url += "&" + property + "=" + values[property];
+ }
+ }
+ httpRequest.open('GET', url, false);
+ var stateChangeFunction = function() {
+ if(httpRequest.readyState == 4)
+ {
+ if (httpRequest.status == 200)
+ {
+ result = true;
+ }
+ }
+ }
+ if (isIe)
+ {
+ httpRequest.onreadystatechange = stateChangeFunction;
+ }
+ else
+ {
+ httpRequest.onload = stateChangeFunction;
+ }
+ try
+ {
+ httpRequest.send(null);
+ }
+ catch (e)
+ {
+ return result;
+ }
+ return result;
+}
+
+/**
+ *
+ */
+function gotoLocation(url, values)
+{
+ url += "?";
+ for (var property in values)
+ {
+ if (values.hasOwnProperty(property))
+ {
+ url += property + "=" + values[property] + "&";
+ }
+ }
+ window.location = url;
+}
+
+/**
+ *
+ */
+function showPopup(url, values)
+{
+ url += "?";
+ for (var property in values)
+ {
+ if (values.hasOwnProperty(property))
+ {
+ url += property + "=" + values[property] + "&";
+ }
+ }
+ window.open(url);
+}
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl 2009-06-19 10:36:12 UTC (rev 4834)
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+<xsl:template match="/">
+<html>
+ <head>
+ <LINK href="/data/web_interface/user_01/css/menu.css" rel="stylesheet" type="text/css"/>
+ <script src="/data/web_interface/user_01/js/common.js" type="text/javascript"/>
+ <script language="javascript">
+ <![CDATA[
+ function showContent()
+ {
+ var menu = document.getElementById("menu").value;
+ var menuLeft = document.getElementById("menuLeft");
+ var menuCenter1 = document.getElementById("menuCenter1");
+ var menuCenter2 = document.getElementById("menuCenter2");
+ var menuCenter3 = document.getElementById("menuCenter3");
+ var menuRight = document.getElementById("menuRight");
+ menuLeft.className = "menuLeftEnable";
+ menuCenter1.className = "menuCenterEnable";
+ menuCenter2.className = "menuCenterEnable";
+ menuCenter3.className = "menuCenterEnable";
+ menuRight.className = "menuRightEnable";
+ var frameUrl = "";
+ if (menu == "livewithtux")
+ {
+ menuLeft.className = "menuLeftActivate";
+ frameUrl = "/wi_devel/page_livewithtux?uuid=NULL";
+ }
+ else if (menu == "gadgets")
+ {
+ menuCenter1.className = "menuCenterActivate";
+ frameUrl = "/wi_devel/gadgets?";
+ }
+ else if (menu == "attitunes")
+ {
+ menuCenter2.className = "menuCenterActivate";
+ frameUrl = "/wi_devel/page_attitunes?";
+ }
+ else if (menu == "tools")
+ {
+ menuCenter3.className = "menuCenterActivate";
+ frameUrl = "/wi_devel/page_tools?";
+ }
+ else if (menu == "online")
+ {
+ menuRight.className = "menuRightActivate";
+ frameUrl = "/wi_devel/page_online?";
+ }
+ else
+ {
+ menuLeft.className = "menuLeftActivate";
+ frameUrl = "/wi_devel/page_livewithtux?uuid=NULL";
+ }
+ frameUrl += "&language=" + document.getElementById('language').value;
+ frameUrl += "&skin='" + document.getElementById('skin').value + "'";
+ var iframe = document.getElementById('ContentIFrame');
+ iframe.src = frameUrl;
+ }
+
+ function gotoMenu(menuName)
+ {
+ document.getElementById("menu").value = menuName;
+ showContent();
+ }
+ ]]>
+ </script>
+ </head>
+ <body bgcolor="#EFEFEF" onLoad="showContent();">
+ <!-- SKIN STORAGE -->
+ <xsl:element name="input">
+ <xsl:attribute name="type">hidden</xsl:attribute>
+ <xsl:attribute name="id">skin</xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="root/skin"/>
+ </xsl:attribute>
+ </xsl:element>
+
+ <!-- LANGUAGE STORAGE -->
+ <xsl:element name="input">
+ <xsl:attribute name="type">hidden</xsl:attribute>
+ <xsl:attribute name="id">language</xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="root/language"/>
+ </xsl:attribute>
+ </xsl:element>
+
+ <!-- CURRENT MENU STORAGE -->
+ <xsl:element name="input">
+ <xsl:attribute name="type">hidden</xsl:attribute>
+ <xsl:attribute name="id">menu</xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="root/menu"/>
+ </xsl:attribute>
+ </xsl:element>
+
+ <!-- MAIN DIV FRAMES -->
+ <div style="position:absolute;
+ top:0px;
+ left:0px;
+ height:65px;
+ width:855px;
+ margin-left:50px;
+ margin-right:50px;">
+ <xsl:element name="a">
+ <xsl:attribute name="class">menuLeftEnable</xsl:attribute>
+ <xsl:attribute name="id">menuLeft</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:gotoMenu('livewithtux');return false;</xsl:attribute>
+ <xsl:attribute name="href"></xsl:attribute>Live with Tux
+ </xsl:element>
+ <xsl:element name="a">
+ <xsl:attribute name="class">menuCenterEnable</xsl:attribute>
+ <xsl:attribute name="id">menuCenter1</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:gotoMenu('gadgets');return false;</xsl:attribute>
+ <xsl:attribute name="href"></xsl:attribute>Gadgets
+ </xsl:element>
+ <xsl:element name="a">
+ <xsl:attribute name="class">menuCenterEnable</xsl:attribute>
+ <xsl:attribute name="id">menuCenter2</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:gotoMenu('attitunes');return false;</xsl:attribute>
+ <xsl:attribute name="href"></xsl:attribute>Attitunes
+ </xsl:element>
+ <xsl:element name="a">
+ <xsl:attribute name="class">menuCenterEnable</xsl:attribute>
+ <xsl:attribute name="id">menuCenter3</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:gotoMenu('tools');return false;</xsl:attribute>
+ <xsl:attribute name="href"></xsl:attribute>Tools
+ </xsl:element>
+ <xsl:element name="a">
+ <xsl:attribute name="class">menuRightEnable</xsl:attribute>
+ <xsl:attribute name="id">menuRight</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:gotoMenu('online');return false;</xsl:attribute>
+ <xsl:attribute name="href"></xsl:attribute>Online
+ </xsl:element>
+ </div>
+ <div class="ContentView" id="ContentView">
+ <iframe class="ContentIFrame"
+ id="ContentIFrame"
+ name="ContentIFrame"
+ frameborder="0"
+ scrolling="no"
+ width="100%"
+ height="535"
+ src="">
+ </iframe>
+ </div>
+ </body>
+</html>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
Added: software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-06-19 10:36:12 UTC (rev 4834)
@@ -0,0 +1,59 @@
+# ==============================================================================
+# Resource : Web Interface - User 01.
+# ==============================================================================
+
+# ------------------------------------------------------------------------------
+# Declaration of the resource "wi_user_01".
+# ------------------------------------------------------------------------------
+class TDSResourceWIUser01(TDSResource):
+
+ # --------------------------------------------------------------------------
+ # Inherited methods from TDSResource
+ # --------------------------------------------------------------------------
+
+ def configure(self):
+ self.name = "wi_user_01"
+ self.comment = "Resource to manage the web interface - user 01."
+ self.fileName = RESOURCE_FILENAME
+
+# Create an instance of the resource
+resourceWIUser01 = TDSResourceWIUser01("resourceWIUser01")
+# Register the resource into the resources manager
+resourcesManager.addResource(resourceWIUser01)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "index".
+# ------------------------------------------------------------------------------
+class TDSServiceWIUser01Index(TDSService):
+
+ def configure(self):
+ self.parametersDict = {
+ 'language' : 'string',
+ 'skin' : 'string',
+ 'menu' : 'string',
+ }
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = False
+ self.name = "index"
+ self.comment = "Show the main user page."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ language = parameters['language']
+ skin = parameters['skin']
+ menu = parameters['menu']
+ contentStruct['root']['data'] = {}
+ contentStruct['root']['skin'] = skin
+ contentStruct['root']['menu'] = menu
+ contentStruct['root']['language'] = language
+ self.haveXsl = True
+ self.xslPath = "/data/web_interface/%s/xsl/index.xsl" % skin
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceWIUser01.addService(TDSServiceWIUser01Index)
+# Bind the resource index url to this service
+resourcesManager.addBinding("user", "wi_user_01", "index", "skin=user_01&language=en&menu=livewithtux")
+resourcesManager.addBinding("user/index", "wi_user_01", "index", "skin=user_01&language=en&menu=livewithtux")
|
|
From: jerome <c2m...@c2...> - 2009-06-19 10:15:36
|
Author: jerome Date: 2009-06-19 12:15:17 +0200 (Fri, 19 Jun 2009) New Revision: 4833 Added: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.xml Log: * Updated description. * Added help file. Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot =================================================================== --- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot 2009-06-19 09:54:32 UTC (rev 4832) +++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot 2009-06-19 10:15:17 UTC (rev 4833) @@ -1,7 +1,7 @@ msgid "Facebook Gadget" msgstr "" -msgid "This gadget connects to your facebook account to get base informations" +msgid "The Facebook gadget will notify you of any updates on your Facebook account." msgstr "" msgid "Give messages count" Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.xml =================================================================== --- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.xml 2009-06-19 09:54:32 UTC (rev 4832) +++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.xml 2009-06-19 10:15:17 UTC (rev 4833) @@ -6,7 +6,7 @@ </interpreter> <description> <name>Facebook Gadget</name> - <description>This gadget connects to your facebook account to get base informations</description> + <description>The Facebook gadget will notify you of any updates on your Facebook account.</description> <author>Jerome Conan</author> <version>0.1</version> <iconFile>resources/gadget.png</iconFile> Added: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html =================================================================== --- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html (rev 0) +++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/help.html 2009-06-19 10:15:17 UTC (rev 4833) @@ -0,0 +1,17 @@ +<html> +<body> +<font size="2" face="Verdana, Arial, Helvetica, sans-serif"> +The Facebook gadget will make Tux Droid connect to your Facebook and check<br> +for any updates. Drag and drop the gadget into your favorites to activate it.<br> +For more information about Facebook, visit www.facebook.com<br> +<br> <br> +After entering your login and password in the configuration, there are several<br> +functions available :<br> +- Check number of private messages : will give the number of private messages you received<br> +- Check friend requests : will give the number and name of waiting friend requests<br> +- Check group invites : will give the number and name of received group invites<br> +- Check event invites : Will give the number and name of received event invites<br> +- Check pokes : Will report the number of received pokes.<br> +</font> +</body> +</html> |
|
From: jerome <c2m...@c2...> - 2009-06-19 09:54:41
|
Author: jerome
Date: 2009-06-19 11:54:32 +0200 (Fri, 19 Jun 2009)
New Revision: 4832
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/src/FacebookGadget.java
Log:
* Updated strings.
* Added a protection to do not log in when no parameter are selected.
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot 2009-06-19 08:48:41 UTC (rev 4831)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/resources/gadget.pot 2009-06-19 09:54:32 UTC (rev 4832)
@@ -25,27 +25,39 @@
msgid "You have {0} new messages"
msgstr ""
-msgid "You have {0} new message"
+msgid "You have one new message"
msgstr ""
msgid "You have {0} friend requests"
msgstr ""
+msgid "You have one friend request"
+msgstr ""
+
msgid "From {0}"
msgstr ""
msgid "You have {0} group invites"
msgstr ""
+msgid "You have one group invite"
+msgstr ""
+
msgid "to {0}"
msgstr ""
msgid "You have {0} event invites"
msgstr ""
+msgid "You have one event invite"
+msgstr ""
+
msgid "You have {0} pokes"
msgstr ""
+msgid "You have one poke"
+msgstr ""
+
msgid "I must be connected to access your facebook account."
msgstr ""
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/src/FacebookGadget.java
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/src/FacebookGadget.java 2009-06-19 08:48:41 UTC (rev 4831)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/src/FacebookGadget.java 2009-06-19 09:54:32 UTC (rev 4832)
@@ -191,9 +191,15 @@
@Override
protected void start() throws Throwable
{
+ if ( !(this.configuration().notifyEmail && this.configuration().showEventsInvites && this.configuration().showFriendRequests
+ && this.configuration().showGroupsInvites && this.configuration().showPokes))
+ {
+ System.exit(0);
+ }
+
this.connectTuxApi();
- if(true)//tux.radio.getConnected())
+ if(true)
{
FacebookConnection facebook = new FacebookConnection(this, tux, this.configuration().getLogin(), this.configuration().getPassword());
FacebookFunctions functions = new FacebookFunctions(facebook);
@@ -203,7 +209,14 @@
{
if(functions.getEmailNotifications().intValue() > 0)
{
- throwMessage("You have {0} new messages", functions.getEmailNotifications().intValue());
+ if(functions.getEmailNotifications().intValue() == 1)
+ {
+ throwMessage("You have one new message");
+ }
+ else
+ {
+ throwMessage("You have {0} new messages", functions.getEmailNotifications().intValue());
+ }
}
}
@@ -212,7 +225,14 @@
{
if(functions.getFriendRequestsCount().intValue() > 0)
{
- throwMessage("You have {0} friend requests", functions.getFriendRequestsCount());
+ if(functions.getFriendRequestsCount().intValue() == 1)
+ {
+ throwMessage("You have one friend request");
+ }
+ else
+ {
+ throwMessage("You have {0} friend requests", functions.getFriendRequestsCount());
+ }
for(String friendName : functions.getFriendRequestNames())
{
@@ -226,7 +246,14 @@
{
if(functions.getGroupsInvitesCount().intValue() > 0)
{
- throwMessage("You have {0} group invites", functions.getGroupsInvitesCount().intValue());
+ if(functions.getGroupsInvitesCount().intValue() == 1)
+ {
+ throwMessage("You have one group invite");
+ }
+ else
+ {
+ throwMessage("You have {0} group invites", functions.getGroupsInvitesCount().intValue());
+ }
for(String group : functions.getGroupInvitesNames())
{
@@ -240,7 +267,14 @@
{
if(functions.getEventsInvitesCount().intValue() > 0)
{
- throwMessage("You have {0} event invites", functions.getEventsInvitesCount().intValue());
+ if(functions.getEventsInvitesCount().intValue() == 1)
+ {
+ throwMessage("You have one event invite");
+ }
+ else
+ {
+ throwMessage("You have {0} event invites", functions.getEventsInvitesCount().intValue());
+ }
for(String event : functions.getEventInvitesNames())
{
@@ -253,7 +287,14 @@
{
if(functions.getPokesCount().intValue() > 0)
{
- throwMessage("You have {0} pokes", functions.getPokesCount().intValue());
+ if(functions.getPokesCount().intValue() == 1)
+ {
+ throwMessage("You have one poke");
+ }
+ else
+ {
+ throwMessage("You have {0} pokes", functions.getPokesCount().intValue());
+ }
}
}
}
|
|
From: remi <c2m...@c2...> - 2009-06-19 08:48:49
|
Author: remi
Date: 2009-06-19 10:48:41 +0200 (Fri, 19 Jun 2009)
New Revision: 4831
Modified:
software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py
Log:
* previously removed command was not duplicated but at the wrong place ...
Modified: software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py 2009-06-19 08:46:48 UTC (rev 4830)
+++ software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py 2009-06-19 08:48:41 UTC (rev 4831)
@@ -73,6 +73,7 @@
resourcesManager.addDirectoryToServe("/data/web_interface/user_01/css/")
resourcesManager.addDirectoryToServe("/data/web_interface/user_01/img/")
resourcesManager.addDirectoryToServe("/data/web_interface/user_01/js/")
+ resourcesManager.start()
# Start the clients manager
clientsManager.start()
|