[Proto-Scripty] Re: Draggables needs remove (like Droppables)

2008-09-18 Thread bluezehn
>From API: "Called whenever a Draggable is released over the Droppable and the Droppable is accepts it. The callback gets three parameters: the Draggable element, the Droppable element and the Event. You can extract additional information about the drop – like if the Ctrl or Shift keys were presse

[Proto-Scripty] Re: issues with getElementBySelector

2008-09-18 Thread banry
Sorry for this, i've found the error the variable l is used in both the for loop for elements and later down in the code. On Sep 18, 4:56 pm, kangax <[EMAIL PROTECTED]> wrote: > banry wrote: > > I'm trying to convert some code from mootools to prototype, but I can > > get the first ul to work but

[Proto-Scripty] Re: issues with getElementBySelector

2008-09-18 Thread banry
thanks to kangax, justin, matt and bluezehn I now have firebug and some semi-working code. this almost works but for some reason the Organisation menu works fine, the second menu - System setup gets the hover for the first ul but doesn't for the li, and the reconcilation responses menu does nada.

[Proto-Scripty] Draggables needs remove (like Droppables)

2008-09-18 Thread Grego
I would like to do a '.remove' of a draggable element after I drop it on a droppable item. The problem is I only have the element available at that time, and it looks like you need the element's draggable handle so that you can call '.destroy' on it. It would be better to have a '.remove' functio

[Proto-Scripty] Re: AJAX autocompleter

2008-09-18 Thread Jack D
Hi Justin, I'm using IE 6. In the memory leak tool which you've specified, if the #leak is showing some number, then does it mean that its a memory leak? Thanks! On Thu, Sep 18, 2008 at 12:39 PM, Justin Perkins <[EMAIL PROTECTED]>wrote: > > On Thu, Sep 18, 2008 at 2:30 PM, Jack D <[EMAIL PRO

[Proto-Scripty] Re: AJAX autocompleter

2008-09-18 Thread Justin Perkins
On Thu, Sep 18, 2008 at 3:02 PM, Jack D <[EMAIL PROTECTED]> wrote: > Hi Justin, > I'm using IE 6. In the memory leak tool which you've specified, if the > #leak is showing some number, then does it mean that its a memory leak? I guess, but with IE there will be all sorts of stuff marked as #l

[Proto-Scripty] Re: AJAX autocompleter

2008-09-18 Thread Justin Perkins
On Thu, Sep 18, 2008 at 2:30 PM, Jack D <[EMAIL PROTECTED]> wrote: > Hello, > > any clue regarding memory leak? What version of IE? IE is well known for it's memory leaks with JavaScript. I recommend using a memory leak tool for IE rather than just looking at the task manager. sIEve is on

[Proto-Scripty] Re: AJAX autocompleter

2008-09-18 Thread Jack D
Hello, any clue regarding memory leak? Thanks! On Wed, Sep 17, 2008 at 3:43 PM, Jack D <[EMAIL PROTECTED]> wrote: > Hi bluezehn, > Here is the code: > > class="button" type="text" autocomplete="off"> > src="images/inprogress.gif" alt="Working..." /> > > > new Ajax.Autocompleter

[Proto-Scripty] Re: Move a sortable with javascript

2008-09-18 Thread Matt Foster
Sortable simply applies behaviors to elements. You're looking to build a different element structure. Javascript might not be the best approach for this, if its a dynamic list, being rendered from PHP or another server side language than I'd recommend the construction logic to be delegated to th

[Proto-Scripty] Re: order of operations

2008-09-18 Thread BrentNicholas
David, The answer Matt had got me started, but I'm wondering if the called template saving the info firing javascript at the end is enough, or is there is a way to incorporate the onSucess/onComplete features into it to be a little more robust. I ended up doing this: function updateStationDetai

[Proto-Scripty] Re: 7 new messages in 7 topics - digest

2008-09-18 Thread david
Hi Hugh, I think TJ is right , because I have an answer for you :(( If it is not what you attempt, then post a reply to explain what you want and we can go forward step by step !! For your problem, if you have a *LIVE* exemple that could probably help, because the code you give us is a template

[Proto-Scripty] Re: Move a sortable with javascript

2008-09-18 Thread david
Hi fintch2309, go and have a look to the scriptaculous doc for sortable. It begin with: "A Sortable is a quick way to initialize many Draggable elements in a container element. When you create a new Sortable, it takes care of the creation of the corresponding draggable Droppables." the reference

[Proto-Scripty] Re: order of operations

2008-09-18 Thread david
It seems that I arrive a little bit late ... and without the properly answer ... Hummm -- david On 18 sep, 18:41, david <[EMAIL PROTECTED]> wrote: > Hi Nicholas, > > the problem you mention is I think not a JS problem, because all > instruction runs in order. > The problem is more a network

[Proto-Scripty] Re: order of operations

2008-09-18 Thread david
Hi Nicholas, the problem you mention is I think not a JS problem, because all instruction runs in order. The problem is more a network one. What I mean is when you submit the form, I understand that just after you send the AJAX request to see if everything is well done. The problem here is that

[Proto-Scripty] Re: multipart/form-data and prototype

2008-09-18 Thread BrentNicholas
Matt, Thanks! This answered another post I had before checking up on this one... Thanks again! BN On Sep 18, 8:19 am, Matt Foster <[EMAIL PROTECTED]> wrote: > Using an iframe to upload a file isn't too difficult and can be done > with almost any server side language, you simply post the form to

[Proto-Scripty] Re: order of operations

2008-09-18 Thread BrentNicholas
Maybe I should check up on my old posts... Matt answered it quite well here... http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/ffd60dfc2a95899a?hl=en Thanks Matt! On Sep 18, 10:23 am, BrentNicholas <[EMAIL PROTECTED]> wrote: > I was going to ask another question, but

[Proto-Scripty] order of operations

2008-09-18 Thread BrentNicholas
I was going to ask another question, but in tying it out I realised there is a more fundamental question here.. Q: within a function, do the statements run in order? if one statement is running will it move on to the next? I faintly recall reading something about js not paying attention to order.

[Proto-Scripty] Move a sortable with javascript

2008-09-18 Thread fintch2309
Is there any way to move sortable items around using javascript? I want to be able to move an item from one sortable to another on the page load. Any help or ideas would be great! Thanks, Fintch --~--~-~--~~~---~--~~ You received this message because you are subs

[Proto-Scripty] Re: issues with getElementBySelector

2008-09-18 Thread kangax
banry wrote: > I'm trying to convert some code from mootools to prototype, but I can > get the first ul to work but none of the others add the hover class on > mouseover. its got something to do with the call to > getElementBySelector - any help appreciated > > Event.onDOMReady(function(){ A prot

[Proto-Scripty] Re: issues with getElementBySelector

2008-09-18 Thread Justin Perkins
On Thu, Sep 18, 2008 at 10:09 AM, Matt Foster <[EMAIL PROTECTED]> wrote: > > bluezehn, the $$ method just executes getElementsBySelector on the > document. http://prototypejs.org/api/element/getelementsbyselector Doesn't $$ use Element#select? Nobody should be using getElementsBySelector if you'

[Proto-Scripty] Re: issues with getElementBySelector

2008-09-18 Thread Matt Foster
bluezehn, the $$ method just executes getElementsBySelector on the document. http://prototypejs.org/api/element/getelementsbyselector You may be having trouble with the mouseover/out events because of event propagation, the elements inside your s will actually fire their own mouse events which a

[Proto-Scripty] Re: 24 new messages in 10 topics - digest

2008-09-18 Thread T.J. Crowder
Hugh, Two things: 1. Even if you aren't happy with responses to your questions, it's not okay to repost. Your original post did show up. In fact, you got a reply in that thread before you reposted and started this second thread. For readers of this thread, here's his original and if you feel

[Proto-Scripty] Re: delegating the event on document

2008-09-18 Thread Ken Snyder
david wrote: > Hi Rauan, > > A question, does the focus effect bubble ?? > > because this work: > $(document.body).observe('click', function(e) { > var _elem=Event.element(e); > alert(_elem.tagName); > return; > }); > > but not the same code when you use the focus event instead of the > cl

[Proto-Scripty] Re: multipart/form-data and prototype

2008-09-18 Thread Matt Foster
Using an iframe to upload a file isn't too difficult and can be done with almost any server side language, you simply post the form to the frame as any other submission, then instead of displaying the page in the iframe, have a snippet of code to execute a javascript method in the parent window.

[Proto-Scripty] Re: 24 new messages in 10 topics - digest

2008-09-18 Thread Hugh Bothwell
Second attempt: I'm fairly new to Scriptaculous and trying to figure out how to do this properly: I have a menu of question-types and a Sortable list of questions. I want to be able to click on a menu-item (NOT a question) and have it generate a new question - already being dragged - which

[Proto-Scripty] Re: Showing display:none content fails

2008-09-18 Thread Matt
That was it - I should have spotted it, sorry. Thank you so much, this has really pulled me out of a rut! Matt On Sep 18, 2:46 pm, bluezehn <[EMAIL PROTECTED]> wrote: > Well I think it may be this: > > if(!node.id == newBox) > > which should be this: > > if(node.id != newBox) > > other wise use

[Proto-Scripty] Re: Showing display:none content fails

2008-09-18 Thread bluezehn
Well I think it may be this: if(!node.id == newBox) which should be this: if(node.id != newBox) other wise use console.log debugs to sort out whether or not the .each() loop is firing for every element, if it's passing the above if conditional etc. Essentially work out which line is wrong by p

[Proto-Scripty] Re: Showing display:none content fails

2008-09-18 Thread Matt
Thanks for the speedy reply! I'm using Firebug actually, it's invaluable for this kind of thing, but I didn't know about the log/console function - thanks. I tried out your code like so: // hide other boxes $$('.box').each(function(node) { if(!node.id == newBox) node.hid

[Proto-Scripty] Re: issues with getElementBySelector

2008-09-18 Thread bluezehn
Apologies to double post, but you may also find the Array#each() and prototype's various enumerable functionalities useful as it seems you're taking the long way around in a lot of your code. Link again: http://www.prototypejs.org/api/enumerable If you're starting out with prototype I'd also stron

[Proto-Scripty] Re: issues with getElementBySelector

2008-09-18 Thread bluezehn
I haven't read your post any more than seeing the expression "getElementsBySelector", but that alone prompts me to forward you to this link in the api: http://www.prototypejs.org/api/utility/dollar-dollar That's the prototype way of doing what you're trying to do. Try it out and if you have any fu

[Proto-Scripty] Re: Showing display:none content fails

2008-09-18 Thread bluezehn
You should set style="display:none;" in the actual html rather than the css for it to be compatible with prototype. Your code at the bottom is very confusing at the moment as well. It's saying, toggle-fade the box and grow it (at the same time). I'd just go for Element#hide(), Effect.Grow().

[Proto-Scripty] issues with getElementBySelector

2008-09-18 Thread banry
I'm trying to convert some code from mootools to prototype, but I can get the first ul to work but none of the others add the hover class on mouseover. its got something to do with the call to getElementBySelector - any help appreciated Event.onDOMReady(function(){ alert('DOM is loaded!');

[Proto-Scripty] Showing display:none content fails

2008-09-18 Thread Matt
Hopefully this is an easy one... I'm building a multi-level navigation system. You click on one box and a set of sub-boxes displays underneath. Since there are multiple possible sets of sub-boxes, I've tried to write a function to hide them and only display the relevant one. Here's some code:

[Proto-Scripty] Re: Drag and Drop with overflow auto

2008-09-18 Thread Anulith
Thanks so much! This was exactly what I needed. The only change I made was to the getDragElement function. I'm not sure why the author is appending to a fake iframe and didn't bother going back through all the posts to find out. If you change that line to document.body.appendChild(el) then it

[Proto-Scripty] Re: how can we make XHR (AJAX ) calls to other domain ?

2008-09-18 Thread Rama
Thanks for the community i have resolved my problem . I have used iframes and implemented the cross domain communication using fragment identifiers. i opted for iframe as it makes my task easier. much more details are given in below links --

[Proto-Scripty] Re: Autocompleter with multiple word input?

2008-09-18 Thread Walter Lee Davis
Naturally, I found it in the source as soon as I asked in public. // Tokenized incremental autocompletion is enabled automatically // when an autocompleter is instantiated with the 'tokens' option // in the options parameter, e.g.: // new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });

[Proto-Scripty] Re: delegating the event on document

2008-09-18 Thread Rauan Maemirov
Hmm, it's strange. Because your code works fine. But, if I change it to $(document.body).observe('focus', function(e) { var _elem=Event.element(e); alert(_elem.tagName); return; }); it doesn't work. On Sep 18, 5:43 pm, david <[EMAIL PROTECTED]> wrote: > Hi Rauan, > > A question, does

[Proto-Scripty] Re: delegating the event on document

2008-09-18 Thread david
Hi Rauan, A question, does the focus effect bubble ?? because this work: $(document.body).observe('click', function(e) { var _elem=Event.element(e); alert(_elem.tagName); return; }); but not the same code when you use the focus event instead of the click event works. -- david On 18 s

[Proto-Scripty] Autocompleter with multiple word input?

2008-09-18 Thread Walter Lee Davis
I seem to recall from the Bad Old Wiki that there was a way to autocomplete individual words in a multiple word input. I have read the New Git Wiki, and don't see any reference to that there. Could someone please remind me how to do this: Input: meat, fish, egg -

[Proto-Scripty] Re: delegating the event on document

2008-09-18 Thread Rauan Maemirov
I'm using 2nd example. Just thought, that 1st would be more elegant. :)) But if I'll add link dynamically, it will not blur in 2nd example. On Sep 18, 5:02 pm, bluezehn <[EMAIL PROTECTED]> wrote: > Why can't you just use the 2nd example? Semantically that's a lot > better, as you want to really o

[Proto-Scripty] Re: How to handle different forms

2008-09-18 Thread david
Hi luftikus, the code: $('output-div').insert(new Element('form', { id:'form_define_dataset' })) works great in FF3 (don't tested elsewhere. I think you're problem is elsewhere. -- david On 18 sep, 07:54, luftikus143 <[EMAIL PROTECTED]> wrote: > Thanks. > > I know have something like this:

[Proto-Scripty] Re: delegating the event on document

2008-09-18 Thread bluezehn
Why can't you just use the 2nd example? Semantically that's a lot better, as you want to really observe each link, not the whole body. I mean, the first example is saying, "Observe a focus to the body". That's not really helping at all with the focus of any specific link, if you see what I mean.

[Proto-Scripty] Re: how can we make XHR (AJAX ) calls to other domain ?

2008-09-18 Thread david
Hi, there is pluging for prototype to do cross site AJAX, let's have a look ??PB: the version is for prototype 1.5, but try it :)) http://www.mellowmorning.com/2007/10/25/introducing-a-cross-site-ajax-plugin-for-prototype/ hope you could find what you need. -- david On 17 sep, 20:26, Matt Fos

[Proto-Scripty] Re: 7 new messages in 7 topics - digest

2008-09-18 Thread david
Hi Hugh, > Now for my question: > > I would *like* to be able to drag-click an AddQ button and be able to > drag the new question directly to where I want it; but I haven't been > able to figure out how to go about this.  If I make the palette list > sortable, I can drag the add-question button d

[Proto-Scripty] delegating the event on document

2008-09-18 Thread Rauan Maemirov
It's very simple to do for some html object as ancestor, but not for whole body. What I'm doing wrong? $(document.body).observe('focus', function(e) { if (!(elem = e.findElement('a'))) return; elem.blur(); }); The main aim is to avoid effect of "wrapping the link

[Proto-Scripty] Re: JSON for Novice

2008-09-18 Thread bluezehn
There ya go - knew prototype did that somewhere! Cheers for filling in the gaps T.J. On Sep 18, 11:02 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote: > > Now in prototype, it does automatically decode this for you. I can't > > remember off the top of my head where it goes! > > The Ajax.Response obj

[Proto-Scripty] Re: JSON for Novice

2008-09-18 Thread T.J. Crowder
> Now in prototype, it does automatically decode this for you. I can't > remember off the top of my head where it goes! The Ajax.Response object[1] passed to the handlers has a responseJSON property, so if your server-side page returns this JSON: { "success": true, "message":

[Proto-Scripty] Re: Drag / Drop with TinyMCE

2008-09-18 Thread bluezehn
I haven't come across this before, but as a guess somehow TinyMCE's event listeners are being detached from the textarea. Try re-invoking TinyMCE's event listening function whenever that LI is dropped maybe? On Sep 17, 8:27 pm, dante2010 <[EMAIL PROTECTED]> wrote: > Hi, > > I am using TinyMCE as

[Proto-Scripty] Re: JSON for Novice

2008-09-18 Thread bluezehn
Whenever a web page is requested and returned to the browser - whether this is through AJAX or a new page view - the server tells the browser what type of content it is being served and whether or not the request was carried out successfully. Prototype can access this information, and indeed does

[Proto-Scripty] Re: Drag and Drop with overflow auto

2008-09-18 Thread bazikch
Hello, I faced the same problem and after googling I found a patch at the following address: http://dev.rubyonrails.org/ticket/5771 Obviously it seems to work right only with the _ghosting_ options set to _true_, otherwise the dragged element disappear but still activate the droppable one. On 17