[Proto-Scripty] Tying an Element and a custom class together

2009-09-10 Thread Andrea Campi
Hi, in my application I need JS objects to represent some "business" objects, which are represented on the page by an Element. I would like to be able to tie the two together in such a way that I can use them interchangeably. This sounds like it should be a common pattern, so I was wondering what

[Proto-Scripty] Ajax.Updater hitting wrong server?

2009-09-10 Thread MonkeyBoy
I've got a fairly small zip code to city + state chunk of javascript that I run on server 1, and call on server 2. I load prototype.js and my code (zipcode.js) from server 1 in some html on server 2. The problem comes when I make the Ajax.Updater call, as it updates the page with a 404 error, an

[Proto-Scripty] tooltip appears with mouse cursor inside it

2009-09-10 Thread Sole
Hi all, I use Tooltip.js library from tooltip.crtx.org and I have one question: is it possible to have tooltip appear with mouse cursor inside, so I can set 'onmouseout' event as trigger for tooltip disappearance = Tooltip.hideEvent = new Array("mouseout"); ? btw, I tried to tweak Tooltip.js in

[Proto-Scripty] Re: Ajax.Updater hitting wrong server?

2009-09-10 Thread T.J. Crowder
Hi, All relative URLs within a page (including ones in JavaScript Ajax calls) are resolved relative to the document's URL, not the script file's URL. So "/zipcode.cgi" will resolve relative to the URL of the HTML document, which if I'm reading you correctly is on server 2. Hence the 404. To rea

[Proto-Scripty] Re: Tying an Element and a custom class together

2009-09-10 Thread T.J. Crowder
Hi Andrea, FWIW, I'd say the best practice is: Don't do that, it conflates the model with the view *and* the controller. :-) (MVC is not by any means the only game in town, but the terminology is useful for questions like this.) If you ever want to present the business object in two different

[Proto-Scripty] Re: Ajax.updater - after text has been inserted into element

2009-09-10 Thread T.J. Crowder
Hi, The onComplete callback is triggered after all of Updater's work is done. HTH, -- T.J. Crowder tj / crowder software / com www.crowdersoftware.com On Sep 2, 11:11 pm, Mojito wrote: > I'm using the Ajax.Updater.  I'm looking for the callback that is > executed after the server response tex

[Proto-Scripty] Re: Element.insert(htmlString) removes spaces and non-breaking spaces

2009-09-10 Thread T.J. Crowder
Hi, The code you quoted is non-functional; it doesn't identify what element you're working with. The non-method version of Element.insert requires either an ID or an element instance as the first parameter. Using FF3.5, if I do something like this: $('target').insert('stuff more stuff'); ..

[Proto-Scripty] Re: Ajax.updater - after text has been inserted into element

2009-09-10 Thread Daniel Rubin
JoJo wrote: > I tried to defer it, but that didn't work. It said "this.element is > null" in Control.js. I'm guessing because the function wasn't > deferred long enough to wait for the HTML to be inserted. > > new Ajax.Updater( > 'placeToInsertResponse', > 'ajaxScript.php', { > p

[Proto-Scripty] Re: Ajax.updater - after text has been inserted into element

2009-09-10 Thread Alex McAuley
i will say it again for the benefit of people that missed it... Why not execute the JS in "ajaxScript.php" ? and add the option evalScripts: true to your ajax updater ... Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "Daniel Rubin" To: Sent: Thursday, Septem

[Proto-Scripty] Re: How can this be done in Drag & Drop?

2009-09-10 Thread Script-N00b
Now to get the rest of this thing working :) On Sep 9, 5:21 pm, Rick Waldron wrote: > Awesome! > Rick > > > > On Wed, Sep 9, 2009 at 6:15 PM, Dean Elzey wrote: > > Worked perfectly, hack or not :) > > > On Wed, Sep 9, 2009 at 5:11 PM, Rick Waldron wrote: > > >> this is WAY hackish... > >>  

[Proto-Scripty] Re: Element#Storage

2009-09-10 Thread david
Hi Matt, I'am totally agree with you about the trouble when removing a DOM tree if we need to remove all storage. And when Updating a DOM tree, the problem is still the same. And if element is removed with javascript (ie non prototype method) ... The first thought when I last answers, what that i

[Proto-Scripty] Re: How can this be done in Drag & Drop?

2009-09-10 Thread Dr. Underhook
several updates for you. - cleaned up cataloging droppables - added dropSrc members to facilitate 'unDrop' - revised the form input members to include an id (helps w/ removal later) - added UndropHandler dragging the dragMember back to it's home div will remove it from the target, re-insert it in

[Proto-Scripty] Strange behaviour with drag and drop

2009-09-10 Thread Erwann
Hi, In the following source code, I might have done something wrong but I can't find where. What is wrong ? try moving boxes from column 1 and 3 in other columns then try to move the same box again. do the same with the column 2 and 4 could you help me to solve that problem please .list

[Proto-Scripty] Re: clonePosition not behaving accurately on spans

2009-09-10 Thread Tiago
Interesting. I tried to add the following CSS rule to my code: * { padding: 0px; margin: 0px; } The position of the inputs changed. However, input #1 is rendered a little bit below input #2 (even before I call clonePosition). Inspecting span #1 with Firebug, I can see 1px of "off

[Proto-Scripty] Private methods for prototype class

2009-09-10 Thread Ngan
Hi, I apologize if this question has been asked before. I've tried googling for this, but did find a good answer. What's the best way to have private methods using prototype's Class.create? I've tried... var Worker = Class.create((function() { function initialize() { this.someVar = "var";

[Proto-Scripty] Re: Ajax.Updater hitting wrong server?

2009-09-10 Thread Chris Snyder
That does help, thanks. I'm new to client side programming. Normally I do everything server side. I've got a census data zipcode database sitting on server, and on that server some javascript that when a zip code is filled in checks back with the server for the city / state. I also have used th

[Proto-Scripty] Re: Private methods for prototype class

2009-09-10 Thread Allen
Hi Ngan, This should do what you want. var Worker = Class.create((function() { var someVar; function initialize() { someVar = "var"; privateMethod(); } function publicMethod() { privateMethod(); } function privateMethod() { console.info(someVar); console.info(this) } retur

[Proto-Scripty] Re: Private methods for prototype class

2009-09-10 Thread Ngan
Hi Allen, thank you so much for the reply. If I do it that way, someVar will now be a private variable. What if I wanted someVar to be an instance variable. so that it may be accessed externally: aWorker.someVar hence why I did: this.someVar = 'var'; Is this something that you have to give

[Proto-Scripty] Re: Private methods for prototype class

2009-09-10 Thread waldron.r...@gmail.com
additionally i would NOT call your function "Worker" in the global space. google "javascript web workers" and you'll see why... -Original Message- Date: Thursday, September 10, 2009 2:46:16 pm To: "Prototype & script.aculo.us" From: "Ngan" Subject: [Proto-Scripty] Re: Private meth

[Proto-Scripty] Re: Private methods for prototype class

2009-09-10 Thread Ngan
Ah ic. I was just using Worker as an example. But good to know. On Sep 10, 2:00 pm, "waldron.r...@gmail.com" wrote: > additionally i would NOT call your function "Worker" in the global space. > google "javascript web workers" and you'll see why... > > > > -Original Message- > Date:

[Proto-Scripty] Re: Ajax.updater - after text has been inserted into element

2009-09-10 Thread Miguel Beltran R.
#Alex +1 2009/9/10 Alex McAuley > > i will say it again for the benefit of people that missed it... > > Why not execute the JS in "ajaxScript.php" ? and add the option > evalScripts: true to your ajax updater ... > > Alex Mcauley > http://www.thevacancymarket.com > - Original Message -

[Proto-Scripty] Sortable.create & reverteffect

2009-09-10 Thread Jon B.
I'm trying to use the reverteffect option on a sortable and it's not doing what I would expect. My expectation is that the reverteffect would only be triggered if the object I'm dragging is dropped back where it started. What I'm seeing is that the reverteffect is triggered regardless of where I d

[Proto-Scripty] Re: How can this be done in Drag & Drop?

2009-09-10 Thread Script-N00b
This is AWESOME! Thanks Underhook!! On Sep 10, 10:21 am, "Dr. Underhook" wrote: > several updates for you. > - cleaned up cataloging droppables > - added dropSrc members to facilitate 'unDrop' > - revised the form input members to include an id (helps w/ removal > later) > - added UndropHan