Re: [Proto-Scripty] not send data in URL?
On 20 July 2010 06:24, geoffcox g...@freeuk.com wrote: Hello I have this php code for ($count=0;$countsizeof($units);$count++) { echo a href='btec-first/index.php?unit= . $units[$count] . folder=/ . $btec_first_folder[$units[$count]-1] . ' target='content'BTEC First - Unit . $units[$count] . /abr\n; } which sends the data to file index.php as part of the URL. Is it possible to use POST instead so that the path info is not visible to the user? I have thought of ajax/prototype but this would need the array data to be passed to JavaScript and not clear how to do this? Any other way? Cheers Geoff You could have to create a form with am input type=hidden for each unit and folder and a bit of JS to turn an a into a form submitter - or just use a button. If you want to use ajax, then the same mechanism - create the form, but use an ajax submitter to process the forms. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Prototype and WYSIWYG editors weird FF bug
Hi, I don't think it's possible to help with this without a lot more information. What's `editorDocument`, for instance? You said that the failure occurs in `setStyle`; so you're going to need to show us your call to `setStyle` at the very least (or your call to whatever else in Prototype called `setStyle`). I don't think the code you've shown calls Prototype at all, although without knowing what `editorDocument` is... -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Jul 20, 1:34 am, Gindi Bar Yahav g.b.ya...@gmail.com wrote: Hey. I have a question that I'll be glad if you can help me. I'm building a WYSIWYG editor based on prototype and I want to extend prototype to the frame itself. I've written this code var htmlContent = ; htmlContent = '!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;' + \n + html\n + head\n + ' script type=text/javascript language=javascript src=http://localhost/PearCMS2/Public/JavaScripts/ThirdParty/ prototype.js/script' + \n + ieCompatible + /head\n + body\n + content + /body\n + /html; // Write it this.editorDocument.open('text/html', 'replace'); this.editorDocument.write(htmlContent); this.editorDocument.close(); but for some reason, when I'm attaching the prototype.js file it gives me an error with FF - element can not be null, in the setStyle function. in both IE7,8 and safari it works. Hope you can help me. thanks! Yahav. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Prototype and WYSIWYG editors weird FF bug
OK, sorry about the lack of details here is the define of editorDocument /** Iframe exists already? **/ if ( $(PearServicesEditor_ + this.editorID + _IFrame) ) { this.editorFrame= $( PearServicesEditor_ + this.editorID + _iframe ); } else { var editorFrame = new Element(IFRAME, { id: PearServicesEditor_ + this.editorID + _IFrame, tabindex: 0 }); // This is IE and we're using SSL? (fix bug with anoying ssl certificate warning...) if( Prototype.Browser.IE window.location.protocol == 'https:' ) { editorFrame.writeAttribute( 'src', this.options.editorFiles + '/ index.html' ); } else { editorFrame.writeAttribute( src, javascript: void(0);); } // Append this.editorFrame= editorFrame; this.editorTextarea.up().insert( this.editorFrame ); // Match style with non-IE browsers if( !Prototype.Browser.IE ) { this.editorFrame.setStyle( 'border: 1px inset;' ); } } // Get the editor height cookie (if we set one) try { var editorThawedHeight = pearRegistry.Cookies.Get( 'PearServicesEditor_Height' ); } catch(__e) { editorThawedHeight = false; } if ( Object.isNumber( editorThawedHeight ) editorThawedHeight 50 ) { this.editorTextarea.setStyle( { height: editorThawedHeight + 'px' } ); } // Set-up var editorTextareaDims = this.editorTextarea.getDimensions(); if( Object.isUndefined( editorTextareaDims ) || editorTextareaDims.height == 0 ) { editorTextareaDims.height = this.options.editorMinHeight; } this.editorFrame.setStyle( { width: 100%, height: editorTextareaDims.height + 'px', className: this.editorTextarea.className }); // Hide the text-area this.editorTextarea.hide(); // Write attributes this.editorWindow = Element.extend(this.editorFrame.contentWindow); this.editorDocument = Element.extend(this.editorWindow.document); this.editorSpellCheckObject = Element.extend(this.editorDocument.body); and this.editorTextarea is simply a textarea that is display on the document and was grabbed via the $ function thanks for your help!! regards, yahav. On 20 יולי, 15:23, T.J. Crowder t...@crowdersoftware.com wrote: Hi, I don't think it's possible to help with this without a lot more information. What's `editorDocument`, for instance? You said that the failure occurs in `setStyle`; so you're going to need to show us your call to `setStyle` at the very least (or your call to whatever else in Prototype called `setStyle`). I don't think the code you've shown calls Prototype at all, although without knowing what `editorDocument` is... -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Jul 20, 1:34 am, Gindi Bar Yahav g.b.ya...@gmail.com wrote: Hey. I have a question that I'll be glad if you can help me. I'm building a WYSIWYG editor based on prototype and I want to extend prototype to the frame itself. I've written this code var htmlContent = ; htmlContent = '!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;' + \n
[Proto-Scripty] Effect.multiple and toggle
Hello, I'd like to use the toggle effect on multiple object at the same time I tried with Effect.multiple(['id_1','id_2','id_n'], Effect.toggle) but it doesn't work, also I don't know where/how to pass the 'appear' parameter I'm used to call toggle in this way: Effect.toggle('my_id_of_interest','appear') -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Prototype and WYSIWYG editors weird FF bug
Hi, And at what point does the error occur? One of the setStyle calls? Which one? I mean, I could guess, but guessing is a waste of time. -- T.J. On Jul 20, 1:33 pm, Gindi Bar Yahav g.b.ya...@gmail.com wrote: OK, sorry about the lack of details here is the define of editorDocument /** Iframe exists already? **/ if ( $(PearServicesEditor_ + this.editorID + _IFrame) ) { this.editorFrame = $( PearServicesEditor_ + this.editorID + _iframe ); } else { var editorFrame = new Element(IFRAME, { id: PearServicesEditor_ + this.editorID + _IFrame, tabindex: 0 }); // This is IE and we're using SSL? (fix bug with anoying ssl certificate warning...) if( Prototype.Browser.IE window.location.protocol == 'https:' ) { editorFrame.writeAttribute( 'src', this.options.editorFiles + '/ index.html' ); } else { editorFrame.writeAttribute( src, javascript: void(0);); } // Append this.editorFrame = editorFrame; this.editorTextarea.up().insert( this.editorFrame ); // Match style with non-IE browsers if( !Prototype.Browser.IE ) { this.editorFrame.setStyle( 'border: 1px inset;' ); } } // Get the editor height cookie (if we set one) try { var editorThawedHeight = pearRegistry.Cookies.Get( 'PearServicesEditor_Height' ); } catch(__e) { editorThawedHeight = false; } if ( Object.isNumber( editorThawedHeight ) editorThawedHeight 50 ) { this.editorTextarea.setStyle( { height: editorThawedHeight + 'px' } ); } // Set-up var editorTextareaDims = this.editorTextarea.getDimensions(); if( Object.isUndefined( editorTextareaDims ) || editorTextareaDims.height == 0 ) { editorTextareaDims.height = this.options.editorMinHeight; } this.editorFrame.setStyle( { width: 100%, height: editorTextareaDims.height + 'px', className: this.editorTextarea.className }); // Hide the text-area this.editorTextarea.hide(); // Write attributes this.editorWindow = Element.extend(this.editorFrame.contentWindow); this.editorDocument = Element.extend(this.editorWindow.document); this.editorSpellCheckObject = Element.extend(this.editorDocument.body); and this.editorTextarea is simply a textarea that is display on the document and was grabbed via the $ function thanks for your help!! regards, yahav. On 20 יולי, 15:23, T.J. Crowder t...@crowdersoftware.com wrote: Hi, I don't think it's possible to help with this without a lot more information. What's `editorDocument`, for instance? You said that the failure occurs in `setStyle`; so you're going to need to show us your call to `setStyle` at the very least (or your call to whatever else in Prototype called `setStyle`). I don't think the code you've shown calls Prototype at all, although without knowing what `editorDocument` is... -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Jul 20, 1:34 am, Gindi Bar Yahav g.b.ya...@gmail.com wrote: Hey. I have a question that I'll be glad if you can help me. I'm building a WYSIWYG editor based on prototype and I want to extend prototype to the frame itself. I've written this code var htmlContent
[Proto-Scripty] Re: Prototype and WYSIWYG editors weird FF bug
OK, the bug in here setStyle: function(element, styles) { 2206 element = $(element); 2207 var elementStyle = element.style, match; 2208 if (Object.isString(styles)) { 2209 element.style.cssText += ';' + styles; 2210 return styles.include('opacity') ? 2211 element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; 2212 } 2213 for (var property in styles) 2214 if (property == 'opacity') element.setOpacity(styles[property]); 2215 else 2216 elementStyle[(property == 'float' || property == 'cssFloat') ? 2217 (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : 2218 property] = styles[property]; 2219 2220 return element; 2221 }, element is null [Break on this error] var elementStyle = element.style, match; (copied from firebug) thanks :) occured when uncommenting the prototype.js attach linke. On 20 יולי, 15:23, T.J. Crowder t...@crowdersoftware.com wrote: Hi, I don't think it's possible to help with this without a lot more information. What's `editorDocument`, for instance? You said that the failure occurs in `setStyle`; so you're going to need to show us your call to `setStyle` at the very least (or your call to whatever else in Prototype called `setStyle`). I don't think the code you've shown calls Prototype at all, although without knowing what `editorDocument` is... -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Jul 20, 1:34 am, Gindi Bar Yahav g.b.ya...@gmail.com wrote: Hey. I have a question that I'll be glad if you can help me. I'm building a WYSIWYG editor based on prototype and I want to extend prototype to the frame itself. I've written this code var htmlContent = ; htmlContent = '!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;' + \n + html\n + head\n + ' script type=text/javascript language=javascript src=http://localhost/PearCMS2/Public/JavaScripts/ThirdParty/ prototype.js/script' + \n + ieCompatible + /head\n + body\n + content + /body\n + /html; // Write it this.editorDocument.open('text/html', 'replace'); this.editorDocument.write(htmlContent); this.editorDocument.close(); but for some reason, when I'm attaching the prototype.js file it gives me an error with FF - element can not be null, in the setStyle function. in both IE7,8 and safari it works. Hope you can help me. thanks! Yahav.-הסתר טקסט מצוטט- -הראה טקסט מצוטט- -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Prototype and WYSIWYG editors weird FF bug
Hi, I meant where in _your_ code (but that's still useful info), e.g., this call to setStyle: this.editorFrame.setStyle( 'border: 1px inset;' ); (BTW, the semicolon inside the quotes there is an error, although most browsers will ignore it.) ...or this one: this.editorFrame.setStyle( { width: 100%, height: editorTextareaDims.height + 'px', className: this.editorTextarea.className }); ...and though actually, as they're both on editorFrame, I'm not sure how much it matters. Fundamentally, using Prototype's setStyle on an iframe seems to work, whether freshly-created or not: http://jsbin.com/epano3 http://jsbin.com/epano3/2 So it may be worthwhile trying to figure out what's different in your code vs. that working example. HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Jul 20, 4:20 pm, Gindi Bar Yahav g.b.ya...@gmail.com wrote: OK, the bug in here setStyle: function(element, styles) { 2206 element = $(element); 2207 var elementStyle = element.style, match; 2208 if (Object.isString(styles)) { 2209 element.style.cssText += ';' + styles; 2210 return styles.include('opacity') ? 2211 element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; 2212 } 2213 for (var property in styles) 2214 if (property == 'opacity') element.setOpacity(styles[property]); 2215 else 2216 elementStyle[(property == 'float' || property == 'cssFloat') ? 2217 (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : 2218 property] = styles[property]; 2219 2220 return element; 2221 }, element is null [Break on this error] var elementStyle = element.style, match; (copied from firebug) thanks :) occured when uncommenting the prototype.js attach linke. On 20 יולי, 15:23, T.J. Crowder t...@crowdersoftware.com wrote: Hi, I don't think it's possible to help with this without a lot more information. What's `editorDocument`, for instance? You said that the failure occurs in `setStyle`; so you're going to need to show us your call to `setStyle` at the very least (or your call to whatever else in Prototype called `setStyle`). I don't think the code you've shown calls Prototype at all, although without knowing what `editorDocument` is... -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Jul 20, 1:34 am, Gindi Bar Yahav g.b.ya...@gmail.com wrote: Hey. I have a question that I'll be glad if you can help me. I'm building a WYSIWYG editor based on prototype and I want to extend prototype to the frame itself. I've written this code var htmlContent = ; htmlContent = '!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;' + \n + html\n + head\n + ' script type=text/javascript language=javascript src=http://localhost/PearCMS2/Public/JavaScripts/ThirdParty/ prototype.js/script' + \n + ieCompatible + /head\n + body\n + content + /body\n + /html; // Write it this.editorDocument.open('text/html', 'replace'); this.editorDocument.write(htmlContent); this.editorDocument.close(); but for some reason, when I'm attaching the prototype.js file it gives me an error with FF - element can not be null, in the setStyle function. in both IE7,8 and safari it works. Hope you can help me. thanks! Yahav.-הסתר טקסט מצוטט- -הראה טקסט מצוטט- -- 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,
Re: [Proto-Scripty] Effect.multiple and toggle
On 20 July 2010 15:55, Febo ilpuccio.f...@gmail.com wrote: Hello, I'd like to use the toggle effect on multiple object at the same time I tried with Effect.multiple(['id_1','id_2','id_n'], Effect.toggle) but it doesn't work, also I don't know where/how to pass the 'appear' parameter I'm used to call toggle in this way: Effect.toggle('my_id_of_interest','appear') At a guess, you need to curry() [1] the parameter. So, can you try ... Effect.multiple(['id_1','id_2','id_n'], Effect.toggle.curry('appear')); Regards, Richard. [1] http://api.prototypejs.org/language/function/prototype/curry/ -- 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] Effect.multiple and toggle
This is a revelation to me. I didn't know Effect had a multiple. Also, what is curry? My solution has been to tag those elements with a class, ie div class=effects Then use $$('effects') to get each item and all effects... On each Sent from my iPhone On Jul 20, 2010, at 9:08 AM, Richard Quadling rquadl...@gmail.com wrote: On 20 July 2010 15:55, Febo ilpuccio.f...@gmail.com wrote: Hello, I'd like to use the toggle effect on multiple object at the same time I tried with Effect.multiple(['id_1','id_2','id_n'], Effect.toggle) but it doesn't work, also I don't know where/how to pass the 'appear' parameter I'm used to call toggle in this way: Effect.toggle('my_id_of_interest','appear') At a guess, you need to curry() [1] the parameter. So, can you try ... Effect.multiple(['id_1','id_2','id_n'], Effect.toggle.curry('appear')); Regards, Richard. [1] http://api.prototypejs.org/language/function/prototype/curry/ -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Effect.multiple and toggle
On 20 July 2010 17:59, Ralph Brickley i...@topsoftweb.com wrote: This is a revelation to me. I didn't know Effect had a multiple. Also, what is curry? My solution has been to tag those elements with a class, ie div class=effects Then use $$('effects') to get each item and all effects... On each Sent from my iPhone On Jul 20, 2010, at 9:08 AM, Richard Quadling rquadl...@gmail.com wrote: On 20 July 2010 15:55, Febo ilpuccio.f...@gmail.com wrote: Hello, I'd like to use the toggle effect on multiple object at the same time I tried with Effect.multiple(['id_1','id_2','id_n'], Effect.toggle) but it doesn't work, also I don't know where/how to pass the 'appear' parameter I'm used to call toggle in this way: Effect.toggle('my_id_of_interest','appear') At a guess, you need to curry() [1] the parameter. So, can you try ... Effect.multiple(['id_1','id_2','id_n'], Effect.toggle.curry('appear')); Regards, Richard. [1] http://api.prototypejs.org/language/function/prototype/curry/ Curries (burns in) arguments to a function, returning a new function that when called with call the original passing in the curried arguments (along with any new ones) The link http://api.prototypejs.org/language/function/prototype/curry/ is the documentation for curry. So, Effect.toggle.curry('appear') returns a new function which, when called, will call the Effect.toggle function with 'appear' as the first parameter, along with any other parameters supplied by the Effect.multiple() function. Is it the same as $$('effects').invoke('toggle', 'appear'); Hmm. On the surface, probably yes. But I'm not an expert here. One difference is that Effect.multiple allows you to supply any ids. I suppose ... Effect.multiple($$('effects'), Effect.toggle.curry('appear')); could also be a similar approach. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: not send data in URL?
You could have to create a form with am input type=hidden for each unit and folder and a bit of JS to turn an a into a form submitter - or just use a button. If you want to use ajax, then the same mechanism - create the form, but use an ajax submitter to process the forms. Thanks for your reply. Isn't it possible to pass the unit and folder data to JavaScript and then use something like var params = ({ unit: unit_given, folder: folder_given }); new Ajax.Request('send.php', { method:'post', parameters: params, etc? Cheers Geoff -- 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] Morph and setTimeout
I'm trying to mix Effect.Morph and setTimeout() to enlarge a div and after the div finishes enlargening another div inside it appears (this is where I use setTimeout()). The problema is that I get a error and can't find out why. Here is the code: function expandir(id,newh){ new Effect.Morph('cont'+id, { style: 'height:'+newh+'px;', // CSS Properties duration: 0.5 // Core Effect properties }); setTimeout($('masinfo'+id).show(),500,id); } Here it says that id is not defined in the setTimeout line. Any ideas? -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- 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] Morph and setTimeout
JavaScript doesn't know what the +id is because it's within the double quotes. Do this instead setTimeout($('masinfo'+id+).show(),500,id); } Sent from my iPhone On Jul 20, 2010, at 12:59 PM, Martín Marqués martin.marq...@gmail.com wrote: I'm trying to mix Effect.Morph and setTimeout() to enlarge a div and after the div finishes enlargening another div inside it appears (this is where I use setTimeout()). The problema is that I get a error and can't find out why. Here is the code: function expandir(id,newh){ new Effect.Morph('cont'+id, { style: 'height:'+newh+'px;', // CSS Properties duration: 0.5 // Core Effect properties }); setTimeout($('masinfo'+id).show(),500,id); } Here it says that id is not defined in the setTimeout line. Any ideas? -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Morph and setTimeout
The setTimeout only knows what the value of id is when it is created, not when it is invoked. So it's telling you the truth. At the moment when the page loaded, there was no value for id, so there still isn't one inside of setTimeout's little bubble. There's a nice feature in all the Effects that you should use instead: afterFinish. function expandir(id,newh){ new Effect.Morph('cont'+id, { style: 'height:'+newh+'px;', // CSS Properties duration: 0.5, afterFinish: function(){ Element.show.delay(0.5, 'masinfo'+id)} }); } That's not tested, but it should get you close. Walter On Jul 20, 2010, at 3:59 PM, Martín Marqués wrote: I'm trying to mix Effect.Morph and setTimeout() to enlarge a div and after the div finishes enlargening another div inside it appears (this is where I use setTimeout()). The problema is that I get a error and can't find out why. Here is the code: function expandir(id,newh){ new Effect.Morph('cont'+id, { style: 'height:'+newh+'px;', // CSS Properties duration: 0.5 // Core Effect properties }); setTimeout($('masinfo'+id).show(),500,id); } Here it says that id is not defined in the setTimeout line. Any ideas? -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- 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 . -- 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] Morph and setTimeout
I'm pretty sure Ralph's suggestion will work. I prefer to write this in a way which will hopefully highlight the potential bug to a less-experienced maintenance developer after I have moved onto a 6-digit consulting career that I run two-hours a day from the Bahamas (boy, sure hope my idea works or that consulting career is a pipe-dream): var elid = 'masinfo' + id; setTimeout($(elid).show(),500,id); -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Ralph Brickley Sent: Tuesday, July 20, 2010 3:04 PM To: prototype-scriptaculous@googlegroups.com Subject: Re: [Proto-Scripty] Morph and setTimeout JavaScript doesn't know what the +id is because it's within the double quotes. Do this instead setTimeout($('masinfo'+id+).show(),500,id); } Sent from my iPhone On Jul 20, 2010, at 12:59 PM, Martín Marqués martin.marq...@gmail.com wrote: I'm trying to mix Effect.Morph and setTimeout() to enlarge a div and after the div finishes enlargening another div inside it appears (this is where I use setTimeout()). The problema is that I get a error and can't find out why. Here is the code: function expandir(id,newh){ new Effect.Morph('cont'+id, { style: 'height:'+newh+'px;', // CSS Properties duration: 0.5 // Core Effect properties }); setTimeout($('masinfo'+id).show(),500,id); } Here it says that id is not defined in the setTimeout line. Any ideas? -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- 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] Morph and setTimeout
Oops, already made a mistake; Make that: var cmd = $('masinfo' + id + ).show(); setTimeout(cmd,500,id); -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Rick.Wellman Sent: Tuesday, July 20, 2010 3:42 PM To: prototype-scriptaculous@googlegroups.com Subject: RE: [Proto-Scripty] Morph and setTimeout I'm pretty sure Ralph's suggestion will work. I prefer to write this in a way which will hopefully highlight the potential bug to a less-experienced maintenance developer after I have moved onto a 6-digit consulting career that I run two-hours a day from the Bahamas (boy, sure hope my idea works or that consulting career is a pipe-dream): var elid = 'masinfo' + id; setTimeout($(elid).show(),500,id); -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Ralph Brickley Sent: Tuesday, July 20, 2010 3:04 PM To: prototype-scriptaculous@googlegroups.com Subject: Re: [Proto-Scripty] Morph and setTimeout JavaScript doesn't know what the +id is because it's within the double quotes. Do this instead setTimeout($('masinfo'+id+).show(),500,id); } Sent from my iPhone On Jul 20, 2010, at 12:59 PM, Martín Marqués martin.marq...@gmail.com wrote: I'm trying to mix Effect.Morph and setTimeout() to enlarge a div and after the div finishes enlargening another div inside it appears (this is where I use setTimeout()). The problema is that I get a error and can't find out why. Here is the code: function expandir(id,newh){ new Effect.Morph('cont'+id, { style: 'height:'+newh+'px;', // CSS Properties duration: 0.5 // Core Effect properties }); setTimeout($('masinfo'+id).show(),500,id); } Here it says that id is not defined in the setTimeout line. Any ideas? -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Morph and setTimeout
2010/7/20 Rick.Wellman rick.well...@kiewit.com: I'm pretty sure Ralph's suggestion will work. I prefer to write this in a way which will hopefully highlight the potential bug to a less-experienced maintenance developer after I have moved onto a 6-digit consulting career that I run two-hours a day from the Bahamas (boy, sure hope my idea works or that consulting career is a pipe-dream): var elid = 'masinfo' + id; setTimeout($(elid).show(),500,id); This was the first thing I tried out yesterday, and it didn't work. Thanks anyway. -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- 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] Morph and setTimeout
2010/7/20 Rick.Wellman rick.well...@kiewit.com: Oops, already made a mistake; Make that: var cmd = $('masinfo' + id + ).show(); setTimeout(cmd,500,id); Yeah, this is how I made it work, but it's not pretty at all. Walter gave me the beautiful afterFinish. Thanks Walter! -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- 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] Morph and setTimeout
AfterFinish!!! Brilliant. Sent from my iPhone On Jul 20, 2010, at 2:15 PM, Martín Marqués martin.marq...@gmail.com wrote: 2010/7/20 Rick.Wellman rick.well...@kiewit.com: Oops, already made a mistake; Make that: var cmd = $('masinfo' + id + ).show(); setTimeout(cmd,500,id); Yeah, this is how I made it work, but it's not pretty at all. Walter gave me the beautiful afterFinish. Thanks Walter! -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: not send data in URL?
On 20 July 2010 20:58, geoffcox g...@freeuk.com wrote: You could have to create a form with am input type=hidden for each unit and folder and a bit of JS to turn an a into a form submitter - or just use a button. If you want to use ajax, then the same mechanism - create the form, but use an ajax submitter to process the forms. Thanks for your reply. Isn't it possible to pass the unit and folder data to JavaScript and then use something like var params = ({ unit: unit_given, folder: folder_given }); new Ajax.Request('send.php', { method:'post', parameters: params, etc? Cheers Geoff That sort of thing. But I'd use a form and add an observer on the submit. This would allow for graceful degradation. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Effect.multiple and toggle
Thanks Richard and Ralph, I'm studing the code but my feeling is that Effect.toggle can't handle the Object which is always passed by Effect.multiple as last parameter or let's say effect. I don't know very much JavaScript, so I came up with this solution. I added a funciton to public/javascripts/prototype.js Toggle: function(element, options) { element = $(element); effect = ($(options)['effect'] || 'appear').toLowerCase(); Effect.toggle(element, effect, options); } calling the multiple function: Effect.multiple(['id_1','id_2',...,'id_n'], Effect.Toggle, {'effect':'appear'}) I tested the curry but without success, perhaps I'm not so good in JS so I didn't catch the concept of curry. If you have a better solution, let me know. The problem with the class solution is that I have a table and I want to hide some rows of this table, I set the class of each row to odd/ even for zebra colouring. On 20 Lug, 19:08, Richard Quadling rquadl...@gmail.com wrote: On 20 July 2010 17:59, Ralph Brickley i...@topsoftweb.com wrote: This is a revelation to me. I didn't know Effect had a multiple. Also, what is curry? My solution has been to tag those elements with a class, ie div class=effects Then use $$('effects') to get each item and all effects... On each Sent from my iPhone On Jul 20, 2010, at 9:08 AM, Richard Quadling rquadl...@gmail.com wrote: On 20 July 2010 15:55, Febo ilpuccio.f...@gmail.com wrote: Hello, I'd like to use the toggle effect on multiple object at the same time I tried with Effect.multiple(['id_1','id_2','id_n'], Effect.toggle) but it doesn't work, also I don't know where/how to pass the 'appear' parameter I'm used to call toggle in this way: Effect.toggle('my_id_of_interest','appear') At a guess, you need to curry() [1] the parameter. So, can you try ... Effect.multiple(['id_1','id_2','id_n'], Effect.toggle.curry('appear')); Regards, Richard. [1]http://api.prototypejs.org/language/function/prototype/curry/ Curries (burns in) arguments to a function, returning a new function that when called with call the original passing in the curried arguments (along with any new ones) The linkhttp://api.prototypejs.org/language/function/prototype/curry/ is the documentation for curry. So, Effect.toggle.curry('appear') returns a new function which, when called, will call the Effect.toggle function with 'appear' as the first parameter, along with any other parameters supplied by the Effect.multiple() function. Is it the same as $$('effects').invoke('toggle', 'appear'); Hmm. On the surface, probably yes. But I'm not an expert here. One difference is that Effect.multiple allows you to supply any ids. I suppose ... Effect.multiple($$('effects'), Effect.toggle.curry('appear')); could also be a similar approach. -- 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.