[Proto-Scripty] Ajax request Encoding issue iso-8859-1
Could anyone please let me know why Ajax request in the following manner is not setting up the correct encoding. It looks like prototype is using default utf-8 encoding. var params = Form.serialize(my_form); new Ajax.Request(url, { method: 'post', parameters: params, asynchronous: true, encoding: '%= com.myclass.getEncoding() %', //my case its iso-8859-1 onComplete: change, onFailure: showError }); --~--~-~--~~~---~--~~ 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] Executing on dom:loaded
Hello all I am new to Prototype/Scriptaculous and have been trying to get something working on dom:loaded rather than once the page has rendered. I have done a reasonable amount of Googling, though the things that I have tried have been of no success. Any help is greatly appreciated! My code: // Revision 1 //Event.observe(document,'dom:loaded', function(){ // var blockbody = document.getElementsByClassName('blockbody'); // blockbody.each(Element.hide); // alert('hi'); //}); Event.onReady(function() { var blockbody = document.getElementsByClassName('blockbody'); blockbody.each(Element.hide); }); I tried: document.observe('dom:loaded', function(){ var blockbody = document.getElementsByClassName('blockbody'); blockbody.each(Element.hide); }); To which the Firefox error console returned: 'document.observe': invalid label Thanks!! Grant --~--~-~--~~~---~--~~ 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] Something like namespaces problem
Hi guys I have the following problem - on a single page I want to use Draggables Droppables and separately Sortable lists. No problem thus far - I know. Here it is: I'm using a modified Draggables object and Draggable class that enhance a lot their base forms in order to act the way I want. They add more variables, special moves etc. Everything here is working fine. The problem comes when I start using Sortables because they use the modified DragDrop objects and act really weird and in fact are doing it all wrong. If I load non-modified scriptaculous version everything is allright with the Sortables. So my problem is that I'm not really good with javascript and it took me a great effort to implement the changes I wanted. At other hand they are really a lot and if I have to compare every single line with the basic scriptaculous code it will take me ages to create new objects that extend the basic objects with my changes. I can't think of a fast way for me to be able to use both - basic and modified versions of scriptaculous on one page. Any help will be really appreciated! Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-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 request Encoding issue iso-8859-1
If you read the Prototype documentation, you will see that Prototype uses UTF-8 internally, and if you read the W3C recommendations, you will see that UTF-8 is the preferred and expected encoding for Web sites. So what is your issue specifically? Are you unable to set your server to correspond in UTF-8? It's a fairly trivial exercise in most modern frameworks, usually just a single config file edit away. Walter On Nov 25, 2008, at 2:32 AM, AS wrote: why Ajax request in the following manner is not setting up the correct encoding. It looks like prototype is using default utf-8 encoding. --~--~-~--~~~---~--~~ 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: update two container by one ajax call
2008/11/21 tushersuvro [EMAIL PROTECTED] Hey. Everyone! how r u? um having trouble in updating two container (ids) in one ajax call. the function here I use is protoype's updater function. Suppose there is two ids div id=1somethinf/div there are some code here. there are some code here. there are some code here. there are some code here. there are some code here. there are some code here. there are some code here. there are some code here. there are some code here. there are some code here. div id=2another bunch of code/div form name=samplefrm method=post action=javascript:get (document.getElementById('samplefrm')); change to form name=samplefrm id=samplefrm method=post action=results.htm input type=text name=textfield id=textfield value / input type=button name=srch value=submit / /form Now from the if submit button is pressed, two ids in above will be updated with two different contents with one ajax call. can it be done with prototype? Thnaks. Tushersuvro Yes, can do it check onSuccess something like this script type=text/javascript window.observe('dom:loaded', function (){ $('samplefrm').observe('submit', function(evt){ var req=$('samplefrm').request({ onSuccess: function(response){ $('div1').update(some value); $('div2').update(other value); } }) }) }) /script -- 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: update two container by one ajax call
Sorry, forgot the thread URL. [1] http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/9dbd642d6e625cff?hl=en Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] On Tue, Nov 25, 2008 at 2:34 PM, Gabriel Gilini [EMAIL PROTECTED]wrote: On Tue, Nov 25, 2008 at 2:17 PM, Miguel Beltran R. [EMAIL PROTECTED]wrote: [snip] script type=text/javascript window.observe('dom:loaded', function (){ Just change this to document.observe('dom:loaded', function(){ As seen in a thread[1] a few days back, dom:loaded is a document event. [snip] Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: update two container by one ajax call
On Tue, Nov 25, 2008 at 2:17 PM, Miguel Beltran R. [EMAIL PROTECTED]wrote: [snip] script type=text/javascript window.observe('dom:loaded', function (){ Just change this to document.observe('dom:loaded', function(){ As seen in a thread[1] a few days back, dom:loaded is a document event. [snip] Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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?
You prob just need to store the new slidePos. a href=javascript:// onclick=increment()scroll right/a var slidePos = 0 function increment(){ slidePos = slidePos + .1; slider2.setValue(slidePos); } var slider2 = new Control.Slider('handle2', 'track2', { onSlide: function(v) { scrollHorizontal(v, $('scrollable1'), slider2); }, onChange: function(v) { scrollHorizontal(v, $('scrollable1'), slider2);slidePos=v } }); im working on this issue now, let me know if that doesn't work On Oct 10, 1:02 am, djvern [EMAIL PROTECTED] wrote: Hi Diodeus, Thanks for you quick reply! That works, but it only moves one increment on the first click. How can I get it to keep moving along when the linked is clicked repeatedly? Do I need to set up a loop of some kind? Sorry, my knowledge of javascript is very limited! On Oct 9, 6:03 pm, Diodeus [EMAIL PROTECTED] wrote: 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 ?
[Proto-Scripty] Re: The Hop Effect
Why using a script for this ? The following solution is only based on CSS (and lighter) : The CSS : style #menu { position:fixed; margin-right:20px; margin-top: 40px; z-index:100; } /style The HTML : div id=menu ... what you want in there .../div Best regards. Asterix On 19 nov, 02:24, Adam Rochford [EMAIL PROTECTED] wrote: Prototype JavaScript framework, version 1.6.0.3 scriptaculous.js v1.8.1 I am currently running a script that has a menu that scrolls down as you scroll down. You can see it herehttp://www.law.indiana.edu/lawlibrary/research/guides/european/index_... . But you can also a notice that when the scrolling stops theres a hop or a flash or redraw happening making it not seem as a smooth as it should. Is there a remedy for this or is there code in here that should not be here? All advice is welcome. --~--~-~--~~~---~--~~ 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: The Hop Effect
On Tue, Nov 25, 2008 at 4:02 PM, Walter Lee Davis [EMAIL PROTECTED]wrote: To support IE6, may it rest in pieces. That's no excuse, you could easily support IE6 with a little conditional commenting. But you obviously wouldn't achieve the smooth scrolling effect. [snip] Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: The Hop Effect
If you looked at the script I posted, you'd see that I only attach the behavior if the browser doesn't work correctly. Naturally, if the browser is non-broken, we don't want to punish it in any way. Walter On Nov 25, 2008, at 1:14 PM, Gabriel Gilini [EMAIL PROTECTED] wrote: On Tue, Nov 25, 2008 at 4:02 PM, Walter Lee Davis [EMAIL PROTECTED] wrote: To support IE6, may it rest in pieces. That's no excuse, you could easily support IE6 with a little conditional commenting. But you obviously wouldn't achieve the smooth scrolling effect. [snip] Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: The Hop Effect
On Tue, Nov 25, 2008 at 4:20 PM, Walter Lee Davis [EMAIL PROTECTED]wrote: If you looked at the script I posted, you'd see that I only attach the behavior if the browser doesn't work correctly. Naturally, if the browser is non-broken, we don't want to punish it in any way. Yes, I did look at it, but my statement is still valid. !--[if lte IE 6] style body{ height: 100%; overflow: auto; } #menu{ position: absolute; } /style ![endif]-- And there you have it. No UA-sniffing, no JavaScript at all. The downside? Everything positioned as absolute will act like fixed in IE6 and lower. But that should be no problem. And again, with this or yours solutions you can *not* achieve the smooth scrolling effect. Get it now? Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: DOM popup in IE
Why would you want to avoid position:absolute for an object which needs to sit on top of everything in the center of the document? On Nov 22, 6:10 am, Dave L [EMAIL PROTECTED] wrote: I have been struggling to get the DOM popup kit, which uses prototype, to display popups and modal dialog boxes in Internet Explorer for a while now(it is working great in Firefox). Right now, the popup will only display above css elements that have no position value and only if the popup position itself is absolute, BUT I cannot get the overlay to position correctly unless I use an absolute position. Aside from the css issues, it looks the code in the popup kit defines the overlay object to be a child of the body element: document.body.appendChild(overlay); whereas, the popup object is never defined as so. Could it be an issue with the order in which they are defined in IE or an issue regarding being a child of the body in general? As you can see, I am somewhat new to prototype in general and I could really use some input and/or guidance. 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: The Hop Effect
A lot of JS is being executed, listening to scroll is like listening to mousemove, the event fires often. Scrolling up and down your page might fire off more than 100 scroll events, in combination with this, you're executing an effect each time the event is fired, furthermore the Effect execution doesn't use a queue, I think this is where you problem lies. Try using a setTimeout call to delay effect execution until scrolling has finished. Try using a { queue : end, ... } parameter to your options argument for your Effect. -- http://positionabsolute.net On Nov 25, 2:20 pm, Gabriel Gilini [EMAIL PROTECTED] wrote: On Tue, Nov 25, 2008 at 4:20 PM, Walter Lee Davis [EMAIL PROTECTED]wrote: If you looked at the script I posted, you'd see that I only attach the behavior if the browser doesn't work correctly. Naturally, if the browser is non-broken, we don't want to punish it in any way. Yes, I did look at it, but my statement is still valid. !--[if lte IE 6] style body{ height: 100%; overflow: auto; } #menu{ position: absolute; } /style ![endif]-- And there you have it. No UA-sniffing, no JavaScript at all. The downside? Everything positioned as absolute will act like fixed in IE6 and lower. But that should be no problem. And again, with this or yours solutions you can *not* achieve the smooth scrolling effect. Get it now? Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: Use slider with discontinue values
You're sample data isn't really a range though is it? Why would you want to use an instance of ObjectRange over a regular Array? -- http://positionabsolute.net On Nov 24, 12:14 pm, T.J. Crowder [EMAIL PROTECTED] wrote: P.S : Oh and by the way, I can't post from my mail software. My mails are rejected by google, saying that the address is wrong or that I'm not allowed to post here. Can someone take a llok at that please ? You'll have to contact Google about it, it's not something we're doing on the group. We do hold first posts for moderation, but they don't get rejected, just held -- like this post was. You never know, it may start working now that you've had a post approved and are no longer moderated. FWIW, -- T.J. Crowder tj / crowder software / com On Nov 24, 10:33 am, Bounga [EMAIL PROTECTED] wrote: Hello, I need to implement a slider (scriptaculous Control.Slider) that uses discontinue values. The slider should go through these values : 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7. So my question is, is it possible to create an ObjectRange with these values (I know that it's not a normal behaviour for a range) or is there another way to feed slider values (I mean using something else than ObjectRange)? Thanks in advance. P.S : Oh and by the way, I can't post from my mail software. My mails are rejected by google, saying that the address is wrong or that I'm not allowed to post here. Can someone take a llok at that 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: onUpdate does not work with Sortable.create
No idea if this works or not, but a quick search on Google has produced an almost identical question and answer to your issue. http://chumby.net/2008/10/27/scriptaculous-sortablecreate-onupdate-event-isnt-firing/ -- http://positionabsolute.net On Nov 22, 4:53 pm, patrick [EMAIL PROTECTED] wrote: Let me simplify my example.. Though the items are sortable, the alert never gets called... ul id=list liitem 1/li liitem 2/li liitem 3/li liitem 4/li /ul %= javascript_tag Sortable.create('list', { onUpdate:function() { alert('hi'); }});% --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---