[Proto-Scripty] Re: Submit a form using enter

2008-12-11 Thread Rick Waldron
I whipped this together, tested and confirmed: document.observe(dom:loaded, function () { $('login_form').observe('keydown', function (e) { if ( e.keyCode == 13 ) { //event.findElement('form').submit();

[Proto-Scripty] Re: .each not working in IE?

2009-04-06 Thread Rick Waldron
$R(1,31).each(function(i){ console.log(i); // if you have firebug. }); On Mon, Apr 6, 2009 at 3:51 AM, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Why are you calling $?  $[1] is for extending elements or looking elements up by ID, it has nothing to do with ObjectRanges.  The

[Proto-Scripty] Re: $(dialog_1) is null by firebug

2009-04-15 Thread Rick Waldron
You can trim that down even more... document.observe('dom:loaded', function () { $('dialog_1').observe('click',function(){ modal.open(); }); }); Event.observe(document, 'dom:loaded', //the prototype.js magic event function () {

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-30 Thread Rick Waldron
. Thanks a lot. On Apr 29, 3:16 pm, Rick Waldron waldron.r...@gmail.com wrote: Just sort of curious ... of all the convenience that prototype offers, why is the only method you need is Element.update()? Anyway, try this... (function() {   function _$(args) {     this.elements

[Proto-Scripty] Re: Problem with Ajax.Updater...

2009-06-02 Thread Rick Waldron
I noticed you're missing a comma... var myAjax = new Ajax.Updater(target, url, {method: 'post', parameters: { params: pars } onComplete:function(){ Between { params: pars } onComplete (should be right before onComplete) That may be unrelated, but an observation worth noting. On Tue, Jun

[Proto-Scripty] Re: Working outside loop, but not inside

2009-06-03 Thread Rick Waldron
There is a much cleaner way to do this... check it out (tested and passed) This goes in script tags, or in your external js file: document.observe('dom:loaded', function () { $$('.blinders').each(function (b) { b.observe('click', function () { this.next().toggle('blinddown',

[Proto-Scripty] Re: Working outside loop, but not inside

2009-06-03 Thread Rick Waldron
Oh yeah... and this was your problem; onclick='Effect.toggle('blinddown1', 'slide'); return false;' would've worked as: onclick=Effect.toggle('blinddown1', 'slide'); return false; You cant use single quotes inside of single quotes. On Thu, Jun 4, 2009 at 12:37 AM, Rick Waldron

[Proto-Scripty] Re: Working outside loop, but not inside

2009-06-04 Thread Rick Waldron
A quick google for php single quotes vs double quotes will help you understand the difference and what it means to the overhead and scalability of your code. I picked this article from said google results: http://andrewgatenby.com/single-quotes-and-double-quotes-in-php @Alex, I honestly can't

[Proto-Scripty] Re: Working outside loop, but not inside

2009-06-04 Thread Rick Waldron
:* Rick Waldron waldron.r...@gmail.com *To:* prototype-scriptaculous@googlegroups.com *Sent:* Thursday, June 04, 2009 4:06 PM *Subject:* [Proto-Scripty] Re: Working outside loop, but not inside A quick google for php single quotes vs double quotes will help you understand the difference and what

[Proto-Scripty] Re: Working outside loop, but not inside

2009-06-04 Thread Rick Waldron
files. Which file should I be putting it in? I examined the scriptaculous and prototype files for similar looking code, but being a supernoob I'm reluctant to just throw it in there. On Jun 4, 2:29 pm, Rick Waldron waldron.r...@gmail.com wrote: @Alex, I think i met all of your criteria

[Proto-Scripty] Re: Working outside loop, but not inside

2009-06-04 Thread Rick Waldron
on the href's valid xhtml ? because i cant see it on the list of valid nodes!... And i would rather use inline callees than use invalid xhtml! Regards Alex - Original Message - *From:* Rick Waldron waldron.r...@gmail.com *To:* prototype-scriptaculous@googlegroups.com *Sent:* Thursday

[Proto-Scripty] Re: $$ behavior in IE ?

2009-06-04 Thread Rick Waldron
That still wont work... console.log( $$('#gridRow').last().down().innerHTML ); # --- is for IDs you need: console.log( $$('.gridRow').last().down().innerHTML ); And i PROMISE that wont work either, you need to iterate through $$('.gridRow') if you want to output both rows. Like so:

[Proto-Scripty] Re: Possible Bug: Youtube in a Draggable DIV

2009-06-04 Thread Rick Waldron
1.Your link is 404, I guessed and added an L to htm (.html) 2. Use the option 'handle'... take a look: http://www.genevajs.com/misc/drag-handle.php dig it. On Thu, Jun 4, 2009 at 10:47 AM, jevchance john.va...@gmail.com wrote: Hi everyone. I'm experiencing some possible bugs with a

[Proto-Scripty] Re: Working outside loop, but not inside

2009-06-04 Thread Rick Waldron
but not really explained the real reasons why or why not to!! - same with php and ' vs !! Long day for me time to hit the hay ! Regards Alex - Original Message - *From:* Rick Waldron waldron.r...@gmail.com *To:* prototype-scriptaculous@googlegroups.com *Sent:* Thursday, June 04

[Proto-Scripty] Re: Event.toggle

2009-06-05 Thread Rick Waldron
Alex is right ... I would even suggest not using Event.observe(window, 'load', function() {}); for this application at all... you can wrap all those other event handlers in one big document.observe('dom:loaded', function () { all your stuff goes here. }); On Fri, Jun 5, 2009 at 6:18

[Proto-Scripty] Re: Event.toggle

2009-06-05 Thread Rick Waldron
Simple fix, you need to put those observers inside the proper document.observe('dom:loaded') block for them to actually know when and what to start observing. i posted your demo - fixed: http://www.genevajs.com/misc/demo-ps-list-0013.php cope/paste as needed. be sure to update the script

[Proto-Scripty] Re: Event.toggle

2009-06-05 Thread Rick Waldron
that arent there, IE basically says: 'tough shit' Good luck! On Fri, Jun 5, 2009 at 9:24 PM, Rick Waldron waldron.r...@gmail.com wrote: Simple fix, you need to put those observers inside the proper document.observe('dom:loaded') block for them to actually know when and what to start observing

[Proto-Scripty] Re: Event.toggle

2009-06-05 Thread Rick Waldron
Whoops! Also... IE collapsed your wrapper div. i put 75% on that and then 100% on the inner div - worked like a charm. On Fri, Jun 5, 2009 at 9:27 PM, Rick Waldron waldron.r...@gmail.com wrote: Sorry, should've explained why IE is so dumb... Firefox knows to wait to execute, but it doesnt know

[Proto-Scripty] Re: Effect.toggle('BLIND'); select by class not id

2009-06-12 Thread Rick Waldron
Try this: a href=javascript:; id=toggleswitchToggle Blind/a Below goes in a script tag in the head document.observe('dom:loaded', function (){ $('toggleswitch').observe('click', function () { $$('.class2').each(function (d) { Effect.toggle(d, 'blind'); }); }); }); On

[Proto-Scripty] Re: setOpacity issue

2009-06-12 Thread Rick Waldron
I'm developing a library that will allow this sort of syntax. Actually, it allows you write jQuery syntax in Prototype, giving $() that power of $$() I've created a use case of your question. http://genevajs.com/demos/demo-set-opacity.php If you view source on the page, you'll see i'm calling

[Proto-Scripty] Re: setOpacity issue

2009-06-12 Thread Rick Waldron
purposes! -- T.J. :-) On Jun 12, 3:33 pm, Rick Waldron waldron.r...@gmail.com wrote: I'm developing a library that will allow this sort of syntax. Actually, it allows you write jQuery syntax in Prototype, giving $() that power of $$() I've created a use case of your question. http

[Proto-Scripty] Re: setOpacity issue

2009-06-12 Thread Rick Waldron
On Jun 12, 7:45 pm, Rick Waldron waldron.r...@gmail.com wrote: TJ, Al MacDonald of Processing.js used GenevaJS in a presentation last night... he wanted to use Box2D.js (a prototype extension) but he's not familiar with Prototype syntax... anyway its now posted on our site, with links

[Proto-Scripty] Re: Effect.toggle('BLIND'); select by class not id

2009-06-12 Thread Rick Waldron
The way i shared with you allows you to do this task without repeating without repeating the code. Yes... i did that on purpose. On Fri, Jun 12, 2009 at 10:49 AM, Gatsman jgats...@gmail.com wrote: Thanks Rick but I found an other way 2 minutes ago I added this under the head script

[Proto-Scripty] Re: Prototype and forms

2009-06-16 Thread Rick Waldron
A few things... var params = Form.serialize($('createAdjForm')); You can clean this up as: var params = $('createAdjForm').serialize(); There are other points that you could optimize, but thats not your question... And at whatever point you want adjForm to appear, you need to add:

[Proto-Scripty] Re: element is null error on Draggable - element exists!

2009-06-16 Thread Rick Waldron
Could you set this up on http://jsbin.com/? On Tue, Jun 16, 2009 at 2:06 PM, adamski adam.elemen...@gmail.com wrote: I'm having some trouble getting a Draggable to dorp onto a Droppable. I get the old element is null error from prototype (its trying to show an non-existent element).

[Proto-Scripty] Re: Curvy Corners + draggables (script.aculo.us)

2009-06-17 Thread Rick Waldron
Before I take a look at your issue... I have a rewrite of CurvyCorners that i did that makes it run way faster. I was using it in a project and was annoyed by how long it took to render the corners. I can't say its any cleaner, but I corrected an unecessary loop. I've attched the rewrite to this

[Proto-Scripty] Re: Need help resolving conflict between Proto and Uize frameworks

2009-06-17 Thread Rick Waldron
Maybe I'm nuts but you're calling setMovie() in the body tag meanwhile... you have an Ajax.Request getting some data that will call... setMovie() when successful So... i suspect, that onload starts playing, then the ajax request finishes and resets your player. I dont recommend onload=''

[Proto-Scripty] Re: Prototype and forms

2009-06-17 Thread Rick Waldron
javascript function getAdjForm(). getAdjForm() looks to see if the form element territory exists. That's the problem, for some reason, it cannot see it. What can I do to make it where it does not fail the if statement in that function? On Jun 16, 11:33 am, Rick Waldron waldron.r

[Proto-Scripty] Re: Problem using prototype.js

2009-06-19 Thread Rick Waldron
Could you post an example page? Upon initial inspection... without delving too deep, I notice this: Your references to the form elements are just that - not form element values. $('StateProvince') should be $('StateProvince').value or $F('StateProvince') $('City') should be $('City').value or

[Proto-Scripty] Re: sessvars

2009-06-19 Thread Rick Waldron
Since no one else has replied, justly so as this is not a Prototype related question... I'm vaguely familiar with sessvars.js - what did you need help with? Rick On Fri, Jun 19, 2009 at 10:47 AM, cob brenda...@gmail.com wrote: Has anyone here used the sessvars lib, would like to ask a

[Proto-Scripty] Re: sessvars

2009-06-22 Thread Rick Waldron
variables to this object at a later stage or do you have to declare all you varaibles at this stage. 2009/6/19 Rick Waldron waldron.r...@gmail.com Since no one else has replied, justly so as this is not a Prototype related question... I'm vaguely familiar with sessvars.js - what did

[Proto-Scripty] Re: Can options in a selection box be made draggable...

2009-06-23 Thread Rick Waldron
I was nearly tempted to post a link to a w3c spec page but then Alex was kind enough to explain. If you need an example of what Alex is talking about: http://weblog.morosystems.cz/ostatni/dropdown-xhtml-css-javascript-replacement-of-classic-selectbox On Tue, Jun 23, 2009 at 9:56 AM, Alex

[Proto-Scripty] Re: drag and drop tr from one table to another table.

2009-06-24 Thread Rick Waldron
Can you post a link to an example? Rick On Wed, Jun 24, 2009 at 3:29 AM, Nivash Ramachandran rniv...@gmail.comwrote: Hi all, I am using scriptaculous drag functionality in table tr element. Now I am facing the following issues. I can drag a row from one table to another table but 1.

[Proto-Scripty] Re: drag and drop tr from one table to another table.

2009-06-24 Thread Rick Waldron
Whoops - i replied to your first message before updating the thread. Sorry about that. Rick On Wed, Jun 24, 2009 at 12:57 PM, Rick Waldron waldron.r...@gmail.comwrote: Can you post a link to an example? Rick On Wed, Jun 24, 2009 at 3:29 AM, Nivash Ramachandran rniv...@gmail.comwrote

[Proto-Scripty] Re: [ANN] Alpha version of scripty2 (script.aculo.us' next major version!) out now

2009-06-26 Thread Rick Waldron
Thomas, Is there any specifics we should know about (things no longer available)? I just plugged in s2.js to a page that has one element that will *shake()* Firebug says: $(element).shake() is not a function :\ I chose that one arbitrarily... Rick On Fri, Jun 26, 2009 at 9:26 AM,

[Proto-Scripty] Re: [ANN] Alpha version of scripty2 (script.aculo.us' next major version!) out now

2009-06-27 Thread Rick Waldron
Right... I've come to this conclusion. Anyway, one the examples here: http://scripty2.com/doc/scripty2%20fx/element.html#morph-class_method $('element_id').morph('width:500px;height:500px', { duration: 4, transition: '', delay: .5, propertyTransitions: { width: 'mirror', height:

[Proto-Scripty] Re: Prototype in salesforce development

2009-06-27 Thread Rick Waldron
This is sort of redundant to TJ, but I'm going to throw it out there... I'm not familiar with salesforce development, but firebug has a number of add-ons that make life so much easier allowing you to debug your server side code right in firebug: http://getfirebug.com/extensions/index.html I use

[Proto-Scripty] Re: Prototype in salesforce development

2009-06-28 Thread Rick Waldron
of reources[1] on the unofficial wiki. [1] http://proto-scripty.wikidot.com/resources Thanks Rick! -- T.J. :-) On Jun 27, 4:38 pm, Rick Waldron waldron.r...@gmail.com wrote: This is sort of redundant to TJ, but I'm going to throw it out there... I'm not familiar with salesforce

[Proto-Scripty] Re: determine if dom:onload has happened yet?

2009-06-29 Thread Rick Waldron
In RC 1.6.1 when you use: document.observe('dom:loaded', function () { // do stuff with the DOM }); it is executed as early as it possibly can. Inside of that, you will not need an additional dom:loaded listener, because the dom is loaded - it only happens once per page render. All nodes

[Proto-Scripty] Re: Events in own Class

2009-06-29 Thread Rick Waldron
Dig it: http://jsbin.com/uhogi (view the source) Rick On Mon, Jun 29, 2009 at 12:19 PM, Sven stuebe...@googlemail.com wrote: Hi, is it possible to add Events to own classes? something like this: var myClass = Class.create({ foo : function(){

[Proto-Scripty] Re: Events in own Class

2009-06-29 Thread Rick Waldron
No problem Rick On Mon, Jun 29, 2009 at 12:41 PM, Sven stuebe...@googlemail.com wrote: wow thank you ;) On 29 Jun., 18:38, Rick Waldron waldron.r...@gmail.com wrote: Dig it: http://jsbin.com/uhogi (view the source) Rick On Mon, Jun 29, 2009 at 12:19 PM, Sven stuebe

[Proto-Scripty] Re: Events in own Class

2009-06-29 Thread Rick Waldron
); abc.foo(); // alert(1234); and second $('bla').hide(); rgds sven On 29 Jun., 18:41, Sven stuebe...@googlemail.com wrote: wow thank you ;) On 29 Jun., 18:38, Rick Waldron waldron.r...@gmail.com wrote: Dig it: http://jsbin.com/uhogi (view the source) Rick On Mon, Jun

[Proto-Scripty] Re: question from newbie, how add parameters?

2009-06-29 Thread Rick Waldron
You code was rife with syntax errors... I posted a demo of the corrected switch statement here: http://jsbin.com/ataka there is also some basic event stuff to show it in action Rick On Mon, Jun 29, 2009 at 7:08 PM, Miguel Beltran R. yourpa...@gmail.comwrote: Hi list if have a variable

[Proto-Scripty] Re: question from newbie, how add parameters?

2009-06-29 Thread Rick Waldron
After the switch, add this: vparams['your_additional_property'] = 'additional property's value'; I hope this is what you mean... On Mon, Jun 29, 2009 at 8:16 PM, Miguel Beltran R. yourpa...@gmail.comwrote: 2009/6/29 Rick Waldron waldron.r...@gmail.com You code was rife with syntax

[Proto-Scripty] Re: question from newbie, how add parameters?

2009-06-29 Thread Rick Waldron
a literal string). FWIW, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 30, 1:54 am, Miguel Beltran R. yourpa...@gmail.com wrote: 2009/6/29 Rick Waldron waldron.r...@gmail.com After the switch, add this: vparams

[Proto-Scripty] Re: Drag and Drop problems

2009-06-30 Thread Rick Waldron
Alex, Thats super rad. Rick On Tue, Jun 30, 2009 at 7:16 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: For the second question you have to work out its positioning on the page and relative to its parent... enclosing is not easy but its also not difficult ... Here is some

[Proto-Scripty] Re: resize problem.

2009-07-01 Thread Rick Waldron
As a helpful sidenot, i think you'd benefit from NOT using onload= script document.observe('dom:loaded', function () { var onResize = function(e) { var viewport = document.viewport.getDimensions(); var screen = $('screen'); var s_view = screen.getDimensions();

[Proto-Scripty] Re: iterator.call is not a function

2009-07-01 Thread Rick Waldron
The reason you need to use an index on playlist is because select returns an array, so... instead of using the index[0] the way you've done, you can send it back to the el.select(): $$('div.fp_YouTube').each(function(el) { var player = el.select('.player')[0]; // --- right here!

[Proto-Scripty] Re: differences between mootools 'each' and Prototype 'Enumerable.each'

2009-07-10 Thread Rick Waldron
The result your getting is completely correct, you're just missing one aspect... Take a look: http://jsbin.com/anefa (view source... ) On Fri, Jul 10, 2009 at 4:57 PM, ronman ron.new...@gmail.com wrote: Hi, I've been puzzling over this for a couple of days and finally admit I need help.

[Proto-Scripty] Re: Is Form.Element.EventObserver deprecated ?

2009-07-10 Thread Rick Waldron
$('id-of-form-element').observe('change', function () {// do stuff in here. }); On Fri, Jul 10, 2009 at 3:33 PM, Mathew math...@gmail.com wrote: I don't see Form.Element.EventObserver in the API doc. Is it deprecated ? If not could someone provide an example of using this API. Basically

[Proto-Scripty] Re: differences between mootools 'each' and Prototype 'Enumerable.each'

2009-07-11 Thread Rick Waldron
of attr.edges (if it existed). alert(edge); }, this); On Jul 10, 4:15 pm, Rick Waldron waldron.r...@gmail.com wrote: The result your getting is completely correct, you're just missing one aspect... Take a look: http://jsbin.com/anefa (view source... ) On Fri, Jul 10, 2009

[Proto-Scripty] Re: Observing elements not working...

2009-07-16 Thread Rick Waldron
are you adding the observer after the dom is loaded? document.observe('dom:loaded', function () [ $('btn-link-cancel').observe('click',function(){ RedBox.close(); }); }); On Thu, Jul 16, 2009 at 7:30 AM, david david.brill...@gmail.com wrote: Hi lun.ashis, One thing, because code seems

[Proto-Scripty] Re: selectors failing in IE8FF3

2009-07-20 Thread Rick Waldron
Instead of changing the way the core works... and potentially causing breakage to existing code - perhaps you might try rewriting your selector statement with escaped periods. This question caused me to read a bunch regarding valid id's from one html spec to another, and then double back to css

[Proto-Scripty] Re: selectors failing in IE8FF3

2009-07-20 Thread Rick Waldron
. and : altogether. On Mon, Jul 20, 2009 at 10:10 PM, Rick Waldron waldron.r...@gmail.comwrote: Instead of changing the way the core works... and potentially causing breakage to existing code - perhaps you might try rewriting your selector statement with escaped periods. This question caused me

[Proto-Scripty] Re: selectors failing in IE8FF3

2009-07-21 Thread Rick Waldron
This is a really interesting thread... I don't want to retract my statement, but I dont entirely agree with what i wrote previously (it's all part of learning right ?). I've discussed this with a respected colleague, and we both agree that just because a spec says so doesn't make it right or

[Proto-Scripty] Re: scriptaculous PHP help

2009-07-24 Thread Rick Waldron
Or output class=some-class in the element tags and observe the whole set with some event delegation... will keep your markup and JS sep. and clean. On Fri, Jul 24, 2009 at 7:59 PM, T.J. Crowder t...@crowdersoftware.comwrote: Hi, echo h2a href=\#\ onclick=\Effect.toggle('d2','BLIND',

[Proto-Scripty] Re: selectors failing in IE8FF3 @ Colin

2009-07-29 Thread Rick Waldron
Colin, I was just thinking about your statement: (OTOH I wish that browsers and libraries would object to a very common instance of invalid HTML: duplicate id's) And how much I agree. This is the result... (function () { var _domIdentities = function () {}; _domIdentities.prototype = {

[Proto-Scripty] Re: ternary operators

2009-07-30 Thread Rick Waldron
Drop the parens around the first argument. function foo(arg) { return $(arg) ? true : alert('Element Does not exist'); // i commented this out: false; } ... On Tue, Jul 28, 2009 at 12:02 PM, Alex McAuley webmas...@thecarmarketplace.com wrote: In my usual Not enough coffee moments i

[Proto-Scripty] Re: ternary operators

2009-07-30 Thread Rick Waldron
'); However it cannot be achieved so it must be done usung if/else.. Regards Alex Mcauley http://www.thevacancymarket.com - Original Message - *From:* Rick Waldron waldron.r...@gmail.com *To:* prototype-scriptaculous@googlegroups.com *Sent:* Thursday, July 30, 2009 1:18 PM

[Proto-Scripty] Re: ternary operators

2009-07-30 Thread Rick Waldron
- Original Message - *From:* Rick Waldron waldron.r...@gmail.com *To:* prototype-scriptaculous@googlegroups.com *Sent:* Thursday, July 30, 2009 1:18 PM *Subject:* [Proto-Scripty] Re: ternary operators Drop the parens around the first argument. function foo(arg) { return $(arg

[Proto-Scripty] Re: Newbee question : Compatibility with javascript 1.5

2009-07-30 Thread Rick Waldron
That sounds like fun... i like device app development. Can you tell us what device you're working with? That will be helpful Rick On Thu, Jul 30, 2009 at 3:55 PM, Christophe christophe.dec...@gmail.comwrote: Hi there, Apologies to everybody if my question is offending in any way, but this

[Proto-Scripty] Re: can I get a list of event listeners on an element?

2009-08-25 Thread Rick Waldron
This question has been asked... but I've never seen a solid answer... maybe I just missed them. But if you're using version 1.6.1_rc3 (or any version with Element#getStorage() ) var _storage= $('element').getStorage(); console.log(

[Proto-Scripty] Re: When to expect code changes to be added to Prototype.

2009-09-05 Thread Rick Waldron
I wasn't previously aware of this enhancement (which is most def. is)... however re: TJ's reply, I think support for something like this is quite appropriate, as i know the jQuery does support the use of multiple selector expressions sep. by commas. Rick On Fri, Sep 4, 2009 at 11:49 AM, T.J.

[Proto-Scripty] Re: Scriptaculous callback function parameters

2009-09-09 Thread Rick Waldron
You want to use either function#call() or function#apply Definitions (from https://developer.mozilla.org/) function#call(): Calls a function with a given *this *value and *arguments * provided individually. $('aDiv').morph('background:#00ff00; width:300px;', {

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

2009-09-09 Thread Rick Waldron
Since you say your are just learning, I'd like to impart a tip :) Instead of... Droppables.add('DropDiv_G1', { hoverclass: 'hover', accept: 'G1', onDrop: DropHandler }); Droppables.add('DropDiv_G2', { hoverclass: 'hover', accept: 'G2', onDrop: DropHandler

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

2009-09-09 Thread Rick Waldron
PM, Chris Sansom ch...@highway57.co.ukwrote: At 14:39 -0400 9/9/09, Rick Waldron wrote: Since you say your are just learning, I'd like to impart a tip :) Instead of... Droppables.add('DropDiv_G1', { hoverclass: 'hover', accept: 'G1', onDrop: DropHandler

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

2009-09-09 Thread Rick Waldron
Awesome! Rick On Wed, Sep 9, 2009 at 6:15 PM, Dean Elzey dean.el...@gmail.com wrote: Worked perfectly, hack or not :) On Wed, Sep 9, 2009 at 5:11 PM, Rick Waldron waldron.r...@gmail.comwrote: this is WAY hackish... droppableDivs.each(function (_div) { Droppables.add(_div

[Proto-Scripty] Re: how merge two json objects?

2009-09-15 Thread Rick Waldron
To note, the jQuery#extend implementation is a bit more in depth... has there been any talk in the proto-core list about strengthening Object#extend? Rick On Mon, Sep 14, 2009 at 8:35 PM, Miguel Beltran R. yourpa...@gmail.comwrote: Thanks to both #Mangus and #Alexander Use Object.extend look

[Proto-Scripty] Re: prototype code to load images?

2009-09-15 Thread Rick Waldron
One SUPER hackish thing i've seen done in the past: wrap your entire page contents in a div with style=display:none, then after that, but before the /body tag, add another div with a loading message... like... body div id=container style=display:none all your content is in here /div div

[Proto-Scripty] Re: prototype code to load images?

2009-09-15 Thread Rick Waldron
= function(){ $('container').appendChild(new Element('img', { src : '...', title : '...', alt : '...' }); }); On Sep 15, 12:21 pm, Rick Waldron waldron.r...@gmail.com wrote: One SUPER hackish thing i've seen done in the past: wrap your entire page contents in a div with style=display:none

[Proto-Scripty] Re: A better way to check for an element.

2009-09-18 Thread Rick Waldron
Its not much different, but this is what i do: if ( $('some_button') ) { $('some_button').observe('click', function (e) { //do stuff. }); } Ideally, i wish prototype was a bit more strict about this stuff... If you're using Firebug, you could replace your $() definition: function

[Proto-Scripty] Re: A better way to check for an element.

2009-09-20 Thread Rick Waldron
Mislav's when() seems a bit redundant when called inside of document.observe('dom:loaded')... I think this topic would be interesting to discuss in the the proto-dev mailing list, ie. exceptions thrown for non-existant elements... i'd also like to see some kind of support for catching stupid

[Proto-Scripty] Re: A better way to check for an element.

2009-09-20 Thread Rick Waldron
Thats not to say that when() isn't pretty cool :) On Sun, Sep 20, 2009 at 9:00 AM, Rick Waldron waldron.r...@gmail.comwrote: Mislav's when() seems a bit redundant when called inside of document.observe('dom:loaded')... I think this topic would be interesting to discuss in the the proto

[Proto-Scripty] Re: including prototype dynamically, and observe:domloaded

2009-09-20 Thread Rick Waldron
If none of the above work... document.write('script type=text/javascript src=' http://somewhere/edu/is//prototype.js;\/script'); have you tried removing the extra / before prototype.js? On Fri, Sep 18, 2009 at 1:45 PM, Ngan Pham nganp...@gmail.com wrote: Hi jrochkind, I believe

[Proto-Scripty] Re: better solution for Observe.click

2009-09-26 Thread Rick Waldron
Try: container.observe('click', function(e) { * var el = e.element().tagName == 'a' ? e.element() : e.element().up('a');* if (el.match('.pagination a')) { el.up('.pagination').insert(createSpinner()) new Ajax.Request(el.href, { method: 'get' }) e.stop() }

[Proto-Scripty] Re: Observe new elements

2009-09-26 Thread Rick Waldron
var _observers On Thu, Sep 24, 2009 at 5:41 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: You need to stopObserving the old ones relative to your element (cleans up the observers) and add a new observer as normal HTH Alex Mcauley http://www.thevacancymarket.com -

[Proto-Scripty] Re: Observe new elements

2009-09-26 Thread Rick Waldron
() { Observers(); }); On Sat, Sep 26, 2009 at 5:56 PM, Rick Waldron waldron.r...@gmail.comwrote: var _observers On Thu, Sep 24, 2009 at 5:41 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: You need to stopObserving the old ones relative to your element (cleans up the observers

Re: [Proto-Scripty] Re: Prototype conflict solution

2009-12-02 Thread Rick Waldron
Wow, I'm flattered... I was beginning to think that GenevaJS amounted to nothing more then a novelty :D Keep in mind that GenevaJS is not 100% yet, but if you do use it and come across broken or missing methods, you can certainly contribute Rick On Wed, Dec 2, 2009 at 7:43 AM, david

Re: [Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-06 Thread Rick Waldron
Instead of onSuccess, try using onComplete... -- Sent from my Palm Prē evilC wrote: Thanks TJ, I tried to make a self-contained version, so I ripped out prototype and did the same thing with object literals, and I still had issues, so clearly it wasnt prototype. In the end I figured out that

Re: [Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-06 Thread Rick Waldron
The problem is that when the dom is loaded... there is no such thing as pb_add_location. On Sun, Dec 6, 2009 at 5:09 PM, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Just tried onComplete - no joy You probably don't want onComplete. onComplete is called regardless of whether the

Re: [Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-06 Thread Rick Waldron
','pb_bottombar'); // Insert zoom box (Shows current zoom) pb_zoombox.initialize('pb_wipe_database','pb_bottombar'); //Insert Add button insertHtmlFromTemplate(pb_add_location_button,pb_map_controls); readLocations(); }); On Sun, Dec 6, 2009 at 6:11 PM, Rick Waldron waldron.r...@gmail.com

Re: [Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-06 Thread Rick Waldron
Also, in PHP related advice, *ereg *and *split* are deprecated. if you turned on your PHP errors and use E_ALL, it will throw back errors. Rick On Sun, Dec 6, 2009 at 6:36 PM, Rick Waldron waldron.r...@gmail.com wrote: Actually, my reasoning for that response was a fluke, so ignore

Re: [Proto-Scripty] Re: Delay or defer ajax requests

2009-12-07 Thread Rick Waldron
I'm not at a computer to try this out, and well, it might be a little hair-brained but perhaps... ( new Ajax.Updater() ).defer(); -- Sent from my Palm Prē T.J. Crowder wrote: Hi, I'm using animations on my website, and i want to start an Ajax request after a animation has finished. So i

Re: [Proto-Scripty] Re: document.write() vs Element/appendChild()

2009-12-07 Thread Rick Waldron
IMO, this is bad practice. $(element).insert('lt;divlt;/div');  -- Sent from my Palm Prē david wrote: Hi All, This is not the original question, but to insert elements in the DOM, you should do: $('myContent').innerHTML='lt;div .. lt;/div' It's faster in execution than creating an

Re: [Proto-Scripty] When Ajax Insert Expands Page Downward...

2009-12-07 Thread Rick Waldron
Yes and it drives me nuts. I'm sure there is a correct way of fixing this, but i'm ok with just setting somekind of footer content below the fold so that I always have scroll bars -- Sent from my Palm Prē Dave L wrote: I am having an issue: when inserting a number of elements that end up

Re: [Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-07 Thread Rick Waldron
A good place to start, add: console.log('this is my first debug output'); Anywhere inside of a loaded dom closure (like your initializer function or prototype's document.observe('dom:loaded', ...);  ) -- Sent from my Palm Prē evilC wrote: Great, that worked. I didn't realise this could be

Re: [Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-07 Thread Rick Waldron
Very, very cool. -- Sent from my Palm Prē evilC wrote: The idea of Placebook is social networking for places. Sort of like if you could have a facebook or twitter account for a place. People can log in and add locations, then people can make posts on it's wall, or add tags to the location to

Re: [Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-07 Thread Rick Waldron
Weird, maybe I thought it was doing what it should do... Either way, nice fix -- Sent from my Palm Prē evilC wrote: For future reference, document.observe('resize',winResize); Never fires. Maybe because the document as a whole has not been extended? However, Event.observe(window,

Re: [Proto-Scripty] Re: document.observe and Sorter in scrolling li sts

2009-12-07 Thread Rick Waldron
Missing: lt;head lt;body If found, please return. -- Sent from my Palm Prē Niko Schwarz wrote: I don't know why, but somehow this snippet executes document.observe fine. I just open another script tag and suddenly the world is good. But the issue with the scrolling drag and drop remains.

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

2009-12-07 Thread Rick Waldron
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 something like this: $('foo').update('lt;script . ' + this.someVariable + '/);

Re: [Proto-Scripty] Internet Explorer bug with Effect.Appear

2009-12-07 Thread Rick Waldron
Before I even begin to help you with this... you have 3+ copies of the Prototype/Scriptaculous libraries being called in. While your at it: http://www.getfirebug.com On Mon, Dec 7, 2009 at 2:03 PM, Mark K. mki...@gmail.com wrote: Hey all, If you take a look at a site I'm working on at

Re: [Proto-Scripty] Re: Include scripts

2009-12-09 Thread Rick Waldron
Something I came across in my Twitter feed... LABjs On Wed, Dec 9, 2009 at 6:54 AM, Frédéric f...@gbiloba.org wrote: Le mercredi 9 décembre 2009 11:25, T.J. Crowder a écrit : Your best bet for something like that is to have a build process that combines the scripts (and then minifies