From 4bd8fb082324e363b823dbf0b37e858d5800651c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Sun, 8 May 2011 17:00:11 +0200 Subject: [PATCH] Corrections sur la taille des boutons. --- code/serveur/php/ressources/my-extensions.js | 15 ++-- code/serveur/php/ressources/pticlic.js | 73 ++++++++++---------- 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/code/serveur/php/ressources/my-extensions.js b/code/serveur/php/ressources/my-extensions.js index 35e1972..bb196d4 100644 --- a/code/serveur/php/ressources/my-extensions.js +++ b/code/serveur/php/ressources/my-extensions.js @@ -45,19 +45,22 @@ $.fn.sumHeight = function() { } catch(e) {alert("Error sumHeight");alert(e);} } -$.fn.fitFont = function(w, h, minFont, maxFont, noContainer) { +$.fn.fitFont = function(w, h, minFont, maxFont, noContainer, oneline) { try { var oldpos = this.css("position"); - this.css({ - position: "absolute", - maxWidth: w - }); + this.css({position: "absolute"}); + + if (oneline) + this.css("white-space", "nowrap"); + else + this.css({maxWidth: w}); + if (noContainer) { var wrappers = this; } else { var wrappers = this.wrapInner("").children(); } - + var that = this; this.css("font-size", dichotomy(parseInt(this.css("font-size"), 10), function(x) { try { diff --git a/code/serveur/php/ressources/pticlic.js b/code/serveur/php/ressources/pticlic.js index 57cfe18..ad4f426 100644 --- a/code/serveur/php/ressources/pticlic.js +++ b/code/serveur/php/ressources/pticlic.js @@ -624,6 +624,32 @@ score.click.jaivu = function() { } catch(e) {alert("Error score.click.jaivu");alert(e);} }; +// ==== 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 { + $("#info-back").clickOnce(info.click.goBack); + jss(); + UI().dismiss(); + } catch(e) {alert("Error info.enter");alert(e);} +}; + +info.click = {}; +info.click.goBack = function(){ + try { + state.set('screen', 'frontpage').validate(); + } catch(e) {alert("Error anonymous in info.enter");alert(e);} +}; + // ==== Code métier pour la connexion connection = {}; @@ -639,11 +665,11 @@ connection.jss = function(w, h, iconSize) { $c("input, label") .css("white-space", "nowrap") .css('position', 'absolute') - .fitFont(w*0.3, h*0.06); - $c("#user-label").east({left:w*0.45,top:h*0.25}); - $c("#user").west({left:w*0.55,top:h*0.25}); - $c("#passwd-label").east({left:w*0.45,top:h*0.5}); - $c("#passwd").west({left:w*0.55,top:h*0.5}); + .fitFont(w*0.45, h*0.06, null, null, true, true); + $c("#user-label").east({left:w*0.475,top:h*0.25}); + $c("#user").west({left:w*0.525,top:h*0.25}); + $c("#passwd-label").east({left:w*0.475,top:h*0.5}); + $c("#passwd").west({left:w*0.525,top:h*0.5}); $c("#connect").center({left:w/2,top:h*0.75}); } catch(e) {alert("Error connection.jss");alert(e);} }; @@ -682,32 +708,6 @@ connection.connectFetched = function(data) { } catch(e) {alert("Error connection.connectFetched");alert(e);} } -// ==== 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 { - $("#info-back").clickOnce(info.click.goBack); - jss(); - UI().dismiss(); - } catch(e) {alert("Error info.enter");alert(e);} -}; - -info.click = {}; -info.click.goBack = function(){ - try { - state.set('screen', 'frontpage').validate(); - } catch(e) {alert("Error anonymous in info.enter");alert(e);} -}; - // ==== Code métier pour la page de configuration prefs = {}; @@ -721,13 +721,12 @@ prefs.jss = function(w,h,iconSize) { }; $("input, label, select") - .css("white-space", "nowrap") .css('position', 'absolute') - .fitFont(w*0.3, h*0.06); - $p("#theme-label").east({left:w*0.45,top:h*0.25}); - $p("#theme").west({left:w*0.55,top:h*0.25}); - $p("#prefs-cancel").east({left:w*0.45,top:h*0.5}); - $p("#prefs-apply").west({left:w*0.55,top:h*0.5}); + .fitFont(w*0.45, h*0.06, null, null, true, true); + $p("#theme-label").east({left:w*0.475,top:h*0.25}); + $p("#theme").west({left:w*0.525,top:h*0.25}); + $p("#prefs-cancel").east({left:w*0.475,top:h*0.5}); + $p("#prefs-apply").west({left:w*0.525,top:h*0.5}); } catch(e) {alert("Error prefs.jss");alert(e);} }