[Proto-Scripty] Textarea as a container
I tried using a textarea as the container for Ajax.updater without luck. I presume I need to write the js to take the response and put it in the textarea, but the API just doesn't give me enough detail to use Ajax.request to do that. The returned data is plain text. A bit of assistance would be appreciated. -- 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-scriptaculous@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] Textarea as a container
On 11/22/2011 8:25 AM, David Behler wrote: From the top of my head and totally untested: new Ajax.Request('http://url-you-want-to-request', { onSuccess: function(transport) { $('id-of-your-textarea').setValue(transport.responseText); } }); David Thanks David, that's easy enough. -- 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-scriptaculous@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] WYSIWYG textarea replacement
On 8/10/2011 8:35 AM, Walter Lee Davis wrote: I'm pretty sure that TinyMCE itself does not use jQuery directly. There may be some add-ons that do, but it's not part of the core. Have a look at this project, which is using TinyMCE as well, and is Prototype-centric: http://inplacericheditor.box.re/ Walter Thanks, you are correct- never trust someone else's documentation (or even your own :-)) -- 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-scriptaculous@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] WYSIWYG textarea replacement
I am updating an application that uses TinyMCE, a jquery based script that makes textareas into mini-editors with the ability to format text. Does anyone know of a prototype based equivalent ? In TinyMCE you create a text area and then call an init that reformats it on the page and then call a close routine that converts the entered text into html within the textarea. The user has the ability to bold, underline... -- 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-scriptaculous@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: Prototype's evolution
On 7/21/2011 9:42 PM, Walter Lee Davis wrote: On Jul 21, 2011, at 8:32 PM, Jason wrote: I agree with both Richard and Sander - and there might be a middle ground I think that community comments, examples etc are a good addition to documentation and help users that are starting out - it would also give the new user a sense there was someplace to go for help. There has been many times I was working with a new function and was able to figure it out from the community comments instead of the official documentation (no offense intended) On the other hand full blown PHP documentation like is overkill and is too much too fast On the third hand - I would be more than happy to contribute to building the community section, but I'm not sure if a PHP guru will be much help (as I'm assuming its built on Ruby) The current documentation (1.7) is generated directly from the source code using a tool written by one of the core guys -- I think it's called jsDoc or something like that. Anyway, it's just static HTML, CSS and JavaScript (naturally) once that tool is done. I think that if there was enough energy for moderation, or some sort of community moderation system, that a great add-on to the site would be something like Disqus, so the user comments and corrections could be added to the mix. That's the thing I really love about the PHP site, and miss in other languages. It's an annotated encyclopedia that has lots of interesting stuff written in the margins by everyone else who ever used it. I can't count the number or really hard problems I was able to solve by looking at someone's example code in the comments. AGREED ! -- 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-scriptaculous@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] problem with Ajax.Updater going from FF3 to FF5
I found it - it was not a prototype issue: my html was table bunch of table stuff form input field, not contained in tr's /form /table and Firefox 5 was rewriting it to table bunch of table stuff form/form input field /table when I rewrote it to: table bunch of table stuff /table form input field, not contained in tr's /form it works just fine. -- 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-scriptaculous@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: A bit of assistance please
On 6/1/2011 10:19 AM, Eric wrote: On May 31, 5:51 pm, Walter Daviswa...@wdstudio.com wrote: On May 31, 2011, at 11:12 AM, bill wrote: I need the scroll of the div contents only. You can back into that by using the cumulative offset, and subtracting the document.viewport.getScrollOffsets() from that. Or you may use yourdiv.scrollTop and yourdiv.scrollLeft Eric Thank you. scrollTop is a MSIE extension that is not a W3C specification, but mozilla (at least) has picked it up and it does the job. bill -- 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-scriptaculous@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: A bit of assistance please
On 5/30/2011 11:22 AM, Eric wrote: Hi Bill, Using Event.PointerX() and Event.PointerY() you can get the absolute position of the mouse on the page. Using Element.Layout you can get the exact position of your image. If you substract the layout's left value to PointerX and the layout's top value to PointerY, you should have the X/Y position relative to top/left corner of your image. More simple but I am not sure it is crossbrowser supported, events *may* have clientX and clientY attributes which *may* contain what you're looking at (if your event is attached to the img DOM object). I can use clientX/Y or pageX/Y to get the location of the mouse, but I can't figure out how to get the scroll of the _DIV_. I looked at the options available for Element, but which will give me the amount that the contents of the _DIV_ have scrolled. pageX/Y gives me the amount the body is scrolled, not the _DIV_. -- 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-scriptaculous@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: A bit of assistance please
On 5/31/2011 11:06 AM, Walter Davis wrote: On May 31, 2011, at 10:57 AM, bill wrote: On 5/30/2011 11:22 AM, Eric wrote: Hi Bill, Using Event.PointerX() and Event.PointerY() you can get the absolute position of the mouse on the page. Using Element.Layout you can get the exact position of your image. If you substract the layout's left value to PointerX and the layout's top value to PointerY, you should have the X/Y position relative to top/left corner of your image. More simple but I am not sure it is crossbrowser supported, events *may* have clientX and clientY attributes which *may* contain what you're looking at (if your event is attached to the img DOM object). Take a look at Element.cumulativeScrollOffset and see if that can give you what you need. According to the docs, it can handle multiply-nested scrolling containers. Walter I looked at that, but I do not want to account for the scroll of the body, and cumulativeScrollOffset seems as it would do that. I need the scroll of the div contents only. Thanks for the thought bill I can use clientX/Y or pageX/Y to get the location of the mouse, but I can't figure out how to get the scroll of the _DIV_. I looked at the options available for Element, but which will give me the amount that the contents of the _DIV_ have scrolled. pageX/Y gives me the amount the body is scrolled, not the _DIV_. -- 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-scriptaculous@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. -- 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-scriptaculous@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] A bit of assistance please
On 5/29/2011 12:56 AM, venu gupta wrote: Hi Bill, You can do both the ways . But I personally prefer to have it in the main page which is always loaded. I obviously sounded as if I know more than I do. I need some help in the form of the observer and with determining the x/y location of the click and/or determining the id of the div clicked upon. On Sun, May 29, 2011 at 12:58 AM, bill will...@techservsys.com mailto:will...@techservsys.com wrote: I am dynamically generating a div which is loaded via AJAX. It is a schedule, with a background image (loaded with img..., not css - so it scrolls) and the appointments as superimposed divs. If the user clicks on the background image (not on a div) I need to determine the x and y coordinates of the click on the image, not in the viewport. (ie: the same coordinates regardless of how the image has scrolled) If the user clicks on a div (superimposed on the image) I need to return the id of the div. It seems that I could just have one observer watching the outer div and bubble up the information, but I just can't seem to get started. I can load the js with the page or I can have it in the main page that is always loaded. -- Bill Drescher william {at} TechServSys {dot} com -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us http://script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com mailto:prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com mailto:prototype-scriptaculous%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- Regards, Venu Kumar Bukka -- 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 prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- 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-scriptaculous@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] A bit of assistance please
I am dynamically generating a div which is loaded via AJAX. It is a schedule, with a background image (loaded with img..., not css - so it scrolls) and the appointments as superimposed divs. If the user clicks on the background image (not on a div) I need to determine the x and y coordinates of the click on the image, not in the viewport. (ie: the same coordinates regardless of how the image has scrolled) If the user clicks on a div (superimposed on the image) I need to return the id of the div. It seems that I could just have one observer watching the outer div and bubble up the information, but I just can't seem to get started. I can load the js with the page or I can have it in the main page that is always loaded. -- 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-scriptaculous@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] Firefox 4 - preliminary report
When I updated a working application based on prototype to Firefox 4, many things stopped working, including detection of mouse clicks. As I am in the middle of writing the application I will not be debugging it now. FYI. I downgraded to Firefox 3. -- 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-scriptaculous@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: Setting the focus on an input after an effect to show the input.
On 6/11/2010 5:07 PM, Walter Lee Davis wrote: Yes, but is there only one form on the entire page at any time? That's the point I was trying to get at here. If you have two inputs with the same ID, you can call focus() but only the first one with that ID will gain focus. Walter It is a violation of the spec to have 2 elements with the same ID. IDs are supposed to be unique in a page. bill On Jun 11, 2010, at 4:57 PM, Richard Quadling wrote: The afterFinish is what I needed. Thanks. The form in question has 2 inputs and it is the first one that I want to get the focus on. Thank you. I didn't see anything in the scripy docs, but I've probably missed it. -- 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.
Re: [Proto-Scripty] Re: draggable problems
On 3/28/2010 11:30 PM, Martin wrote: u could use the hande option http://wiki.github.com/madrobby/scriptaculous/draggable or you can modify dragdrop.js . i had an UL with scrollbars so i added UL here and fixed what you describe in 1) line 300+ initDrag: function(event) { if(!Object.isUndefined(Draggable._dragging[this.element]) Draggable._dragging[this.element]) return; if(Event.isLeftClick(event)) { // abort on form elements, fixes a Firefox issue var src = Event.element(event); if((tag_name = src.tagName.toUpperCase()) ( tag_name=='INPUT' || tag_name=='SELECT' || tag_name=='OPTION' || tag_name=='BUTTON' || tag_name=='TEXTAREA' || )) return; Thank you very much ! bill On Mar 28, 12:41 pm, billwill...@techservsys.com wrote: When I set a div to draggable I get two problems: 1) when I try to scroll it by dragging the scroll bar, I drag the whole div instead of scrolling it 2) when I try to copy text from it, I drag the div instead of highlighting text. Perhaps there is a way I could set up a handle to drag it by (a small area, maybe 25 x 25 px) when clicked on would drag the div, or does anyone have any suggestions ? -- Bill Drescher william {at} TechServSys {dot} com -- 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.
Re: [Proto-Scripty] Re: evalScripts - resend
On 3/10/2010 10:04 AM, T.J. Crowder wrote: Bill, If you're in doubt whether you're getting replies, check the web interface: http://groups.google.com/group/prototype-scriptaculous (There were no replies to your earlier post.) -- T.J. Thanks T.J. I just couldn't believe that no one would help. bill On Mar 9, 11:56 am, billwill...@techservsys.com wrote: Pardon me if this has been seen/replied to, apparently I am not getting all the mail from the group When I load a div using AJAX.updater that contains a script and then call the script, recalc(), I get the error message: recalc is not defined. thoughts/suggestions please where did I go wrong ? These are old scripts that I am using in the rewrite of an application, but should work. The script that loads the div is: function scriptChain (evt, newDivID, chainToProgram, chainFromFormID) { // scriptChain stopBubble (evt); // if chainFromFormID is blank, use a chain without data if (chainFromFormID == ) { // no data document.getElementById (newDivID).style.display = block; new Ajax.Updater(newDivID, chainToProgram, { evalScripts:true }); return false; //inhibit the href } //no data else { // with data new Ajax.Updater(newDivID, chainToProgram, { parameters: $(chainFromFormID).serialize(true), onFailure: function(response) { alert (patient.php: failure to submit form: + chainFromFormID); }, evalScripts:true }); return false; } //with data } // scriptChain --- and works fine The page that I am loading contains -- SCRIPT type=text/javascript window.reformat = function (t,d) { var bal = ( Math.round((t.value * 100) + .4))/100.0; t.value= FormatNumber(bal,2) return true } window.recalc = function (t,d){ reformat(t,d); //then recalc amount remaining var bal = t.form.amount.value bal -=t.form.amount1.value bal -=t.form.amount2.value bal -=t.form.amount3.value bal -=t.form.amount4.value bal -=t.form.amount5.value bal -=t.form.amount6.value t.form.amount_remaining.value = bal reformat(t.form.amount_remaining,2) if (t.form.amount_remaining.value 0.0) { // error alert (ERROR, you can not distribute MORE than the amount of the payment) } } /script -- Bill Drescher william {at} TechServSys {dot} com -- 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] evalScripts
The script that loads the div is: function scriptChain (evt, newDivID, chainToProgram, chainFromFormID) { // scriptChain //alert (scriptChain: + newDivID + - + chainToProgram + with + chainFromFormID +); stopBubble (evt); // if chainFromFormID is blank, use a chain without data if (chainFromFormID == ) { // no data //alert (with no data); closeMenu2 () ; // no harm if it does not need to be closede document.getElementById (newDivID).style.display = block; new Ajax.Updater(newDivID, chainToProgram, { evalScripts:true }); return false; //inhibit the href } //no data else { // with data new Ajax.Updater(newDivID, chainToProgram, { parameters: $(chainFromFormID).serialize(true), onFailure: function(response) { alert (patient.php: failure to submit form: + chainFromFormID); }, evalScripts:true }); return false; } //with data } // scriptChain --- and works fine The page that I am loading has as a fragment: -- SCRIPT type=text/javascript window.reformat = function (t,d) { var bal = ( Math.round((t.value * 100) + .4))/100.0; t.value= FormatNumber(bal,2) return true } window.recalc = function (t,d){ reformat(t,d); //then recalc amount remaining var bal = t.form.amount.value bal -=t.form.amount1.value bal -=t.form.amount2.value bal -=t.form.amount3.value bal -=t.form.amount4.value bal -=t.form.amount5.value bal -=t.form.amount6.value t.form.amount_remaining.value = bal reformat(t.form.amount_remaining,2) if (t.form.amount_remaining.value 0.0) { // error alert (ERROR, you can not distribute MORE than the amount of the payment) } } /script but when I call recalc, I get the error message: recalc is not defined. thoughts/suggestions please where did I go wrong ? These are old scripts that I am using in the rewrite of an application, but should work. -- 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] sticky radio button
I have a form with some radio buttons that via Ajax.Updater relaod a td with a selection pull down. It all works fine, except that the first radio button clicked stays clicked, even when I click another. The correct data is loaded into the td though. tr td colspan=2 onclick= return scriptChain(event, 'proccodeSelect', 'dollar/showProccodes.php', 'postUnscheduledForm'); Procedures for: input type=radio name=sortClass value=office Office nbsp; input type=radio name=sortClass value=hospital Hospital nbsp; input type=radio name=sortClass value=forensic Forensic nbsp; input type=radio name=sortClass value=admin Administrative /td /tr tr td align=rightProcedure/tdtd id=proccodeSelectselect name=proccode$proccodeList/select/td /tr // **G E N E R I C S C R I P T C H A I N I N G *** function scriptChain (evt, newDivID, chainToProgram, chainFromFormID) { // scriptChain //alert (scriptChain: + newDivID + - + chainToProgram + with + chainFromFormID +); stopBubble (evt); new Ajax.Updater(newDivID, chainToProgram, { parameters: $(chainFromFormID).serialize(true), onFailure: function(response) { alert (patient.php: failure to submit form: + chainFromFormID); } }); return false; } // scriptChain -- 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.
Re: [Proto-Scripty] Re: Prototype 1.6.1 kills IE8?
On 2/19/2010 2:58 AM, joy wrote: Hi~ I can't imagine it either, but it happens. T.T Try follow steps. 1. Open a web page that including Prototype 1.6.1 on IE8 on Windows XP. 2. Right click on your mouse and click Properties. 3. Isn't your browser killed? I don't know the reason but when I remove the Prototype 1.6.1, It doesn't happen anymore. Even it happens on Prototype API page. (http://api.prototypejs.org) I tried your test on XP (SP3 build 2600) with IE8 - version 8.0.6001.18702 and had no problem opening the properties menu -- 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.
Re: [Proto-Scripty] Re: IE8
On 2/15/2010 3:33 AM, gwyohm wrote: hi, why not using prototype cross-browser document.viewport methods ? document.viewport.getHeight() simple answer: still learning. I very much appreciate the suggestion ! -- 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] IE8
IE 8 chokes on line 16: line 16 is the line after var aw = window.innerWidth; script type=text/javascript function setsize() { // adjust divs var ah = window.innerHeight ; //alert (Setsize - ah = + ah); var aw = window.innerWidth; $('leftPane').style.height = '' + ((.99 *ah)-20 ) + 'px'; //this is line 16 //document.getElementById(leftPane).style.height = + ((.99 *ah)-20 ) + px; If I replace the prototype code with the getElementById line, I get the same error. the error message in the IE8 developer tools is Invalid argument The right side of the assignment is single quote, single quote (( Anyone see the problem ? This works fine in firefox bill -- 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.
Re: [Proto-Scripty] IE8
On 2/13/2010 8:05 AM, Alex McAuley wrote: you dont need the quote before hand ... $('leftPane').style.height = '' + ((.99 *ah)-20 ) + 'px'; //this is line 16 into $('leftPane').style.height = Math.round(( ( .99 * ah ) -20 )) + 'px'; //this is line 16 I thought the quotes were needed to force the argument to be a string. But, it doesn't like your suggestion any better. I still get invalid argument It is having trouble with this line: var ah = window.innerHeight ; I guess innerHeight is not accepted by IE8 so I switched to screen.availHeight - 30; and it works, although it is not quite the same thing, at least it works -- 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.
Re: [Proto-Scripty] Safe Browser Resize
On 2/9/2010 10:33 PM, kstubs wrote: I'm trying to write the following jquery sample code in prototype. I am stuck, and do not understand the following: http://noteslog.com/personal/projects/wresize/1.1/jquery.wresize.js this.each( function() { if ( this == window ) { $( this ).resize( handleWResize ); } else { $( this ).resize( f ); } } ); The above code is not fitting well into the namespaced function that I am creating. I was expecting to create another function, something like ... }, newFunction function() { } Any ideas? I need a save browser resize test. I am working on code to resize objects on my page to push them to the bottom of the viewable browser. Thanks, Karl.. The simple way in Firefox is to get the web developer Add-on which permits resizing to various standard sizes as well as custom sizes. -- 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] PLease Wait or Loading message
I have an application that uses Ajax.updater. As it runs over the internet sometimes the response can take 10 seconds, by which time the user thinks that it did not work so I would like to show a message as soon as the link is clicked to fire the Ajax request. I am however befuddled. If I set the innerHTML of the div with the message, it wipes out the form that needs to be sent. If I use onSuccess, it takes too long. Suggestions ? -- 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.
Re: [Proto-Scripty] PLease Wait or Loading message
On 2/10/2010 9:42 AM, Christophe Decaux wrote: I would use onCreate to show an element displaying your please wait message (or a graphical spinner, etc.) and use onComplete to hide it Enjoy, Christophe Le 10 févr. 2010 à 15:20, bill a écrit : Thanks guys - that works -- 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.
Re: [Proto-Scripty] Re: Check if instance is a specified class
On 2/8/2010 8:53 AM, Don wrote: Yes you are right, shortly after posting I thought exactly that, I feel incredibly stupid It is a well known corollary of Murphy's Law that the important and obvious piece of information you need will be hidden from you until just after you tell the world that you don't know it. I can not tell you how many times this has happened to me. On the other hand, if the price of discovering the information is feel like a fool, it is worth it. -- 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] SSL and Ajax.updater
Please pardon if this is a duplicate, but after 24 hours it had not come back to my mailbox If I load a page using https and then update a div using Ajax.updater, is this transaction also encrypted if I use relative addressing, eg: no https:// url = 'profile.php'; new Ajax.Updater('replyPane',url ); // get the requested message or do I need to use the complete URL including the protocol ? -- 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.
Re: [Proto-Scripty] SSL and Ajax.updater
On 2/4/2010 7:48 AM, Alex McAuley wrote: anything relative to the page without a protocol inherits the protocol and the URL iirc ... To test .. use firebug and make an ajax request on the page and see what the url ends up as.. HTH thanks, I have firebug but don't know how to see the url. -- 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] groups question
I am not receiving my messages back when I send them - I went to the google groups page for this group but could not find a way to set that. Any hints. -- 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] SSL and Ajax.updater
If I load a page using https and then update a div using Ajax.updater, is this transaction also encrypted if I use relative addressing, eg: no https:// url = 'profile.php'; new Ajax.Updater('replyPane',url ); // get the requested message or do I need to use the complete URL including the protocol ? -- 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] unscheduled refresh of Div with periodical updater
I have a div that is updated by a periodical updater and all is well. However, what is the best way to update the div on demand. a) Ajax.periodicalUpdater.stop(); periodcalUpdater.start() b) Ajax.updater() c) ?? -- 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.
Re: [Proto-Scripty] Ajax.Update back to previous page
On 1/22/2010 7:24 AM, Noppanit wrote: Hi everybody, I am using Ajax.Update to change my page, like my page1 to page2. When I click the button on page1 it goes to page2. Is there a way to go back to page1 from page2? I know that's this is not the way that AJAX should work, but is there a chance to make this work? Thank you so much. You can go back to a new copy of page 1 just the same way you went to page 2, using Ajax.Updater. As is noted earlier, going back to the contents of the prior div is really hard. -- 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.
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.
Re: [Proto-Scripty] Re: Event.element
T.J. Crowder wrote: Hi, On Jan 10, 7:08 pm, bill will...@techservsys.com wrote: DJ Mangus wrote: What is returned is the same thing you'd get if you used $('id'). Chain on .identify to get the Id from a DOM node. Thank you. as in: function clickHander (event) { var id = event.element().identify ? or rather: function clickHander (event) { var element= event.element() var id = element.identify() The latter, since #identify is a function. (Don't forget your semicolons, though!) FYI, Tobie says that Event#element is deprecated and we should use Event#findElement with no arguments instead, so: function clickHandler(event) { var id = event.findElement().identify(); } 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. Element#identify just returns `id`, but it checks first to see if the element *has* an ID and if not it assigns one to it. I know the divs will have IDs, so how would I write it to just use the id property ? -- Bill Drescher (who is still climbing the learning curve) 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] Event.element
The docs say: |Event.element(event) - Element| Returns the DOM element on which the event occurred. But, what is actually returned ? If not the ID, what do I do to get the id of the div in which the click occurred ? -- 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.
Re: [Proto-Scripty] Event.element
DJ Mangus wrote: What is returned is the same thing you'd get if you used $('id'). Chain on .identify to get the Id from a DOM node. Thank you. as in: function clickHander (event) { var id = event.element().identify ? ... -- 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.
Re: [Proto-Scripty] Event.element
DJ Mangus wrote: What is returned is the same thing you'd get if you used $('id'). Chain on .identify to get the Id from a DOM node. Thank you. as in: function clickHander (event) { var id = event.element().identify ? or rather: function clickHander (event) { var element= event.element() var id = element.identify() ? ... -- 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.
Re: [Proto-Scripty] Assistance with clicks
Walter Lee Davis wrote: I just did something very similar (also a calendar) and what I came up with was this: I had a single overlay DIV hidden at the top of the page, and after a click on an empty cell, I would load the overlay with the Create Appointment screen, use Element.clonePosition() to set the top and left of the overlay to match the cell that was clicked on, and then Effect.Grow to cause it to appear. Thanks Walter, Obviously I will need study this for a bit - thanks bill For an existing appointment, the same thing would happen except that I would load the Edit Appointment screen by following the link on the A tag that represented the existing appointment. Here's the relevant code, note that there are some optimizations I have not made (substitute Event.findElement for my business with the tagName attribute). References to combinator() are simply setting up combo box behavior on select elements. document.observe('click',function(evt){ var elm = evt.element(); var o = $('overlay'); if($('table_week') elm.descendantOf($('table_week'))){ evt.stop(); if(elm.tagName.toLowerCase() == 'a'){ if(o.visible()) o.hide(); o.clonePosition(elm.up('td'),{setWidth:false,setHeight:false}); new Ajax.Updater('overlay',elm.href,{ onComplete:function(){ o.grow({direction:'top-left', duration:0.5, afterFinish:function(){ o.down('img.close').show(); o.down('form').focusFirstElement(); o.setOpacity(0.999); } }); combinator(); }, evalScripts: true }); }else{ if(elm.tagName.toLowerCase() != 'td') elm = elm.up('td'); if(elm.id !elm.hasClassName('disabled')){ evt.stop(); if(o.visible()) o.hide(); o.clonePosition(elm,{setWidth:false,setHeight:false}); var parts = elm.id.split(/_/); var date = parts[1] + '-' + parts[2] + '-' + parts[3] + ' ' + parts[4]; new Ajax.Updater('overlay','appointments/create',{ parameters:{ start_at: date + ':00:00', calendars_id: $F('calendars_id'), parent: elm.id }, onComplete:function(){ o.grow({direction:'top-left', duration:0.5, afterFinish:function(){ o.down('img.close').show(); o.down('form').focusFirstElement(); o.setOpacity(0.999); } }); combinator(); }, evalScripts: true }); } } } }); $('overlay').observe('click',function(evt){ if(evt.element().hasClassName('close')) this.hide(); }); Walter On Jan 6, 2010, at 7:42 AM, bill wrote: I am trying am ambitious project - a scheduling system (as part of another application) and need some assistance. Via AJAX I will load a div with: a header div a main div. The main div will contain 0..40 small divs that are displayed as a 7 day schedule. I can do all this. The user will click on a spot in the main div to create an appointment or will click on one of the small divs that represent existing appointments. now for the part with which I need help. If they click on a spot in the main div that does not have a appointment div I need to determine the coordinates of the click both in terms of the main div and the viewport (as the content of the main div will scroll) so I can display a div near the click with a form to fill in to create an appointment. If they click on an existing appointment div I need to determine the coordinates and the div's ID. From what little I know about prototype I presume I need an observer of the main div, but I do not understand how to write it and then process the event information. Suggestions, links, and/or a tutorial would be much appreciated. -- 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
Re: [Proto-Scripty] Re: File output
speedpac...@gmail.com wrote: Hi, No need to open a new window - if it starts downloading you'll be left with an empty window ;) Just do an HTTP call to the server and your original page will remain in the window if you have the correct headers going out from your PHP... Would you be so kind as to expand your suggestion, perhaps with a line of code ? David -- 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.
Re: [Proto-Scripty] Re: File output
speedpac...@gmail.com wrote: Hi, No need to open a new window - if it starts downloading you'll be left with an empty window ;) Just do an HTTP call to the server and your original page will remain in the window if you have the correct headers going out from your PHP... Interestingly enough, when I do a window.open() and the script just does a download, the window does not actually open, just the download dialog. No orphan window after that (in FireFox). David On Dec 11, 10:38 pm, bill will...@techservsys.com wrote: speedpac...@gmail.com wrote: he replied to my mail :p I guess we're all right this time - what a wonderful world it is ; I haven't replied at all, until now. On Dec 11, 4:08 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: I'm not often wrong but i am right this time !!! I feel much better about not being able to do what I couldn't do. I guess I will open the last script in a new window and go from there. Thanks all. Alex is always right, as far as I know. -- 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. -- 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] File output
I am a relative AJAX neophyte and a complete newbe to prototype. I have an application that successively loads a series of php pages into the same div without problem using Ajax.updater. The last php script, instead of generating html, writes a file to the output in OpenOffice Writer format (with the appropriate headers) so instead of displaying the result I want it to do a file download. (http://www.phpclasses.org/browse/package/5797.html) Now we get to the place I am lost. I presume that instead of Ajax.updater I want to do something else (Ajax Request ?) but I am not sure how to do this. -- 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.
Re: [Proto-Scripty] Re: File output
speedpac...@gmail.com wrote: he replied to my mail :p I guess we're all right this time - what a wonderful world it is ; I haven't replied at all, until now. On Dec 11, 4:08 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: I'm not often wrong but i am right this time !!! I feel much better about not being able to do what I couldn't do. I guess I will open the last script in a new window and go from there. Thanks all. Alex is always right, as far as I know. -- 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.
Re: [Proto-Scripty] Re: Maybe OT: passing a function name to a function
T.J. Crowder wrote: Hi Bill, If I'm reading you right, you want to pass a callback into another function. Functions are first-class objects in JavaScript so there's nothing special you need to do (and certainly no need for eval). Say you have a logging function: function logMsg(msg) { alert(msg); // Obviously not realistic } That function is just an object with a name (logMsg). The name is valid throughout its containing scope. (If the declaration above is at page level, its containing scope is the page; if it's within another function, its containing scope is that function.) Now suppose you want to pass that logging function into another function to be used for logging messages. The other function might look like this: function doSomething(logger) { logger(This is message one.); logger(This is message two.); // ... } To do that, just pass it into the function using its name (no quotes): doSomething(logMsg); Note that we're just *referring* to the `logMsg` function, not calling it. You don't want to do this: doSomething(logMsg()); // = WRONG ...because (as you know) that would _call_ `logMsg` and then pass its return value into `doSomething`. The concept of functions as proper objects is very powerful. We can pass functions into other functions (as above). We can assign functions to variables: var f = logMsg; f(Log this message); We can attach functions to objects as properties: var x = {};// Create an empty object x.logger = logMsg; // Create a property `logger` referencing our function x.logger(Foo); // Use it to log Foo You'll recognise some of this from the Prototype API. For instance, Enumerable#each accepts a function as a parameter and calls it for each item in the enumerable. As Alex mentioned, the Ajax stuff accepts an options object that has properties with certain defined names (onSuccess, onComplete); the Ajax stuff expects the values of those properties to be a function to call. When passing functions around, there's something you have to remember: The *context* (the `this` value) within a function call is set by how you *call* the function, not (as it is in several other languages) by how/where you define the function. If `this` is going to be significant in terms of your callback, I'd suggest reading these posts [1] from my (pathetic little) blog. [1] http://blog.niftysnippets.org/2008/03/mythical-methods.html [2] http://blog.niftysnippets.org/2008/04/you-must-remember-this.html HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com As an advanced javascript neophyte i very much appreciate the extended reply and the references. It will take me a few days/weeks to digest and play with this. Thank you very much. bill -- 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. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
Re: [Proto-Scripty] Maybe OT: passing a function name to a function
Alex McAuley wrote: Sorry i get what u mean now!.. Example: function myFunction(options) { alert(options.id); eval(mySecondFunction);// Be very aware that evaluation is bad as JS can be injected if you do not sanitise strings correctly } myFunction({id:1234,callback:'mySecondFunction'}); // alerts 1234 then evals mySecondFunction(); Not using eval EVER i cant remember if you need to add () or not... but its a quick trial and error fix!! HTH Alex Mcauley http://www.thevacancymarket.com Thanks Alex, together with TJ's reply I have plenty to chew on for now. bill -- 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. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
Re: [Proto-Scripty] Re: instanting and reinstanting a function: Ajax.PeriodicalUpdater
Alex McAuley wrote: No need to worry about multiple instances ... just check the variable before you initialise it... Alex Mcauley http://www.thevacancymarket.com Thanks again david and Alex. I looked but could not find the code to check to see if the variable held an instance or was null. Might I beg for one line of code to show me how to check the variable ? bill - Original Message - *From:* bill mailto:will...@techservsys.com *To:* prototype-scriptaculous@googlegroups.com mailto:prototype-scriptaculous@googlegroups.com *Sent:* Tuesday, November 17, 2009 3:18 PM *Subject:* [Proto-Scripty] Re: instanting and reinstanting a function: Ajax.PeriodicalUpdater david wrote: Bill, just a precision (in Fact I did not understand that you still need to get every minutes the result): the stop() method is at http://api.prototypejs.org/ajax/ajax/periodicalupdater.html#stop-instance_method normally, you could stop start the peridical updater at will. -- david Thanks david and Alex, So what is the best practice: 1) create the periodicalupdater when the page loads, stopping it immediately and then start it when the div becomes visible and stop it when the div becomes invisible. 2) create the periodicalupdater when it becomes visible and stop it when it becomes invisible Or is there any difference ? (I worry about multiple instanting the periodicalupdater ) -- 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-scriptaculous@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 -~--~~~~--~~--~--~--- -- 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. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
Re: [Proto-Scripty] Re: instanting and reinstanting a function: Ajax.PeriodicalUpdater
Alex McAuley wrote: myInstance=new Ajax.PeriodicalUpdater( TO check it ... If(myInstace) { do some code here Gee, that is easy, no wonder I couldn't find it :-) I am more used to PHP so I was looking for something like if (isset(myinstance)) should be a piece of cake. Many thanks, bill - Original Message - *From:* bill mailto:will...@techservsys.com *To:* prototype-scriptaculous@googlegroups.com mailto:prototype-scriptaculous@googlegroups.com *Sent:* Wednesday, November 18, 2009 11:11 AM *Subject:* Re: [Proto-Scripty] Re: instanting and reinstanting a function: Ajax.PeriodicalUpdater Alex McAuley wrote: No need to worry about multiple instances ... just check the variable before you initialise it... Alex Mcauley http://www.thevacancymarket.com Thanks again david and Alex. I looked but could not find the code to check to see if the variable held an instance or was null. Might I beg for one line of code to show me how to check the variable ? bill - Original Message - *From:* bill mailto:will...@techservsys.com *To:* prototype-scriptaculous@googlegroups.com mailto:prototype-scriptaculous@googlegroups.com *Sent:* Tuesday, November 17, 2009 3:18 PM *Subject:* [Proto-Scripty] Re: instanting and reinstanting a function: Ajax.PeriodicalUpdater david wrote: Bill, just a precision (in Fact I did not understand that you still need to get every minutes the result): the stop() method is at http://api.prototypejs.org/ajax/ajax/periodicalupdater.html#stop-instance_method normally, you could stop start the peridical updater at will. -- david Thanks david and Alex, So what is the best practice: 1) create the periodicalupdater when the page loads, stopping it immediately and then start it when the div becomes visible and stop it when the div becomes invisible. 2) create the periodicalupdater when it becomes visible and stop it when it becomes invisible Or is there any difference ? (I worry about multiple instanting the periodicalupdater ) -- 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-scriptaculous@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 -~--~~~~--~~--~--~--- -- 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. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=. -- 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. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=. -- 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. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
[Proto-Scripty] Maybe OT: passing a function name to a function
I suspect this is not a prototype question, but then again, every time I turn around I am learning new capabilities of the framework. I need to pass a function name as an argument to a function for a call-back function. Do I just pass the function name as a quoted text argument ? If I do, do I need to eval the function when I want to execute it. or... what is the best way of doing this ? My apologies in advance if prototype does not have a nifty way of doing this and my thanks in advance for any suggestions. -- 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. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
[Proto-Scripty] instanting and reinstanting a function: Ajax.PeriodicalUpdater
When the user clicks a link it executes this function: function fPendingMail() { //set the mail div to show document.getElementById (maildiv).style.display = block; new Ajax.PeriodicalUpdater('maildiv', 'mail/pending_mail.php', { method: 'get', frequency: 60, decay: 1 }); return false; //inhibit the href } and the maildiv appears and loads a list of pending mail messages and all is good. When they are done the script executes document.getElementById (maildiv).style.display = none; I know the div is still updating and I don't need it to so: 1) how do I stop the periodicalUpdater. 2) should I be de-instanting (whatver the correct verb is) the object so that when the user clicks the link again it will not just keep creating more instances of the Ajax.PeriodicalUpdater ? bill -- 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-scriptaculous@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: Some basic basic stuff
Eugene Hourany wrote: Hi all, I'm tearing my hair out trying to figure out why I keep getting a element is null error. Here's what my code looks like: $('firstname').hide(); and I have input id=firstname name=firstname value= / and I get Error: $(firstname) is null Source File: file:///C:/Documents%20and%20Settings/142253/Desktop/test/index.html# Line: 14 I'm doing this locally from my desktop. I'm using prototype 1.6.1. do you have the input declaration before the execution of the $('firstname').hide(); If you execute the js before the input is declared, the id will not exist. bill -- 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-scriptaculous@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] walking the DOM
I have little experience manipulating the dom other than using $( to get/set style elements so direct advice and a link for education would be appreciated. Overall, the problem I have is a bunch of stacked divs with different z-indexes. Sometimes the user will want to move a dive to the front. This is not a problem, but I worry that with the page open for 6 - hours (all functions are performed with AJAX) my z-index number will grow too large. So, what I would like to do is decrement the z-index of all the divs involved when incrementing the one I am bringing to the front. I don't want to decrement the z-index of all the divs. I don't want to decrement the ones that are currently display=none nor the ones that stay visible all the time, nor divs that are children of the stacked divs. The stacked divs are all children of body, but so are some that should not be affected. If it would make the job easier, I could move all the stacked divs into a container div. So, how to walk though all the stacked divs to change their z-index, if currently being displayed ? If prototype does not offer assistance (but I can't imagine that), let me know and I will post in a .js group. -- 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-scriptaculous@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: walking the DOM
T.J. Crowder wrote: Hi Bill, If you make them all children of one container, then you can process them in a loop like so: var divsToSuppress, n; divsToSuppress = $('containerName').children(); for (n = divsToSuppress.length - 1; n = 0; --n) { divsToSuppress[n].setStyle({'zIndex': '4'}); // = Or whatever value } Alternately, if you give all of these stackable divs some class name, you can use divsToSuppress = $$('div.xyz'); ...at the beginning of that. Where xyz is the class name ? bill FWIW, -- T.J. Crowder tj / crowder software / com www.crowdersoftware.com On Sep 20, 12:01 pm, bill will...@techservsys.com wrote: I have little experience manipulating the dom other than using $( to get/set style elements so direct advice and a link for education would be appreciated. Overall, the problem I have is a bunch of stacked divs with different z-indexes. Sometimes the user will want to move a dive to the front. This is not a problem, but I worry that with the page open for 6 - hours (all functions are performed with AJAX) my z-index number will grow too large. So, what I would like to do is decrement the z-index of all the divs involved when incrementing the one I am bringing to the front. I don't want to decrement the z-index of all the divs. I don't want to decrement the ones that are currently display=none nor the ones that stay visible all the time, nor divs that are children of the stacked divs. The stacked divs are all children of body, but so are some that should not be affected. If it would make the job easier, I could move all the stacked divs into a container div. So, how to walk though all the stacked divs to change their z-index, if currently being displayed ? If prototype does not offer assistance (but I can't imagine that), let me know and I will post in a .js group. -- Bill Drescher william {at} TechServSys {dot} com -- 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-scriptaculous@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: walking the DOM
T.J. Crowder wrote: Where xyz is the class name ? Yup. Thanks -- 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-scriptaculous@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: ? of format of evalScripts
Alex McAuley wrote: var request=new Ajax.Updater('element','/url',{ method: 'post', evalScripts: true, parameters : { id: id, page: page } }); request=null; - works fine... Its probably a syntax error in your returning javascript Alex Mcauley http://www.thevacancymarket.com Thanks Alex, my error was trying to put evalScripts:True after the parameters bracket. - Original Message - *From:* bill mailto:will...@techservsys.com *To:* prototype-scriptaculous@googlegroups.com mailto:prototype-scriptaculous@googlegroups.com *Sent:* Tuesday, August 25, 2009 2:26 PM *Subject:* [Proto-Scripty] ? of format of evalScripts My function is: new Ajax.Updater('showMessageDiv', 'mail/process_message.php', { parameters: $('showMessageDiv').down('form').serialize(true), onFailure: function(response) { alert (mail.js: failure to submit form - getmessage); } }); When I try to add evalScripts:true so I can download and evaluate scripts I get a syntax error, no matter what I try. Would someone please show me the correct format to add evalScripts:true the this function ? -- Bill Drescher william {at} TechServSys {dot} com -- 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-scriptaculous@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: How to use Ajax.Updater evalScripts
It may not be as elegant as the solution suggested here, but I got it to work by wrapping the Ajax.Updater in a function called by onsubmit and placed in the main page. But, I still would like to know how to have evalScripts:true work. bill bill wrote: I download a html fragment to a div using this script, which works fine. function fetchMessage(message_id, evt) { stopBubble(evt); url = 'mail/getmessage.php?n=' + message_id; new Ajax.Updater('showMessageDiv',url , {method: 'get',evalScripts: true} ); // get the requested message } I need to include a script in the page loaded by url I tried this way of using evalScripts but it does not download the script afaik. this is the script: script type=text/javascript $('messageProcessForm').observe('submit',function(event) { new Ajax.Updater('showMessageDiv', 'mail/process_message.php', { parameters: $('showMessageDiv').down('form').serialize(true), onFailure: function(response) { alert (mail.js: failure to submit form - getmessage); } }); Event.stop(event); }) /script I was going to put the script in the main body, but that won't work because messageProcessForm does not exist until the div is loaded. \ Issue #2: As this is a script that is watching, it is not a function so I am not sure how to have it be included in the page, or do I need to do that as it is not a function ? -- Bill Drescher william {at} TechServSys {dot} com -- 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-scriptaculous@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: POSTing a form via AJAX
Alex McAuley wrote: I replied to you with an example. I wrote Bill You need to observe the form submit. $('the-id-of-the-form').observe('submit',function(event) { /// do the ajax that TJ said... Event.stop(event); // will stop it doing its default action! }); Alex Mcauley http://www.thevacancymarket.com Putting it all together (apparently wrongly) I have: $('messageProcessForm').observe('submit',function(event) { new Ajax.Updater('showMessageDiv', mail/process_message.php, { parameters: $('showMessageDiv').down('form').serialize(true), onFailure: function(response) { alert (mail.js: failure to submit form - getmessage); } Event.stop(event); // will stop it doing its default action! }); } When I try to load this I get the message: Error: missing } after property list Source File: http://192.168.0.101/MP2010-v2/scripts/mail.js Line: 33 Source Code: Event.stop(event); // will stop it doing its default action! but, I can't see a missing close bracket. -- 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-scriptaculous@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: POSTing a form via AJAX
Chris Sansom wrote: At 10:54 -0400 22/8/09, bill wrote: Putting it all together (apparently wrongly) I have: $('messageProcessForm').observe('submit',function(event) { new Ajax.Updater('showMessageDiv', mail/process_message.php, { parameters: $('showMessageDiv').down('form').serialize(true), onFailure: function(response) { alert (mail.js: failure to submit form - getmessage); } Event.stop(event); // will stop it doing its default action! }); } When I try to load this I get the message: Error: missing } after property list Source File: http://192.168.0.101/MP2010-v2/scripts/mail.jshttp://192.168.0.101/MP2010-v2/scripts/mail.js Line: 33 Source Code: Event.stop(event); // will stop it doing its default action! but, I can't see a missing close bracket. Jumping in here as a non-expert, but I think the problem may be that your 'Event.stop(event);' is in the wrong place and should be outside the 'new Ajax.Updater(...)', either before or after, but not inside. It's when it hits that line that it's looking for the extra } now $('messageProcessForm').observe('submit',function(event) { new Ajax.Updater('showMessageDiv', mail/process_message.php, { parameters: $('showMessageDiv').down('form').serialize(true), onFailure: function(response) { alert (mail.js: failure to submit form - getmessage); } }); Event.stop(event); // will stop it doing its default action! } the error changes to: Error: missing ) after argument list Source File: http://192.168.0.101/MP2010-v2/scripts/mail.js Line: 36, Column: 1 Source Code: } ^ As far as I can see the parens and brackets are balanced -- 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-scriptaculous@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: POSTing a form via AJAX
Chris Sansom wrote: At 11:21 -0400 22/8/09, bill wrote: now $('messageProcessForm').observe('submit',function(event) { new Ajax.Updater('showMessageDiv', mail/process_message.php, { parameters: $('showMessageDiv').down('form').serialize(true), onFailure: function(response) { alert (mail.js: failure to submit form - getmessage); } }); Event.stop(event); // will stop it doing its default action! } the error changes to: Error: missing ) after argument list Source File: http://192.168.0.101/MP2010-v2/scripts/mail.jshttp://192.168.0.101/MP2010-v2/scripts/mail.js Line: 36, Column: 1 Source Code: } ^ As far as I can see the parens and brackets are balanced Nope - just loaded this snippet into BBEdit which has a very handy facility for seeing whether pairs of brackets (of all types) are balanced. You have no closing ) to match the ( after '.observe'. In fact you need a ');' at the end of the whole thing. And btw, shouldn't mail/process_message.php be in quotes? right you are, both times. Many thanks ! bill -- 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-scriptaculous@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] How to use Ajax.Updater evalScripts
I download a html fragment to a div using this script, which works fine. function fetchMessage(message_id, evt) { stopBubble(evt); url = 'mail/getmessage.php?n=' + message_id; new Ajax.Updater('showMessageDiv',url , {method: 'get',evalScripts: true} ); // get the requested message } I need to include a script in the page loaded by url I tried this way of using evalScripts but it does not download the script afaik. this is the script: script type=text/javascript $('messageProcessForm').observe('submit',function(event) { new Ajax.Updater('showMessageDiv', 'mail/process_message.php', { parameters: $('showMessageDiv').down('form').serialize(true), onFailure: function(response) { alert (mail.js: failure to submit form - getmessage); } }); Event.stop(event); }) /script I was going to put the script in the main body, but that won't work because messageProcessForm does not exist until the div is loaded. \ Issue #2: As this is a script that is watching, it is not a function so I am not sure how to have it be included in the page, or do I need to do that as it is not a function ? -- 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-scriptaculous@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: POSTing a form via AJAX
- Original Message - *From:* bill mailto:will...@techservsys.com *To:* prototype-scriptaculous@googlegroups.com mailto:prototype-scriptaculous@googlegroups.com *Sent:* Saturday, August 22, 2009 6:42 PM *Subject:* [Proto-Scripty] Re: POSTing a form via AJAX Chris Sansom wrote: At 11:21 -0400 22/8/09, bill wrote: now $('messageProcessForm').observe('submit',function(event) { new Ajax.Updater('showMessageDiv', mail/process_message.php, { parameters: $('showMessageDiv').down('form').serialize(true), onFailure: function(response) { alert (mail.js: failure to submit form - getmessage); } }); Event.stop(event); // will stop it doing its default action! } the error changes to: Error: missing ) after argument list Source File: http://192.168.0.101/MP2010-v2/scripts/mail.jshttp://192.168.0.101/MP2010-v2/scripts/mail.js Line: 36, Column: 1 Source Code: } ^ As far as I can see the parens and brackets are balanced Nope - just loaded this snippet into BBEdit which has a very handy facility for seeing whether pairs of brackets (of all types) are balanced. You have no closing ) to match the ( after '.observe'. In fact you need a ');' at the end of the whole thing. And btw, shouldn't mail/process_message.php be in quotes? right you are, both times. Many thanks ! bill Alex McAuley wrote: Your URL of the AJax.Updater needs wrapping in '' too - currently its not enclosed in ' Alex Mcauley http://www.thevacancymarket.com yeah, got that. bill -- 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-scriptaculous@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: POSTing a form via AJAX
T.J. Crowder wrote: Hi, 'Tis indeed very easy. Say you have a form wrapped in a div: div id='formwrapper'form /form/div You can post it like so and take the result (which is presumed to be an HTML snippet in this case) and use that to update the container: new Ajax.Updater('formwrapper', someurl, { parameters: $('formwrapper').down('form').serialize(true), onFailure: function(response) { // ...show a failure message... } }); ... That seemed so easy when I read the post, but. . . How do I trigger the submission ? I tried onsubmit = {the code above} and it just submitted regularly and replaced the whole page with the output, not just the div. I tried putting the code above as a script after the form, but still in the div and got the same result. bill -- 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-scriptaculous@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: POSTing a form via AJAX
bill wrote: T.J. Crowder wrote: Hi, 'Tis indeed very easy. Say you have a form wrapped in a div: div id='formwrapper'form /form/div You can post it like so and take the result (which is presumed to be an HTML snippet in this case) and use that to update the container: new Ajax.Updater('formwrapper', someurl, { parameters: $('formwrapper').down('form').serialize(true), onFailure: function(response) { // ...show a failure message... } }); ... That seemed so easy when I read the post, but. . . How do I trigger the submission ? I tried onsubmit = {the code above} and it just submitted regularly and replaced the whole page with the output, not just the div. I tried putting the code above as a script after the form, but still in the div and got the same result. bill Putting the code as a script did not work, I expect, because the script was not served by Ajax.updater. Using Firebug I determined that the script was stripped out, which raises the next question. I know that I need to set a parameter to updater so that it will not strip scripts. I have read the section on evalScripts and the need to set the function with coolFunc = function () { ... } The script that loads the form is invoked as: new Ajax.Updater('showMessageDiv',url , {method: 'get',evalScripts: true} ); // get the requested message where url is defined as: url = 'mail/getmessage.php?n=' + message_id; but it does not upload the script so I suspect that I have the evalScripts in the wrong place. -- 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-scriptaculous@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] POSTing a form via AJAX
I've read the docs, but can't seem to figure out how to POST a form via AJAX. I'm sure it is easy (as most prototype.js function calls are) but how ? I want the reply to update the div that holds the form (which itself was downloaded via AJAX). bill --~--~-~--~~~---~--~~ 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 prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Calling more than one effect fails (script.aculo.us)
Hi, thank you for this hint. Didn't actually solve my problem but a way to improve my code =) Solution for my problem: http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/154cb11c642020f6# On 27 Jul., 16:47, Diodeus diod...@gmail.com wrote: Don't use the onload event in the body tag. Your script starts running before the DOM is ready. Use this instead in a script block: document.observe(dom:loaded, function() { start() }); See:http://www.prototypejs.org/api/document/observe On Jul 25, 8:16 am, bill stefan@googlemail.com wrote: Hi, I'm new in using javascript and script.aculo.us so please patient with me =) I guess the best thing to do is to start with some code: script type=text/javascript language=javascript function start() { Effect.Pulsate('warning', { pulses: 5, duration: 4 , from: 0.4}); Effect.Fade('info', { duration: 6}); } /script body onload=start(); div id='info' Some info text /div div id='warning' Some warning text /div I guess it's pretty obvious what I'm trying to do: after the page is loaded, I want to start trigger two effects for the boxes info and warning. But non of the effect actually happen. If I just try to start one effect (I deleting one of function calls in start()) the remaining one is executed as expected. So why aren't both working at the same time? Thank you for any advice, bill --~--~-~--~~~---~--~~ 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 prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Calling more than one effect fails (script.aculo.us) - Correction
This solves my problem perfectly. Thank you if ($('foo')) new Effect.Highlight('foo'); --~--~-~--~~~---~--~~ 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 prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Calling more than one effect fails (script.aculo.us)
Hi, I'm new in using javascript and script.aculo.us so please patient with me =) I guess the best thing to do is to start with some code: script type=text/javascript language=javascript function start() { Effect.Pulsate('warning', { pulses: 5, duration: 4 , from: 0.4}); Effect.Fade('info', { duration: 6}); } /script body onload=start(); div id='info' Some info text /div div id='warning' Some warning text /div I guess it's pretty obvious what I'm trying to do: after the page is loaded, I want to start trigger two effects for the boxes info and warning. But non of the effect actually happen. If I just try to start one effect (I deleting one of function calls in start()) the remaining one is executed as expected. So why aren't both working at the same time? Thank you for any advice, bill --~--~-~--~~~---~--~~ 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 prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: window.createPopup() and permission denied
Well, just in case anyone has this problem in the future, I did eventually find my answer. To use the createPopup function as described in my post, you must reference Prototype and Scriptaculous locally, not through the Google API as I was doing. As soon as the libraries were in the same domain, my scripts worked without error. Just FYI. On Jan 3, 12:05 pm, Bill in Kansas City will...@seritas.com wrote: I've got a web application written in classic ASP that uses the window.createPopup() method for context menus. When a menu item is selected, the onClick for the item is parent.myFunction(). Note: this is all one page: I'm not scripting across frames, iframes, domains, anything; all one page, all one domain. Been working great for two years. I've introduced Prototype and Scriptaculous, and now this same code produces a permission denied error. I've tried the following scenarios: onClick=alert('clicked!'); works fine onClick=myFunction(); error: object required, of course onClick=parent.myFunction(); error: permission denied I've tried plugging in Proto.Menu, but it's not as plug'n'play as the authors would like to think, and (as always) deadlines loom. Given that there are several systems over which I have maintenance duties, I'd just as soon not have to rewrite them all. Is there a fix for this? Or a workaround? Something I'm missing? 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 prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] window.createPopup() and permission denied
I've got a web application written in classic ASP that uses the window.createPopup() method for context menus. When a menu item is selected, the onClick for the item is parent.myFunction(). Note: this is all one page: I'm not scripting across frames, iframes, domains, anything; all one page, all one domain. Been working great for two years. I've introduced Prototype and Scriptaculous, and now this same code produces a permission denied error. I've tried the following scenarios: onClick=alert('clicked!'); works fine onClick=myFunction(); error: object required, of course onClick=parent.myFunction(); error: permission denied I've tried plugging in Proto.Menu, but it's not as plug'n'play as the authors would like to think, and (as always) deadlines loom. Given that there are several systems over which I have maintenance duties, I'd just as soon not have to rewrite them all. Is there a fix for this? Or a workaround? Something I'm missing? 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 prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: modal message box
Hi Russell, Russell wrote: I have been brwosing the wiki learning the features of script.aculo.us and was wondering if there was an easy way to create a modal message box and if so is there an example somwhere? I'm looking forward to a better way but, in the meantime, I'm under the impression that LightBox and its derivatives are the current 'best answer' to the need for modal dialogs on the web. HTH, Bill --~--~-~--~~~---~--~~ 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: modal message box
Hi Walter, Walter Lee Davis wrote: Here's a couple that are more focused than LightBox et al. http://prototype-window.xilinus.com/ http://livepipe.net/control/window Excellent! I hadn't come across these (I've been focused on Ruby-friendly versions). Thank you. Best regards, Bill --~--~-~--~~~---~--~~ 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] double play with sound.js
Greetings all! I'm adding simple sounds (beep and burp) to a Rails app with sound.js. I'm having a really wierd problem with it though. I call Sound.play(good_sound) or Sound.play(bad_sound) depending on whether or not a search succeeds. First time it works correctly, playing the correct sound. Second time, it plays the last sound, then the correct sound. Works that way from then on. I'm logging the calls to Sound.play in FireFox and, according to the console, it's only getting called once per request/response. But the sound's getting played twice. I've scratched my head raw. Any idea what I might be doing wrong? Thanks in advance, Bill --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---