[Proto-Scripty] Re: Float sortable causes newline
Wrap each image in a DIV, them make the DIVs sortable. On Sep 9, 10:00 am, David Sveningsson [EMAIL PROTECTED] wrote: Hi, I'm new with scriptaculous and I'm having some issues with sortable. What I have is some images with float:left divided into two groups which I want to allow the user to sort. The sorting works great except when I move an image last in any group which causes the image to appear below the others on a new row. A testcase can be found here:http://ruri.sidvind.com/static-20080909.html I can't really figure out what I am doing wrong so any ideas would be great. Thanks! -- //*David Sveningsson [eXt]* Freelance coder | Game Development Studenthttp://sidvind.com Thou shalt make thy program's purpose and structure clear to thy fellow man by using the One True Brace Style, even if thou likest it not, for thy creativity is better used in solving problems than in creating beautiful new impediments to understanding. signature.asc 1KViewDownload --~--~-~--~~~---~--~~ 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: Float sortable causes newline
Did you put style='float:left' on your DIVs? On Sep 9, 11:26 am, David Sveningsson [EMAIL PROTECTED] wrote: Diodeus skrev: Wrap each image in a DIV, them make the DIVs sortable. Thanks for your reply. I tried but the only difference is that the divs is placed below the row but over the previous content. That is the same as before but no new space is added between the images and the content below. On Sep 9, 10:00 am, David Sveningsson [EMAIL PROTECTED] wrote: Hi, I'm new with scriptaculous and I'm having some issues with sortable. What I have is some images with float:left divided into two groups which I want to allow the user to sort. The sorting works great except when I move an image last in any group which causes the image to appear below the others on a new row. A testcase can be found here:http://ruri.sidvind.com/static-20080909.html I can't really figure out what I am doing wrong so any ideas would be great. Thanks! -- //*David Sveningsson [eXt]* Freelance coder | Game Development Studenthttp://sidvind.com Thou shalt make thy program's purpose and structure clear to thy fellow man by using the One True Brace Style, even if thou likest it not, for thy creativity is better used in solving problems than in creating beautiful new impediments to understanding. signature.asc 1KViewDownloa -- //*David Sveningsson [eXt]* Freelance coder | Game Development Studenthttp://sidvind.com Thou shalt make thy program's purpose and structure clear to thy fellow man by using the One True Brace Style, even if thou likest it not, for thy creativity is better used in solving problems than in creating beautiful new impediments to understanding. signature.asc 1KViewDownload --~--~-~--~~~---~--~~ 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: Livepipe
Dunno. This group has nothing to do with Ruby. On Sep 12, 7:19 am, jason maina [EMAIL PROTECTED] wrote: HI all, Wondering whether I have to have ruby to use livepipe??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How to handle different forms
Forms added to a document via innerHTML (which Ajax updater uses) are not recognized at part as the DOM. You can add fields to a form this way, but not forms themselves. You may need to add a form tag (using new Element) then put the contents of your form inside it. Alternately, you can have the form tag as part of your HTML to begin with. On Sep 16, 7:59 am, luftikus143 [EMAIL PROTECTED] wrote: Hi there, my initial page has (at least) two forms. How do I handle then for example a list of radio buttons in the newly generated code via Ajax.Updater? I need a Javascript which loops through the radio buttons to see which one has been selected and returns this one to one of the forms. In most cases a loop like this one for (var i=0; idocument.form[0].selectedID_temp.length; i++) { } does it. But not always. Sometimes the form[0] results in an error message. It seems it depends where my form has been positioned on the page. Can anyone give me a hint what the most practical way is to get this done? Hope my explanation was good enough... Thanks for any help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How to create this cross-fade effect with script.aculo.us?
Why not just skip the delay on the first one? function startPage() { if (rrrstarted == false) { rrrstarted = true; showtime = setInterval('swapFade()',5000); } else { rrrstarted = true; swapFade() showtime = setInterval('swapFade()',5000); } } On Sep 15, 1:40 am, Jeusdi [EMAIL PROTECTED] wrote: Hello All. I'm a beginner with script.aculo.us framework, and I'va some problem in order to create cross-fade effect: javascript code: script type=text/javascript var divs_to_fade = new Array('fade_product0', 'fade_product1', 'fade_product2', 'fade_product3'); var current_index = 0; var rrrstarted = false; function swapFade() { Effect.Fade(divs_to_fade[current_index], { duration:1, from:1.0, to:0.0 }); current_index++; if (current_index == 4) current_index = 0; Effect.Appear(divs_to_fade[current_index], { duration:1, from:0.0, to: 1.0 }); } function startPage() { if (rrrstarted == false) { rrrstarted = true; showtime = setInterval('swapFade()',5000); } } function stopPage() { clearInterval(showtime); rrrstarted = false; } /script So, each 5 seconds the transition is done. However, there is a problem because, the first time this effect (cross-fade) takes 5 seconds, and the goal would be, that when the mouse is in product_viewer div (see bellow) the effect begins immediately. So, now when I set the mouse over the product_viewer div, I need to wait 5 seconds in order to view the effect, I the first time have to be immediately. Thanks for all in advanced. I will appreciate alot your help. div id=product_viewer onmouseover=startPage() onmouseout=stopPage() div class=fade-box id=fade_product0 img src=img/EtiProd0.gif/ /div div class=fade-box id=fade_product1 style=display: none; img src=img/EtiRibb0.gif/ /div div class=fade-box id=fade_product2 style=display: none; img src=img/EtiInd0.gif/ /div div class=fade-box id=fade_product3 style=display: none; img src=img/EtiRfid0.gif/ /div /div style #product_viewer { border:double; height:45mm; margin:0 0 0 10px; width:63mm; } .fade-box { height:45mm; margin-left:0; position:absolute; width:63mm; } /style --~--~-~--~~~---~--~~ 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: javascript widget (using prototypejs)
Assuming you are attempting to make an Ajax call to a server that is not in your web page's domain, it is a deliberate security restriction in the browser designed to prevent cross-site scripting (XSS) attacks. On Sep 16, 1:34 pm, Rama [EMAIL PROTECTED] wrote: hi, i have developed a widget/badge in javasript. (using prototypejs) It is working well on my own site. but when placed on other domains AJAX(XHR) requests are not working porperly. Can anyone please guide us on why the ajax(XHR) calls/requests are not working when placed on other doman. Regards rama --~--~-~--~~~---~--~~ 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: Apply an effect to every element _except_ one
As usual, I should have added but Kangax probably does this in one line of code. :) On Sep 17, 5:32 am, Matt [EMAIL PROTECTED] wrote: On Sep 16, 5:29 pm, Diodeus [EMAIL PROTECTED] wrote: One way would be to grab the nodes, use a loop, and skip over the element that has the special class. Something like this: div id='container' divX/div divX/div div class='special'don't hide me/div divX/div /div a href='javascript://' onclick='hideExcept(special)'hide most/a script type=text/javascript function hideExcept(notMe) { myNodes = $('container').select('div') for(x=0;xmyNodes.length;x++) { if(!$(myNodes[x]).hasClassName(notMe)) { Element.hide(myNodes[x]) } }} /script Thanks for this. I've had some success, but also some new issues. Here's my function - it's supposed to show a child box and shrink its parent, as well as shrink other boxes on the same level as the parent, but smaller. Essentially, say you have three boxes on level 1 and you click box 3, I want the script to then shrink box 1 and 2 to 20% and shrink box 3 to 30% (so you know which one was clicked) and then display a new box that's a child of box3. function showBox(boxToShow, boxToHide) { // hide any existing level 2 box containers Element.hide('level2'); // show the relevant box in a fancy way Effect.toggle(boxToShow, 'appear'); new Effect.Grow(boxToShow, 120); myNodes = $('level1').select('div') // grab all divs inside 'container' for(x=0;xmyNodes.length;x++) { // loop through each div if(!$(myNodes[x]).hasClassName(boxToHide)) { // if class is called in function name, don't hide it new Effect.Scale(myNodes[x], 30, {scaleX: true, scaleY: true, scaleContent: false}); // scales everything except boxToHide } } // shrink the parent box down too, but not as much new Effect.Scale(boxToHide,40,{scaleX: true, scaleY: true, scaleContent: false}); } I'm calling the function like this: div class=box green 1A a href=javascript:// onclick=showBox('level2a', this.parentNode) div class=box green 1B a href=javascript:// onclick=showBox('level2b', this.parentNode) The end result is that when clicking on the first box, div 1A shrinks to 40% and div 1B shrinks to 30%, but when clicking the second box, they scale down properly (with div 1B remaining 10% bigger than div 1A but then when the animation ends, div 1B flickers down to 30% so it's the same size as 1A still. I've probably made this more complex sounding than it is, but does anyone have any ideas? Matt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How to handle different forms
To insert something into the DOM use this. You can add other attributes as well. Read the Prototype docs. $(someDiv).insert(new Element(form, { id: 'moo' })) On Sep 17, 6:53 am, luftikus143 [EMAIL PROTECTED] wrote: You may need to add a form tag (using new Element) then put the contents of your form inside it. Alternately, you can have the form tag as part of your HTML to begin with. Thanks a lot! How does this new Element thing work? Do you have by chance a quick example? Thanks anyway, I'll see what I can do. --~--~-~--~~~---~--~~ 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: Does Prototype have a future?
One this that I always thought strange is why it is called Prototype -- it makes it seem like it's half-built and experimental, rather than a usable product. While I understand the OO reference, I'm sure many don't. Perhaps the suggestion of merging the two is a valid one (even if they continue to be two separate pieces). Perhaps all of this would benefit from a re-branding and a better community-based web site where people can post more code samples, tutorials and such. On Sep 26, 11:48 am, bluezehn [EMAIL PROTECTED] wrote: What prototype desperately needs is a better community than a group on google! I mean, there are much better interfaces for communities, and there's an irony there that prototype is supposed to be promoting the better use of interfaces... Also merging prototype and scriptaculous into one project I believe would be beneficial. I understand the distinction but it's just confusing for new users. I love coding on prototype - I think it's fantastic - but if it's not going to be supported/developed on in the future, then I'll have no choice but to start again with jquery. On Sep 26, 4:30 pm, Nick Stakenburg [EMAIL PROTECTED] wrote: I'm not sure if Prototype has a real future, at the moment it seems to be getting more and more a side project for it's authors. The reason jQuery is so popular is it's community, it's certainly not those points in your article since those are true for most frameworks. People who write those articles look at it from one framework and are often not even familiar with other frameworks. What would help is if Prototype focussed more on the community, things like scripteka.com need to be intergrated into prototypejs.org . People tend to go with jQuery because all they want is plugins, jQuery has them right there on the main page, while for prototype hardly anyone knows how to find a plugin so the choice for the average guy to pick a framework then becomes very easy. Perhaps 1.6.1 will breath some new life into things, or maybe not. -- Nick On 26 sep, 16:52, Diodeus [EMAIL PROTECTED] wrote: While I am strong advocate of Prototype and Script.aculo.us, I find that the vast majority of discussion/coverage on the web is focussed on jQuery. I understand that there are not huge differences in the capabilities of these two libraries, so why has jQuery gained such popularity vs Prototype? This really hit home since I've been following questions/discussions on stackoverflow.com. Prototype is virtually invisible there. I know this isn't a library war and that the two can cheerfully coexist, and that there is plenty of room in the marketplace for everyone. A few years from now, where will we be? jQuery seems to be gaining momentum. Will there be a resurgence in the popularity of Prototype, or will it fade off into obscurity? (I certainly hope not) Here's the post I read today: - - -http://stackoverflow.com/questions/139723/which-javascript-framework-... - - - Question: Which Javascript Framework is the simplest and most powerful? - - - I propose jQuery. I'll give you some of the major arguments from the presentation that my team put on yesterday for senior management to convince them of that. Reasons: 1. Community acceptance. Look at this graph. It shows searches for prototype, yui and scriptaculous growing from 2004 to 2008. Then out of nowhere in 2006 searches fro jquery shoot up to double the number of the other libraries. The community is actually converging on a single leading product, and it's jQuery. 2. jQuery is very very succinct and readable. I conducted an experiment in which I took existing code (selected at random) written in YUI, and tried re-writing it in jQuery. It was 1/4 as long in jQuery. That makes it 4 times as easy to write, and 4 times as easy to maintain. 3. jQuery integrates well with the rest of the web world. The use of CSS syntax as the key for selecting items is a brilliant trick which helps to meld together the highly diseparate worlds of HTML, CSS and JavaScript. 4. Documentation: jQuery has excellent documentation, with clear specifications and working examples of every method. It has excellent books (I recommend jQuery in Action.) The only competitor which matches it is YUI. 5. Active user community: the Google group which is the main community discussion forum for Prototype has nearly 1000 members. The Google group for jQuery has 10 times as many members. And my personal experience is that the community tends to be helpful. 6. Easy learning curve. jQuery is easy to learn, even for people with experience as a designer, but no experience in coding. 7. Performance. Check out this, which is published by mootools. It compares the speed of different
[Proto-Scripty] Re: Does Prototype have a future?
I must say that I'm really quite pleased that there are so many passionate responses to my original posting. It's good to see the community stand up and be counted. Getting a better community site is probably the best idea going. There needs to be enhancements to the documentation, more code examples, sample projects and the like. It seems there is a lot of community support out there, it's just a matter of providing the right forum to do so. I've got a number of tricks and tips of my own, that I'd love to share and I'm certainly willing to write for whatever forum comes along. I think moving this Google group to its current form was an excellent idea, and has greatly improved our ability to spread the word. So let's move on to the next stage - let's get a Wiki or something set up and get rolling from there. --~--~-~--~~~---~--~~ 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: is there a way for Droppable to reject Dragable?
I'm not 100% clear on what you're describing, but this is how i do it: Droppables.add('myDrop', {accept:'someDraggable',onDrop:function(dragName,dropName) {registerDrop(dragName,dropName)}}) On Oct 1, 2:47 pm, Jo Rhett [EMAIL PROTECTED] wrote: I was thinking that, but I don't see how to know when the Draggable leaves it. Would storing a reference to the droppable in the draggable be sufficient for this? Use the onDropped function to re-add the previous Dropabble? I've noticed that onDropped doesn't appear to be documented (but does work...) On Oct 1, 2008, at 11:15 AM, Diodeus wrote: You will need to remove the droppable for the element once the first item is dropped on it. You car re-create the droppable later if you want to enable that emelemt again. Droppables.remove(element); http://github.com/madrobby/scriptaculous/wikis/droppables On Oct 1, 1:26 pm, Jo Rhett [EMAIL PROTECTED] wrote: Very simple problem: my droppable items are timeslots, so they should only accept one draggable. I need a useful way to prevent a second draggable from being dropped there, but to allow the original draggable to be moved elsewhere. From what I can see of the API, it appears my only real choice is to determine this in a function for revert on the Draggable item. I'm fine with that, but I'm not sure how to determine that the Droppable is full. I can set a variable with onDrop for the Droppable, but it doesn't seem to be possible to unset that variable when the Draggable leaves for greener pastures. Has anyone else bounced off this problem before? Got any good ideas? I can post a small example if anyone wants to see that. -- Jo Rhett Net Consonance : consonant endings by net philanthropy, open source and other randomness --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Effect.morph morphing out of screen.
Try chaning your style to position:absolute. On Oct 2, 3:46 am, revivedk [EMAIL PROTECTED] wrote: Yeah. could be, though I need to somehow get around it. anyways, your example didn't work, and resultet in the same. On 1 Okt., 20:36, Diodeus [EMAIL PROTECTED] wrote: It looks like something about your negative margin is messing things up. Try something like this instead: new Effect.Move('lightbox',{x:137, mode:'relative'}); On Oct 1, 2:18 pm, revivedk [EMAIL PROTECTED] wrote: Is there any reason that using: $('lightbox').morph('left: 137px;'); so, is there any reason, that this causes the DIV to move partially out of the screen? the preset css style of the lightbox (if it can be the cause?) is this: div#lightbox { position: fixed; top: 50%; left: 50%; z-index: 1004; background-color: white; width: 500px; height: 300px; text-align: left; margin-left: -250px; margin-top: -150px; overflow: auto; padding: 0px; } I can't really figure it out, since left: 137px; is a perfectly valid location, within the screen? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Ajax.Updater works only when html is on server where script is
You can add another script tag to your document, and point it to a remote source other then your own domain, but that is not part of the AJAX functionality provided in most libraries, including Prototype. You would have to add a new script tag programmatically. It's a different beast. On Oct 2, 9:55 am, Dave [EMAIL PROTECTED] wrote: Thanks guys, I caught this: While it is not possible to directly query websites for data due to the same origin policy, the script tag does not honor the same- origin policy and can be used in conjunction with JSON. I'm assuming prototype is enforcing the same-origin policy then? Thanks, Dave On Oct 1, 5:17 pm, Brian Williams [EMAIL PROTECTED] wrote: ditto, i was just going to say if the sandbox is accessed through a different port (ie 8080) it will probably trigger a different origin. On Wed, Oct 1, 2008 at 5:15 PM, T.J. Crowder [EMAIL PROTECTED] wrote: What am I missing? Is Ajax.Updater limited to the same host? Ajax.Updater and everything else using XHR: http://en.wikipedia.org/wiki/Same_origin_policy HTH, -- T.J. Crowder tj / crowder software / com On Oct 1, 9:23 pm, Dave [EMAIL PROTECTED] wrote: I have a simple html document: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8/ titleAjax.Updater/title script type=text/javascript src=[absolute path to prototype.js 1.6]/script /head body div id=sandboxscript type=text/javascript new Ajax.Updater('sandbox', '[absolute path to my ruby cgi script]'); /script/div /body /html When I have this html file on the server that is hosting the ruby cgi script it works exactly as it's supposed to (content is dumped to the sandbox). However, when I have the html file to another server the sandbox remains empty. What am I missing? Is Ajax.Updater limited to the same host? I doesn't seem to be a firewall issue as I can access the script directly no problem. An SELinux thing maybe? I'm allowing apache to run scripts though in SELinux, is there something else I need to enable? Any ideas as to what I need to do? Thanks, Dave --~--~-~--~~~---~--~~ 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: 'hoverclass' option for draggables?
onDrag runs continuously as you drag the item. Use onStart and onEnd. Like this: new Draggable('sample',{onStart:function(){$ ('sample').addClassName('dark')},onEnd:function(){$ ('sample').removeClassName('dark')}}) On Oct 3, 10:16 am, lfortin [EMAIL PROTECTED] wrote: With the Droppable class, there is an option 'hoverclass', which allows us to temporarily add a css class when an acceptable draggable is hovering it. I was wondering if such an option exists for the Draggable class? To add a css class to the draggable instead of the droppable in this case? If it does not exists, do you have a suggestion on how to do it using the onDrag callback? Thanks in advance, -Laurent --~--~-~--~~~---~--~~ 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: 'hoverclass' option for draggables?
I'm not sure that answered your question. What conditions are required for the hover? On Oct 3, 11:10 am, Diodeus [EMAIL PROTECTED] wrote: onDrag runs continuously as you drag the item. Use onStart and onEnd. Like this: new Draggable('sample',{onStart:function(){$ ('sample').addClassName('dark')},onEnd:function(){$ ('sample').removeClassName('dark')}}) On Oct 3, 10:16 am, lfortin [EMAIL PROTECTED] wrote: With the Droppable class, there is an option 'hoverclass', which allows us to temporarily add a css class when an acceptable draggable is hovering it. I was wondering if such an option exists for the Draggable class? To add a css class to the draggable instead of the droppable in this case? If it does not exists, do you have a suggestion on how to do it using the onDrag callback? Thanks in advance, -Laurent --~--~-~--~~~---~--~~ 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: can I calculate the file size?
You would have to have the server tell you, and use Ajax to poll that information. It can be done, but it would depend on your server-side code. On Oct 3, 11:22 am, Cristisor [EMAIL PROTECTED] wrote: Hi everyone. I'm trying to build a photo uploader that tells me in real time what percent was uploaded but I don't know how to calculate the file size. I'm sorry if my question is not 100% related to the group discussions. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: script.aculo.us: effect busy or not...
Here's the cheap-and-cheerful method: var running = 1 new Effect.Fade('something',{afterFinish:function(){running=0} }) If you want to go into the guts of scriptaculous, you can look at the effect queue object: http://github.com/madrobby/scriptaculous/wikis/effect-queues On Oct 6, 7:22 am, Roland [EMAIL PROTECTED] wrote: How can i verify if an element currently has an effect which is busy.. looking for something like: $('myElement').__effectBusy //- boolean What are my options? Roland, --~--~-~--~~~---~--~~ 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: Drag'N'Drop question
Here's how to make the drag/drop work. Putting a clone of the dragged item back in the start position depends on how you want your code to work afterwards. Does the item need to be dragged again? style .hovering { background-image:url(Images/something.png); background-repeat:no-repeat } /style div class='draggy' style='width:150px;height:150px;' id='sampleDrag'div id='inside'Drag Me/div/div div id='sampleDrop' style='width:250px;height:250px;border:1px solid #ff'/div script type=text/javascript var cloneDIV new Draggable('sampleDrag',{onDrag:function(){}, onStart:function(){$ ('sampleDrag').addClassName('hovering');Element.hide('inside')}, onEnd:function(){$ ('sampleDrag').removeClassName('hovering');Element.show('inside');}}) Droppables.add('sampleDrop') /script On Oct 6, 12:41 am, Sloan [EMAIL PROTECTED] wrote: Hi all, I'm new to prototype and script.aculo.us. I'm building an interface that will allow a user to drag a tool onto a workarea and drop it. So far, pretty easy. But I need to image/object being dragged to be different from the one the user clicked on at the start of the drag. The item the user will click on to drag is a small graphic, but they need to be able to drag a div containing the result of adding the item (text, input fields, etc.) Also, when dropped, the new item needs to be added to the droppable, and the original graphic needs to be where it was before the drag'n'drop. I've tried using the helper, and replacing the _clone and the draggable (the later sort of works) with different HTML. But when it's dropped the dropped image stays in place, and the original image disappears. Any suggestions, code examples, etc. would be greatly appreciated! Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: OT: Idea for the Prototype wiki site whever it may be
Don't worry Brian, I'll have lots of typos to fix :) On Oct 6, 2:01 pm, Brian Williams [EMAIL PROTECTED] wrote: My idea is pretty straight forward. A Newb's Corner type of area where those who are experienced or even those who aren't all that experienced can make a post or whatnot and talk about something simple that the less-experienced may not know about, or may not be documented all that well. Seriously, I would really like to help out with this site. I can't do much in the way of coding (because me + javascript = grey hair) , but I can do moderation and stuff like that. --~--~-~--~~~---~--~~ 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: Add scroll buttons to Scriptaculous slider?
First you need to store your current slider position when the scroll occurs. Then set the slider position to this value +/- your increment when the link is clicked. a href=javascript:// onclick=slider2.setValue(slidePos+.1)scroll right/a var slidePos = 0 var slider2 = new Control.Slider('handle2', 'track2', { onSlide: function(v) { scrollHorizontal(v, $('scrollable1'), slider2); }, onChange: function(v) { scrollHorizontal(v, $('scrollable1'), slider2);slidePos=v } }); On Oct 9, 12:10 pm, djvern [EMAIL PROTECTED] wrote: Hi, I am using a Scriptaculous slider to scroll a div but I want to be able to control the position of the scroller using buttons too. See my example here: http://www.stickycreation.co.uk/laurus/scroll_testX.html This file links to the prototype framework and the js file slider.js, which contains the following code: // script.aculo.us slider.js v1.6.5, Wed Nov 08 14:17:49 CET 2006 // Copyright (c) 2005, 2006 Marty Haught, Thomas Fuchs // // script.aculo.us is freely distributable under the terms of an MIT- style license. // For details, see the script.aculo.us web site: a href=http:// script.aculo.us/http://script.aculo.us//a if(!Control) var Control = {}; Control.Slider = Class.create(); // options: // axis: 'vertical', or 'horizontal' (default) // // callbacks: // onChange(value) // onSlide(value) Control.Slider.prototype = { initialize: function(handle, track, options) { var slider = this; if(handle instanceof Array) { this.handles = handle.collect( function(e) { return $(e) }); } else { this.handles = [$(handle)]; } this.track = $(track); this.options = options || {}; this.axis = this.options.axis || 'horizontal'; this.increment = this.options.increment || 1; this.step = parseInt(this.options.step || '1'); this.range = this.options.range || $R(0,1); this.value = 0; // assure backwards compat this.values= this.handles.map( function() { return 0 }); this.spans = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false; this.options.startSpan = $(this.options.startSpan || null); this.options.endSpan = $(this.options.endSpan || null); this.restricted = this.options.restricted || false; this.maximum = this.options.maximum || this.range.end; this.minimum = this.options.minimum || this.range.start; // Will be used to align the handle onto the track, if necessary this.alignX = parseInt(this.options.alignX || '0'); this.alignY = parseInt(this.options.alignY || '0'); this.trackLength = this.maximumOffset() - this.minimumOffset(); this.handleLength = this.isVertical() ? (this.handles[0].offsetHeight != 0 ? this.handles[0].offsetHeight : this.handles[0].style.height.replace(/px$/,)) : (this.handles[0].offsetWidth != 0 ? this.handles[0].offsetWidth : this.handles[0].style.width.replace(/px$/,)); this.active = false; this.dragging = false; this.disabled = false; if(this.options.disabled) this.setDisabled(); // Allowed values array this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false; if(this.allowedValues) { this.minimum = this.allowedValues.min(); this.maximum = this.allowedValues.max(); } this.eventMouseDown = this.startDrag.bindAsEventListener(this); this.eventMouseUp = this.endDrag.bindAsEventListener(this); this.eventMouseMove = this.update.bindAsEventListener(this); // Initialize handles in reverse (make sure first handle is active) this.handles.each( function(h,i) { i = slider.handles.length-1-i; slider.setValue(parseFloat( (slider.options.sliderValue instanceof Array ? slider.options.sliderValue[i] : slider.options.sliderValue) || slider.range.start), i); Element.makePositioned(h); // fix IE Event.observe(h, mousedown, slider.eventMouseDown); }); Event.observe(this.track, mousedown, this.eventMouseDown); Event.observe(document, mouseup, this.eventMouseUp); Event.observe(document, mousemove, this.eventMouseMove); this.initialized = true; }, dispose: function() { var slider = this; Event.stopObserving(this.track, mousedown, this.eventMouseDown); Event.stopObserving(document, mouseup, this.eventMouseUp); Event.stopObserving(document, mousemove, this.eventMouseMove); this.handles.each( function(h) { Event.stopObserving(h, mousedown, slider.eventMouseDown); }); }, setDisabled: function(){ this.disabled = true; }, setEnabled: function(){ this.disabled = false; }, getNearestValue: function(value){ if(this.allowedValues){ if(value = this.allowedValues.max()) return(this.allowedValues.max()); if(value =
[Proto-Scripty] Re: Observe on Script Elements
Do it the other way around: have the loaded script announce itself once it has loaded by putting a function call in it. On Oct 10, 2:37 pm, webbear1000 [EMAIL PROTECTED] wrote: Hey peeps I've got this pretty knotty problem. I'm loading js files on demand by generating them and appending them to the head element. What I'm also doing is binding a passed function to the script tag for it's load event which enables me to call in a js file and work on it when I know it's loaded. I hope that makes sense. The problem is IE (of course). It doesn't seem to call the load event. Anybody done something similar and managed to work around the problem? Thanks guys and gals --~--~-~--~~~---~--~~ 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: prototype and iframe
You don't use AJAX to put content into an Iframe. An Iframe is a new separate document. Use: $(iframe_show).src=http://; On Oct 10, 1:17 pm, Miguel Beltran R. [EMAIL PROTECTED] wrote: Hi list I have the next code but not work, iframe show nothing what I doing wrong? html ... body div id=content div id=form_search form target=iframe_show.../form /div div id=show iframe id=iframe_show name=iframe_show/iframe /div /div script var muestra = function(m_id, m_modulo, m_modo){ var element = $(m_id); element.update('cargando...'); new Ajax.Updater(element, 'muestra.html', { method: 'get', parameters: {modulo:m_modulo, modo:m_modo} }); } document.observe('dom:loaded', function(){ muestra('iframe_show', 'taller_busca', 'nada');} /script /body /html -- Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida --~--~-~--~~~---~--~~ 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: Dynamic script file loading
You can, like this: document.body.insert(new Element(script, { type: 'text/javascript', src:'test.js' })) The fun part is writing a wrapper for all the functions contained in that script so that they load the script and execute, rather than fail. On Oct 15, 7:16 am, jason maina [EMAIL PROTECTED] wrote: Hi, Is it possible to load script files only when they are needed. In the application im currently making there are too many script(js) files loaded on the parent page yet in the entire life-cycle of the application usage some tabs will not even be clicked hence the idea to only load script files when needed. Thank you in advance. - Jason --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] New Script.aculo.us combination effect: Wipe (beta)
After being annoyed by a Flash-based solution for the same functionality, I decided to write a wipe effect for Scriptaculous. It's in beta, and not quite ready for release. new Effect.Wipe('content',{'newImg':'Images/Wipe3.jpg',duration: 2,mode:'vSplit'}) Modes: Vertical split Horizontal split Wipe right Wipe left Wipe up Wipe down Page Flip Panels I'm looking for some feedback and (hopefully not) some bug reports. Demo: http://jameslab.moveable.com/wipe/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: script.aculo.us syntax ??
Try changing the way you position your element: #box { width: 300px; height: 300px; position: absolute; background-color: #ddd; } div style='position:relative'div id=box/div/div --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Effect.grow in a fixed height div
I think the problem is how tables are rendered, not because of the DIV itself. They seem to wait until the rest of the page has rendered before sizing themselves. You can really see it happen in this example: table border=1 tr td width=50%nbsp;/td tdnbsp;/td /tr tr tdnbsp;div style='display:none' id='xx'pLorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse at felis. Etiam ullamcorper. Aenean fringilla, eros eu dapibus tristique, erat lacus vestibulum metus, nec pharetra leo ante et quam. Nunc ac mi molestie justo placerat laoreet. Morbi eget dolor. Curabitur pretium, mi quis iaculis molestie, dolor ligula sagittis orci, at sodales quam dolor quis sem. Suspendisse vitae risus./p/div/td tdnbsp;/td /tr /table script type=text/javascript new Effect.Grow('xx',{delay:1.0,duration:5.0}) /script On Oct 30, 12:44 pm, James [EMAIL PROTECTED] wrote: I'm using Effect.grow() to expand table rows in a fixed height div. In Firefox, the div overflows properly and everything is fine. In IE7, the all of the records grow past the bottom of the div momentarily, then disappear behind the div. This brief flash before the recovery looks unprofessional. The element that is growing is a div nested inside a td. In the Scriptaculous api is the following warning: Works safely with most Block Elements, except tables. Is the fact that the div is nested in a table structure contributing to this problem? I would welcome any advice from others who have experienced this problem. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: New Script.aculo.us combination effect: Wipe (beta)
Good idea. I'll add that in. Thanks. On Oct 30, 12:05 pm, kangax [EMAIL PROTECTED] wrote: On Oct 29, 12:50 pm, Diodeus [EMAIL PROTECTED] wrote: After being annoyed by a Flash-based solution for the same functionality, I decided to write a wipe effect for Scriptaculous. It's in beta, and not quite ready for release. new Effect.Wipe('content',{'newImg':'Images/Wipe3.jpg',duration: 2,mode:'vSplit'}) Modes: Vertical split Horizontal split Wipe right Wipe left Wipe up Wipe down Page Flip Panels I'm looking for some feedback and (hopefully not) some bug reports. Demo:http://jameslab.moveable.com/wipe/ Nice, but how come there are no vertical Panels? -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: IE problem with multiple paralell morphings
I'm not experiencing the problem you describe. In IE the menu effect is quite smooth. On Nov 6, 2:06 pm, jrmout [EMAIL PROTECTED] wrote: Hi! I developped a webpage for my string quartet, and as i had so many problems with IE i did 2 versions. I'll fuse them when both are ready. A version for non IE browsers:http://cuartetotoldra.com/toldrismo/prueba3enhanced.html and another one just for IE:http://cuartetotoldra.com/toldrismo/prueba3ie.html The thing is that with IE exploring the menus (which means morphing, just have a look) will cause undesired jumps and pops of some divs... It seems like the parallel morphings aren't completely coordinated..With firefox 3, opera, chrome and safari, there's no problem. Firefox 2 is not perfect but is not that bad as IE. I even tried with IE 8, but these random jumps won't disappear. I suppose there's no solution for this, but if someone had such a problema and could solve it, some help would be appreciated... :) Thanks!! JR --~--~-~--~~~---~--~~ 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: slide up effect
A simple Effect.Move will do. http://github.com/madrobby/scriptaculous/wikis/effect-move On Nov 12, 11:31 am, shawnl [EMAIL PROTECTED] wrote: Hello scriptaculous people. I am looking for an effect that will slide a div up from a fixed location on the page. For example, I will have a navigation bar that runs across the page and would like for a div to slide up. Everything I have seen and tested is based on either down or to the right from the starting point. Any direction that you can point me in to find something that will work would be great. I vaguely remember a hacked version of scriptaculous' Slide.Down, I was unable to find it though. Thanks, Shawn --~--~-~--~~~---~--~~ 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: Attaching onload event while creating new img tag
Ah, That is much cleaner. Thank you. On Nov 13, 6:18 pm, kangax [EMAIL PROTECTED] wrote: On Nov 13, 3:43 pm, Diodeus [EMAIL PROTECTED] wrote: I've been dynamically building a slideshow based on a list of image filenames. I use the following code to create thumbnails: $('placeholder').insert(new Element(img, {id:'something', src:myImage})) I would like to display a progress bar, so I'm going to count the number of images loaded as they go. To do this I was hoping to do something like this, but it doesn't work. $('placeholder').insert(new Element(img, {id:'something', src:myImage, onload:function(){alert(MOO)}})) After asking the question on stackoverflow.com one suggestion was this: $('placeholder').insert(new Element(img, {id: 'something', src:myImage}).observe('load', function() { // onload code here})); The problem is that attaching an event listener after the tag have been created is too late to catch the onload event. The thumbnail loads before the event handler is listening. The thumbnails are often only 3-4k in size. So how do I do this? I know I could create the element with the onload, then set the src separately later in the code, but I would prefer to do it all inside the new Element constructor. Ah, the addiction of chaining : ) The problem is that `Element` constructor does `writeAttribute` for every property of that second object you pass to it. It's easy to pull that `writeAttribute('src', ...)` out of constructor (and put after observer attachment): $('placeholder').insert(new Element(img, { id: 'something' }).observe ('load', function() { /*... */ }).writeAttribute('src', myImage)); -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] .getHeight() is not a function
This code works in IE, bot for FF: var prev = $(element).previousSibling alert(prev.getHeight()) In FF gives me prev.getHeight()) is not a function. Has FF gone mad? Have I? --~--~-~--~~~---~--~~ 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: .getHeight() is not a function
Nope, that doesn't work either. On Nov 27, 11:40 am, Ken Snyder [EMAIL PROTECTED] wrote: Be sure to extend the previousSibling element: var prev = $(element).previousSibling alert($(prev).getHeight()) - Ken On Thu, Nov 27, 2008 at 8:53 AM, Diodeus [EMAIL PROTECTED] wrote: This code works in IE, bot for FF: var prev = $(element).previousSibling alert(prev.getHeight()) In FF gives me prev.getHeight()) is not a function. Has FF gone mad? Have I? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Effect.Morph using class names
Is it possible to specify a CSS class name instead of a style for Effect.Morph? This doesn't work, I wish it would: new Effect.Morph('test',{className:'med',duration:.2}) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Effect.Morph using class names
I managed to hack my own, although I'll probably have to go test it on every browser now. new Effect.Morph(next,{style:getStyle('.med'),duration:.2}) function getStyle(className) { var classes = document.styleSheets[0].rules || document.styleSheets [0].cssRules for(var x=0;xclasses.length;x++) { if(classes[x].selectorText==className) { return (classes[x].cssText || classes[x].style.cssText).toLowerCase ().replace('\n','') } } } On Nov 27, 3:00 pm, Walter Lee Davis [EMAIL PROTECTED] wrote: Maybe, if one were to create an object off screen, run addClass to add the style, then use getStyle to read it back, and then apply that as the argument to Morph. Seems like a lot of work, but since Morph uses getStyle and setStyle internally, that's what will have to happen (I think). Walter On Nov 27, 2008, at 12:50 PM, Diodeus wrote: Is it possible to specify a CSS class name instead of a style for Effect.Morph? This doesn't work, I wish it would: new Effect.Morph('test',{className:'med',duration:.2}) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: New Script.aculo.us combination effect: Fisheye (beta), I need help with callback
That's very nice. Smoother than the one I've put together. On Dec 1, 9:49 am, julien Devouassoud [EMAIL PROTECTED] wrote: check this out : http://www.ndesign-studio.com/blog/design/css-dock-menu/http://www.javascriptfr.com/telecharger.aspx?ID=26334 On Mon, Dec 1, 2008 at 2:42 PM, Diodeus [EMAIL PROTECTED] wrote: options.mouseClick(evt); That's the piece I needed. Thank you. On Nov 28, 9:35 pm, Jerod Venema [EMAIL PROTECTED] wrote: You probably want to do something like: mouseClick:. arguments[1].onClick || function(){} and then, in your code, you hook up the click like so: myelement.on(click, options.mouseClick); which hooks the click event to the passed in function. If you need to do other processing first, try: myelement.on(click, function(evt){ dostuff(); options.mouseClick(evt); }); Jerod Venema Frozen Mountain Softwarehttp://www.frozenmountain.com/ 919-368-5105 On Fri, Nov 28, 2008 at 4:32 PM, Diodeus [EMAIL PROTECTED] wrote: I am building a Scriptaculous-based fisheye menu, which is coming along well. The thing I can't figure out is how to fire what is in the onClick callback I created. new Effect.FishEye('demo',{onClick:function(){alert(##)}}) In the initialization I have: options = Object.extend({ mouseClick: arguments[1].onClick || '' ... }) ...which then goes to this method: mouseClick: function(event) { alert(u...I dunno) }, I've been looking at other effects code to try and figure it out, but I'm not getting anywhere. Here's the demo: jameslab.moveable.com/fisheye Thank you. - James. -- Jerod Venema --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: New Script.aculo.us combination effect: Fisheye (beta), I need help with callback
It was more about solving the problem of how to do it, and getting a little more practice in OO programming, than being the first to do it. Regardless, there isn't a scriptaculous version floating around yet. Based on the links you posted I have discovered room for improvement. It's turning out to be a good exercise for a slow day. On Dec 1, 12:29 pm, julien Devouassoud [EMAIL PROTECTED] wrote: yeah much, but good effort man.. reinventing the wheel is cool, i love to do it.. and then realize thing existed all along :) On Mon, Dec 1, 2008 at 6:11 PM, Diodeus [EMAIL PROTECTED] wrote: That's very nice. Smoother than the one I've put together. On Dec 1, 9:49 am, julien Devouassoud [EMAIL PROTECTED] wrote: check this out : http://www.ndesign-studio.com/blog/design/css-dock-menu/http://www.ja... On Mon, Dec 1, 2008 at 2:42 PM, Diodeus [EMAIL PROTECTED] wrote: options.mouseClick(evt); That's the piece I needed. Thank you. On Nov 28, 9:35 pm, Jerod Venema [EMAIL PROTECTED] wrote: You probably want to do something like: mouseClick:. arguments[1].onClick || function(){} and then, in your code, you hook up the click like so: myelement.on(click, options.mouseClick); which hooks the click event to the passed in function. If you need to do other processing first, try: myelement.on(click, function(evt){ dostuff(); options.mouseClick(evt); }); Jerod Venema Frozen Mountain Softwarehttp://www.frozenmountain.com/ 919-368-5105 On Fri, Nov 28, 2008 at 4:32 PM, Diodeus [EMAIL PROTECTED] wrote: I am building a Scriptaculous-based fisheye menu, which is coming along well. The thing I can't figure out is how to fire what is in the onClick callback I created. new Effect.FishEye('demo',{onClick:function(){alert(##)}}) In the initialization I have: options = Object.extend({ mouseClick: arguments[1].onClick || '' ... }) ...which then goes to this method: mouseClick: function(event) { alert(u...I dunno) }, I've been looking at other effects code to try and figure it out, but I'm not getting anywhere. Here's the demo: jameslab.moveable.com/fisheye Thank you. - James. -- Jerod Venema --~--~-~--~~~---~--~~ 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: analogue clock?
This one's a classic and does it using native JavaScript. http://rainbow.arch.scriptmania.com/scripts/mouse_clock3.html On Dec 1, 5:55 pm, geoffcox [EMAIL PROTECTED] wrote: Hello, Is it possible to construct a javascript analogue clock using prototype/scriptaculous? In particular I want one where the speed of the hours/minutes/seconds hands can be increased/decreased. 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-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] Hacking Effect.Move - follow cursor?
I am using Effect.Move to slide some graphic down the height of the screen. I would like to be able to manipulate the x-position of the item after it gets below a certain y-position to follow the mouse cursor. What happens is I get this pulsating effect, where it follows the cursor, then Effect.Move performs an update and puts it back to its original position. By looking at Effect.Move: setup: function() { this.element.makePositioned(); this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); this.originalTop = parseFloat(this.element.getStyle('top') || '0'); if (this.options.mode == 'absolute') { this.options.x = this.options.x - this.originalLeft; this.options.y = this.options.y - this.originalTop; } } The effect uses this.originalLeft to figure out the base position for the original object, which makes sense, and uses it in the update: method. I was wondering if there was a way to write to this value inside the effect object? I'd prefer not to modify the orignal effect code. Maybe I need to make my own effect wrapper and extend the Effect.Move object. I'm not sure. Does anyone have any suggestions? --~--~-~--~~~---~--~~ 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: Scriptaculous limit sortable or reset sortable
In the current version of scriptaculous you can't cancel a draggable programatically. This has been put in as a suggestion for the next version. You must manually move it back to its original position using Effect.Move. You'll also need to keep track of where it was originally so you can do that. On Dec 15, 11:52 am, Kaiser kaisersolohay...@gmail.com wrote: I want to use a sortable to make a graphical and multiple select box application on a web page. The objective is move elements from box1 to box2 with some limitations: We must have 4 elements max. on box2 (destination box) If the user moves the element with id #1 to box2, only that element would remain in box2 and the rest must return to box 1. With the code, i can detect if the moved element is the 5th but i must cancel the drag or return the last element of the box2 to box1. That is a problem because i dont see any place in documentation to do something like that. The second answer is how to reset one of the boxes. I have box1 and box2 (original and destination boxes) and i want to reset the initial status without reload the page. ¿Is there any method to do this? Simple sample: triggerupdate is the function i use to check if the element is 1st, 2nd, 3rd, 4th or +4th div id=page div id=group1 class=section h3 class=handleGroup 1/h3 div id=item_1 class=lineitemThis is item 1/div div id=item_2 class=lineitemThis is item 2/div div id=item_3 class=lineitemThis is item 3/div div id=item_4 class=lineitemThis is item 4/div /div div id=group2 class=section h3 class=handleGroup 2/h3 /div /div input type=button onclick=resetea(); script type=text/javascript // ![CDATA[ Sortable.create('group1',{tag:'div',dropOnEmpty: true, containment: sections,only:'lineitem'}); Sortable.create('group2',{tag:'div',dropOnEmpty: true, containment: sections,only:'lineitem', onUpdate:function(){triggerupdate()}}); Sortable.create('page',{tag:'div',only:'section',handle:'handle'}); // ]] /script 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: Draggable and Droppable
You can try wrapping everything in one div with position:relative. Other than that I'd need a look at your code. You can paste it here (http://www.pastie.org/) and post the link. On Dec 15, 8:10 am, Marley nathaniel.au...@gmail.com wrote: I have been trying to figure out how to drag and drop images without them moving back to a 0,0 absolute position in my div. First problem: I tried the: revert: failure but it does not work; the draggable still snaps back. I am using the latest version 1.8.3 i think it is. I want to drop the draggable onto the droppable and have it stay there. My second problem is: I have dynamically positioned my draggables so their top and left style attrbutes do not match their real positions. When the draggable reverts after i release my mouse, the draggable does not return to its position but rather uses the style sheet position. Is there any way around that? --~--~-~--~~~---~--~~ 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: Coupon Code validation
This is awesome - I am totally almost getting this! Totally almost - snicker Regex hurts my brain. --~--~-~--~~~---~--~~ 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 can drag a dragable object to another droppable more than one time ?
You need to reinsert the dragged DIV into the document where it started from and reinitialize it as a draggable. $(dragContainer).insert(new Element(div, { id: 'something', 'class':'whatever' })) new Draggable('something',{revert:true}) On Dec 15, 4:05 pm, PATMAP patmap...@yahoo.com wrote: Hello to script.aculo.us developer team. thank you for your best scripts. I want to drop the draggable onto the droppable and have it stay there but not remove from source, i want only a copy of dragable droped on droppable and i can drag and drop this dragable next time and more. by means i want drag a object to another droppable more than one time and source object dont remove. best regards --~--~-~--~~~---~--~~ 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: Problem (propably logical one) with dynamic fadein / fadeout for a navigation menu
You're right on that one. Reposition the abort code: slink.observe('mouseover', function(e) { if(running==1) { return } running=1 this.elm = Event.element(e); this.elm_array = new Array(); this.elm_array = elms.without(this.elm); this.elm_array.each(function(elms) { elms.fade({ duration: 0.5, to: 0.3, scope: 'specials', limit: '1', afterFinish:function() {running=0} }); }); }); On Dec 17, 6:08 am, Chris c...@clicksports.de wrote: Hi Diodeus, that wont work for me, because i am runing the function just once. This adds the event listeners to all of the images. --~--~-~--~~~---~--~~ 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: Improving FPS Speeds
Posting an example that is not your code and does not display the problem you are experiencing really doesn't help us debug YOUR problem. On Dec 17, 5:52 am, Craig cr...@europe.com wrote: site im developing is not live but similar tohttp://www.aspecto.co.uk/ Is there much use in creating a slider function to run all the sliders from would this make much of a difference? On Dec 17, 4:35 am, RobG rg...@iinet.net.au wrote: On Dec 17, 3:13 am, Craig cr...@europe.com wrote: I have a very graphics intense website with 4 sliders on each coded in a serperate JS file. Recently i have developed a full screen image viewer that behaves much like lightbox. I am using the effects library to BlindDown the image and alternates in their containers as well as Appear/Fading a background that covers the whole page. Problem is that this makes the browser lag and the animation does not look smooth at all. Does anyone have any tips that could be helpful for me to improve the FPS as i am not the most experienced js programmer? Optimisation for speed usually starts by finding the code that is most sluggish. You can spend a very long time optimising by doint things like replacing for loops with do loops or whatever for marginal improvement when some other simple change, like replacing extensive use of += to concatenate strings with Array.join or just plain + (specific to IE), can have a dramatic effect. Post a link. You might also consider whehter your effects add to the functionality of the page or are just a nusance. -- Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-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: Adding properties to all form elements
I don't believe html properties elements are extensible. All you can do is add css class names. On Dec 17, 12:29 pm, Kupido kup...@hotmail.com wrote: I need to extend all form elements with some properties. To add my own methods, I use: Object.extend(Form.Methods, { method1: function () { }, method2: function () { }, ... }); Element.addMethods(); I don't know if this is the right way but it works. So, how can I add my own properties too? Is there a way to have an initialization function automatically called on every form element? I tried extending Form.Methods with the initialize() function but it seemed not to work for forms created with document.createElement ('form'). Any suggestion? --~--~-~--~~~---~--~~ 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: - Return the new x*y position?
I usually use this handy script from Quirksmode.com function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft curtop = obj.offsetTop while (obj = obj.offsetParent) { curleft += obj.offsetLeft curtop += obj.offsetTop } } return [curleft,curtop]; } On Dec 19, 9:46 am, M. Wieczorek nolawncha...@gmail.com wrote: Hi, Is it possible (through feature or tweak) to have the new X and Y position values (of the top left corner) of the dragged object returned? I'm writing an online textbook builder, and would like to have these values returned, and saved into the database via AJAX, so the elements' new positions are saved? 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: table does not display in IE7 until DOM explorer is turned on...
Changing the visibility of any item on the page will cause a redraw. You could try Element.show('') after your insertion. On Dec 22, 3:28 am, Jay jebum@gmail.com wrote: I'm using the following code to add a table to DOM. var table = Builder.node('table', {id: x}, Builder.node('tbody', eachdayArr) ); $('parent').insert(table); But this doesn't show right away in IE (works fine in FF). When I turn on my DOM explorer, however, it suddenly shows!! (By the way, this isn't a missing tbody' problem). Which makes me think that somehow the browser isn't really refreshing or rendering new elements... (because the fact that it shows up means everything was inserted correctly) Is there any reason why this might be happening? And is there a way to force the browser to refresh?? --~--~-~--~~~---~--~~ 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: appending div to page and changing focus to the new input box in that div
1) Setting focus In your Ajax call add: evalScripts:true as a parameter. In your response, add a JavaScript block to set the focus as you normally would - $('someID').focus() 2) Scrolling Find the position of a DIV at the bottom of the screen. I like this handy function from Quirksmode: function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft curtop = obj.offsetTop while (obj = obj.offsetParent) { curleft += obj.offsetLeft curtop += obj.offsetTop } } return [curleft,curtop]; } so you would do this: myPos = findPos($('someDiv')) window.scrollTo(0,myPos[1]) --~--~-~--~~~---~--~~ 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: Jagged Text with setOpacity
This is a bug in IE. It's due to the poor implementation of ClearText. If the text is on a solid colour you can set the DIV containing the text to the same background color as what's behind it and that will clear it up. If you're on top of a photo or gradient, you're out of luck. Another free gift from the folks at Microsoft. On Jan 5, 11:06 am, bflanagan flanag...@gsicommerce.com wrote: Hey all- I know this has been covered before, but all of he fixes I've found don't seem to be working for me. OF course the issue is with IE... I'm implementing a simple fadeIn/fadeOut using prototype's setOpacity. In IE7, the text changes format during the fades. One fix I've seen is to apply a background color to the container div, but that's not having an impact on my end. I tried using the script.aculo.us lib as well, but the results were the same. I also tried adding a container div with a background color set and animating it, but I'm still getting the crappy jagged text effect. Any ideas how to fix this? Here's the code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head titleTest/title script type=text/javascript src=js/prototype.js/script style type=text/css #mainWindow {background-color:#FF;} /style script type=text/javascript Element.addMethods({ fadeOut: function(obj){ obj.setOpacity(1.0); var currentOpacity = 1.0; var temp = setInterval(function(){ currentOpacity -= .1; obj.setOpacity(currentOpacity); if (currentOpacity =0){ obj.setOpacity(0.0); clearTimeout(temp); } },40); }, fadeIn: function(obj){ obj.setOpacity(0.0); var currentOpacity = 0.0; var temp = setInterval(function(){ currentOpacity += .1; obj.setOpacity(currentOpacity); if(currentOpacity = 1.0){ obj.setOpacity(1.0); clearTimeout(temp); } },40); } }); function test(){ $('mainWindow').fadeOut(); setTimeout(function(){ $('mainWindow').innerHTML = 'Updated content'; $('mainWindow').fadeIn(); },500); } /script /head body input type=button value=click onclick=test(); / div id=mainWindowSome wonderful content/div /body /html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-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: Why does a javascript preload appear to take longer than an HTML load?
You may find a faster answer to this question here: www.stackoverflow.com On Dec 31 2008, 6:45 pm, Walter Lee Davis wa...@wdstudio.com wrote: I have a bunch of images that I am preloading inside of a loop. One of these images is also loaded by the html, so I get a good look at how these two different methods perform. For measurement, I am using the Network pane of the Safari Web Inspector, after clearing the cache. The ClownFish image referenced by the HTML is 280KB, and takes 14ms to load, while one of the Aurora image referenced by JS in the preload is 116KB and takes 77ms to load. var images = ['Aurora', 'ClownFish', 'DewDrop', 'EarthHorizon', 'FlowingRock', 'GentleRapids', 'GoldenPalace']; images.each(function(elm){ var path = elm + '.jpg'; var preload = new Image(); preload.setAttribute('src',path); }); Is this all overhead from setting up the Image() and then assigning the src to it? Is there any way to speed this up? Thanks in advance (and happy new year), Walter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: onload not working properly
It's likely that you're hooking up these events before the HTML is loaded. If you JavaScript is ahead of your HTML, this will happen. See the example here: http://www.prototypejs.org/api/event/observe On Jan 8, 8:14 am, freddie lin.freder...@gmail.com wrote: Hi everyone, Can someone enlighten me on why this isn't working for me.. I have an onload with 3 functions listening on the submit buttons of 3 different forms... problem is, the 3rd form's listener isn't being activated on submit... I tried swapping the 3rd 1 to be called before the other 2 and it works, but the other 2 will be brokekn... what am I doing wrong here? I'm using the prototype library... [PHP] window.onload = function () { $('rating').onsubmit = function () { rateit(); return false; } $('form_tell').onsubmit = function () { tellfriend(); return false; } $('form_comment').onsubmit = function () { comment(); return false; }} [/PHP] --~--~-~--~~~---~--~~ 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: Ajax.Updated DIV seems to still have the same innerHTML...
One way to get comfortable with how Prototype uses classes is to look at some of the Scriptaculous effects and see how they work. Once you get in the groove it's a lot easier. On Jan 8, 12:04 pm, Ian R i...@fairmountfair.com wrote: On Jan 8, 4:09 am, SGD danny.g...@googlemail.com wrote: Try new Ajax.Updater(this.id, as you have to pass the id of an element, not the element itself. Oh! I thought you could pass either the ID or an element reference... in fact, the code seems to work either way, so maybe that's true. You can optimize your code by just having: $$('[contenteditable=true]').each(function(el) { new Ajax.Updater(el.id,'loader.php',{parameters: {field: el.id}, onComplete: function(){ alert('check #2: ' + el.innerHTML); } }); }); This works really well, and thank you, but I have a need to call this function in multiple places (like, both on page load and on a button click, and maybe some other places)... which is not a problem, I've taken the meat of it out and placed it in a function called load(el), and I'm calling that function in this loop and I can call it elsewhere, and I can continue from here in this realm. However, what I *thought* I was trying to do was develop my editfield as an object, add the appropriate properties and methods and things, and then call these functions as el.load() rather than load (el). I suppose there is not a ton of benefit from this, other than to increase my fluency with OOP and to allow for subclassing and method overriding. I would really like to know more about this, though, and in particular how one can take existing HTML (like my DIVs) and apply such an object to it... the example that I keep coming back to is how one can take an existing UL and say: Sortable.create(el); And then that UL has methods and properties of a Sortable. HOWEVER: I would like to have an instance which I can call in events. Once again, I have talked myself dizzy and I'm not quite sure what I'm saying anymore. If any of this makes sense, I would love to be directed to some sort of document that I could read on the subject, or if anyone could advise me on a decent search string, I have been looking this up but I am not 100% sure I'm using the correct terms. Thanks so much! I am very excited about Prototype! I didn't realize how much I liked it until I started messing around with Dojo. Prototype makes a lot more sense to me, personally. Ian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-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 read draggables position?
Just add a new JavaScript block to your current page and paste it in. On Jan 23, 4:45 pm, antonio.grazi...@gmail.com antonio.grazi...@gmail.com wrote: I have declared a New Draggable called 'module_left' in a script in my HTML page should I add your code in the HTML page or in the .js file ? --~--~-~--~~~---~--~~ 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] new Element(label), problem with 'for' attribute
IE seems to barf when setting the for attribute of a label with the element constructor: $(element).insert(new Element(label, { id:'something', for:'check1', className:'FBRadioLabelLeft' })) Should result in: label for=check1 id=something/label It seems IE thinks it's starting a for-loop or something. Is there a work-around for this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: new Element(label), problem with 'for' attribute
Thanks, Walter, that worked. It does feel a little 'unnatural' though. :) On Feb 4, 4:21 pm, Walter Lee Davis wa...@wdstudio.com wrote: Did you try it with the names of the attributes quoted? {'id': 'foo', 'for':'bar', 'class':'baz'} Walter On Feb 4, 2009, at 4:13 PM, Diodeus wrote: IE seems to barf when setting the for attribute of a label with the element constructor: $(element).insert(new Element(label, { id:'something', for:'check1', className:'FBRadioLabelLeft' })) --~--~-~--~~~---~--~~ 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] JSON form generator demo
Hello Prototypers, I've been working on a JSON-based form generator that uses Prototype. Basically it allows you provide a form specification using JSON and the engine generates the output dynamically. It's still in the early stages but there is a working demo. I am looking for comments and feedback. http://jameslab.moveable.com/JSONForm --~--~-~--~~~---~--~~ 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: JSON form generator demo
Thanks Nathan, I'll take a look at it. Interoperability is a good thing. On Feb 22, 9:04 am, nlloyds nllo...@gmail.com wrote: Diodeus, On Feb 20, 3:32 pm, Diodeus diod...@gmail.com wrote: Hello Prototypers, I've been working on a JSON-based form generator that uses Prototype. Basically it allows you provide a form specification using JSON and the engine generates the output dynamically. It's still in the early stages but there is a working demo. I am looking for comments and feedback. http://jameslab.moveable.com/JSONForm Very cool. I have another implementation of the same type of thing. Currently it runs with server-side Prototype only and is only available on a hosted proprietary CMS, but perhaps some work could be done on standardizing a JSON form definition formats, etc. We're working on putting a real GUI form builder into our CMS very soon, but right now our users can just create a JSON file (or have us create one) to use for their forms. Public (and somewhat incomplete) documentation for my implementation is here:http://markupfactory.com/documentation/form-builder Thanks, Nathan --~--~-~--~~~---~--~~ 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: JSON form generator demo
Hi Rob, No, I haven't made a comparison. I have built client-side form generators before but have used XML for the form schema. JSON is obviously faster than XML. Generating the entire form server-side and inserting it as a single block would obviously be faster than generating fields one at a time on the client. That being said, there doesn't seem to be a visible difference to the user performance-wise. On Mar 1, 8:01 pm, RobG rg...@iinet.net.au wrote: On Feb 21, 7:32 am, Diodeus diod...@gmail.com wrote: Hello Prototypers, I've been working on a JSON-based form generator that uses Prototype. Basically it allows you provide a form specification using JSON and the engine generates the output dynamically. It's still in the early stages but there is a working demo. I am looking for comments and feedback. Have you compared the difference in performance between running a database query, creating the JSON, sending it to the client and building the form there vs building the form on the server directly from the database query and sending the HTML ready to insert? -- Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-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: Drag and drop - using it with a form and a database
This should get you started (requires scriptaculous) table border=1 cellpadding=5 tr td valign=top ul id='fList' liApples/li liGrapes/li liStrawberries/li /ul /td td valign=top div id='fish' class='meat'Fish/div div id='chicken' class='meat'Chicken/div /td /tr /table input type=button onclick=getList() value =get list script type=text/javascript Sortable.create(fList, {constraint:false}) new Draggable('fish',{revert:true}) new Draggable('chicken',{revert:true}) Droppables.add('fList',{accept:'meat',onDrop:function (dragName,dropName){placeFood(dragName,dropName)}}) function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft curtop = obj.offsetTop while (obj = obj.offsetParent) { curleft += obj.offsetLeft curtop += obj.offsetTop } } return [curleft,curtop]; } function placeFood(dragName,dropName) { myPos = findPos($(dropName)) //alert(myPos[0]+, +myPos[1]) $(fList).insert(new Element(li, { id: $(dragName).id+_ })) $($(dragName).id+_).innerHTML = $(dragName).innerHTML Sortable.destroy(fList) Sortable.create(fList, {constraint:false}) } function getList() { var myList = '' $('fList').select('li').each(function(element) { myList = myList + $(element).innerHTML + | }) alert(myList) } /script On Mar 10, 10:20 am, Harleycoder mbrio...@gmail.com wrote: Hi I am wondering how to make a drag and drop function actually pass values - I'm trying to build a photo gallery function where you have a bunch of photos you've uploaded and you are going to drag them to a (box) that represents a certain photo gallery. I'm a php coder and while I've used JavaScript for years, I've never actually written any from scratch; just changed existing code, made it dynamic, etc. Hope someone can help me make some magic...I've seen this in action but don't have the source code! Best, MJ --~--~-~--~~~---~--~~ 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: Drag and drop - using it with a form and a database
Put the result in a hidden field and post the form, or make it a parameter in an Ajax call. The server side of things is no different than any regular form posting. On Mar 10, 5:13 pm, Marian Briones mbrio...@gmail.com wrote: I've got the drag and drop capability; it's getting it to talk to a form and pass values somehow to enter info in a db. --~--~-~--~~~---~--~~ 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: Image magnifier script written in scriptaculous
Hi Farhan, I wrote one here: http://www.mintomidtown.com/Penthouse/floorplans.asp?p=1 You can grab the code by viewing the source of the page. On Mar 26, 9:53 am, farhan mmfar...@gmail.com wrote: Hi, I am trying to find an image zoom script like: http://www.magictoolbox.com/magiczoom/ orhttp://www.nihilogic.dk/labs/mojozoom/ orhttp://www.mind-projects.it/projects/jqzoom/demos.php but for scriptaculous. Thanks Regards, Farhan --~--~-~--~~~---~--~~ 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] Select form elements by name
What's the Prototype equivalent of this jQuery code? I would like to select all of the radio button with a certain name. $('#billship input:radio[name=shipType]'); --~--~-~--~~~---~--~~ 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] Associative arrays vs hash
I'm building the following array: var ax = [] ax['aaa'] = 1 ax['aab'] = 2 ax['aac'] = 4 ax['aad'] = 6 I would like to loop though all of the values in this array. If I do the following, I get nothing: ax.each(function(s) { alert(s) }) ...but if I do the following, I get my values, followed by all the names of the Prototype enumerable method names. for(s in ax) { alert(s) } I've even tried this, which behaves in a similar manner: var ah = $H(ax) ah.each(function(s) { alert(s) }) What am I doing wrong here? --~--~-~--~~~---~--~~ 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: Associative arrays vs hash
The problem is in my case, I'm adding elements to the array as I go, as opposed to building it as a JSON-type hash up front. I'd like to be able to do: ax[newValue] = y Looping through an associative array should be simple, but I'm missing something here. On Apr 2, 10:38 am, Walter Lee Davis wa...@wdstudio.com wrote: I wasn't aware that JavaScript arrays could be associative like this. My understanding was that they are always numerically indexed, and if you want an associative array-like structure that you can iterate over, you should use a vanilla Object or a Prototype Hash. var ax = {'aaa':1,'aab':2,'aac':4,'aad',6} for(i in ax){ alert( i + ': ' + ax[i] ); } var ax = $H({'aaa':1,'aab':2,'aac':4,'aad',6}); ax.each(function(s){ alert( s ) }); Walter On Apr 2, 2009, at 10:28 AM, Diodeus wrote: 'm building the following array: var ax = [] ax['aaa'] = 1 ax['aab'] = 2 ax['aac'] = 4 ax['aad'] = 6 I would like to loop though all of the values in this array. --~--~-~--~~~---~--~~ 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: Associative arrays vs hash
Yes, you're right, of course. I'm going to use Szymon's method. It just seems that it's a bit of a song-and-dance to do something that you'd assume would be handled in the native functionality of JavaScript arrays. On Apr 2, 11:30 am, Walter Lee Davis wa...@wdstudio.com wrote: What's missing is associative arrays in JavaScript. As to adding elements in a (Prototype) Hash, Szymon already gave you that: ax.set('aad',4); And there's a matching get() function to pluck an individual element out of the Hash, too. ax.get('aad') //-- 4 Walter On Apr 2, 2009, at 11:04 AM, Diodeus wrote: The problem is in my case, I'm adding elements to the array as I go, as opposed to building it as a JSON-type hash up front. I'd like to be able to do: ax[newValue] = y Looping through an associative array should be simple, but I'm missing something here. --~--~-~--~~~---~--~~ 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] Named functions in onComplete not waiting for completion
Here is my function. It is a general purpose wrapper for various AJAX call in my program. Since the callback could be any function, I'm passing the callback function as a string and calling it via window [callBack], which kinda of works except it's not waiting for the actual AJAX call to complete - it fires right away. Since I wrapped the callback in an anonymous function, I would have expected the execution to be deferred, but it isn't. Where have I gone wrong? function exFetch(url,element,callBack) { now = new Date() //break cache //$('lastAjax').innerHTML = url +|+element new Ajax.Updater(element, url+'_UserReference='+key+'now='+now, {method:'get',evalScripts:true,onComplete:function(transport) { window[callBack] } }); } --~--~-~--~~~---~--~~ 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: Named functions in onComplete not waiting for completion
Yes, I understand what you've said. I was making it more convoluted than need be. wrapAjaxUpdater('showsomething.php', 'somediv', handleCompletion); - works correctly wrapAjaxUpdater('showsomething.php', 'somediv', handleCompletion()); - does not work because I'm calling the function, not passing a reference to it. In another situation, I need to pass parameters to the callback. So would I do it this way? var temp = handleCompletion(5) wrapAjaxUpdater('showsomething.php?id=5', 'somediv', temp); --~--~-~--~~~---~--~~ 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: Named functions in onComplete not waiting for completion
Thanks for the tips T.J. Curry was been around a lot longer than Prototype. Yep, it's a strange name. see: http://en.wikipedia.org/wiki/Currying On Apr 15, 10:21 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, In another situation, I need to pass parameters to the callback. So would I do it this way? var temp = handleCompletion(5) wrapAjaxUpdater('showsomething.php?id=5', 'somediv', temp); You're calling the function immediately again. This line: var temp = handleCompletion(5) ...calls the function handleCompletion with the argument 5 and assigns the result of the function to the variable temp. That's probably not what you meant to do! :-) What you want is a reference for a function that, when called, will call handleCompletion with the value 5. The generic way to do that is to use your own function for it: wrapAjaxUpdater('showsomething.php?id=5', 'somediv', function() { handleCompletion(5); }); But this is such a common thing to want to do that Prototype provides a mechanism for doing it: Function#curry[1]. (I have no idea who thought curry was a good name for this, but it's not the Prototype developers' fault, they just used a term that was already being used elsewhere.) Using Function#curry: var temp = handleCompletion.curry(5); wrapAjaxUpdater( 'showsomething.php?id=5', 'somediv', temp ); ...or just: wrapAjaxUpdater( 'showsomething.php?id=5', 'somediv', handleCompletion.curry(5) ); If you want to do that with a function where you *also* want to set its context (the this value that will be in effect when the function is called), use Function#bind[2] instead: wrapAjaxUpdater( 'showsomething.php?id=5', 'somediv', handleCompletion.bind(desiredContext, 5) ); In addition to simplicity and convenience, using curry() and bind() means you don't create a closure in the current context (you create a closure in a different context, but it's a pretty thin one so the overhead is minimal), which can be useful sometimes. For more about closures, I wrote up a couple of blog entires on them a while back.[3] [4] [1]http://prototypejs.org/api/function/curry [2]http://prototypejs.org/api/function/bind [3]http://blog.niftysnippets.org/2008/02/closures-are-not-complicated.html [4]http://blog.niftysnippets.org/2008/03/closures-by-example.html offtopicsoapbox BTW, it's OT, but I get the impression you're not very experienced in JavaScript yet, so: FWIW , I noticed in your code examples that you frequently leave off semicolons at the ends of lines, e.g.: var temp = handleCompletion(5) wrapAjaxUpdater('showsomething.php?id=5', 'somediv', temp); (There are three missing from your earlier exFetch function as well.) That really should be: var temp = handleCompletion(5); wrapAjaxUpdater('showsomething.php?id=5', 'somediv', temp); (Note the semicolon at the end of the first line.) It's perfectly valid syntax to leave off that semicolon, it's part of the JavaScript specification that the interpreter will automatically insert it for you in places where it thinks you meant to have one. But it's an extremely bad idea and arguably the worst feature in JavaScript. Never rely on semicolon insertion, *always* include them yourself. Not only does it make your intent clearer to those who read your code, but it means that if you use minifiers and such (and who doesn't?), your code will still work. Many minifiers will remove line breaks, which means your code above would become: var temp = handleCompletion(5) wrapAjaxUpdater('showsomething.php?id=5', 'somediv', temp); ...which is *not* valid syntax and will cause an error. If the semicolon were there: var temp = handleCompletion(5); wrapAjaxUpdater('showsomething.php?id=5', 'somediv', temp); It would still work. Just FWIW. Some minifiers are better at preserving necessary line breaks than others, but barring writing a full JavaScript parser (most of these are regex-based), they're going to get it wrong some of the time... /soapbox/offtopic ;-) HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Apr 15, 2:26 pm, Diodeus diod...@gmail.com wrote: Yes, I understand what you've said. I was making it more convoluted than need be. wrapAjaxUpdater('showsomething.php', 'somediv', handleCompletion); - works correctly wrapAjaxUpdater('showsomething.php', 'somediv', handleCompletion()); - does not work because I'm calling the function, not passing a reference to it. In another situation, I need to pass parameters to the callback. So would I do it this way? var temp = handleCompletion(5) wrapAjaxUpdater('showsomething.php?id=5', 'somediv', temp); --~--~-~--~~~---~--~~ You received this message because you are subscribed
[Proto-Scripty] AJAX response - Content-type: text/html; charset=windows-1251 not encoding properly
I'm working on and English/French site. The French data is in the windows-1251 character set. My main application uses: meta http-equiv=Content-Type content=text/html; charset=windows-1252/ So I am also adding the appropriate HTTP response header in my AJAX response. If I go to the AJAX URL directly, the encoding comes out fine, but if I call it via Prototype the accented French characters come out as the ? diamond in Firefox. I've tried adding encoding:'windows-1252' in my request, but I'm still getting the same result. Does Prototype need some other configuration to treat the response as something other than UTF-8? --~--~-~--~~~---~--~~ 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: International Characters with Ajax.autocompleter
I was under the impression that encoding: set the request encoding, not the response. Yup, I'm sending out the 1252 header but I'm still getting broken accented characters. I'd like to make it UTF-8 all the way, but the client's data was written using Word and is already in the database. : ( On Apr 23, 10:01 pm, Walter Lee Davis wa...@wdstudio.com wrote: I don't know. Did you try setting the option in the Autocompleter? var options = { encoding: 'window-1252' } new Ajax.Autocompleter(id_of_text_field, id_of_div_to_populate, url, options); Also, in your CGI, set the header before you send any results: header('Content-type: text/html; charset=windows-1252'); And make sure that any text getting within your CGI is also aware of the character set of your database. Personally, I would probably fork out to iconv for this, make it UTF-8 on the server and serve it that way. Walter On Apr 23, 2009, at 7:29 PM, Diodeus wrote: Does that mean I'm screwed if the database text is windows-1252? On Apr 23, 2:48 pm, Walter Lee Davis wa...@wdstudio.com wrote: Is your entire path to and from the database UTF-8? That's a huge requirement of Prototype's Ajax implementation, so if you are sending back data under the wrong Content-type/charset header, or your database is transmogrifying the characters somewhere, or Perl is, then you've got your problem there. I've used the AAC with Greek characters, French accents, I know it works if your entire path is UTF-8. You can try adding the Ajax options detailed here[1], but I'm not sure if it will entirely solve your problem. Walter 1.http://prototypejs.org/api/ajax/options On Apr 23, 2009, at 8:46 AM, Per wrote: Hi I am trying to add Ajax.autocompleter to an old Perl.cgi + Oracle application we use. I am looking up people from our people database, for some person fields, and an email cc list. I have everything working to my liking, except I have run into two problems: Some of the names in our database, contain French accented characters like é and è, and these do not work, as é is translated to %C3%A9 in the request sent to the server, and if é is sent from the server it is translated to character 0xe9. Is there any way to disable this translation? --~--~-~--~~~---~--~~ 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: Ajax with charset iso-8859-1
Miguel, I am having a similar problem and have spent many hours looking for an answer.The answer I always get is: serve it as UTF-8, which requires the program answering the AJAX call to do the conversion. Unfortunately the system I am using does not allow me to do this and I need to support French characters. It seem the encoding parameter specifies the encoding of the REQUEST, not the RESPONSE. The only way I have figured out on how to get around this whole problem is NOT to use AJAX. I am experimenting with simply pulling the content into a hidden Iframe, that grabbing the response and shoving it into the appropriate DIV. like this: div id=A###/div a href=javascript:// onclick=run()go/a br / iframe id=AJ style=height:200px;width:600px/iframe script type='text/javascript' function run() { $('AJ').src=http://..some URL } function fill() { $('A').innerHTML = $(AJ).contentWindow.document.body.innerHTML } $('AJ').onload=function() { fill() } /script I hope this helps. On Apr 24, 12:23 pm, Miguel Beltran R. yourpa...@gmail.com wrote: Hi list Here in my job the system use MS Sql Server 2000 what not have support utf-8, so I need work with ISO-8859-1. Using Ajax this send the parameters with encoding utf-8, after read a lots post I tried with the options modifica: function(evt){ evt.stop(); console.log(estro a modifica); $('estado').update(cargando...); var req = $('main_form').request({ encoding: 'iso-8859-1', onCreate: function(resp) { resp.transport.overrideMimeType(text/html; charset=ISO-8859-1); }}); req=null; } but not work :( User-AgentMozilla/5.0 (Windows; U; Windows NT 5.1; es-AR; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 Accepttext/javascript, text/html, application/xml, text/xml, */* Accept-Languagees-mx,es;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encodinggzip,deflate Accept-CharsetISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive300 Connectionkeep-alive X-Requested-WithXMLHttpRequest X-Prototype-Version1.6.0.3 Content-Typeapplication/x-www-form-urlencoded; charset=UTF-8 -- still use utf-8 can someone give me a tip? -- Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida --~--~-~--~~~---~--~~ 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: Effect.Appear doesn't work when in queue
function barcodeFlyToSimLeft(){ new Effect.Move('barcodeLeft',{x: -350, y: 200, mode: 'relative'}); new Effect.Shrink('barcodeLeft',{direction: 'center', queue: 'end', afterFinish: function(){Barcode('043396097742');}}); new Effect.Appear('barcodeLeft',{x: 0, y:0, duration: '1.0', queue: 'end'}); return false; } Duration should be numeric, not a string. On Apr 24, 5:26 pm, alpineedge3 gmarzl...@gmail.com wrote: Hi, I'm running an effect chain: move, shrink, then appear. The appear effect doesn't fade in. rather, it just becomes visible with 100% opacity. The scripts are controlling the barcode boxes on the homepage ofwww.fastpricecheck.com. Any help would be appreciated. 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: Is there a way to determine absolute coordinates of an element on the screen?
You need the famous Kangax Prototype cheat sheet. There is a very handy diagram on the PDF that will help you with this positioning issue: http://thinkweb2.com/projects/prototype/prototype-1602-cheat-sheet/ On Apr 26, 5:56 pm, buda www...@pochta.ru wrote: this gets coordinates in a page but I need to translate them to screen On 26 апр, 19:35, Diodeus diod...@gmail.com wrote: I use this: ( fromhttp://www.quirksmode.org/js/findpos.html) function findPos(obj) { //find coordinates of a DIV var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft curtop = obj.offsetTop while (obj = obj.offsetParent) { curleft += obj.offsetLeft curtop += obj.offsetTop } } return [curleft,curtop]; } myPos = findPos($('someDIV')) alert(myPos[0] + , myPos[1]) On Apr 25, 7:02 am, buda www...@pochta.ru wrote: I have a problem with keydown event - event.screenY in the handler show coordinates inside a form instead of screen so I need to have absolute coordinates of an element to show popup element under an element or beneath of it Help me please- Скрыть цитируемый текст - - Показать цитируемый текст - --~--~-~--~~~---~--~~ 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: AJAX response - Content-type: text/html; charset=windows-1251 not encoding properly
I'm going to get my DB admin to convert the database to UTF-8 and be done with it. On Apr 28, 11:02 am, Walter Lee Davis wa...@wdstudio.com wrote: Ohhh -- that makes quite a lot of sense if you think about it. serialize() uses encodeURIComponent() under the hood, and the spec says that it will always encode the string as UTF-8, regardless of source. I'm not sure what your options are if you're doing a form submission, other than recognizing the content-type on the server and using iconv or another conversion utility to make it match your database. Walter On Apr 28, 2009, at 10:52 AM, Miguel Beltran R. wrote: You use forms? I tried use iso-8859-1 and forms and I have much trouble. The function serialize fields always give back data using utf-8. If not use forms, try adding option encoding 2009/4/23 Diodeus diod...@gmail.com I'm working on and English/French site. The French data is in the windows-1251 character set. My main application uses: meta http-equiv=Content-Type content=text/html; charset=windows-1252/ So I am also adding the appropriate HTTP response header in my AJAX response. If I go to the AJAX URL directly, the encoding comes out fine, but if I call it via Prototype the accented French characters come out as the ? diamond in Firefox. I've tried adding encoding:'windows-1252' in my request, but I'm still getting the same result. Does Prototype need some other configuration to treat the response as something other than UTF-8? --~--~-~--~~~---~--~~ 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: Prototype script.aculo.us not working in firefox
Please post the URL. On May 6, 7:00 am, lesserone leonde...@gmail.com wrote: Hi all I am using Prototype script.aculo.us. All I want to do is use a horizontal slider with a list of images. If I do not use a master page then it all works in IE but not in Firefox. If I use a master page still nothing in Firefox and the Images are not hidden but all of them show please help. --~--~-~--~~~---~--~~ 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: Prototype Ajax with Perl script gets random internal server error
All I can suggest is performing some error-trapping in your server- side code to see where it's crapping-out. On May 5, 2:55 pm, Nobody stefan.e...@googlemail.com wrote: Hi guys, i got a problem with prototype in connection with a perl script. I'm performing AJAX-requests with Ajax.Request of prototype calling a perl script for performing the backend functions. Somehow i get random 500 Internal Server Error messages. I tried so many things (checking permissions, checking error.log, etc.) but i got no further with this. The cryptic part is that i can run the AJAX-request several times, every time succesfully, but if i run it once more, it crashes with the mentioned error. I can exclude an error within the perl script. I ran it several times without an AJAX-request just through a normal POST- call and i never got errors. Even more weird is the fact that the perl script evidently performs the commands it should perform even if i get the internal server error. Anybody got me any idea how to solve this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Queing effects
Take a look here too: http://proto-scripty.wikidot.com/scripty:how-to-timing-and-sequencing-animations On May 13, 1:27 pm, Jeztah webmas...@thecarmarketplace.com wrote: Evening guys, Does anyone know if i can queue effects in scriptaculous... Basically what i want to do is... On document loaded a div moves from one position to another (Effect.Move) then when its finished fire another Effect (Effect.Grow) after it... in the past i would do this with setTimeout and wait for it to fire then fire the next effect but it seems stupid to do if scriptaculous allows this... I was looking at effect.queue on the github page but i am not sure if its what i am after or not.. can anyone clarify or point me in the direction of what i need to do. Thanks in advance Alex --~--~-~--~~~---~--~~ 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] Alternatives to Protosafe?
I am working on a content delivery solution. This would allow people to include some content on their page by adding a script tag. I would like to add some slickness to the content, so I would like to use Prototype. I'm looking for some suggestions to safely add Prototype to the target pages (I'm inserting a script tag dynamically) without interfering with an existing copy of Prototype, jQuery or other libraries. --~--~-~--~~~---~--~~ 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: Alternatives to Protosafe?
I'd rather not test for conflicts, but rather to safely coexist. On Jul 9, 4:48 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: You could check for the jQuery object - this will get round jQuery... if(jQuery) { .. } There must be prototype only objects/functions/classes you can test for in prototype I am not sure about other libraries but i think extjs uses the Ext. namespace and similar with yahoo - Original Message - From: Diodeus diod...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, July 09, 2009 8:10 PM Subject: [Proto-Scripty] Alternatives to Protosafe? I am working on a content delivery solution. This would allow people to include some content on their page by adding a script tag. I would like to add some slickness to the content, so I would like to use Prototype. I'm looking for some suggestions to safely add Prototype to the target pages (I'm inserting a script tag dynamically) without interfering with an existing copy of Prototype, jQuery or other libraries. --~--~-~--~~~---~--~~ 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: Need help for performantly creating tooltips
Performantly isn't a word. On Jul 21, 10:31 am, Chris c...@clicksports.de wrote: Hi all, one of our clients has a very javascript heavy application for local intranets. On many pages of this application, there are tooltips that get loaded (usually up to 60 or 70), which make the application behave very slowly at some time or another (at least in good ole IE6, which we need to support). Currently we are using Prototip2 from nick stackenburg, but it seems that this seems overkill and isnt so performant at all. So, I want to start to build my own tooltip-functionality, which should be lightweight and does not need thousands of listeners, which also seems to make pages very slow. My question is: What is the best approach for this task? I am currently experimenting with event-bubbeling to only use one listener on this page, so I can create as many tooltips as i want without raising memory too much. This is what I have come up with in the last 20 minutes or so: /** * Creat tooltips for an array of objects * @param {Object} classes Classname of elements where the tooltips should be shown on * @param {Object} content_attribute The dom attribute of the element we should get the content from */ var tt = Class.create({ initialize: function(classes, content_attribute) { this.classes = classes; this.content_attribute = content_attribute; this.initListeners(); }, /** * Initialize the global listener */ initListeners: function() { document.observe('mouseover', this.moverListener.bindAsEventListener (this)); document.observe('mouseout', this.moutListener.bindAsEventListener (this)); }, moverListener: function(e) { elm = Event.findElement(e, '.' + this.classes); if(elm !== undefined) { this.showToolTip(elm) } else return; }, moutListener: function(e) { elm = Event.findElement(e, '.' + this.classes); if(elm !== undefined) { this.hideTooltip(elm); } }, showToolTip: function(elm) { console.log(elm + ' is shown') }, hideTooltip: function(elm) { console.log(elm + ' is hidden') } }; As I am quite experienced in prototype.js (well, at least I think I am...), but not in such things like performance tuning javascript and such stuff, I really would love to hear some feedback from you. Are there any other performance problems that this type of listener would force me in (dont know how fast findElement() is compared to a direct binding to the source element of a listener). do you think that this is maybe the wrong approach at all? The tooltips should go without great graphical stuff, the only thing I want to add are pointers in pure css, like those seen onhttp://www.filamentgroup.com/lab/image_free_css_tooltip_pointers_a_us..., to save some more bandswidth. Thanks in advance, Chris --~--~-~--~~~---~--~~ 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 do I implement this Prototype/AJAX effects on my page?
The Wiki may be helpful for you: http://proto-scripty.wikidot.com/ On Jul 21, 11:11 pm, elggtester jphil...@gmail.com wrote: If you go here, http://demo2.analoganalytics.net/publishers/7/offers I want an identical effect that has three buttons -- print, email, text that does the same thing on the site. I can handle the server-side code (PHP), but I want to know how I can get that exact effect? My JavaScript is a bit above beginners (new to Prototype), and I see they are using Prototype with some other effects. Now, on Firefox, I had saved the webpages but when I tried click on either of the 3 buttons, the JavaScript effect did not work. Can anyone show me how to implement something similar on my site? --~--~-~--~~~---~--~~ 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)
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: Sliding panels
See if this is like what you're looking for. Click on the main links. http://teachers.scholarschoice.ca/ On Oct 26, 8:58 pm, eng. Ilian Iliev anthonyl...@gmail.com wrote: Hi all, I`m not absolutely sure this is the right place to ask, but I hope to find find at least directions where to ask. The problem is that I`m trying to build a web site where I need a very wide navigation, available on each page. To be more specific something like book sections where these sections titles my vary in length. So I want to place a icon at the corner of the content from which to hide/show this content list overlying the current page content. Of course it will be nice to have sliding effect. I`m using prototype/ script.aculo.us for few other things on my site so I`m asking in this group. Any ideas and hints will be appreciated. 10x in advance, Ilian Iliev --~--~-~--~~~---~--~~ 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: Question RE Appear and Fade
Set a flag that prevents the function from executing if the fade/ appear action is already running. var running = 0 function fadeMe() { if(running==1) { return } running = 1 new Effect.Fade('something',afterFinish:function(){running=0}) } On Oct 26, 12:34 am, Ngan Pham nganp...@gmail.com wrote: Hi everyone, I have quick question: I which to make a div appears (Effect.Appear) and disappears (Effect.Fade) when the mouse is moved over and out of a div. Problem is the effect would collide with each other if the mouse goes over, out, over, out too quickly. What is the best way to stop the effect midway and reverse it so that it won't flicker. Currently I'm doing this: I keep an var effect = Effect.Appear...If effect exists and is running when the mouse goes over, I effect.cancel() it and get the opacity and call Fade on it passing in from argument. I'm not using queues or anything. Is this the best/only way? Or is there a absolutely better/best way of doing this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to 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 update suggestion: show/hide, CSS, unobtrusive
Try: $$(.dealerAddress).each(function(element) {element.removeClassName(dealerAddress)}); This will unhide them. Not sure if this will be any faster. On Jan 26, 1:06 pm, kenxle kenstcl...@gmail.com wrote: Here's the problem I'm running into: $$(.dealerAddress).invoke(hide); takes too long because a very large page structure is loading, and there are many dealer addresses, so my page shows everything, then hides it, when it loads. Ew. To fix this, I put .dealerAddress{display:none;} in my CSS style sheet. However, when Prototype runs its show/hide functions (I'm using toggle), it only seems to be adding the attribute ... style=display:none or removing it. Which means that my style sheet takes back over when it removes the attribute, and the tag ends up never showing. I fixed it by putting my style declaration inline in the tag, as Prototype does, but I find this solution hackish and obtrusive. Why doesn't Prototype toggle from ... style=display:none to ... style=display:[inline||block]? Wouldn't this solve my problem, as the inline style declaration would override the style sheet declaration? If so, I'd like to propose it as an update. Discussion or alternate solutions welcome. Thanks. (P.S. jQuery handles this situation without issue...) -- 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: passing a recordset when using AJAX
Yes, you can use XML, which can be hundreds of times slower on the client to parse, or you can make your own customer structured string blob than you then parse on the client. Alternately you can verbosely declare JavaScript arrays from strings built up in your ASP code (person = [];person[0] = tom etc) JSON, because it is a native JavaScript object (does not need to be parsed) is by far the best method for getting data into the client. You are wise to befriend this data format. On Feb 2, 6:38 pm, Fab fabrice.blonco...@gmail.com wrote: Hi, I am a one week old newcomer to AJAX. My intentions are to attempt to pass a recordset to my page in order to either use it for filling a drop-down list or other elements of my page or even display it through a table... That said, my question is, is there a way to be able to pass the recordset back to my original asp page in order to decide how to treat it from there? idea of design: default.asp: asp page which contains my html and some asp functions. back-end.asp: asp page which contains my connection to the DB and obtains the records returned by which ever stored procedure is called. So to try to be as clear as possible, I obtain the recordset in back- end.asp but want to use it, however it may be, inside of default.asp... Am I day dreaming or is this possible? So far everything i found seems to point that i have to deal with the recordset within my back-end.asp page and finally send it back... most of the time it was using JSON... is there any other options then JSON? Thanks in advance for your help! Fab -- 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: input label solution
What is a input label solution/plugin to begin with? On Feb 1, 10:45 pm, Marcelo Barbudas nos...@gmail.com wrote: Hi Guys, What are you using as an input label solution/plugin? Basically just some default texts in input fields based on labels. I looked at stereolabels, apparently it doesn't work on IE7 (and last updated in 2007). -- Cheers, R. -- 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.