[Proto-Scripty] Re: Sortable onUpdate firing at the wrong time

2009-08-16 Thread JoJo
I think I figured it out. The callback must not have parentheses. FAIL:onUpdate: someFunction(); GOOD: onUpdate: someFunction; I have no idea why. I am a beginner to JS. On Aug 15, 11:17 pm, Mojito tokyot...@gmail.com wrote: Why is the onUpdate callback fired right when the Sortable is

[Proto-Scripty] Re: Delete page on Scriptaculous Wiki

2009-08-22 Thread JoJo
And how would I contact this Thomas god? On Aug 22, 11:07 am, Walter Lee Davis wa...@wdstudio.com wrote: Where by Sam I meant Thomas, obviously... On Aug 22, 2009, at 2:04 PM, Walter Lee Davis wrote: I asked on the Github list, and only the repo owner can delete pages entirely. We are

[Proto-Scripty] Re: to NEW or not to NEW, that is the question

2009-08-22 Thread JoJo
If I want to quickly develop without looking up whether I need NEW or don't need NEW, can I just put NEW in front of everything? Would this lead to a memory leak or does Prototype have some sort of garbage collection? On Aug 20, 2:04 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, In

[Proto-Scripty] Re: scope of this in anonymous functions

2009-08-22 Thread JoJo
How do I use bind? Doesn't the bind function take an object as an argument? I'm doing this stuff inside a class, not an object. On Aug 22, 6:15 pm, Gareth Evans agr...@gmail.com wrote: Use bind (method on the function object) see the typewriter example i wrote for syntax On Sun, Aug 23, 2009

[Proto-Scripty] Re: scope of this in anonymous functions

2009-08-22 Thread JoJo
in js is an object. Even function literals. On 8/22/09, JoJo tokyot...@gmail.com wrote: How do I use bind? Doesn't the bind function take an object as an argument? I'm doing this stuff inside a class, not an object. On Aug 22, 6:15 pm, Gareth Evans agr...@gmail.com wrote: Use bind

[Proto-Scripty] Re: does prototype have a plain timer?

2009-08-24 Thread JoJo
Nevermind. I found it though Google search: http://www.prototypejs.org/api/periodicalExecuter Boy, was it hard to find. On Aug 24, 4:24 pm, Paul Kim kimba...@gmail.com wrote: I don't think Prototype has a plain timer, but couldn't you just use setTimeOut? setTimeout(javascript statement,

[Proto-Scripty] Re: array.indexOf fails sometimes in IE8

2009-09-02 Thread JoJo
I (Mojito) [don't know why my first post name differs from reply name] have solved by issue. I was passing in strings with '\0' on their ends. So 'mpg\0' does not equal 'mpg'. It was a nightmare to debug because '\0' is invisible. On Sep 2, 10:29 am, enigment enigm...@gmail.com wrote: Ah,

[Proto-Scripty] execution order in IE

2009-09-02 Thread JoJo
In my head, I'm loading several JS files. I'm expecting this to occur: 1) script1.js is loaded 2) script1.js runs - it creates an object 3) script2.js is loaded 4) script2.js runs - it creates a different object that depends on script1's object. 5) and so on This works perfectly in Firefox

[Proto-Scripty] Re: execution order in IE

2009-09-03 Thread JoJo
= new MYAPP.Class2(); }); On Sep 3, 10:40 am, DJ Mangus d.man...@gmail.com wrote: See this article:http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami... On Thu, Sep 3, 2009 at 9:25 AM, JoJo tokyot...@gmail.com wrote: Instead of loading JS in the head, how do I do

[Proto-Scripty] Re: execution order in IE

2009-09-03 Thread JoJo
to fix similar errors on my web desktop Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: JoJo tokyot...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 7:40 PM Subject: [Proto-Scripty] Re

[Proto-Scripty] Re: Appear + IE 7

2009-09-04 Thread JoJo
I never knew about the shortcut. Could you point me to the page that talks about this? Thanks! On Sep 4, 6:30 am, mau mauro.torr...@gmail.com wrote: JoJo, thanks for your response, There’s also a shortcut method offered which you can call on the element itself. Note, that this will only

[Proto-Scripty] Re: execution order in IE

2009-09-04 Thread JoJo
(); }); //]] /script /head body button onclick=MYAPP.class1.speak() /make class1 speak/ button /body /html + On Sep 4, 12:51 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi JoJo, I suspect there's some small (but important

[Proto-Scripty] Re: execution order in IE

2009-09-04 Thread JoJo
, JoJo tokyot...@gmail.com wrote: Hi TJ, This is the simple script which will say MYAPP.class1 is null or not an object - Line 33 about 25% of the time on IE8 in IE7-compatability- mode.  You must hit refresh a few times and then click the button to see the error.  Maybe we need to find out

[Proto-Scripty] Re: execution order in IE

2009-09-05 Thread JoJo
: Hi JoJo, Excellent example of a pared-down test case, thanks for that. I don't have time right now to try this, but just quickly:  You say that the code in the load event never runs, are you sure you haven't interrupted it by clicking the button really early and causing the error

[Proto-Scripty] Highlighting text box makes it look like Windows 95

2009-09-11 Thread JoJo
I'm highlighting an input textbox if the user forgot to fill out the form. After the box get highlighted, it looks like retro Windows 95 with thick borders and boxy edges. So I attempt to remove the styling with an afterFinish callback, but for some reason, that is never called. Why? if

[Proto-Scripty] Range utility increment

2009-09-24 Thread JoJo
http://www.prototypejs.org/api/utility/dollar-r From the documentation of the Range utility, it seems like it can only increment by 1's. For example, $A($R(1,10,true)) gives you: [1,2,3,4,5,6,7,8,9,10]. I'm looking for a way to specify that I want to increment by any value. Let's say count up

[Proto-Scripty] inPlaceEditor changes from single line to multiline

2009-10-01 Thread JoJo
Upon entering the page and clicking on an inPlaceEditor, I get the expected result: single line editing of a text field. I then click ok without even touching the text. My PHP script trims it and spits back the value. I then click to edit again, but now the box has become a 3 multi-line box. It

[Proto-Scripty] element.down() invalid string

2009-10-12 Thread JoJo
Why is it that the following gives the error: [Exception... An invalid or illegal string was specified code: 12] var title = $(channelId).down('strong').down('a').innerHTML; While this one, which looks identical to me work just fine? var title = $$('#' + channelId + ' strong

[Proto-Scripty] Re: element.down() invalid string

2009-10-13 Thread JoJo
/ comwww.crowdersoftware.com On Oct 12, 11:52 pm, JoJo tokyot...@gmail.com wrote: Why is it that the following gives the error: [Exception... An invalid or illegal string was specified code: 12]    var title = $(channelId).down('strong').down('a').innerHTML; While this one, which looks identical

[Proto-Scripty] Ajax callbacks execute in unpredictable order

2009-10-19 Thread JoJo
* onUninitialized, * onLoading, * onLoaded, * onInteractive, * onComplete and * onException. I'm trying to display a swirly animated GIF while my AJAX request is being processed. I am currently using the onLoading callback to display the GIF. In some rare cases, the

[Proto-Scripty] Re: Ajax callbacks execute in unpredictable order

2009-10-20 Thread JoJo
to prototypejs, so for some of those processes, it doesn't work for us, but this does the trick ;) ) Cheers, David. On Oct 20, 1:52 am, JoJo tokyot...@gmail.com wrote:     * onUninitialized,     * onLoading,     * onLoaded,     * onInteractive,     * onComplete and     * onException

[Proto-Scripty] Disable double click in IE6 and 7

2009-10-27 Thread JoJo
I wanted to prevent rapid double clicking of an AJAXed tab. My code works well in IE8, FF, and S. In IE7 and 6, the tab gets disabled permanently even though I see both window.status calls printing out the expected stuff. What's going on? ++ var tabOnclick =

[Proto-Scripty] $$ is a violation of Model-View-Controller

2009-10-29 Thread JoJo
Is it poor practice to use $$? $$('#grandparent #parent tag.class'); I've been using $$ quite a lot because it has sped up DEVELOPMENT, but now I have realized that it will slow down MAINTENANCE. Recently, my boss asked me to move a whole div to another part of the page. Since I was

[Proto-Scripty] Hourglass cursor appear on whole page

2009-11-17 Thread JoJo
When the user clicks a button, I want to show an hourglass cursor while its onclick handler is being run. I tried this: $$('body').first().setStyle({cursor: 'progress'}); The hourglass only appears when I hover over the body background. When hovering over the button itself (which is an a), the

[Proto-Scripty] Re: Hourglass cursor appear on whole page

2009-11-18 Thread JoJo
I am making a website with an embedded app, so it is very much like a desktop application. There are blocking events. On Nov 18, 12:12 am, Peter De Berdt peter.de.be...@pandora.be wrote: On 18 Nov 2009, at 01:30, JoJo wrote: When the user clicks a button, I want to show an hourglass cursor

[Proto-Scripty] get body height, not viewable height

2009-11-29 Thread JoJo
How do you get the true height of the body element? I have a very long page and calling getDimensions() only returns the viewable area's height. Thanks. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send

[Proto-Scripty] Remove element after fading it

2009-11-29 Thread JoJo
I want to remove an element from the DOM after fading it. new Effect.Fade( 'lightbox', { duration: this.animationTime, afterFinish: $('lightbox').remove() } ); The above code works but gives me an error. Why is it still trying to calculate opacity after it's finished?

[Proto-Scripty] Re: get body height, not viewable height

2009-11-29 Thread JoJo
{width: w, height: h}; On Nov 29, 8:44 pm, JoJo tokyot...@gmail.com wrote: How do you get the true height of the body element? I have a very long page and calling getDimensions() only returns the viewable area's height. Thanks. -- You received this message because you are subscribed

[Proto-Scripty] Element.update() without evaluating the script.

2009-12-07 Thread JoJo
I have a textarea id=foo which contains JS code that people can copy and paste. It's dynamically generated, so I do something like this: $('foo').update('script . ' + this.someVariable + '/); The documentation on Element.update states that the script will be evaluated rather than inserted

[Proto-Scripty] Re: Element.update() without evaluating the script.

2009-12-07 Thread JoJo
All conditions. On Dec 7, 4:27 pm, Rick Waldron waldron.r...@gmail.com wrote: What condition should exist to stop the evaluation? -- Sent from my Palm Prē JoJo wrote: I have a lt;textarea id=foo which contains JS code that people can copy and paste. It's dynamically generated, so I do

[Proto-Scripty] Firefox's inline JS execution order

2009-12-15 Thread JoJo
I'm creating a widget where I tell people to copy and paste this code onto their site: script type=text/javscript src=http://www.site.com/script.js;/ script div class=widget/div Script.js looks for all the widget divs on the page by using $$ and dynamically fills them up. Now, I'm not

[Proto-Scripty] Re: Firefox's inline JS execution order

2009-12-17 Thread JoJo
How does dom:ready prevent multiple executions of the same script? On Dec 16, 6:16 am, Alex McAuley webmas...@thecarmarketplace.com wrote: Why not attach the widget code to dom:ready Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: JoJo tokyot...@gmail.com

[Proto-Scripty] Re: Firefox's inline JS execution order

2009-12-18 Thread JoJo
/ comwww.crowdersoftware.com On Dec 15, 8:57 pm, JoJo tokyot...@gmail.com wrote: I'm creating a widget where I tell people to copy and paste this code onto their site:    script type=text/javscript src=http://www.site.com/script.js;/ script    div class=widget/div Script.js looks for all the widget

[Proto-Scripty] Update title tag

2010-02-12 Thread JoJo
I want to update the title tag. This works in Firefox: $$('title').first().update('dynamic string'); Do you know why there is a runtime error in Internet Explorer 8? -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this

[Proto-Scripty] getStyle('padding-top') returns different values in different browsers

2010-02-14 Thread JoJo
$('div').getStyle('padding-top') returns 1em in Internet Explorer and 12px in Firefox. It appears that Firefox has recursively multiplied all its ancestor's font-sizes to get the absolute value of 12px. This is actually better for the particular GUI I'm making. Is there anyway for Internet

[Proto-Scripty] Ajax onFailure never gets called

2010-03-10 Thread JoJo
I noticed that the onFailure callback never fires when there's actually an error in Ajax.Request. Commonly, I just alert('server busy') in the callback. I never see this alert when my web host is overloaded and just doesn't respond at all. How do I alert an error message when the server is too

[Proto-Scripty] Re: IE6 cannot run dynamicly inserted script tag

2010-03-16 Thread JoJo
( 'Cache-Control: max-age=0, must-revalidate, post-check=0, pre- check=0', false ); On Mar 16, 2:17 am, Daan Mortier daanmort...@gmail.com wrote: JoJo: I'm doing some cross-site AJAX hack by dynamically inserting a script tag. This script tag loads a PHP script that prints out javascript: Me

[Proto-Scripty] Re: getStyle('zIndex') returns exponentiated number in Safari

2010-04-01 Thread JoJo
(20,001) of vertical planes to stack... FWIW, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Apr 1, 1:13 am, JoJo tokyot...@gmail.com wrote: On all browsers but Safari, getStyle('zIndex') returns a string representation of the max

[Proto-Scripty] anchor button causes IE8 to fire onbeforeunload

2010-04-24 Thread JoJo
I'm using an anchor tag to run some JS when clicked. This works perfectly in Firefox, but Internet Explorer 8 wrongfully fires the onbeforeunload callback. I know this can be solved by changing HREF=javascript:void(0) to HREF=#, but it won't work in my situation because my anchor is very low in

[Proto-Scripty] Re: anchor button causes IE8 to fire onbeforeunload

2010-04-24 Thread JoJo
- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of JoJo Sent: Saturday, April 24, 2010 4:46 PM To: Prototype script.aculo.us Subject: [Proto-Scripty] anchor button causes IE8 to fire onbeforeunload I'm using an anchor tag to run

[Proto-Scripty] Hash cannot resolve variable as keys

2010-06-14 Thread JoJo
Why can't I create hashes where the keys are variables? var klass = Class.create( initialize: function() { this.field = new Hash({klass.staticVar: 999}); } ); klass.staticVar = 888; SyntaxError: missing : after property id { message=missing : after property id, more...} I

[Proto-Scripty] detect if window is already loaded

2010-06-16 Thread JoJo
Is it possible to test whether the window has been loaded or not? I have a script.js that anyone can use. Some people will put it in the head tag, so this script will be run before Window has been loaded. Other people might do something crazier like only load script.js when someone clicks a

[Proto-Scripty] Conflict when Prototype is included twice

2010-07-08 Thread JoJo
PROBLEM In IE7, many of Prototype's functions stop working when Prototype.js is included twice. What is the best practice for shielding against multiple loads of Prototype? BACKGROUND I'm creating a widget script people can embed on their websites. My script uses Prototype. There's a

[Proto-Scripty] Re: Conflict when Prototype is included twice

2010-07-08 Thread JoJo
for the existence of Prototype.Version (look in   scriptaculous.js for the exact syntax) and then error out or skip   loading? Walter On Jul 8, 2010, at 5:02 PM, JoJo wrote: PROBLEM In IE7, many of Prototype's functions stop working when Prototype.js is included twice. What is the best

[Proto-Scripty] Re: Conflict when Prototype is included twice

2010-07-08 Thread JoJo
my code. Anyway, this is not a bulletproof solution because if the site owner's Prototype loads after mine, it will still be included twice and crash IE7. On Jul 8, 2:39 pm, JoJo tokyot...@gmail.com wrote: I can do a lot of things like: if (typeof(Prototype) === 'undefined') {    // put all my

[Proto-Scripty] Ajax request on anchor onclick is buggy in Safari

2010-08-10 Thread JoJo
I'm collecting stats on user clicking behavior. In this example, I write an entry into the database whenever someone clicks a link that starts a download: a href=program.exe onclick=logClick()download program/a function logClick() { new Ajax.Request( '/logger.php?action=1' ); } This

[Proto-Scripty] AJAX callbacks are not executed atomically?

2010-09-24 Thread JoJo
I have several lines of code that I want to run atomically (no context switches to other code). Please look at the following barebones example that illustrates the issue: //= function doAjax() { console.info('making request'); new Ajax.Request( url, { onSuccess:

[Proto-Scripty] Re: AJAX callbacks are not executed atomically?

2010-09-24 Thread JoJo
24, 2010 at 3:21 PM, JoJo tokyot...@gmail.com wrote: I have several lines of code that I want to run atomically (no context switches to other code). Please look at the following barebones example that illustrates the issue: //= function doAjax() {  console.info

[Proto-Scripty] Re: AJAX callbacks are not executed atomically?

2010-09-24 Thread JoJo
I believe I solved the problem. I had a queue of work orders. One of these work orders queued up another work order, so it was a nested AJAX request - BAD IDEA! On Sep 24, 12:56 pm, JoJo tokyot...@gmail.com wrote: I don't need A to finish before B. I need A's callbacks to not be cut off by B's

[Proto-Scripty] Safari can't pre-select a dropdown menu

2010-09-29 Thread JoJo
I am trying to pre-select an option in a standard HTML select dropdown using option.writeAttribute('selected', 'selected'). It worked in IE and FF, but not in Safari. I had to change the code to option.selected=true for all 3 browsers to work. I'd prefer to use the writeAttribute wrapper instead

[Proto-Scripty] Get scroll offsets of a DIV with overflow:auto

2010-10-04 Thread JoJo
Is there a version of document.viewport.getScrollOffsets for DIVs with CSS style of overflow:auto? I have a DIV with scroll bars and it contains 150 images. I wish to only load the images as the user scrolls to them, so I don't burden the server. To do this, I would need to detect the scroll

[Proto-Scripty] delayed show/hide does not work in IE7

2010-10-14 Thread JoJo
$('someElement').hide.delay(2); $('someElement').show.delay(3); These functions trigger this error: 'style' is null or not an object in IE7. The only way to solve it is to write long ugly code: var f = function() { $('someElement').hide(); }; f.delay(2) -- You received this message because

[Proto-Scripty] Cursor blinker disappears from textarea after a clear()

2010-10-19 Thread JoJo
I'm creating a standard chat system. When the user hits the Enter key in the textarea, I send her comment to the server. Then I clear her message so she can begin typing a new one. The cursor blinker disappears when I do this clear. It's better for usability if the blinking remains. How do I put

[Proto-Scripty] Re: Cursor blinker disappears from textarea after a clear()

2010-10-20 Thread JoJo
activate() did not fix it. On Oct 19, 11:08 pm, Walter Lee Davis wa...@wdstudio.com wrote: Try activate in place of focus, and see if that works for you. Just   checking -- you do have Prototype in your page, right? Walter On Oct 19, 2010, at 9:59 PM, JoJo wrote: I'm creating a standard

[Proto-Scripty] Re: Cursor blinker disappears from textarea after a clear()

2010-10-20 Thread JoJo
is processing... On Oct 20, 1:36 pm, JoJo tokyot...@gmail.com wrote: activate() did not fix it. On Oct 19, 11:08 pm, Walter Lee Davis wa...@wdstudio.com wrote: Try activate in place of focus, and see if that works for you. Just   checking -- you do have Prototype in your page, right? Walter

[Proto-Scripty] Anchor button triggers window.onbeforeunload in IE

2010-10-21 Thread JoJo
I use anchors to call javascript functions. Usually, I do this: a href=javascript:void(0) onclick=someFunc(); return false; call the function /a This works fine in all browsers. Window.onbeforeunload is never triggered because the ONCLICK returns false, and thus the HREF if not executed. When

[Proto-Scripty] Re: Anchor button triggers window.onbeforeunload in IE

2010-10-22 Thread JoJo
software / com www / crowder software / com On Oct 22, 2:41 am, JoJo tokyot...@gmail.com wrote: I use anchors to call javascript functions. Usually, I do this: a href=javascript:void(0) onclick=someFunc(); return false;    call the function /a This works fine in all browsers

[Proto-Scripty] Re: Extending a DOM-Object

2010-11-22 Thread JoJo
Why is the Element::store() not listed in the documentation??? http://www.prototypejs.org/api/element . Thanks for pointing out this feature. I've been stupidly creating my own data structures to further describe DOM elements. Now I don't have to do that. On Nov 22, 12:31 pm, Luke