From: Greg Burri Date: Mon, 26 May 2008 19:32:07 +0000 (+0000) Subject: MOD amélioration du style X-Git-Tag: 1.0.0^2~28 X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=commitdiff_plain;h=ec0132f1c1f3599d7818a566b08129c994e6647b MOD amélioration du style FIX problème lié aux appels concurrents --- diff --git a/css/1/euphorik.css b/css/1/euphorik.css index f772ba8..7a9fdf4 100755 --- a/css/1/euphorik.css +++ b/css/1/euphorik.css @@ -182,21 +182,26 @@ form select { border: #841919 1px solid; } +form input:hover, form input:focus, +form button:hover, form button:focus, +form select:hover, form select:focus { + background-color: #ffffff; +} + form input, form select { font-size: 12px; } - form button { font-size: 11px; } a { - text-decoration: none; + text-decoration: underline; } -a:link:visited { +a:link, a:visited { color: #c62929; } -a:hover:active { +a:hover, a:active { color: #e84747; } diff --git a/css/1/pageAdmin.css b/css/1/pageAdmin.css index 95c835a..2341b6c 100644 --- a/css/1/pageAdmin.css +++ b/css/1/pageAdmin.css @@ -14,10 +14,11 @@ #page.admin div.troll, #page.admin .ban { - margin-top: 10px; + margin-top: 5px; padding: 2px 10px 2px 10px; border: 1px solid; background-color: #841919; + color: #ffffff; } #page.admin div.troll img { @@ -27,12 +28,10 @@ #page.admin div.troll span.content { font-style: italic; - color: #ffffff; } #page.admin div.troll .author { margin-left: 10px; - color: #ffffff; } #page.admin div.troll input { @@ -52,8 +51,21 @@ padding-left: 5px; background-color: #f0df95; border: #841919 1px solid; + color: #841919; } +#page.admin div.troll .editTroll:hover, +#page.admin div.troll .delTroll:hover, +#page.admin div.troll .modifier:hover, +#page.admin div.troll .annuler:hover, +#page.admin div.ban .deban:hover +{ + background-color: #ffffff; +} + +#page.admin #ips { + color: #ffffff; +} #page.admin #ips .ip { margin-right : 10px; diff --git a/js/euphorik.js b/js/euphorik.js index 126f335..b44f042 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -914,6 +914,9 @@ function PageEvent(page, util) // l'objet JSONHttpRequest représentant la connexion d'attente this.attenteCourante = null + + // le multhreading du pauvre, merci javascript de m'offrire autant de primitives pour la gestion de la concurrence... + this.stop = false } /** @@ -921,8 +924,12 @@ function PageEvent(page, util) */ PageEvent.prototype.stopAttenteCourante = function() { + this.stop = true + if (this.attenteCourante != null) + { this.attenteCourante.abort() + } } /** @@ -932,11 +939,13 @@ PageEvent.prototype.stopAttenteCourante = function() */ PageEvent.prototype.waitEvent = function(funSend, funReceive) { - var thisPageEvent = this - this.stopAttenteCourante() + + this.stop = false + + var thisPageEvent = this - // on doit conserver l'ordre des valeurs de l'objet JSON (le serveur les veux dans l'ordre définit dans le protocole) + // on doit conserver l'ordre des valeurs de l'objet JSON (le serveur les veut dans l'ordre définit dans le protocole) // TODO : ya pas mieux ? var dataToSend = { @@ -948,6 +957,7 @@ PageEvent.prototype.waitEvent = function(funSend, funReceive) dataToSend[v] = poulpe[v] ;;; dumpObj(dataToSend) + this.attenteCourante = jQuery.ajax({ type: "POST", url: "request", @@ -961,15 +971,24 @@ PageEvent.prototype.waitEvent = function(funSend, funReceive) funReceive(data) // rappel de la fonction dans 100 ms - setTimeout(function(){ thisPageEvent.waitEvent(funSend, funReceive) }, 100); + setTimeout(function(){ thisPageEvent.waitEvent2(funSend, funReceive) }, 100) }, error: function(XMLHttpRequest, textStatus, errorThrown) { - setTimeout(function(){ thisPageEvent.waitEvent(funSend, funReceive) }, 1000); + setTimeout(function(){ thisPageEvent.waitEvent2(funSend, funReceive) }, 1000) } }) +} +/** + * Si un stopAttenteCourante survient un peu n'importe quand il faut imédiatement arreter de boucler. + */ +PageEvent.prototype.waitEvent2 = function(funSend, funReceive) +{ + if (this.stop) + return + this.waitEvent(funSend, funReceive) } ///////////////////////////////////////////////////////////////////////////////////////////////////