'
It's faster in execution than creating an eleme
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
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 wrote:
> Actually, my reasoning for that response was a fluke, so ignore it
>
>
> the pro
{id: 'pb_sidebar'})
);
*/
*
// Insert loc box (Shows current location)
pb_locbox.initialize('pb_locbox','pb_bottombar');
// Insert zoom box (Shows current zoom)
pb_zoombox.initialize('pb_zoombox','pb_bottombar');
// Insert zoom box (Shows current zoom
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 wrote:
> Hi,
>
> > Just tried onComplete - no joy
>
> You probably don't want onComplete. onComplete is called regardless of
> whether the request was succ
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 t
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 wrote:
, function () {
Observers();
});
On Sat, Sep 26, 2009 at 5:56 PM, Rick Waldron wrote:
> 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 elem
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
>
> ---
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()
}
If none of the above work...
document.write('
Thats not to say that when() isn't pretty cool :)
On Sun, Sep 20, 2009 at 9:00 AM, Rick Waldron wrote:
> Mislav's when() seems a bit redundant when called inside of
> document.observe('dom:loaded')...
>
>
> I think this topic would be interesting to discuss
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 codi
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 $(ele
could just
> yeah...
>
> window.onload = function(){
>
> $('container').appendChild(new Element('img', { src : '...',
> title : '...', alt : '...' });
>
> });
>
> On Sep 15, 12:21 pm, Rick Waldron wrote:
> > O
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 tag, add another div with a loading
message... like...
all your content is in here
Loading some big stuff, please hold.
*// Event.observe(
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. wrote:
> Thanks to both #Mangus and #Alexander
>
> Use Object.extend look so easy, what I
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...
>> >droppableDivs.each(function (_div) {
>> > Droppa
this is WAY hackish...
>droppableDivs.each(function (_div) {
> Droppables.add(_div, {
> hoverclass: 'hover',
> accept: *_div.split('_')[1]*,
> onDrop: DropHandler
> });
>});
...but it works. And makes me look less absent minded.
On
9, 2009 at 4:44 PM, Chris Sansom wrote:
>
>>
>> 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(
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
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;', {
afterFinish:callExample.ca
This would be a really EXCELLENT use case for DOM Mutation events.
On Tue, Sep 8, 2009 at 7:09 AM, david wrote:
>
> Hi Yaffle,
>
> There is nothing in the code that seems to automatically delete the
> Storage object when an element is deleted.
> Even in the Element .remove,
>
> I think that if
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. Cr
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(
_storage._object.prototype_e
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 wrote:
>
> Hi there,
>
> Apologies to everybody if my question is offending in any way, but
> this is my first post to suc
Message -
> *From:* Rick Waldron
> *To:* prototype-scriptaculous@googlegroups.com
> *Sent:* Thursday, July 30, 2009 7:31 PM
> *Subject:* [Proto-Scripty] Re: ternary operators
>
> Huh?
>
> Jeztah == Alex?
>
> On Thu, Jul 30, 2009 at 8:37 AM, Alex McAuley <
>
exist'); alert('The second responsee');
>
> 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
> *To:* prototyp
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" momen
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 = {
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 wrote:
>
> Hi,
>
> > echo " > {duration: 2.0}); return false;\">$directory";
>
> I'm not a PHP guy,
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 "b
d the confusion and stay away from using . and : altogether.
On Mon, Jul 20, 2009 at 10:10 PM, Rick Waldron wrote:
> Instead of changing the way the core works... and potentially causing
> breakage to existing code - perhaps you might try rewriting your selector
> statement with escap
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 se
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 wrote:
>
> Hi lun.ashis,
>
> One thing, because code seems to be good, is that w
// but this shows the source code of a function! I wanted the
> value of a member of attr.edges (if it existed).
> alert(edge);
>
>}, this);
>
>
>
>
>
> On Jul 10, 4:15 pm, Rick Waldron wrote:
> > The result your getting is completely correct, yo
$('id-of-form-element').observe('change', function () {// do stuff in here.
});
On Fri, Jul 10, 2009 at 3:33 PM, Mathew 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 the requiremen
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 wrote:
>
> Hi,
> I've been puzzling over this for a couple of days and finally admit I
> need help. I have a Hash of
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!
As a helpful sidenot, i think you'd benefit from NOT using onload=""
document.observe('dom:loaded', function () {
var onResize = function(e) {
var viewport = document.viewport.getDimensions();
var screen = $('screen');
var s_view = screen.getDimensions();
scre
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
y
> name is a reserved word (although it works, of course, even if you're
> giving a literal string).
>
> FWIW,
> --
> T.J. Crowder
> tj / crowder software / com
> Independent Software Engineer, consulting services available
>
>
> On Jun 30, 1:54 am, "M
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. wrote:
>
>
> 2009/6/29 Rick Waldron
>
>> You code was rife with sy
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. wrote:
> Hi list
>
> if have a variable like this
> switch
r");
> abc.foo(); // alert("1234"); and second $('bla').hide();
>
> rgds sven
>
> On 29 Jun., 18:41, Sven wrote:
> > wow thank you ;)
> >
> > On 29 Jun., 18:38, Rick Waldron wrote:
> >
> >
> >
> > > Dig it:
> &
No problem
Rick
On Mon, Jun 29, 2009 at 12:41 PM, Sven wrote:
>
> wow thank you ;)
>
> On 29 Jun., 18:38, Rick Waldron wrote:
> > Dig it:
> >
> > http://jsbin.com/uhogi
> >
> > (view the source)
> >
> > Rick
> >
> >
&
Dig it:
http://jsbin.com/uhogi
(view the source)
Rick
On Mon, Jun 29, 2009 at 12:19 PM, Sven wrote:
>
> Hi,
>
> is it possible to add Events to own classes?
>
> something like this:
>
> var myClass = Class.create({
>foo : function(){
>this.fire('bar');
>}
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 & eleme
he list 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 wrote:
> > This is sort of redundant to TJ, but I'm going to throw it out there...
> I
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
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: 'easeI
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, wal
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 wrote:
> Can you post a link to an example?
>
> Rick
>
>
> On Wed, Jun 24, 2009 at 3:29 AM, Nivash Ramachandran wrote:
>
>>
Can you post a link to an example?
Rick
On Wed, Jun 24, 2009 at 3:29 AM, Nivash Ramachandran wrote:
>
>
>
> 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. While i dra
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 McA
this object at a later stage or do you have to
> declare all you varaibles at this stage.
>
>
>
>
>
>
>
> 2009/6/19 Rick Waldron
>
> Since no one else has replied, justly so as this is not a Prototype related
>> question...
>>
>> I'm vaguely familiar
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 wrote:
>
> Has anyone here used the sessvars lib, would like to ask a question if
> you have
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 $
t
> > > others. The problem I have is that the form had two dynamic places:
> >
> > >
> > > and
> > >
> >
> > > There is an onChange that calls the javascript function getTerritories
> > > () allows the
> > > to display which h
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='' ev
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 em
Could you set this up on http://jsbin.com/?
On Tue, Jun 16, 2009 at 2:06 PM, adamski 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).
>
> However, the element
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:
$('adjF
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 wrote:
>
> Thanks Rick but I found an other way 2 minutes ago
>
> I added this under the
>
> function blind1(){
> Effec
gt;
> Best,
>
> Tobie
>
> On Jun 12, 7:45 pm, Rick Waldron 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
>
y expect to ditch Prototype for jQuery. :-) But very cool
> for other purposes!
>
> -- T.J. :-)
>
> On Jun 12, 3:33 pm, Rick Waldron wrote:
> > I'm developing a library that will allow this sort of syntax. Actually,
> it
> > allows you write jQuery syntax in Prototype, g
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 pr
Try this:
Toggle Blind
Below goes in a
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 wrote:
> Sorry, should've explained why IE is so dumb... Firefox knows to wait to
> execute, but it doesnt know everyth
that arent there, IE basically says: 'tough shit'
Good luck!
On Fri, Jun 5, 2009 at 9:24 PM, Rick Waldron 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
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 tags... those
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 AM,
(luckily) !!!
>
> This is probably a good debate to have in an open group like this as alot
> of people new to Javascirpt programming are told not to inline things but
> not really explained the real reasons why or why not to!! - same with php
> and ' vs " !!
>
> Long day
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 wrote:
>
> Hi everyone.
>
> I'm experiencing some possible bugs with a Scriptaculous dr
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:
t;
> Also ... is the "record" node 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 Wa
Yeah, i discovered the same gotcha...
the JS should actually look like this:
document.observe('dom:loaded', function () {
$$('.blinders').each(function (b) {
b.observe('click', function () {
Effect.toggle(this.next(), 'blind');
// or like this if you used th
one wrote code the same then the internet would be boring !!
>
> I would be interested to see how you would tackle problems like the one
> above as i've never really discussed it with anyone before
>
> Regards
> Alex
>
> - Original Message -
> *From:*
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
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
There is a much cleaner way to do this... check it out (tested and passed)
This goes in
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, Ju
of code of yours a spin.
>
> Thanks a lot.
>
> On Apr 29, 3:16 pm, Rick Waldron 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...
>>
&
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 = [];
for (var i = 0, len = args.length; i < len; ++i) {
if (typeof args[i] == 'str
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 () {
$('dialog_1').observe('cli
$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 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 types
> it's document
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();
ale