[Proto-Scripty] Prototype and Galleria.js
Greetings, I'm still new at this, but here is my problem. I'm currently using prototype and script.aculo.us for animations on my a website. I want to use galleria.js for an image gallery, but i can't seem to get them to cooperate. I've used jQuery.noConflict(); and my animations run, but none of the galleria code wants to work. I looked around and all I could find was was information about protosafe.js, but nothing else. Has anyone here been able to get galleria.js to work with prototype and script.aculo.us? Thank you very much. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Prototype and Galleria.js
try assigning jquery to a new variable.. $j=jQuery.noConflict(); Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Mike Santini dwarfthem...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Tuesday, January 12, 2010 6:26 AM Subject: [Proto-Scripty] Prototype and Galleria.js Greetings, I'm still new at this, but here is my problem. I'm currently using prototype and script.aculo.us for animations on my a website. I want to use galleria.js for an image gallery, but i can't seem to get them to cooperate. I've used jQuery.noConflict(); and my animations run, but none of the galleria code wants to work. I looked around and all I could find was was information about protosafe.js, but nothing else. Has anyone here been able to get galleria.js to work with prototype and script.aculo.us? Thank you very much. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: problem with iterating
Hi, On Jan 11, 4:42 pm, shellster shellsterd...@gmail.com wrote: Also here's the prototype page that deals with the for...in construct:http://www.prototypejs.org/api/array That's the old API stuff; the latest copy is here: http://api.prototypejs.org/language/array.html (The old stuff is still up because in places it's still more complete than the new and easier to link to; the Prototype guys are working on it...) -- T.J. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Change variable value outside onSuccess
Hi, My answer to another recent thread should help: http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/bc28002a8ab0d784/97894151c66abe79#97894151c66abe79 HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Jan 6, 7:08 pm, Ian Raphael list...@gmail.com wrote: Hello everybody. I'm starting to use prototype framework and i'm having a problem. I have an ajax javascript function that checks if the user is logged. This function uses coldfusion's native ajax. The code function userLogged(){ var $userLogin = new objUser(); //objUser is a coldfusion component var result = $userLogin.getUserLoginStatus(); //getUserLoginStatus is a method return result; } function checkLogged(){ var logged = userLogged(); if(logged == true) alert('logged'); else alert('not logged'); } But i need to replace this to one written with prototype. I tried the code down (the return of cfm script is a JSON). function userLogged(){ var logged = false; new Ajax.Request('/includes/GetUserLoginStatus.cfm', { method: 'get', onSuccess: function(r) { var response = r.responseText.evalJSON(); var logged = response.STATUS; } }); return logged; } When i call this function the return always false. Obviously because onsuccess create another function and it doesn't change the value of external variable. I'm asking for you guys if there's some way to change the value of variable logged based on the return of the ajax call? Or there's a way inside onSuccess to return the response to the caller function? Thanks for the attention and sorry for my english. Regards, Ian -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: Event.element
T.J. Crowder wrote: Hi, On Jan 11, 2:03 pm, bill will...@techservsys.com wrote: Also note that if you know the element will have an ID, or if you don't care if it doesn't, you can just use the `id` property. [snip] I know the divs will have IDs, so how would I write it to just use the id property ? It's just a property of the element instance: var elm, id; elm = event.findElement(); if (elm) { id = elm.id; } I'm probably being too conservative there; I can't immediately imagine #findElement ever returning undefined if you give it no arguments -- *something* fired the event. :-) HTH, -- T.J. Thanks T.J. -- Bill Drescher william {at} TechServSys {dot} com -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] An other Ajax.getTransport...
Hello, This is my first post, and i don't speak easily english. I update prototype.js to optimize Ajax.getTransport (line 1313) : Original code : var Ajax = { getTransport: function() { return Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0 }; My modifications : I fix the handler to obtain an XHR ... var XHR=false; var Ajax = { getTransport:false, activeRequestCount: 0, FixeXHR:function() { var xhr1 = function() { try{ return new XMLHttpRequest(); } catch (e) {}; return false; } var xhr2 = function() { try{return new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) {}; return false; } var xhr3 = function() { try{return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {}; return false; } function FixeXHR() { if (xhr3()) { XHR=xhr3; return;} if (xhr1()) { XHR=xhr1; return;} if (xhr2()) { XHR=xhr2; return;} } FixeXHR(); this.getTransport=XHR; } }; What did you think about ? I use it with javascript alert, and it work for me ... Thanks for all. AS. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: An other Ajax.getTransport...
The working code is : var XHR=false; var Ajax = { getTransport:false, activeRequestCount: 0, FixeXHR:function() { var xhr1 = function() { try{ return new XMLHttpRequest (); } catch (e) {}; return false; } var xhr2 = function() { try{return new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) {}; return false; } var xhr3 = function() { try{return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {}; return false; } function FixeXHR() { if (xhr3()) { XHR=xhr3; return;} if (xhr1()) { XHR=xhr1; return;} if (xhr2()) { XHR=xhr2; return;} } FixeXHR(); this.getTransport=XHR; } }; Ajax.FixeXHR(); Ajax.FixeXHR=null; XHR=null; Sorry ...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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: An other Ajax.getTransport...
Hi, I'm a bit surprised that it's still that way in 1.6.1, truthfully, because that's no longer in keeping with what I understand to be the standards for Prototype, which I believe include (amongst other things) doing this sort of feature detection once rather than repeatedly (as in your suggestion), and doing it with clearly named functions, etc. More verbose, but more easily maintained. The core team are completely rewriting the Ajax stuff for 2.0 (1.7?), so I'd expect this would change then anyway. I think they'll probably do something more like this (but I'm sure I'm not quite keeping to all of their standards here): http://pastie.org/774819 ...but it will depend on what else they're doing. (That assumes a hypothetical `Prototype.chooseWorking` function that does what `Try.these` does, but returns the function rather than its result, and returns undefined if none of the functions succeeds.) FWIW, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Jan 12, 1:16 pm, Saadi AYATA ayatasa...@gmail.com wrote: Hello, This is my first post, and i don't speak easily english. I update prototype.js to optimize Ajax.getTransport (line 1313) : Original code : var Ajax = { getTransport: function() { return Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0}; My modifications : I fix the handler to obtain an XHR ... var XHR=false; var Ajax = { getTransport:false, activeRequestCount: 0, FixeXHR:function() { var xhr1 = function() { try{ return new XMLHttpRequest(); } catch (e) {}; return false; } var xhr2 = function() { try{ return new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) {}; return false; } var xhr3 = function() { try{ return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {}; return false; } function FixeXHR() { if (xhr3()) { XHR=xhr3; return;} if (xhr1()) { XHR=xhr1; return;} if (xhr2()) { XHR=xhr2; return;} } FixeXHR(); this.getTransport=XHR; } }; What did you think about ? I use it with javascript alert, and it work for me ... Thanks for all. AS. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: An other Ajax.getTransport...
Hi, Thanks for your comments, i think the detection is needed to use with among of requester... I optimize my code : var Ajax = { getTransport:false, activeRequestCount: 0, FixeXHR:function() { var xhr1 = function() { try{ return new XMLHttpRequest(); } catch (e) {}; return false; } var xhr2 = function() { try{return new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) {}; return false; } var xhr3 = function() { try{return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {}; return false; } if (xhr3()) { this.getTransport=xhr3; return;} if (xhr2()) { this.getTransport=xhr2; return;} if (xhr1()) { this.getTransport=xhr1; return;} } }; Ajax.FixeXHR(); Ajax.FixeXHR=null; - After the execution, all functions are free for the GC! And, my code is a just a little more verbose, lol. Why externalize the feature detection ? Where can i read the standarts for prototype? If the core team want to use my code, they can. I see http://pastie.org/774819 And, the code is clear. This is the new version ? Thanks? AS. On 12 jan, 15:01, T.J. Crowder t...@crowdersoftware.com wrote: Hi, I'm a bit surprised that it's still that way in 1.6.1, truthfully, because that's no longer in keeping with what I understand to be the standards for Prototype, which I believe include (amongst other things) doing this sort of feature detection once rather than repeatedly (as in your suggestion), and doing it with clearly named functions, etc. More verbose, but more easily maintained. The core team are completely rewriting the Ajax stuff for 2.0 (1.7?), so I'd expect this would change then anyway. I think they'll probably do something more like this (but I'm sure I'm not quite keeping to all of their standards here):http://pastie.org/774819 ...but it will depend on what else they're doing. (That assumes a hypothetical `Prototype.chooseWorking` function that does what `Try.these` does, but returns the function rather than its result, and returns undefined if none of the functions succeeds.) FWIW, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Jan 12, 1:16 pm, Saadi AYATA ayatasa...@gmail.com wrote: Hello, This is my first post, and i don't speak easily english. I update prototype.js to optimize Ajax.getTransport (line 1313) : Original code : var Ajax = { getTransport: function() { return Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0}; My modifications : I fix the handler to obtain an XHR ... var XHR=false; var Ajax = { getTransport:false, activeRequestCount: 0, FixeXHR:function() { var xhr1 = function() { try{ return new XMLHttpRequest(); } catch (e) {}; return false; } var xhr2 = function() { try{ return new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) {}; return false; } var xhr3 = function() { try{ return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {}; return false; } function FixeXHR() { if (xhr3()) { XHR=xhr3; return;} if (xhr1()) { XHR=xhr1; return;} if (xhr2()) { XHR=xhr2; return;} } FixeXHR(); this.getTransport=XHR; } }; What did you think about ? I use it with javascript alert, and it work for me ... Thanks for all. AS. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Ajax Issue
I use instead of amp;, but I don't know why you can't see it here. For you Cowder, that I wanted a Ajax Request like that, I would use it. I want something else. As in my code, I want to create a one function for all ajax requests. So, I just call that function, and in it I define callback function, url. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: AsyncExecutioner
Feel free to post questions or comments here as I disabled them on the actual article. I think this is a valuable plugin for Prototype, it certainly isn't a common use case but there are instances where data gets too big to handle in one shot. On Jan 11, 9:51 am, Matt Foster mattfoste...@gmail.com wrote: Hey Everyone, I've completed work on a new Prototype plugin to handle massive datasets elegantly and avoid the dreaded Stop Script dialog. It uses a chunking algorithm to split up the dataset into small pieces, and then loop over those using chained setTimeout executions to allow a break in execution in order for regular UI processing to be handled, such as scrolling or selecting text. It can be extremely useful for less than pertinent processing that can be carried on in the background. http://positionabsolute.net/blog/2010/01/asynchronous-execution.php Regards, Matt -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: An other Ajax.getTransport...
Hi, You can put out try/catch bloc by using this code : (prototype.js, line 1313) var Ajax = { getTransport:false, activeRequestCount: 0, FixeXHR:function() { var xhr1 = function() { return new XMLHttpRequest(); }; var xhr2 = function() { return new ActiveXObject ('Msxml2.XMLHTTP'); }; var xhr3 = function() { return new ActiveXObject ('Microsoft.XMLHTTP'); }; try { if (xhr3()) this.getTransport=xhr3; return; }catch(e) {}; try { if (xhr2()) this.getTransport=xhr2; return; }catch(e) {}; try { if (xhr1()) this.getTransport=xhr1; return; }catch(e) {}; } }; Ajax.FixeXHR(); Ajax.FixeXHR=null; More elegant!? I update my prototype.js file, and to use with a lot of requester, and they working fine. This is just a little modification. Thanks, AS. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Ajax Issue
Hi Sanil Music, What TJ (it's not CORWDER) want to explain is that you can't do what you're trying to do or use the ajax request in synchronous mode . In execution mode, the JS thread in the browser will execurt the AJAX.Request, and continue like if nothing was done by this function. There is just a mechanism inside the browser which get the thread back on the receveid value. And at that time the defined callback for ONSUCCESS or ONFAILURE or ... will just be launch with the result as first parameter. So you need to split ypour code to handle the behaviour you want. I think you should re-read TJ response, he gives you the answer. -- david On 12 jan, 15:34, Sanil Music music.sa...@gmail.com wrote: I use instead of amp;, but I don't know why you can't see it here. For you Cowder, that I wanted a Ajax Request like that, I would use it. I want something else. As in my code, I want to create a one function for all ajax requests. So, I just call that function, and in it I define callback function, url. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Can not display flash when use Ajax.Updater
Hi Song, What kind of error do you have i firebug ??? While reading code, I can say that the ajax.update will insert HTML inside a DOM element. But what your trying to do is insert inside a div an iFrame. So beside that, I suggest not using the ajax.update, but simply an iframe. So the code become: Filename : heloajax.html html head script src=js/prototype.js/script script src=fusioncharts/JSClass/FusionCharts.js/script /head body a href=javascript:void loadTab( 'heloajax_1.html' )Tab 1/a | a href=javascript:void loadTab( 'tab2.html' )Tab 2/a | a href=javascript:void loadTab( 'tab3.html' )Tab 3/a iframe id=content style=padding:5px;border:2px solid black; src=about:blank/divscript function loadTab( tab ) { $('content').src=tab; } loadTab( heloajax_1.html' ); /script /body /html the code of heloajax_1.html: html head script language=JavaScript src=../fusioncharts/JSClass/ FusionCharts.js/script /head body div id=chartDivTopSigInt_Live align=centerXX/div script type=text/javascript var myChart1 = new FusionCharts(fusioncharts/Charts/Pie3D.swf, myChartId, 550, 250); myChart1.setDataURL(intdatalive_db.xml); myChart1.render(chartDivTopSigInt_Live); /script /body /html and it should work like that. -- david On 8 jan, 09:16, Song chen.so...@gmail.com wrote: Hi, I use below code to display a page which including flash in a table, Filename : heloajax.html html head script src=js/prototype.js/script script src=fusioncharts/JSClass/FusionCharts.js/script /head body a href=javascript:void loadTab( 'heloajax_1.html' )Tab 1/a | a href=javascript:void loadTab( 'tab2.html' )Tab 2/a | a href=javascript:void loadTab( 'tab3.html' )Tab 3/a div id=content style=padding:5px;border:2px solid black;/ divscript function loadTab( tab ) { new Ajax.Updater( 'content', tab, { method: 'get' } ); } loadTab( heloajax_1.html' ); /script /body /html the code of heloajax_1.html: html head script language=JavaScript src=../fusioncharts/JSClass/ FusionCharts.js/script /head body div id=chartDivTopSigInt_Live align=centerXX/div script type=text/javascript var myChart1 = new FusionCharts(fusioncharts/Charts/Pie3D.swf, myChartId, 550, 250); myChart1.setDataURL(intdatalive_db.xml); myChart1.render(chartDivTopSigInt_Live); /script /body /html The page heloajax_1.html can display normal when I access it directly , but can not display flash when access it via heloajax.html. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Prototype and Galleria.js
thanks for the reply. I'm trying this, but i'm fairly sure i'm doing it wrong. I'm not much of a developer. let me explain what i'm doing so that it may better help with things. I'm making a simple portfolio website for my gf using animations from script.aculo.us. I want to use galleria.js for the gallery though. The first time I included galleria.js and jquery.js none of my animations worked. I found jQuery.noConflict(); and inserted it into the line of code you put on your page for galleria.js like this: script type=text/javascript jQuery.noConflict(); jQuery(function($) { $('ul.gallery').galleria(); }); /script Once I used jQuery.noConflict(); my animations started working, but galleria.js still doesn't work. I've used galleria.js in the past, though not with another library, so I'm pretty sure i'm implementing galleria correctly. Should I try to edit the galleria.js? I tried to put jQuery.noConflict (); in the galleria.js file and nothing seemed to happen. I'm not sure how just assigning jquery to a new variable works. It seems too simple to wrap my head around. Thanks for the help. On Jan 12, 5:04 am, Alex McAuley webmas...@thecarmarketplace.com wrote: try assigning jquery to a new variable.. $j=jQuery.noConflict(); Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Mike Santini dwarfthem...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Tuesday, January 12, 2010 6:26 AM Subject: [Proto-Scripty] Prototype and Galleria.js Greetings, I'm still new at this, but here is my problem. I'm currently using prototype and script.aculo.us for animations on my a website. I want to use galleria.js for an image gallery, but i can't seem to get them to cooperate. I've used jQuery.noConflict(); and my animations run, but none of the galleria code wants to work. I looked around and all I could find was was information about protosafe.js, but nothing else. Has anyone here been able to get galleria.js to work with prototype and script.aculo.us? Thank you very much. --- - -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Element feature Requests
Hi shellster, I think what you do is good. If you think it could be usefull for others, create a prototype plug- in that will does that and send it to everybody with scripteka. -- david On 6 jan, 19:02, shellster shellsterd...@gmail.com wrote: Hello, First let me say that prototype js is a godsend. I use it on every project I do now. I repeatedly find myself having to do something like this: var firstDiv = new Element('div', { id: 'theID', className: 'theClassName' }).update(content); var replacement = new Element('div').update(firstDiv); oldElement = htmlText.replace(RegExp.escape(searchString), replacement.innerHTML); Or sometimes I want to find how long the text of the new element will be. In both cases I end up having to create a wrapper div, then call innerHTML on the new div to get the text content of the original element. What I would like to see (unless I don't know of a feature that already exists) would be a replication of IE's outerHTML feature. Maybe call the method htmlText(). Using firstDiv from above, it would work like this: firstDiv.htmlText() or Element.htmlText(firstDiv) would return div id=\theID class=\theClassName\[content]/div The closest feature I can find to this is Element.inspect(), but it only returns (in this example): div id=\theID class=\theClassName \ Thanks, in advance. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Help with blindup/blinddown effect using mouseover/mouseout events
hi kimbaudi, This is a common mistake with animation. Let me explain. When you mouseover element, you'll start animation. If you mouseout, after animation is finished, no problem, mouseout animation will be executed. But now if you repeatedlly move mouse over/out/over/out, if you did not manage global animations, you'll have 2 blinddown and 2 blindup executing concurrently. In your code exemple, you'll set the queue parameter so each animation is stack and play one after the other ... but this is not what you want ?? And to lmimit execution code, you set the limit parameter, which prevent having more tahn 1 animation in the queue. But that's not like that it should be handle. What you should do is: script type=text/javascript document.observe(dom:loaded, function() { var effectInExecution=null; $('observearea').observe('mouseover', function() { if(effectInExecution) effectInExecution.cancel(); effectInExecution=$('peekaboo').blindDown({ duration: 0.3 }); } $('observearea').observe('mouseout', function() { if(effectInExecution) effectInExecution.cancel(); effectInExecution=$('peekaboo').blindUp({ duration: 0.3 }); } }); /script In fact, you just save the scriptaculous object and cancel it if another animation should execute. Is that what your trying to do ?? -- david On 9 jan, 23:05, kimbaudi kimba...@gmail.com wrote: Hi, I have a hidden block element absolutely positioned to the bottom right of my webpage. I am trying to display this block element when I mouseover that area and hide this block element when I mouseout from that area using Effects.BlindUp and Effects.BlindDown. At first glance, my webpage seems to work okay. However, if I repeatedly mouseover/mouseout of the area quickly, the block element becomes visible once I mouseout of that area even though the block element should be hidden. Can anybody tell me what is wrong with my code? Can anybody point me to a website or share some example code that would achieve the results that I am trying to pull? Thanks. I would have provided the sample code on pastie.org, but the site is down. Here is my sample code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html;charset=utf-8 / titleBlind Test/title script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/prototype/1.6.1.0/prototype.js/script script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/scriptaculous/1.8.3/scriptaculous.js/script script type=text/javascript document.observe(dom:loaded, function() { $('observearea').observe('mouseover', function() { if ($('peekaboo').visible()) { $('peekaboo').blindUp({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } else { $('peekaboo').blindDown({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } }); $('observearea').observe('mouseout', function() { if ($('peekaboo').visible()) { $('peekaboo').blindUp({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } else { $('peekaboo').blindDown({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } });}); /script style type=text/css body {margin:0; padding:0;} #peekaboo { position:absolute; bottom:0px; right:10px; z-index:; width:100px; height:20px; background:pink; text-align:center;} #observearea { position:absolute; bottom:0px; right:10px; z-index:; width:100px; height:20px;} /style /head body div id=peekaboo style=display:none;divPeek-A-Boo/div/div div id=observearea/div /body /html -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: instantiate class problem on IE
Hi RobG, Thanks to point it out, all should read HOST OBJECT :)) Can you imagine the ramifications of IE not allowing native objects to have methods? :-) No, I prefer not thinking to that. IE have so much pain for developper that it didn't need this one. -- david On 23 déc 2009, 03:31, RobG rg...@iinet.net.au wrote: On Dec 23, 4:17 am, david david.brill...@gmail.com wrote: Hi Loris, I think that your trouble is normal, because IE don't allow to instantiate method on native object. You might need to re-think that statement. From ECMA-262: Native Object A native object is any object supplied by an ECMAScript implementation independent of the host environment. Standard native objects are defined in this specification. Some native objects are built-in;others may be constructed during the course of execution of an ECMAScript program. Can you imagine the ramifications of IE not allowing native objects to have methods? :-) Perhaps you meant host object. But if that were true, most of Prototype.js would not work at all in IE. Generally it's not a good idea to extend native objects because your not sure that another JS will not use the same method name !! Perhaps you did mean host object. Yes, it's a bad idea to add *non- standard* properties to host objects. How do you reconcile that notion with the use of Prototype.js's $() function? -- Rob -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: Help with blindup/blinddown effect using mouseover/mouseout events
Hi David, thank you for your response and what you explained is exactly what I'm trying to do. I have tried your code sample, but I get an error from the Firebug console: effectInExecution.cancel is not a function. Here is the code that I have used: http://pastie.org/775288. It seems that effectInExecution=$('peekaboo').blindUp({ duration: 0.3 }); does not reference the Scriptaculous Effect object, which is what is needed to call the cancel() method. However, I don't know how to reference the Effect object using the effectInExecution variable. I've tried: if(effectInExecution) effectInExecution*.effect*.cancel(); but it returns an 'undefined', not the Effect object. Thanks for your time and I hope I can find a solution to this problem. On Tue, Jan 12, 2010 at 10:01 AM, david david.brill...@gmail.com wrote: hi kimbaudi, This is a common mistake with animation. Let me explain. When you mouseover element, you'll start animation. If you mouseout, after animation is finished, no problem, mouseout animation will be executed. But now if you repeatedlly move mouse over/out/over/out, if you did not manage global animations, you'll have 2 blinddown and 2 blindup executing concurrently. In your code exemple, you'll set the queue parameter so each animation is stack and play one after the other ... but this is not what you want ?? And to lmimit execution code, you set the limit parameter, which prevent having more tahn 1 animation in the queue. But that's not like that it should be handle. What you should do is: script type=text/javascript document.observe(dom:loaded, function() { var effectInExecution=null; $('observearea').observe('mouseover', function() { if(effectInExecution) effectInExecution.cancel(); effectInExecution=$('peekaboo').blindDown({ duration: 0.3 }); } $('observearea').observe('mouseout', function() { if(effectInExecution) effectInExecution.cancel(); effectInExecution=$('peekaboo').blindUp({ duration: 0.3 }); } }); /script In fact, you just save the scriptaculous object and cancel it if another animation should execute. Is that what your trying to do ?? -- david On 9 jan, 23:05, kimbaudi kimba...@gmail.com wrote: Hi, I have a hidden block element absolutely positioned to the bottom right of my webpage. I am trying to display this block element when I mouseover that area and hide this block element when I mouseout from that area using Effects.BlindUp and Effects.BlindDown. At first glance, my webpage seems to work okay. However, if I repeatedly mouseover/mouseout of the area quickly, the block element becomes visible once I mouseout of that area even though the block element should be hidden. Can anybody tell me what is wrong with my code? Can anybody point me to a website or share some example code that would achieve the results that I am trying to pull? Thanks. I would have provided the sample code on pastie.org, but the site is down. Here is my sample code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html;charset=utf-8 / titleBlind Test/title script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/prototype/1.6.1.0/prototype.js/script script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/scriptaculous/1.8.3/scriptaculous.js/script script type=text/javascript document.observe(dom:loaded, function() { $('observearea').observe('mouseover', function() { if ($('peekaboo').visible()) { $('peekaboo').blindUp({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } else { $('peekaboo').blindDown({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } }); $('observearea').observe('mouseout', function() { if ($('peekaboo').visible()) { $('peekaboo').blindUp({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } else { $('peekaboo').blindDown({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } });}); /script style type=text/css body {margin:0; padding:0;} #peekaboo { position:absolute; bottom:0px; right:10px; z-index:; width:100px; height:20px; background:pink; text-align:center;} #observearea { position:absolute; bottom:0px; right:10px; z-index:; width:100px; height:20px;} /style
[Proto-Scripty] Re: Collecting checked checkboxes
my bad. I misunderstood your question. Ignore my response On Jan 11, 4:16 pm, Scott counterstre...@gmail.com wrote: you could submit the entire form using request. $(formid).request({ method: 'post', onComplete:function(request){ alert(request.responseText); } }); On Jan 11, 12:11 am, Hussein B hubaghd...@gmail.com wrote: Hey, I have a checkbox in front of each row in my table. Upon clicking on submit button, I want to collect the checked boxes and send values via Ajax request. How to iterate over the checked boxes? Thanks for help and time. -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: script.aculo.us autocomplete: Restrict to list
So I was looking at something that would only let them type values that appear in the autocomplete list. So, say it was a state list (for example). If you type in cal you would have California showing up in the list. Current autocomplete behavior allows them to type in Calasdfasdfasdfasdf or whatever. I'm curious if there is a solution already implemented that would let them type CAL and would ignore everything else until they typed the IFORNIA in the correct order. In other words, they're restricted to only the items on the autocomplete list. If we have , AAAB, AAAC then after they type AAA the only options allowed to type would be A, B, or C. On Jan 11, 7:34 am, shellster shellsterd...@gmail.com wrote: Should be pretty simple: var array = //your array of acceptable values; $('field).observe('keyup', checkword); function checkword() { var string = '/^' + RegExp.escape($('field').value) + '.*/'; if(array.grep(string).length == 0) return false; else return true; } Is a rough start of something. On Jan 6, 2:38 pm, Strider strid...@gmail.com wrote: Has anyone implemented a restrict-to-list option in the autocompleter or know any of the pitfalls I should watch out for? I would like to implement this option, for say State names, or such, and I would rather restrict to the list than doing post-selection error messages. It seems like a feature that should be included (for things like state names, or other limited lists.) Does such a feature already exist (and I missed it in my search) or has anyone already implemented it? Thanks, StriderA -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Internet connection dies during AJAX, how to catch this?
Hi, Can someone please help with this? How do I catch lost/no internet connection when I make a call to: new Ajax.Updater('some-div', '/some/url', options); I tried supplying the onException callback, but it doesn't get called... Any ideas? -- 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-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.