commit 4bd8fb082324e363b823dbf0b37e858d5800651c
parent d2a1632a8df422bef7acb7ffcb9215569e585f80
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date: Sun, 8 May 2011 17:00:11 +0200
Corrections sur la taille des boutons.
Diffstat:
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
@@ -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("<span/>").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
@@ -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);}
}