[Proto-Scripty] Autocompleting text fields (customized)
Hello In the To field when you type the letter 'a', the first item in the drop down list is the Ada Noel, how do I capture the e-mail address, basically I want to set a hidden field in the form with the email address selected. thanks in advance Sridhar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Iframe issue with IE7 (probably 6)
Thomas, Some sample code and HTML would help immensely. +1 for that. Thomas, if you can create a small, self-contained example demonstrating the problem and post it to Pastie[1], I expect folks will be able to help you figure out how to deal with the IE problem. [1] http://pastie.org -- T.J. Crowder tj / crowder software / com On Oct 29, 11:40 pm, Gabriel Gilini [EMAIL PROTECTED] wrote: Thomas, Some sample code and HTML would help immensely. Cheers Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] On Wed, Oct 29, 2008 at 5:37 PM, Matt Foster [EMAIL PROTECTED] wrote: Very strange, not sure if i understand completely. So there is an internal iFrame object that is getting references from its containing document object. When the iframe reloads it no longer has these references? Wouldn't a reload of the iframe force it to retrieve fresh references as everything internal is lost? Does the parent page take an action on the IFrame on its initial load that isn't being taken on the iframe refresh? On Oct 29, 10:43 am, Thomas A [EMAIL PROTECTED] wrote: The reference is the other way round. The Iframe content references for example buttons or divs of the surrounding html page. And if the iframe reloads or changes the page, it tries to rereference these elements but fails on IE. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Document.domainName issue
Hi, i am using prototype js , i have become fan of it after using it extensively, i had one request for you. while communicating in between the same domain from parent to window...i face some problems example: i have abc.pradeep.com in window, inside an iframe i am calling xyz.pradeep.com when i tried to do so...it showed me some security problem, i have used document.domainName = *.pradeep.com and i am able to communicate between this two domainshowever there was issue in opera as it not supports this property, could handle this scenario in the prototype any quick fix if you have ..please do tell me Regards spradeepkumar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Document.domainName issue
Hi, Just to be clear about the question: It sounds like you're familiar with the Same Origin Policy and you're using Document.domainName to deal with it. Are you saying the problem is that Opera doesn't support that and still thinks the SOP is being violated? And you're looking for a suggestion for how Prototype can help you work around that? Just clarifying. Thanks, -- T.J. Crowder tj / crowder software / com On Oct 30, 9:01 am, pradeep [EMAIL PROTECTED] wrote: Hi, i am using prototype js , i have become fan of it after using it extensively, i had one request for you. while communicating in between the same domain from parent to window...i face some problems example: i have abc.pradeep.com in window, inside an iframe i am calling xyz.pradeep.com when i tried to do so...it showed me some security problem, i have used document.domainName = *.pradeep.com and i am able to communicate between this two domainshowever there was issue in opera as it not supports this property, could handle this scenario in the prototype any quick fix if you have ..please do tell me Regards spradeepkumar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] How to extend Element with single public method and few private methods?
Hi, I've never written anything in javascript besides some simple event handlers. I'm trying to write a simple script for ajaxified tabs and I'd like to be able to simply call $('some-id').tabs(); to initialize them - similarly as it works in jQuery plugin. Here's a sample code: Object.extend(Element.Methods, { tabs: function(element, options) { element = $(element); var links = element.select('ul li a'); links.invoke('observe', 'click', function(e) { alert(blah) }); } }); Element.addMethods(); How can I define private methods for tabs function, so that onclick event handler can use this private function, instead of anonymous one? Cheers, Szymek --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Document.domainName issue
Dear crowder, Happy to see a instant support. I am aware of SOP. , i think we can access our sub-domains by putting document.domain = maindomainname : ex: xyz.pradeep.com abs.pradeep.com are my sub domians now at abs.pradeep.com i have an application which i am trying to open from xyz.pradeep.com in an iframe. but for closing the iframe i have to communicate with the parent xyz.pradeep.com so i am using document.domain = pradeep.com and i am able to communicate between the too.. but in opera i am able to do this.. So, it would be nice , if prototype supports any method extending document.domain so that it is supported in all the browsers.. could you please tell me if i am violating the SOP...is the above method of document.domain is supported in all the browsers.. On Thu, 30 Oct 2008 T.J. Crowder [EMAIL PROTECTED] wrote Hi, Just to be clear about the question: It sounds like you're familiar with the Same Origin Policy and you're using Document.domainName to deal with it. Are you saying the problem is that Opera doesn't support that and still thinks the SOP is being violated? And you're looking for a suggestion for how Prototype can help you work around that? Just clarifying. Thanks, -- T.J. Crowder tj / crowder software / com On Oct 30, 9:01 am, pradeep [EMAIL PROTECTED] wrote: Hi, i am using prototype js , i have become fan of it after using it extensively, i had one request for you. while communicating in between the same domain from parent to window...i face some problems example: i have abc.pradeep.com in window, inside an iframe i am calling xyz.pradeep.com when i tried to do so...it showed me some security problem, i have used document.domainName = *.pradeep.com and i am able to communicate between this two domainshowever there was issue in opera as it not supports this property, could handle this scenario in the prototype any quick fix if you have ..please do tell me Regards spradeepkumar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Document.domainName issue
sorry there is a typo in my previous maili am unable to do this in opera ...should be replaced instead of but in opera i am able to do this On Thu, 30 Oct 2008 spradeepkumar [EMAIL PROTECTED] wrote Dear crowder, Happy to see a instant support. I am aware of SOP. , i think we can access our sub-domains by putting document.domain = maindomainname : ex: xyz.pradeep.com abs.pradeep.com are my sub domians now at abs.pradeep.com i have an application which i am trying to open from xyz.pradeep.com in an iframe. but for closing the iframe i have to communicate with the parent xyz.pradeep.com so i am using document.domain = pradeep.com and i am able to communicate between the too.. but in opera i am able to do this.. So, it would be nice , if prototype supports any method extending document.domain so that it is supported in all the browsers.. could you please tell me if i am violating the SOP...is the above method of document.domain is supported in all the browsers.. On Thu, 30 Oct 2008 T.J. Crowder [EMAIL PROTECTED] wrote Hi, Just to be clear about the question: It sounds like you're familiar with the Same Origin Policy and you're using Document.domainName to deal with it. Are you saying the problem is that Opera doesn't support that and still thinks the SOP is being violated? And you're looking for a suggestion for how Prototype can help you work around that? Just clarifying. Thanks, -- T.J. Crowder tj / crowder software / com On Oct 30, 9:01 am, pradeep [EMAIL PROTECTED] wrote: Hi, i am using prototype js , i have become fan of it after using it extensively, i had one request for you. while communicating in between the same domain from parent to window...i face some problems example: i have abc.pradeep.com in window, inside an iframe i am calling xyz.pradeep.com when i tried to do so...it showed me some security problem, i have used document.domainName = *.pradeep.com and i am able to communicate between this two domainshowever there was issue in opera as it not supports this property, could handle this scenario in the prototype any quick fix if you have ..please do tell me Regards spradeepkumar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Autocompleting text fields (customized)
[I hate top-posting, but that seems to the the norm here] Use 'informal' [1] Make your ajax call return lispan class='informal'Ada Noel/spanspan class='hide'[EMAIL PROTECTED]/span/li etc. Then have a CSS rule span.hide {display:none} The CSS will ensure that only the name is displayed to the user, but the Ajax.Autocomplete takes only the text which is NOT in a span with class 'informal', and so will take only the email address. Colin [1]: http://github.com/madrobby/scriptaculous/wikis/ajax-autocompleter, section 'Server return' On Oct 30, 6:41 am, srid [EMAIL PROTECTED] wrote: Hello In the To field when you type the letter 'a', the first item in the drop down list is the Ada Noel, how do I capture the e-mail address, basically I want to set a hidden field in the form with the email address selected. thanks in advance Sridhar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Stopping page from moving back to top
Thanks so much it worked like a charm :) On Mon, Oct 27, 2008 at 7:55 PM, Gabriel Gilini [EMAIL PROTECTED]wrote: Place this inside anFunction: evt.stop(); it stops the default behavior of the current event, which in your case is following a link. ps: shouldn't it be called aFunction? :) Cheers, Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] On Mon, Oct 27, 2008 at 2:47 PM, jason maina [EMAIL PROTECTED]wrote: That one is not working also producing error... On Mon, Oct 27, 2008 at 7:42 PM, Brian Williams [EMAIL PROTECTED]wrote: try javascript:void(); in place of javascript:return false; On Mon, Oct 27, 2008 at 12:22 PM, jason maina [EMAIL PROTECTED]wrote: Hi all, Im having this page with tabs in another page but added through php. Thing is when I click on a tab and the page was like halfway it scrolls to the top I know it is connected to the hashes in the href bit but dont know how to tweak it to stop from this behaviour. Tried remedying with replacing it(#) with javascript:return false; but it generates an error though it doesnt scroll. Here is my code: http://pastie.org/301494 on the page the code is like : ul id=tablist lia href=# id=tb1 class=Race 1/a/li lia href=# id=tb2 class=Race 2/a/li lia href=# id=tb3 class=Race 3/a/li /ul Kind regards Jason --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] mouseover/mouseout events firing off of childern elements.
I have taken a look at a few other threads and noticed that someone posted a bubbledFromChild function. This function isn't working for me and I'm not sure how to get around this issue. I'm attempting to overlay a div over another div which contains a few elements. The problem is that the mouseout even is firing when I move from the container div to any of it's child elements. I have tried the following to fix this problem. 1.) Use a bubbledFromChild event. 2.) Writing mouseover events for all child elements of the div that triggers the overlay. Thanks in advance. --- div style=float:left; div style=border:solid 1px black; width:300px; float:left; clear:both; a class=blarg href=# style=display:block; width:100%; img src=someimage.jpg / br / spanblah blah blah/span /a div style=float:left; left /div div style=float:right right /div /div div style=border:solid 1px black; width:300px; float:left; clear:both; div class=blarg href=# img src=someimage.jpg / br / spanblah blah blah/span /div div style=float:left; left /div div style=float:right right /div /div div style=border:solid 1px black; width:300px; div class=blarg img src=someimage.jpg / br / spanblah blah blah/span /div div style=float:left; left /div div style=float:right right /div /div /div script type=text/javascript var elements = $$('.blarg'); for(var i = 0; ielements.length; i++){ elements[i].observe('mouseover', function(event){ if(!bubbledEvent(event.element(),this) $ (this.identify() + '-overlay') == null){ this.setStyle({border: 'solid 1px black'}); var rolloverElem = new Element('div', {id:this.identify() + '-overlay'}); rolloverElem.setStyle({ height:'18px' , position: 'relative', top:'0px', left:'0px', opacity: '0.5', border:'solid 1px green', display:'block', backgroundColor:'Blue' }); this.insert({bottom: rolloverElem}); } }.bindAsEventListener(elements[i])); elements[i].observe('mouseout', function(event){ this.setStyle({border: 'none 0px white'}); $(this.identify() + '-overlay').remove(); alert('called 1'); }.bind(elements[i])); elements[i].descendants().each(function(e){ e.observe('mouseout', function(event){alert('called');}); }); } function bubbledEvent(element, parent){ var elems = parent.descendants(); boolReturn = false; for(var j=0; jelems.length; j++) { if(element == elems[j]) boolReturn = true; } return boolReturn; } /script --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Event.observe working in Firefox but not IE6-7
Thanks kangax, I tried renaming the names as you suggested but it's still the same thing. In Firefox it works, in IE it doesn't. If I change the following line: Event.observe('events', 'change', function (e) { To observe one of the input elements instead Event.observe('event1', 'change', function (e) { It works in both IE and Firefox. Upon some further reading I found from this document: http://www.w3.org/TR/DOM-Level-2-Events/events.html That it looks like change isn't valid for ol elements. So shame on Firefox I guess? I'll try observing the form and update the event details when it's submitted, hopefully that will work. On Oct 29, 5:16 pm, kangax [EMAIL PROTECTED] wrote: On Oct 29, 4:01 pm, Dave [EMAIL PROTECTED] wrote: As the subject says I have the follow js: Event.observe('events', 'change', function (e) { new Ajax.Updater('event_details', 'URL', { method: 'post', parameters: 'event=' + e.element().id.gsub('event', '') });}); This is working inFirefoxbut notIE. I'm kind of at a loss as to why it's not working. Taking a guess, maybe it has something to do with whatIEconsiders a change to the ol #events: ol id=events liinput id=event1 type=radio name=event value=Event1 / label for=event1Event1/label/li liinput id=event2 type=radio name=event value=Event2 / event is a pretty dangerous name to choose [1] : ) Browsers happen to do quite stupid things with named controls - e.g. shadowing same-named global variables. In this case,IE'sglobal `event` (which actually referenceseventobject wheneventoccurs) is most likely shadowed with this input element. This means that `e' is resolved to an element (rather than aneventobject) and so everything sort of messes up. Try to namespace those names - e.g. use something like foo-uname, foo-password, etc. and see if the problem still exists. [snip] [1]http://jibbering.com/faq/names/ -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: evalJSON with array data
I was using the wrong brackets.() not [] Working fine now. Thanks for your help. On Oct 30, 3:09 pm, T.J. Crowder [EMAIL PROTECTED] wrote: Hi, var arrpeople = transport.responseText.evalJSON(true); alert(arrpeople.name); //this line doesn't fail but It returns 'Undefined' You're getting back an array, right? Just because it only has one entry, doesn't make it less of an array. So you have to index into it for the record you want. alert(arrpeople[0].name); HTH, -- T.J. Crowder tj / crowder software / com On Oct 29, 5:02 pm, gedm [EMAIL PROTECTED] wrote: Hi, I'm new to JSON and prototype so you may need to dumb it down a bit for me. I am using the JSON for ASP code to return a recordset in JSON format. It is only returning one record, which is correct for the query I am running, but the JSON for ASP class is putting the [ ] at each end of the data resulting in an array of data with 1 member. How can I pass this via evalJSON in prototype. I want to retrieve the values of the JSON data and fill some form fields but can't figure out how to access the array. That is: data as follows [ {name:John,surname:Smith}] how do I access the name and the surname? var arrpeople = transport.responseText.evalJSON(true); alert(arrpeople.name); //this line doesn't fail but It returns 'Undefined' Firebug shows the evalJSON has worked because I can drill down into arrpeople... 0... name and it shows John. What is the correct syntax to show arrpeople(0).name ? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How to extend Element with single public method and few private methods?
On Oct 30, 9:24 am, darrinholst [EMAIL PROTECTED] wrote: How can I define private methods for tabs function, so that onclick event handler can use this private function, instead of anonymous one? Is this what you're looking for? Object.extend(Element.Methods, { tabs: function(element, options){ var saySomething = function() { alert(blah); } I wouldn't recommend this. Instead of creating a function object every time `tabs' method is called, it would make more sense to declare a function outside of the `tabs' body, but in such way that its body would have helper function in its scope: Element.addMethods({ tabs: (function() { function private() { }; return function() { // use `private' function here }; })(); }); or structured differently (if that makes things clearer): (function(){ function private(){}; Element.addMethods({ tabs: function(){ // use `private' function here } }) })(); [snip] -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: IE issue when with 'new Element' : expected identifier, string or number
Hi, Just put 'class' in quotes, it's a reserved word in JScript. The example in the docs[1] has it in quotes for that reason, I suspect. [1] http://www.prototypejs.org/api/element HTH, -- T.J. Crowder tj / crowder software / com On Oct 30, 3:49 pm, Brandon [EMAIL PROTECTED] wrote: Internet Explorer throws 'expected identifier, string or number' when it loads a JS script that contains a new Element statement, like this: new_song_info_div = new Element('div', {class : 'song_info'}); It took me a while to figure out this was the issue too, because the script debugger that comes with Windows kept crashing when it caught an exception. Real nice. Eventually I got the debugger to behave though. It seems that something is out of scope between my JS file and prototype. This works as expected in other browsers. Damn You IE Maybe it should be called AYE-EE. Has anyone else shared this frustration, and if so how did you fix it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: New Script.aculo.us combination effect: Wipe (beta)
On Oct 29, 12:50 pm, Diodeus [EMAIL PROTECTED] wrote: After being annoyed by a Flash-based solution for the same functionality, I decided to write a wipe effect for Scriptaculous. It's in beta, and not quite ready for release. new Effect.Wipe('content',{'newImg':'Images/Wipe3.jpg',duration: 2,mode:'vSplit'}) Modes: Vertical split Horizontal split Wipe right Wipe left Wipe up Wipe down Page Flip Panels I'm looking for some feedback and (hopefully not) some bug reports. Demo:http://jameslab.moveable.com/wipe/ Nice, but how come there are no vertical Panels? -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] script.aculo.us syntax ??
Hi all, currently i am learning script.aculo.us.. and i have some question on a bit of syntax here.. //css #box { width: 300px; height: 300px; position: relative; background-color: #ddd; } //html div id=box/div //js script new Effect.Morph('box', {style:left: 50px; top: 50px;,duration: 1.0}); new Effect.Move('box', { x: 50, y: 50 }); new Effect.Scale('box', 150); all the above works $('box').morph({top: 125px, left: 150px}, { duration: 1.0 }); ###//this is working the one below does not work?? why.. $('box').move({top: 125px, left: 150px}); $('box')..scale(150); could any one explain to me?.. thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: script.aculo.us syntax ??
edit $('box')..scale(150); TO $('box').scale(150); and addition this... //not working too $('box').move({x: 125px, y: 150px}); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] IE issue when with 'new Element' : expected identifier, string or number
Internet Explorer throws 'expected identifier, string or number' when it loads a JS script that contains a new Element statement, like this: new_song_info_div = new Element('div', {class : 'song_info'}); It took me a while to figure out this was the issue too, because the script debugger that comes with Windows kept crashing when it caught an exception. Real nice. Eventually I got the debugger to behave though. It seems that something is out of scope between my JS file and prototype. This works as expected in other browsers. Damn You IE Maybe it should be called AYE-EE. Has anyone else shared this frustration, and if so how did you fix it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Event.observe working in Firefox but not IE6-7
On Oct 30, 11:32 am, Dave [EMAIL PROTECTED] wrote: Thanks kangax, I tried renaming the names as you suggested but it's still the same thing. In Firefox it works, in IE it doesn't. If I change the following line: Event.observe('events', 'change', function (e) { To observe one of the input elements instead Event.observe('event1', 'change', function (e) { It works in both IE and Firefox. Upon some further reading I found from this document: http://www.w3.org/TR/DOM-Level-2-Events/events.html That it looks like change isn't valid for ol elements. So shame on Firefox I guess? I'll try observing the form and update the event details when it's submitted, hopefully that will work. Well, change event is only valid for INPUT, SELECT, and TEXTAREA elements. It should also bubble (probably that's why it's caught on OL element). I'm not sure why IE doesn't like this. [snip] -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Effect.grow in a fixed height div
I'm using Effect.grow() to expand table rows in a fixed height div. In Firefox, the div overflows properly and everything is fine. In IE7, the all of the records grow past the bottom of the div momentarily, then disappear behind the div. This brief flash before the recovery looks unprofessional. The element that is growing is a div nested inside a td. In the Scriptaculous api is the following warning: Works safely with most Block Elements, except tables. Is the fact that the div is nested in a table structure contributing to this problem? I would welcome any advice from others who have experienced this problem. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: script.aculo.us syntax ??
Try changing the way you position your element: #box { width: 300px; height: 300px; position: absolute; background-color: #ddd; } div style='position:relative'div id=box/div/div --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Effect.grow in a fixed height div
I think the problem is how tables are rendered, not because of the DIV itself. They seem to wait until the rest of the page has rendered before sizing themselves. You can really see it happen in this example: table border=1 tr td width=50%nbsp;/td tdnbsp;/td /tr tr tdnbsp;div style='display:none' id='xx'pLorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse at felis. Etiam ullamcorper. Aenean fringilla, eros eu dapibus tristique, erat lacus vestibulum metus, nec pharetra leo ante et quam. Nunc ac mi molestie justo placerat laoreet. Morbi eget dolor. Curabitur pretium, mi quis iaculis molestie, dolor ligula sagittis orci, at sodales quam dolor quis sem. Suspendisse vitae risus./p/div/td tdnbsp;/td /tr /table script type=text/javascript new Effect.Grow('xx',{delay:1.0,duration:5.0}) /script On Oct 30, 12:44 pm, James [EMAIL PROTECTED] wrote: I'm using Effect.grow() to expand table rows in a fixed height div. In Firefox, the div overflows properly and everything is fine. In IE7, the all of the records grow past the bottom of the div momentarily, then disappear behind the div. This brief flash before the recovery looks unprofessional. The element that is growing is a div nested inside a td. In the Scriptaculous api is the following warning: Works safely with most Block Elements, except tables. Is the fact that the div is nested in a table structure contributing to this problem? I would welcome any advice from others who have experienced this problem. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: IE issue when with 'new Element' : expected identifier, string or number
Thanks was it. Thanks for the help. Though a slew of new IE issues are popping up now, fun fun!. So it's probably a good and safe practice to quote all the element property names, right? On Thu, Oct 30, 2008 at 12:02 PM, T.J. Crowder [EMAIL PROTECTED]wrote: Hi, Just put 'class' in quotes, it's a reserved word in JScript. The example in the docs[1] has it in quotes for that reason, I suspect. [1] http://www.prototypejs.org/api/element HTH, -- T.J. Crowder tj / crowder software / com On Oct 30, 3:49 pm, Brandon [EMAIL PROTECTED] wrote: Internet Explorer throws 'expected identifier, string or number' when it loads a JS script that contains a new Element statement, like this: new_song_info_div = new Element('div', {class : 'song_info'}); It took me a while to figure out this was the issue too, because the script debugger that comes with Windows kept crashing when it caught an exception. Real nice. Eventually I got the debugger to behave though. It seems that something is out of scope between my JS file and prototype. This works as expected in other browsers. Damn You IE Maybe it should be called AYE-EE. Has anyone else shared this frustration, and if so how did you fix it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: New Script.aculo.us combination effect: Wipe (beta)
Good idea. I'll add that in. Thanks. On Oct 30, 12:05 pm, kangax [EMAIL PROTECTED] wrote: On Oct 29, 12:50 pm, Diodeus [EMAIL PROTECTED] wrote: After being annoyed by a Flash-based solution for the same functionality, I decided to write a wipe effect for Scriptaculous. It's in beta, and not quite ready for release. new Effect.Wipe('content',{'newImg':'Images/Wipe3.jpg',duration: 2,mode:'vSplit'}) Modes: Vertical split Horizontal split Wipe right Wipe left Wipe up Wipe down Page Flip Panels I'm looking for some feedback and (hopefully not) some bug reports. Demo:http://jameslab.moveable.com/wipe/ Nice, but how come there are no vertical Panels? -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Element.update()
HELP! This is the first time I have my script working for IE but not for Firefox. I have a 3 drop downs. The first dropdown dictates what will be shown on the second. And second drop down dictates the third. I use Ajax.Request() to get the drop down values from database. onSuccess, I call the function below: function updateList2(list){ var selectList = $('list2'); selectList.update(); var newOption = new Element('option',{innerHTML:'-- Select One --',value:''}); selectList.insert({bottom:newOption}); if (list){ list.each(function(item){ var newOption = new Element('option', {innerHTML:item.nm,value:item.id}); selectList.insert({bottom:newOption}); }); } } Works fine in IE, but when Firefox will not insert the new options into the list! Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Simple, unobtrusive way to open all links marked external
Hi guys, I'm learning the prototype library after coming from jQuery, and I'm trying to write a simple snippet that opens external links in a new window. This doesn't seem to work in Firefox, or Safari, and I'm not sure what I'm doing wrong here, I'm sure it's something really obvious, but I've been staring at this code for so long now that I've effecitvely gone snow blind. Can anyone help? I'm using prototype 1.6.0.1, and I'm on a mac. // goal - select all external links and onclick, open that link in a new window, in an unobtrusive manner var openNewWindow = function(element) { element.observe('click', function() {window.open(element.href);} ); }; // begin constructing regexp that makes any url with the host domain in it, and with the optional www prefix var internalUrl = / + (www)? + document.location.hostname + /; // turn string into regexp to match against var pattern = eval(internalUrl); // reject all links whose href matches the host domain regexp defined above filteredResult = result.reject(function(e) { return e.href.match(pattern); }); add onclick handler each member of the array of remaining links filteredResult.invoke('openNewWindow'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable.create Issue with IE6 7
I'm using a pretty basic example that works just find in FireFox but does not work in IE 6 or 7. Have a look at this sample (not mine, but is what I used to create my code and I get the exact same problem): http://www.gregphoto.net/sortable/advanced/ If you take, say 3 items and drag them into Group 2, then take another from Group 1 and this time place it directly over one of the items (without it trying to snap anywhere) and let it go, you'll see that the list does not refresh. You will notice at the bottom, that space was created for the new item, but it doesn't appear. Now, if you grab the Group 2 heading and start to move it, you'll see the contents re-display properly. Does anyone have any ideas what is causing this in IE? Is there a CSS setting required somewhere or something? Is there something I should be doing in the onUpdate callback? Thanks Paul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Display:none causes script.aculo.us sliders to initialize incorrectly!
I've developed a set of sliders using script.aculo.us that allows my users to rate content. The sliders work perfectly. However, I'd like set the sliders to be hidden by default and to only appear when the user clicks a button. So I set the div that contains all the sliders to display:none. I did this within the HTML (not in the CSS). Now, when the user clicks the button that removes the display:none property, the sliders appear, but they do not function! I am unable to move the handles, and the handles are not located in the places they are supposed to be. I am stumped by how to fix this. I don't understand how just adding display:none to the sliders container div would cause them to initialize incorrectly. Can anyone help me with this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Element.update()
Well, first of all, try quoting your hash keys like this: list.each(function(item){ var newOption = new Element('option', {'innerHTML':item.nm,'value':item.id}); selectList.insert({bottom:newOption}); }); If it still doesn't work, try using firebug's[1] console and debug to see any exception the script might be throwing. [1] www.getfirebug.com Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] On Thu, Oct 30, 2008 at 5:30 PM, cyiam [EMAIL PROTECTED] wrote: HELP! This is the first time I have my script working for IE but not for Firefox. I have a 3 drop downs. The first dropdown dictates what will be shown on the second. And second drop down dictates the third. I use Ajax.Request() to get the drop down values from database. onSuccess, I call the function below: function updateList2(list){ var selectList = $('list2'); selectList.update(); var newOption = new Element('option',{innerHTML:'-- Select One --',value:''}); selectList.insert({bottom:newOption}); if (list){ list.each(function(item){ var newOption = new Element('option', {innerHTML:item.nm,value:item.id}); selectList.insert({bottom:newOption}); }); } } Works fine in IE, but when Firefox will not insert the new options into the list! Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Simple, unobtrusive way to open all links marked external
What's the error that the script's throwing? Also, are the elements in the result enum already extended[1]? If not, switch element.observ to $(element).observe. [1] http://prototypejs.org/learn/extensions Cheers Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] On Thu, Oct 30, 2008 at 5:07 PM, [EMAIL PROTECTED] [EMAIL PROTECTED]wrote: Hi guys, I'm learning the prototype library after coming from jQuery, and I'm trying to write a simple snippet that opens external links in a new window. This doesn't seem to work in Firefox, or Safari, and I'm not sure what I'm doing wrong here, I'm sure it's something really obvious, but I've been staring at this code for so long now that I've effecitvely gone snow blind. Can anyone help? I'm using prototype 1.6.0.1, and I'm on a mac. // goal - select all external links and onclick, open that link in a new window, in an unobtrusive manner var openNewWindow = function(element) { element.observe('click', function() {window.open(element.href);} ); }; // begin constructing regexp that makes any url with the host domain in it, and with the optional www prefix var internalUrl = / + (www)? + document.location.hostname + /; // turn string into regexp to match against var pattern = eval(internalUrl); // reject all links whose href matches the host domain regexp defined above filteredResult = result.reject(function(e) { return e.href.match(pattern); }); add onclick handler each member of the array of remaining links filteredResult.invoke('openNewWindow'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Ajax.Updater appears to drop plus signs
On Oct 30, 2008, at 5:56 PM, rev_robert wrote: I put the window.alert in the function to see if opt.postBody had the plus (+) signs in it before the call to Ajax.Updater, which it did. This is worrisome. Is there some documentation on which characters Ajax.updater will pass through and whch ones it will drop? I suspect that the + characters are being interpreted as url-encoded spaces. You might want to look over your code and see if you can avoid manually serializing your form contents. It looks like you're working way too hard here: postBody: 'ID=' + aForm.ID.value + 'Name=' + aForm.Name.value + 'Description=' + aForm.Description.value + 'Tracking_Type_ID=' + aForm.Tracking_Type_ID.value + 'Script=' + aForm.Script.value + 'CSS=' + aForm.CSS.value + 'Generation_Code=' + aForm.Generation_Code.value , This could just be postBody: aForm.serialize(), Or maybe even simpler, use aForm.request() to replace nearly everything else in your function. Have a look through the docs for more insight. Walter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Strange .update Error?
Well, that's weird. It could be a bug, you should probably fill a ticket with some sample code and a copy of the error message at Lighthouse[1]. [1] http://prototype.lighthouseapp.com/projects/8886-prototype Cheers Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] On Thu, Oct 30, 2008 at 8:24 PM, cyiam [EMAIL PROTECTED] wrote: I couldn't get update to work correctly, so I ended up clearing the element out, then do an Element.insert. On Oct 30, 4:20 pm, Jonathan Rosenberg [EMAIL PROTECTED] wrote: I'm having what I think is a weird problem with .update on IE. This statement fails: this._question.update(divYou/div) but this works this._question.update(spanYou/span) It fails in the prototype.js code, but only on IE. Any thoughts? -- Jonathan Rosenberg Founder Executive Director, Tabby's Placehttp://www.tabbysplace.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Autocompleting text fields (customized)
Hi Colin, Really appreciate your input. Sorry, I should've been more crisper with my requirement. Let me try to do that: When the user types in 'a', I still like the display of the drop down list with contact name and email address one below the other. When I select a contact from the list, I still need the contact name Ada Noel to be displayed in the text field to the user. At the same time, I also need the email address [EMAIL PROTECTED] to be set in a hidden text field inside the same form. Hope I got it clear this time around. Thanks Sridhar On Thu, Oct 30, 2008 at 4:52 AM, ColinFine [EMAIL PROTECTED] wrote: [I hate top-posting, but that seems to the the norm here] Use 'informal' [1] Make your ajax call return lispan class='informal'Ada Noel/spanspan class='hide'[EMAIL PROTECTED]/span/li etc. Then have a CSS rule span.hide {display:none} The CSS will ensure that only the name is displayed to the user, but the Ajax.Autocomplete takes only the text which is NOT in a span with class 'informal', and so will take only the email address. Colin [1]: http://github.com/madrobby/scriptaculous/wikis/ajax-autocompleter, section 'Server return' On Oct 30, 6:41 am, srid [EMAIL PROTECTED] wrote: Hello In the To field when you type the letter 'a', the first item in the drop down list is the Ada Noel, how do I capture the e-mail address, basically I want to set a hidden field in the form with the email address selected. thanks in advance Sridhar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: curry Misunderstanding?
On Oct 30, 2:30 am, T.J. Crowder [EMAIL PROTECTED] wrote: The lost context is easily fixed: sendState(email, $F('save-comments'), sph.fire.bind(sph).curry(doneEvent)); bind() accepts additional parameters for the function, so you don't need the curry: sendState( email, $F('save-comments'), sph.fire.bind(sph, doneEvent) ); curry is really just bind without the context param. Good catch : ) I'd suggest to simply pass a function as in your first example: sendState(email, $F('save-comments'), function() { sph.fire(doneEvent) }); Yes, it's definitely clearer. The only thing would be if there's a lot of data referenced in the context where this is occurring that he's trying to avoid involving in a closure. One of the great things about bind and curry is that they help you avoid creating closures when you don't want to. :-) Interesting. There are usually so many closures created (specially in larger applications), that I have never considered minimizing their presence. Have you, by any chance, done any memory tests on this, T.J.? -- T.J. Crowder tj / crowder software / com [snip] -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Effect.toggle slide doesn't work well with unordered/ordered list elements
Hi, I was inspired by http://www.exit404.com/2005/57/unobtrusive-persistant-scriptaculous-effects to create a menu that would expand and contract the menu whenever I click on the menu header. Instead of using Effect.BlindDown and Effect.BlindUp, I decided to use Effect.toggle to toggle the unordered list when I click on the menu header. I decided to use the slide effect for Effect.toggle, but found that it is buggy in FF3, IE7, Safari3 and works as it should in Opera9. It seems that adding Effect.toggle to ul is problematic. You can check out my result at http://icecreamcola.com/test/jsMenu.html or take a look at some code below: [html] div class=menu h3 id=menu-headRECENTLY/h3 ul id=menu-body liMenu List 1/li liMenu List 2/li liMenu List 3/li liMenu List 4/li liMenu List 5/li liMenu List 6/li liMenu List 7/li liMenu List 8/li /ul /div [/html] [script] function toggleMenu() { if ($('menu-head').getStyle('background-image').include('img/ sidebarh3bg.jpg') $('menu-head').getStyle('background- position')=='0px 0px') { Effect.toggle('menu-body', 'slide', {duration: 0.5}); Element.setStyle.delay(0.5, $('menu-head'), {background:'url(img/ sidebarh3bg.jpg) no-repeat -165px 0px', cursor:'pointer'}); } else { Effect.toggle('menu-body', 'slide', {duration: 0.5}); Element.setStyle.delay(0.5, $('menu-head'), {background:'url(img/ sidebarh3bg.jpg) no-repeat 0px 0px', cursor:'pointer'}); } } [/script] - Paul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---