[mochikit] problem with Effect.fade (opacity) in IE7 with scriptaculous, test included
Hi, I'm getting an error in IE7 with the test case included at bottom which just trys to do an Effect.Fade. If I comment out mochikit, the page works fine. Does this mean Mochikit and scriptaculous are incompatible? I'm using mochikit version from subversion downloaded today (Jan 16, 2006) build 1250, Scriptaculous 1.6.5 and prototype 1.5_rc1. Any ideas? Thanks, Mark code html head script type=text/javascript src=app/javascript/prototype.js/script script type=text/javascript src=app/javascript/scriptaculous/scriptaculous.js/script script type=text/javascript src=app/javascript/MochiKit.js/script script language=JavaScript function init(){ Effect.Fade($('creationTipsDiv')); } /script /head body onload=init(); div id=creationTipsDiv style= Tips /div /body /html /code --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~--~~~~--~~--~--~---
[mochikit] Re: problem with Effect.fade (opacity) in IE7 with scriptaculous, test included
On 1/16/07, mwaschkowski [EMAIL PROTECTED] wrote: Any ideas? MochiKit's $ function is clobbering Prototype's. I don't know if Scriptaculous is breaking because of this, but I wouldn't be surprised. If you move the MochiKit src above the other two, it should work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~--~~~~--~~--~--~---
[mochikit] Re: problem with Effect.fade (opacity) in IE7 with scriptaculous, test included
Ya, that works great, problem is gone (so there IS a problem with Mochikit's $ function clobbering Prototype and impacting scriptaculous). Thanks for the help! Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~--~~~~--~~--~--~---
[mochikit] Re: problem with Effect.fade (opacity) in IE7 with scriptaculous, test included
mwaschkowski a écrit : Ya, that works great, problem is gone (so there IS a problem with Mochikit's $ function clobbering Prototype and impacting scriptaculous). Or there's a problem with scriptaculous using $ function. It depends of the point of view :). The best way to handle this is to set MochiKit.__export__ to false (unless there's a side effect, but it should do the trick). -- Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~--~~~~--~~--~--~---
[mochikit] Re: problem with Effect.fade (opacity) in IE7 with scriptaculous, test included
Actually, this still no worky :( If I MochiKit.js loads first, firefox 2.0 doesn't work, and if it loads last, IE7 doesn't work! Here is a testcase using the export false, and it doesn't work in Firefox 2.0 (gives an Effect not defined error as if the scriptaculous lib didn't get loaded). If the Mochikit lines are removed, everything works fine. I believe this should work because export false should ensure that Mochikit doesn't have side effects with other js libraries, but this doesn't appear to be the case... Really need some help here! Thanks, Mark html head script type=text/javascriptMochiKit = {__export__: false};/script script type=text/javascript src=app/javascript/MochiKit.js/script script type=text/javascript src=app/javascript/prototype.js/script script type=text/javascript src=app/javascript/scriptaculous/scriptaculous.js/script script language=JavaScript function init(){ new Effect.Fade($('creationTipsDiv')); } /script /head body onload=init(); div id=creationTipsDiv style= Tips /div /body /html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~--~~~~--~~--~--~---
[mochikit] add custom attributes with setNodeAttribute
Hi, I'm adding an atribute called 'tag' (is hard to chosse one name) with setNodeAttribute to attach one value that I would use soon, in FFox it's all OK, in IE this is a little bit harder, but works. Is it a bery bad practice? what you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~--~~~~--~~--~--~---
[mochikit] [patch] Problems with showElement
Hi, While using MochiKit.DOM's showElement function, I have come across some wierd behaviour that I believe is worthy of a fix. showElement always sets the display of the element to show to 'block', regardless of the element's type (it's a partial application of this.setDisplayForElement to 'block'). This doesn't work properly for tables, who should have their display set to 'table'. If set to block their width won't be set to 100% in firefox if a CSS rule says it should be. There are other elements that should have their display set to other values, as listed here: http://www.w3schools.com/css/pr_class_display.asp For now, Martyn Smith prepared a patch that provides a basic implementation that handles the 'table' case. However, rather than completing it, we were wondering if the patch looks like the right way to go about fixing this issue. If so, we may be able to prepare a more complete patch for setting the display for other elements too. For now, the patch is here: Index: Style.js === --- Style.js(revision 1250) +++ Style.js(working copy) @@ -424,13 +424,26 @@ __new__: function () { var m = MochiKit.Base; +var d = MochiKit.DOM; this.elementPosition = this.getElementPosition; this.elementDimensions = this.getElementDimensions; this.hideElement = m.partial(this.setDisplayForElement, 'none'); -this.showElement = m.partial(this.setDisplayForElement, 'block'); +var self = this; +this.showElement = function(elem) { +elem = d.getElement(elem); +switch(elem.nodeName) { +case 'TABLE': +self.setDisplayForElement('table', elem); +break; +default: +self.setDisplayForElement('block', elem); +break; +} +} + this.EXPORT_TAGS = { ':common': this.EXPORT, ':all': m.concat(this.EXPORT, this.EXPORT_OK) Nigel McNie signature.asc Description: OpenPGP digital signature
[mochikit] Re: [patch] Problems with showElement
On 1/16/07, Nigel McNie [EMAIL PROTECTED] wrote: Hi, While using MochiKit.DOM's showElement function, I have come across some wierd behaviour that I believe is worthy of a fix. showElement always sets the display of the element to show to 'block', regardless of the element's type (it's a partial application of this.setDisplayForElement to 'block'). This is documented. I'm reluctant to include a pile of workarounds as there's a better and more generic solution (that requires a little CSS): http://mochikit.com/doc/html/MochiKit/Style.html#element-visibility -bob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~--~~~~--~~--~--~---
[mochikit] Re: problem with Effect.fade (opacity) in IE7 with scriptaculous, test included
Well, there seems to be a bit of a problem with Mochikit and Scriptaculous, but I can't definitively say what is is, all I can say is the noted problem and solution. Noted problem: scriptaculous library would work fine in IE7 but not Firefox2.0 when loading as such: script type=text/javascript src=app/javascript/mochikit/MochiKit.js/script script type=text/javascript src=app/javascript/prototype.js/script script type=text/javascript src=app/javascript/scriptaculous/scriptaculous.js/script However, loading the mochikit library last worked fine in Firefox, but not IE: script type=text/javascript src=app/javascript/prototype.js/script script type=text/javascript src=app/javascript/scriptaculous/scriptaculous.js/script script type=text/javascript src=app/javascript/mochikit/MochiKit.js/script IE7 needs the first configuration to run properly and Firefox2.0 the second config. Ugh. The reason appears to me to be because of scriptaculous also trying to write out to the document to make references to its own libraries. The solution I found, and I'm not sure why it works! is this load the mochikit.js and prototype libs in the head, and then scriptaculous in the body, as such: head script type=text/javascript src=app/javascript/mochikit/MochiKit.js/script script type=text/javascript src=app/javascript/prototype.js/script /head body onload=init(); script type=text/javascript src=app/javascript/scriptaculous/scriptaculous.js/script ... /body If anyone could shine some more light on why this issues occurs, I would appreciate it. It took me a couple of hours to track this down, so I would like to understand exactly whats going on here... Cheers, Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~--~~~~--~~--~--~---