From: Greg Burri Date: Sat, 19 Jul 2008 23:31:26 +0000 (+0000) Subject: MOD avancement de la Grande Restructuration X-Git-Tag: 1.1.0~71 X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=1146f3264ff7535ff3408230140414789c3c25da;p=euphorik.git MOD avancement de la Grande Restructuration --- diff --git a/index.yaws b/index.yaws index 105694d..9a5d1e2 100755 --- a/index.yaws +++ b/index.yaws @@ -23,7 +23,7 @@ }. - +
diff --git a/js/client.js b/js/client.js index ea96902..92009f5 100644 --- a/js/client.js +++ b/js/client.js @@ -18,16 +18,6 @@ /*jslint laxbreak:true */ -// les statuts possibes du client -euphorik.Client.statutType = { - // mode enregistré, peut poster des messages et modifier son profile - auth_registered : 0, - // mode identifié, peut poster des messages mais n'a pas accès au profile - auth_not_registered : 1, - // mode déconnecté, ne peut pas poster de message - deconnected : 2 -}; - /** * Représente l'utilisateur du site. */ @@ -46,6 +36,16 @@ euphorik.Client = function(util) { this.autoflush = $.browser.opera; }; +// les statuts possibes du client +euphorik.Client.statutType = { + // mode enregistré, peut poster des messages et modifier son profile + auth_registered : 0, + // mode identifié, peut poster des messages mais n'a pas accès au profile + auth_not_registered : 1, + // mode déconnecté, ne peut pas poster de message + deconnected : 2 +}; + euphorik.Client.prototype.resetDonneesPersonnelles = function() { this.id = 0; this.pseudo = euphorik.conf.pseudoDefaut; @@ -126,11 +126,15 @@ euphorik.Client.prototype.goPremierePage = function(numConv) */ euphorik.Client.prototype.ajouterConversation = function(racine) { // vérification s'il elle n'existe pas déjà + var existe = false this.conversations.each(function(i, conv) { if (conv.root === racine) { - return false; + existe = true; } }); + if (existe) { + return false; + } this.conversations.push({root : racine, page : 1, reduit : false}); if (this.autoflush) { @@ -260,6 +264,7 @@ euphorik.Client.prototype.setStatut = function(statut) } this.statut = statut; + this.majMenu(); this.majLogo(); }; @@ -402,7 +407,7 @@ euphorik.Client.prototype.majMenu = function() { var displayType = "block"; $("#menu .admin").css("display", this.ekMaster ? displayType : "none"); - + // met à jour le menu if (this.statut == euphorik.Client.statutType.auth_registered) { $("#menu .profile").css("display", displayType).text("profile"); diff --git a/js/conf.js b/js/conf.js index 1ff7fb5..0010d2d 100644 --- a/js/conf.js +++ b/js/conf.js @@ -1,5 +1,5 @@ // coding: utf-8 -// Copyright 2008 Grégory Burri +// Copyright 2008 Gr�gory Burri // // This file is part of Euphorik. // @@ -15,44 +15,44 @@ // // You should have received a copy of the GNU General Public License // along with Euphorik. If not, see . - -/** - * La configuration. - */ -euphorik.conf = { - versionProtocole : 3, // version du protcole - nickDefaut : "", - nbMessageAffiche : 10, // (par page) - pseudoDefaut : "", - tempsAffichageMessageDialogue : 4000, // en ms - tempsKick : 15, // en minute - tempsBan : 60 * 24 * 3, // en minutes (3 jours) - smiles : { - "smile" : [/:\)/g, /:-\)/g], - "bigsmile" : [/:D/g, /:-D/g], - "clin" : [/;\)/g, /;-\)/g], - "cool" : [/8\)/g, /8-\)/g], - "eheheh" : [/:P/g, /:-P/g], - "lol" : [/\[-lol\]/g], - "petrus" : [/:F/g], - "spliff" : [/\[-spliff\]/g], - "oh" : [/:o/g, /:O/g], - "heink" : [/\[-heink\]/g], - "hum" : [/\[-hum\]/g], - "boh" : [/\[-boh\]/g], - "sniff" : [/:\(/g, /:-\(/g], - "triste" : [/\[-triste\]/g], - "pascontent" : [/>\(/g, />\(/g], - "argn" : [/\[-argn\]/g], - "redface" : [/\[-redface\]/g], - "bunny" : [/\[-lapin\]/g], - "chat" : [/\[-chat\]/g], - "renne" : [/\[-renne\]/g], - "star" : [/\[-star\]/g], - "kirby" : [/\[-kirby\]/g], - "slurp" : [/\[-slurp\]/g], - "agreed" : [/\[-agreed\]/g], - "dodo" : [/\[-dodo\]/g], - "bn" : [/\[-bn\]/g] - } -}; + +/** + * La configuration. + */ +euphorik.conf = { + versionProtocole : 3, // version du protcole + nickDefaut : "", + nbMessageAffiche : 40, // (par page) + pseudoDefaut : "", + tempsAffichageMessageDialogue : 4000, // en ms + tempsKick : 15, // en minute + tempsBan : 60 * 24 * 3, // en minutes (3 jours) + smiles : { + "smile" : [/:\)/g, /:-\)/g], + "bigsmile" : [/:D/g, /:-D/g], + "clin" : [/;\)/g, /;-\)/g], + "cool" : [/8\)/g, /8-\)/g], + "eheheh" : [/:P/g, /:-P/g], + "lol" : [/\[-lol\]/g], + "petrus" : [/:F/g], + "spliff" : [/\[-spliff\]/g], + "oh" : [/:o/g, /:O/g], + "heink" : [/\[-heink\]/g], + "hum" : [/\[-hum\]/g], + "boh" : [/\[-boh\]/g], + "sniff" : [/:\(/g, /:-\(/g], + "triste" : [/\[-triste\]/g], + "pascontent" : [/>\(/g, />\(/g], + "argn" : [/\[-argn\]/g], + "redface" : [/\[-redface\]/g], + "bunny" : [/\[-lapin\]/g], + "chat" : [/\[-chat\]/g], + "renne" : [/\[-renne\]/g], + "star" : [/\[-star\]/g], + "kirby" : [/\[-kirby\]/g], + "slurp" : [/\[-slurp\]/g], + "agreed" : [/\[-agreed\]/g], + "dodo" : [/\[-dodo\]/g], + "bn" : [/\[-bn\]/g] + } +}; diff --git a/js/euphorik.js b/js/euphorik.js index d2cd248..1f3dc01 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -26,7 +26,7 @@ // tout euphorik est contenu dans cet objet var euphorik = {} // ;; euphorik.include = -// ;; euphorik.include = function(f) { var s = document.createElement('script'); s.type = 'text/javascript'; s.src = "js/" + f + ".js"; document.getElementsByTagName('head')[0].appendChild(s); } + //;; euphorik.include = function(f) { var s = document.createElement('script'); s.type = 'text/javascript'; s.src = "js/" + f + ".js"; document.getElementsByTagName('head')[0].appendChild(s); } // version jQuery : function(f) { jQuery.ajax({async : false, url : "js/" + f + ".js", dataType : "script"}) } @@ -34,55 +34,58 @@ var euphorik = {} ;; euphorik.include = function(f) { ;; var req, url = 'js/' + f + '.js' ;; if (window.XMLHttpRequest) { -;; req = new XMLHttpRequest(); req.open("GET", url, false /* async */); req.send(null); +;; req = new XMLHttpRequest(); req.open("GET", url, false); req.send(null); ;; } else if (window.ActiveXObject) { ;; req = new ActiveXObject((navigator.userAgent.toLowerCase().indexOf('msie 5') != -1) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP"); ;; if (req) { req.open("GET", url, false); req.send(); } ;; } ;; if (req!==false) { if (req.status==200) { window.eval(req.responseText); } else if (req.status==404) { alert("erreur de chargement (404) de : " + url) } } -;; } - -;; euphorik.include("jquery") -;; euphorik.include("jquery.lightbox") -;; euphorik.include("md5") -;; euphorik.include("json2") - -;; euphorik.include("conf") -;; euphorik.include("util") -;; euphorik.include("formateur") -;; euphorik.include("pages") - -;; euphorik.include("pageMinichat") -;; euphorik.include("pageAdmin") -;; euphorik.include("pageProfile") -;; euphorik.include("pageRegister") -;; euphorik.include("pageAbout") - - -// tout un tas d'améliorations de JavaScript ;) -/** - * Pour chaque propriété de l'objet execute f(p, v) ou p est le nom de la propriété et v sa valeur. - * Ne parcours pas les propriétés des prototypes. - */ -Object.prototype.each = function(f) { - for (var k in this) { - if (this.hasOwnProperty(k)) { - f(k, this[k]); - } - } -}; - -Array.prototype.each = function(f) { - for (var i = 0; i < this.length; i++) { - f(i, this[i]); - } -}; - -Array.prototype.map = function(f) { - for (var i = 0; i < this.length; i++) { - this[i] = f(this[i]) - } -}; +;; }; + +;; euphorik.include("jquery"); +;; euphorik.include("jquery.lightbox"); +;; euphorik.include("md5"); +;; euphorik.include("json2"); + +;; euphorik.include("conf"); +;; euphorik.include("util"); +;; euphorik.include("formateur"); +;; euphorik.include("pages"); +;; euphorik.include("client"); +;; euphorik.include("pageEvent"); + +;; euphorik.include("pageMinichat"); +;; euphorik.include("pageAdmin"); +;; euphorik.include("pageProfile"); +;; euphorik.include("pageRegister"); +;; euphorik.include("pageAbout"); + +// tout un tas d'améliorations de JavaScript ;) +/** + * Pour chaque propriété de l'objet execute f(p, v) ou p est le nom de la propriété et v sa valeur. + * Ne parcours pas les propriétés des prototypes. + * FIXME : Normalement : Object.prototype.each = function(f) mais non supporté par jquery + */ +//Object.prototype.each = function(f) { +var objectEach = function(o, f) { + for (var k in o) { + if (o.hasOwnProperty(k)) { + f(k, o[k]); + } + } +}; + +Array.prototype.each = function(f) { + for (var i = 0; i < this.length; i++) { + f(i, this[i]); + } +}; + +Array.prototype.map = function(f) { + for (var i = 0; i < this.length; i++) { + this[i] = f(this[i]) + } +}; String.prototype.trim = function() { return jQuery.trim(this) // anciennement : this.replace(/^\s+|\s+$/g, ""); @@ -94,34 +97,34 @@ String.prototype.ltrim = function() { String.prototype.rtrim = function() { return this.replace(/\s+$/, ""); -} - - -/** - * Voir : http://www.coolpage.com/developer/javascript/Correct%20OOP%20for%20Javascript.html - * - * Exemple : - * - * function Mammal(name) { - * this.name = name; - * } - * - * Cat.Inherits(Mammal); - * function Cat(name) { - * this.Super(Mammal, name); - * } - */ -Object.prototype.Super = function(parent) { - if(arguments.length > 1) { - parent.apply( this, Array.prototype.slice.call( arguments, 1 ) ); - } else { - parent.call( this ); - } -} -Function.prototype.Inherits = function(parent) { - this.prototype = new parent(); - this.prototype.constructor = this; -} +} + + +/** + * Voir : http://www.coolpage.com/developer/javascript/Correct%20OOP%20for%20Javascript.html + * + * Exemple : + * + * function Mammal(name) { + * this.name = name; + * } + * + * Cat.Inherits(Mammal); + * function Cat(name) { + * this.Super(Mammal, name); + * } + */ +/*Object.prototype.Super = function(parent) { + if(arguments.length > 1) { + parent.apply( this, Array.prototype.slice.call( arguments, 1 ) ); + } else { + parent.call( this ); + } +} +Function.prototype.Inherits = function(parent) { + this.prototype = new parent(); + this.prototype.constructor = this; +}*/ @@ -131,12 +134,13 @@ Function.prototype.Inherits = function(parent) { // le main $(document).ready( function() - { + { var formateur = new euphorik.Formateur() - var util = new euphorik.Util(formateur) - var client = new Client(util) + var util = new euphorik.Util(formateur) + var client = new euphorik.Client(util) var pages = new euphorik.Pages() + // connexion vers le serveur (utilise un cookie qui traine) client.connexionCookie() diff --git a/js/formateur.js b/js/formateur.js index 23f2531..e0e7240 100644 --- a/js/formateur.js +++ b/js/formateur.js @@ -46,7 +46,7 @@ euphorik.Formateur.prototype.filtrerInputPseudo = function(pseudo) { euphorik.Formateur.prototype.getSmilesHTML = function() { var XHTML = ""; - this.smiles.each(function(nom) { + objectEach(this.smiles, function(nom) { XHTML += "\"""; }); return XHTML; @@ -81,7 +81,7 @@ euphorik.Formateur.prototype.traiterLiensConv = function(m) { * moyenne sur échantillon : 234ms */ euphorik.Formateur.prototype.traiterSmiles = function(m) { - this.smiles.each(function(nom, smiles) { + objectEach(this.smiles, function(nom, smiles) { for (var i = 0; i < smiles.length; i++) { m = m.replace(smiles[i], "\"""); } diff --git a/js/jquery.js b/js/jquery.js index 88e661e..4228a57 100755 --- a/js/jquery.js +++ b/js/jquery.js @@ -1,13 +1,13 @@ (function(){ /* - * jQuery 1.2.6 - New Wave Javascript + * jQuery 1.2.7pre - New Wave Javascript * * Copyright (c) 2008 John Resig (jquery.com) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * - * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ - * $Rev: 5685 $ + * $Date: 2008-06-30 12:17:44 -0400 (Mon, 30 Jun 2008) $ + * $Rev: 5754 $ */ // Map over jQuery in case of overwrite @@ -22,7 +22,7 @@ var jQuery = window.jQuery = window.$ = function( selector, context ) { // A simple way to check for HTML strings or ID strings // (both of which we optimize for) -var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/, +var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, // Is it a simple selector isSimple = /^.[^:#\[\.]*$/, @@ -84,7 +84,7 @@ jQuery.fn = jQuery.prototype = { }, // The current version of jQuery being used - jquery: "1.2.6", + jquery: "1.2.7pre", // The number of elements contained in the matched element set size: function() { @@ -442,7 +442,7 @@ jQuery.fn = jQuery.prototype = { }, eq: function( i ) { - return this.slice( i, i + 1 ); + return this.slice( i, +i + 1 ); }, slice: function() { @@ -944,12 +944,12 @@ jQuery.extend({ context = context.ownerDocument || context[0] && context[0].ownerDocument || document; jQuery.each(elems, function(i, elem){ + if ( typeof elem == 'number' ) + elem += ''; + if ( !elem ) return; - if ( elem.constructor == Number ) - elem += ''; - // Convert html string into DOM nodes if ( typeof elem == "string" ) { // Fix "XHTML"-style tags in all browsers @@ -1245,7 +1245,8 @@ jQuery.extend({ styleFloat: styleFloat, readonly: "readOnly", maxlength: "maxLength", - cellspacing: "cellSpacing" + cellspacing: "cellSpacing", + rowspan: "rowSpan" } }); @@ -1368,7 +1369,8 @@ jQuery.each([ "Height", "Width" ], function(i, name){ // Helper function used by the dimensions and offset modules function num(elem, prop) { return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; -}var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ? +} +var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ? "(?:[\\w*_-]|\\\\.)" : "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)", quickChild = new RegExp("^>\\s*(" + chars + "+)"), @@ -1814,7 +1816,7 @@ jQuery.extend({ }); /* * A number of helper functions used for managing events. - * Many of the ideas behind this code orignated from + * Many of the ideas behind this code originated from * Dean Edwards' addEvent library. */ jQuery.event = { @@ -1982,7 +1984,10 @@ jQuery.event = { if ( !elem ) { // Only trigger if we've ever bound an event for it if ( this.global[type] ) - jQuery("*").add([window, document]).trigger(type, data); + jQuery.each( jQuery.cache, function(){ + if ( this.events && this.events[type] ) + jQuery.event.trigger( type, data, this.handle.elem ); + }); // Handle triggering a single element } else { @@ -2088,6 +2093,8 @@ jQuery.event = { return val; }, + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" "), + fix: function(event) { if ( event[expando] == true ) return event; @@ -2096,9 +2103,11 @@ jQuery.event = { // and "clone" to set read-only properties var originalEvent = event; event = { originalEvent: originalEvent }; - var props = "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" "); - for ( var i=props.length; i; i-- ) - event[ props[i] ] = originalEvent[ props[i] ]; + + for ( var i = this.props.length, prop; i; ){ + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } // Mark it as fixed event[expando] = true; @@ -2410,9 +2419,12 @@ var withinElement = function(event, elem) { // Prevent memory leaks in IE // And prevent errors on refresh with events like mouseover in other browsers // Window isn't included so as not to unbind existing unload events -jQuery(window).bind("unload", function() { - jQuery("*").add(document).unbind(); -}); +jQuery( window ).bind( 'unload', function(){ + for ( var id in jQuery.cache ) + // Skip the window + if ( id != 1 && jQuery.cache[ id ].handle ) + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); +}); jQuery.fn.extend({ // Keep a copy of the old load _load: jQuery.fn.load, @@ -2441,7 +2453,7 @@ jQuery.fn.extend({ params = null; // Otherwise, build a param string - } else { + } else if( typeof params == 'object' ) { params = jQuery.param( params ); type = "POST"; } @@ -2651,12 +2663,13 @@ jQuery.extend({ jQuery.event.trigger( "ajaxStart" ); // Matches an absolute URL, and saves the domain - var remote = /^(?:\w+:)?\/\/([^\/?#]+)/; + var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url ); // If we're requesting a remote document // and trying to load JSON or Script with a GET - if ( s.dataType == "script" && type == "GET" - && remote.test(s.url) && remote.exec(s.url)[1] != location.host ){ + if ( s.dataType == "script" && type == "GET" && parts + && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){ + var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = s.url; @@ -2742,16 +2755,16 @@ jQuery.extend({ ival = null; } - status = isTimeout == "timeout" && "timeout" || - !jQuery.httpSuccess( xhr ) && "error" || - s.ifModified && jQuery.httpNotModified( xhr, s.url ) && "notmodified" || + status = isTimeout == "timeout" ? "timeout" : + !jQuery.httpSuccess( xhr ) ? "error" : + s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" : "success"; if ( status == "success" ) { // Watch for, and catch, XML document parse errors try { // process the data (runs the xml through httpData regardless of callback) - data = jQuery.httpData( xhr, s.dataType, s.dataFilter ); + data = jQuery.httpData( xhr, s.dataType, s ); } catch(e) { status = "parsererror"; } @@ -2875,7 +2888,7 @@ jQuery.extend({ return false; }, - httpData: function( xhr, type, filter ) { + httpData: function( xhr, type, s ) { var ct = xhr.getResponseHeader("content-type"), xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, data = xml ? xhr.responseXML : xhr.responseText; @@ -2884,8 +2897,9 @@ jQuery.extend({ throw "parsererror"; // Allow a pre-filtering function to sanitize the response - if( filter ) - data = filter( data, type ); + // s != null is checked to keep backwards compatibility + if( s && s.dataFilter ) + data = s.dataFilter( data, type ); // If the type is "script", eval it in global context if ( type == "script" ) @@ -2901,14 +2915,18 @@ jQuery.extend({ // Serialize an array of form elements or a set of // key/values into a query string param: function( a ) { - var s = []; + var s = [ ]; + + function add( key, value ){ + s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value); + }; // If an array was passed in, assume that it is an array // of form elements if ( a.constructor == Array || a.jquery ) // Serialize the form elements jQuery.each( a, function(){ - s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) ); + add( this.name, this.value ); }); // Otherwise, assume that it's an object of key/value pairs @@ -2918,10 +2936,10 @@ jQuery.extend({ // If the value is an array then the key names need to be repeated if ( a[j] && a[j].constructor == Array ) jQuery.each( a[j], function(){ - s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) ); + add( j, this ); }); else - s.push( encodeURIComponent(j) + "=" + encodeURIComponent( jQuery.isFunction(a[j]) ? a[j]() : a[j] ) ); + add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] ); // Return the resulting serialization return s.join("&").replace(/%20/g, "+"); @@ -2975,26 +2993,6 @@ jQuery.fn.extend({ }); }, - slideDown: function(speed,callback){ - return this.animate({height: "show"}, speed, callback); - }, - - slideUp: function(speed,callback){ - return this.animate({height: "hide"}, speed, callback); - }, - - slideToggle: function(speed, callback){ - return this.animate({height: "toggle"}, speed, callback); - }, - - fadeIn: function(speed, callback){ - return this.animate({opacity: "show"}, speed, callback); - }, - - fadeOut: function(speed, callback){ - return this.animate({opacity: "hide"}, speed, callback); - }, - fadeTo: function(speed,to,callback){ return this.animate({opacity: to}, speed, callback); }, @@ -3003,17 +3001,16 @@ jQuery.fn.extend({ var optall = jQuery.speed(speed, easing, callback); return this[ optall.queue === false ? "each" : "queue" ](function(){ - if ( this.nodeType != 1) - return false; - + var opt = jQuery.extend({}, optall), p, - hidden = jQuery(this).is(":hidden"), self = this; - + hidden = this.nodeType == 1 && jQuery(this).is(":hidden"), + self = this; + for ( p in prop ) { if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) return opt.complete.call(this); - if ( p == "height" || p == "width" ) { + if ( ( p == "height" || p == "width" ) && this.style ) { // Store display property opt.display = jQuery.css(this, "display"); @@ -3109,6 +3106,19 @@ jQuery.fn.extend({ }); +// Generate shortcuts for custom animations +jQuery.each({ + slideDown: { height:"show" }, + slideUp: { height: "hide" }, + slideToggle: { height: "toggle" }, + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" } +}, function( name, props ){ + jQuery.fn[ name ] = function( speed, callback ){ + return this.animate( props, speed, callback ); + }; +}); + var queue = function( elem, type, array ) { if ( elem ){ @@ -3148,7 +3158,7 @@ jQuery.extend({ opt.duration = (opt.duration && opt.duration.constructor == Number ? opt.duration : - jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds.def; + jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds._default; // Queueing opt.old = opt.complete; @@ -3195,13 +3205,13 @@ jQuery.fx.prototype = { (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); // Set display property to block for height/width animations - if ( this.prop == "height" || this.prop == "width" ) + if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style ) this.elem.style.display = "block"; }, // Get the current size cur: function(force){ - if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null ) + if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) return this.elem[ this.prop ]; var r = parseFloat(jQuery.css(this.elem, this.prop, force)); @@ -3335,23 +3345,19 @@ jQuery.extend( jQuery.fx, { slow: 600, fast: 200, // Default speed - def: 400 + _default: 400 }, step: { - scrollLeft: function(fx){ - fx.elem.scrollLeft = fx.now; - }, - - scrollTop: function(fx){ - fx.elem.scrollTop = fx.now; - }, opacity: function(fx){ jQuery.attr(fx.elem.style, "opacity", fx.now); }, _default: function(fx){ - fx.elem.style[ fx.prop ] = fx.now + fx.unit; + if( fx.prop in fx.elem ) + fx.elem[ fx.prop ] = fx.now; + else if( fx.elem.style ) + fx.elem.style[ fx.prop ] = fx.now + fx.unit; } } }); @@ -3371,7 +3377,7 @@ jQuery.fn.offset = function() { fixed = css(elem, "position") == "fixed"; // Use getBoundingClientRect if available - if ( elem.getBoundingClientRect ) { + if ( !(mozilla && elem == document.body) && elem.getBoundingClientRect ) { var box = elem.getBoundingClientRect(); // Add the document scroll offsets @@ -3489,7 +3495,7 @@ jQuery.fn.extend({ }, offsetParent: function() { - var offsetParent = this[0].offsetParent; + var offsetParent = this[0].offsetParent || document.body; while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') ) offsetParent = offsetParent.offsetParent; return jQuery(offsetParent); diff --git a/js/pageEvent.js b/js/pageEvent.js index 4e69e81..f26a325 100644 --- a/js/pageEvent.js +++ b/js/pageEvent.js @@ -84,7 +84,7 @@ euphorik.PageEvent.prototype.waitEvent = function(funSend, funsReceive) { "page" : this.page }; var poulpe = funSend(); - poulpe.each(function(k, v) { + objectEach(poulpe, function(k, v) { dataToSend[k] = v; });