www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a247b9815f9203c909273abc6ffceb57f26b636f
parent ea6bf51e8754b2c5a420a55fc7faf0e308ead875
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date:   Sat,  7 May 2011 14:06:02 +0200

Ajout de la page d'aide.

Diffstat:
Mcode/serveur/php/jeu.html | 40++++++++++++++++++++++++++++++++++++++--
Mcode/serveur/php/ressources/my-extensions.js | 11+++++++----
Mcode/serveur/php/ressources/pticlic.js | 36+++++++++++++++++++++++++++++++++---
3 files changed, 78 insertions(+), 9 deletions(-)

diff --git a/code/serveur/php/jeu.html b/code/serveur/php/jeu.html @@ -33,7 +33,8 @@ html, body { background-color: #F0F8D0; } -.relationBox { +.relationB +ox { background-color: #F0F8D0; border: thin solid #44AA44; } @@ -84,7 +85,7 @@ html, body { <div><img class="icon" alt="" src="ressources/img/72/default.png" /></div> <div class="text">Connexion</div> </div> - <div class="frontpage-button about"> + <div class="frontpage-button info"> <div><img class="icon" alt="" src="ressources/img/72/default.png" /></div> <div class="text">A Propos</div> </div> @@ -103,6 +104,40 @@ html, body { <input type="submit" name="connect" id="connect" value="Se connecter" /> </form> </div> + <div class="screen" id="info"> + <div class="container"> + <p> + PtiClic a été conçu et développé par Mathieu Lafourcade + (LIRMM - Université Montpellier 2) et Virginie Zampa + (LIDILEM - Université Stendhal Grenoble 3) + </p> + <p> + La présente version pour SmartPhone sous Android, en cours + de développement a été conçue et réalisée par des + étudiants en Master 1 à l'Université Montpellier II : + Yoann BONAVERO, Bertrand BRUN, John CHARRON et + Georges DUPÉRON. + </p> + <p> + Cette version du PtiClic est une version Alpha. Elle n'est + pas exempte de bogues. + </p> + <p> + Si vous souhaitez participer au projet en tant que + Bêta-testeur, rendez-vous sur le site + <a href="http://pticlic.fr/">http://pticlic.fr</a> + pour vous y inscrire. + </p> + <p> + Si vous souhaitez signaler des bogues ou nous faire part + de vos commentaires, vous pouvez nous contacter par + courriel à l'adresse suivante : <a href="mailto:pticlic.android.beta@gmail.com">pticlic.android.beta@gmail.com</a> + </p> + <p id="info-back-p"> + <input id="info-back" type="button" value="Retour" /> + </p> + </div> + </div> <div id="templates" style="display: none;"> <div class="relationBox"> <div class="relation"><img class="icon" alt="" src="ressources/img/72/default.png" /><span class="text"></span></div> @@ -114,3 +149,4 @@ html, body { </div> </body> </html> +<html> diff --git a/code/serveur/php/ressources/my-extensions.js b/code/serveur/php/ressources/my-extensions.js @@ -45,27 +45,30 @@ $.fn.sumHeight = function() { } catch(e) {alert("Error sumHeight");alert(e);} } -$.fn.fitFont = function(w, h, minFont, maxFont) { +$.fn.fitFont = function(w, h, minFont, maxFont, noContainer) { try { var oldpos = this.css("position"); this.css({ position: "absolute", maxWidth: w }); - var wrappers = this.wrapInner("<span/>").children(); + if (noContainer) { + var wrappers = this; + } else { + var wrappers = this.wrapInner("<span/>").children(); + } var that = this; this.css("font-size", dichotomy(parseInt(this.css("font-size"), 10), function(x) { try { that.css("fontSize", x); - fubar = wrappers; return (wrappers.maxHeight() > h || wrappers.maxWidth() > w); } catch(e) {alert("Error anonymous in $.fn.fitFont");alert(e);} },this).clip(minFont || 0, maxFont || Infinity)); // Restore stuff this.css("position", oldpos); - //wrappers.children().unwrap(); + if (!noContainer) wrappers.children().unwrap(); return this; } catch(e) {alert("Error $.fn.fitFont");alert(e);} } diff --git a/code/serveur/php/ressources/pticlic.js b/code/serveur/php/ressources/pticlic.js @@ -249,7 +249,7 @@ frontpage.jss = function(w, h, iconSize) { $fp(".game .icon").data('image', 'mode_normal'); $fp(".prefs .icon").data('image', 'config'); $fp(".connection .icon").data('image', 'config'); - $fp(".about .icon").data('image', 'aide'); + $fp(".info .icon").data('image', 'aide'); $fp(".frontpage-button") .css('text-align', 'center') @@ -279,6 +279,7 @@ frontpage.enter = function () { if (location.hash != '') state.commit(); $("#frontpage .frontpage-button.game").clickOnce(frontpage.click.goGame); $("#frontpage .frontpage-button.connection").clickOnce(frontpage.click.goConnection); + $("#frontpage .frontpage-button.info").clickOnce(frontpage.click.goInfo); jss(); UI().dismiss(); } catch(e) {alert("Error frontpage.enter");alert(e);} @@ -298,6 +299,13 @@ frontpage.click.goConnection = function() { } catch(e) {alert("Error frontpage.click.goConnection");alert(e);} }; +frontpage.click.goInfo = function() { + try { + UI().show("PtiClic", "Chargement…"); + state.set('screen', 'info').commit().validate(); + } catch(e) {alert("Error frontpage.click.goInfo");alert(e);} +}; + // ==== Code métier pour le jeu game = {}; @@ -625,4 +633,27 @@ connection.connectFetched = function(data) { } state.set('screen', 'frontpage').validate(); } catch(e) {alert("Error connection.connectFetched");alert(e);} -} -\ No newline at end of file +} + +// ==== Code métier pour la page d'info +info = {}; + +info.jss = function(w,h,iconSize) { + $("#info-back-p").css('text-align', 'center'); + $("#info.screen .container input").css('font-size', 'inherit'); + $("#info.screen .container") + .fitFont(w*0.9, h*0.9, null, null, true) + .center($("#info.screen")); +} + +info.enter = function() { + try { + jss(); + $("#info-back").clickOnce(function(){ + try { + state.set('screen', 'frontpage').validate(); + } catch(e) {alert("Error anonymous in info.enter");alert(e);} + }); + UI().dismiss(); + } catch(e) {alert("Error info.enter");alert(e);} +};