On 6/9/06, Ryan Gahl <[EMAIL PROTECTED]> wrote:
was just pointing out that proto
does all that stuff
No. Prototype.js actually does far less than the methods described in
Douglas' article, you must have misread it. The current prototype
implementation is at the bottom end of what is possible. A
On 6/3/06, Eric Anderson <[EMAIL PROTECTED]> wrote:
Seems that you could just do:
var camelizedString = oStringList[0];
and achieve the same thing. Am I missing something?
No. http://dev.rubyonrails.org/ticket/4170
Bye,
Martin
___
Rails-spinoffs m
On 6/3/06, Eric Anderson <[EMAIL PROTECTED]> wrote:
Also both functions allow the second parameter to be a function
(although with different arguments).
Not in Internet Explorer 5. This is the sole reason why this function exists.
Bye,
Martin
___
R
On 5/25/06, Gregory Hill <[EMAIL PROTECTED]> wrote:
JS cannot access the attributes if they were
set using a
On 5/15/06, Maninder, Singh <[EMAIL PROTECTED]> wrote:
Yep, it can. But, it's too clutterred and too much info.
Try this as a start.
var Benchmark = new function(){
this.starttime = [];
this.start = function(text) {
this.starttime.push([new Date(), text || ""]);
}
this.stop = function
On 5/15/06, Eric Anderson <[EMAIL PROTECTED]> wrote:
I was reviewing the prototype library (current SVN version) to try to
understand the library better. I noticed there are two implementations
of the "clone" method on the Position object.
The first one is just some leftover code. It is overwri
On 30 Apr 2006 00:48:52 -, Thomas Anderson
<[EMAIL PROTECTED]> wrote:
I've solved it by using Insertion.Before instead of direct innerHTML but
I still don't understand what was wrong with my code...
A.innerHTML += B; does
C = A.innerHTML;
A.innerHTML = "" // HERE
A.innerHTML = C + B
The
On 4/29/06, Jeremy Kitchen <[EMAIL PROTECTED]> wrote:
> bug in prototype. Give me a few minutes and I'll get you a patch :)
and here it is. The problem was because a do { } while() always runs at least
once. So I changed it to a while() {} and it solved the problem.
A patch for this bug wa
On 4/28/06, SPENDLOVE, Matt, GBM <[EMAIL PROTECTED]> wrote:
That's pretty much what I did in the end anyway. Didn't have any joy with
flatten()..
There is also Hash.toQueryString() and
String.prototype.toQueryParams(). Mind the fix from for the later,
laying around in the bug tracker.
As you
On 4/28/06, Thomas Fuchs <[EMAIL PROTECTED]> wrote:
> Why not write a patch?
I froze my Prototype version just prior to the change to $().
Currently, I need stability and this is too much a change in the
fundamental workings of the library. The last thing I need are nasty
surprises, which there w
On 4/26/06, Jeremy Kitchen <[EMAIL PROTECTED]> wrote:
> Element.setStyle(element, {height: 123});
Length in CSS always needs a unit, except for 0. There is no "default
unit" of px. Whether using the setStyle wrapper or direct assignment,
this has to be "123px".
___
On 4/27/06, Siegfried Puchbauer <[EMAIL PROTECTED]> wrote:
> The problem is Element.cleanWhiteSpace() calls Element.remove() on empty
> textnodes. Element.remove tries to extend the element (Element.Methods) and
> IE doesn't support this
So prototype now burns cycles to extend an element that
On 4/25/06, Joseph Annino <[EMAIL PROTECTED]> wrote:
> - Repeat a set of html code and inserts it as the innerHTML of an
> element
> Maybe because
> after the repeating of the HTML, elements temporarily have the same id.
Never insert something into the DOM that results in IDs not being
unique. T
On 4/24/06, Athman,Joseph J <[EMAIL PROTECTED]> wrote:
> I hacked this together on my own using scriptaculous, but I was hoping
> someone had already done this better than me?
How would we know, you did not show your solution.
Bye,
Martin
___
Rails-s
On 4/24/06, Jeremy Kitchen <[EMAIL PROTECTED]> wrote:
> Is there no better way to merge one array into another than iterating over the
> array you wish to append with each() and push()ing the elements on to the
> other array?
Anything wrong with the standard Javascript arr1.concat(arr2) ? :-)
Bye
On 4/21/06, Lindsey Simon <[EMAIL PROTECTED]> wrote:
> That just fixed the same problem for me - makes me wonder why this isn't
> the default behaviour. Anyone know, out of curiousity?
Use the source, Luke.
var Position = {
// set to true if needed, warning: firefox performance problems
// N
On 4/17/06, Erin Brewer <[EMAIL PROTECTED]> wrote:
> My initial approach is to have a 2nd empty form tag on the page, and
> whenever the user changes a form field it will call a function that will
> dynamically create a new hidden form element in the 2nd form and write
> the attribute name and val
On 4/16/06, Maninder, Singh <[EMAIL PROTECTED]> wrote:
> See the following extract from www.sergiopereira.com -
> In case you've tried it before, you know it doesn't work. The reason is that
> the script block will be evaluated, and evaluating a script like the above
> will not create a function
Too fast on the trigger finger.
> evalScriptsGlobal: function() {
> return this.extractScripts().map(function(s){eval(s)}.bind(window));
> },
should rather be
evalScriptsGlobal: function() {
return this.extractScripts().map(function(s){eval.call(window, s)});
},
_
To followup to myself:
> They are defined in the context the eval is executed in. That is: as
> inner functions of the evalScripts method.
The way evalScripts is implemented in prototype: as inner functions of
the enumerator iteration.
A third solution (untested) would be
evalScriptsGlobal: f
On 4/14/06, Matt Adams <[EMAIL PROTECTED]> wrote:
> onUpdate: updateOrder('page_33')
This calls updateOrder at once and assigns the result to onUpdate. ()
means "execute the function".
Use onUpdate: updateOrder.bind(this, 'page_33')
For more details search the mailing list archive for the
On 4/14/06, Will Merrell <[EMAIL PROTECTED]> wrote:
> The one problem with
> this is that any code that defines functions works only while being
> evaluated. The functions are not defined if you try to call them later.
They are defined in the context the eval is executed in. That is: as
inner fun
On 4/10/06, Todd Ross <[EMAIL PROTECTED]> wrote:
> swap theElement and theResponse in your function
> NamedActionResponseHandler definition. Your optionally bind()'ed
> parameters are passed first.
You are right, got that mixed up.
Although
> 'theResponse' as the returned xml still
puzzles me.
On 4/10/06, Michael Peters <[EMAIL PROTECTED]> wrote:
> change this function to return another function. Something like this:
Yes, this is also what .bind() does to form a closure without having
to change NamedActionResponseHandler
> And then call it like this:
> onComplete: NamedActionResponse
On 3/22/06, Maninder, Singh <[EMAIL PROTECTED]> wrote:
> I am not able to follow what you suggested.
>
> Could you take this example and explain?
There is nothing special with document.write. It can be redeclared
like any normal property.
Just try this in normal page:
document.write("written");
On 3/22/06, Maninder, Singh <[EMAIL PROTECTED]> wrote:
> response is received it will be rendered till the point document.write is
> encountered and after that it will write to a new document instead of writing
> to the same one. I know this is how document.write is supposed to work.
>
> But, do
On 3/17/06, Ryan Gahl <[EMAIL PROTECTED]> wrote:
> Why are you not using FF > 1.0.7? sheesh, how many versions have been
> released since then?
I have both 1.0 and 1.5 installed. When I use FF, I use the 1.0
branch, as there are some to me critical extensions not ported to 1.5
yet.
Just for a di
On 3/1/06, Robin Haswell <[EMAIL PROTECTED]> wrote:
> Patch to allow generic Ajax.Autocompleter-style textbox watchers.
Looks good. But check this:
this.hasFocus is never used.
In onObserverEvent, check if the value has really changed since the
last remote call (user might have just moved the car
[ On the W3C box model ]
Therefore css3 allows to switch the box-model.
http://www.w3.org/TR/css3-ui/#box-sizing
I expect it to be usable in general web-design around 2017.
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists
On 3/2/06, Maninder, Singh <[EMAIL PROTECTED]> wrote:
> Like I mentioned earlier, what do you think about using the $$ function?
Troels' code would be faster in any case. It also has constant speed, whereas
> $$('table#main td.active').each(updateClassName(elm, newClass))
grows linear with the
> This one is called EventPublisher.
Cool, very useful. Although I won't remodel my current project to use it :-)
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
On 3/1/06, chuck clark <[EMAIL PROTECTED]> wrote:
>postBody: element.name + '=' + escape(element.value),
Use encodeURIComponent(), not escape().
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman
Or even scratch the args[0] = null; as this "initialization" is not neccessary.
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
On 2/28/06, Todd Ross <[EMAIL PROTECTED]> wrote:
> The plain old Function.prototype.bind() provides this exact
> functionality. If you want to put that into bindAsEventListener, I'd
> recommend using the same variable names/techniques rather than
> reinventing them.
Well, it is basically the same
On 2/28/06, Gregory Hill <[EMAIL PROTECTED]> wrote:
> Hmm... that's an interesting approach. Does that work on all browsers?
Now that you say it: preventDefault() is broken in Safari. It has been
fixed in the nightly builds. But Safari crashes on the app I am
building anyway (to heavy on DOM mani
> The main problem is that Event.stop stops the onclick event, but it does
> not stop the link from firing
It sure does. Must be something else in your code.
I disable Links on form edit like (excerpt)
Event.observe(document.body, "click", noAction.bindAsEventListener(this));
noAction:
I would like to share a modification to bindAsEventListener() that
might be useful to some of you. It makes it possible to do
function show(event, number) {
alert(Event.element(event).id + " = " + number);
}
Event.observe("el1", "click", show.bindAsEventListener(this, 5);
Event.observe("el2", "
On 2/27/06, Robin Haswell <[EMAIL PROTECTED]> wrote:
> I think this would work, I can set the onclick to evaluate a false
> function, this is my stanrd method of doing things like this. Strangely I
> don't think the event.observe(el, "click") method works for this.
When binding an event handler v
On 2/17/06, Jason Hummel <[EMAIL PROTECTED]> wrote:
> So for instance if I wanted to sort on
> myObject.data.line[2] the object would rearrange itself to look like:
Thant would be
myObject.data = myObject.data.sortBy( function(v){ return v.line[2] });
Bye,
Martin
__
Hello,
I am in fly-by mode as I am still more than busy, so I just dumb this
one out for anyone interested. Adapt it for your needs if you like it.
This effect is similar to ScrollTo, but scrolls the viewport
vertically the minimal amount necessary to bring the element into
view.
Usage: new Eff
Actually, scratch the previous post, use this one:
/*
** ++ Methods to use with Cookiejar:
**
** var kekse = new Cookiejar(cookieJarName, CookiePath)
** This is the constructor.cookieJarName is the name of the collection of
** cookies you would like to associate with this
On 11/01/06, Maninder, Singh <[EMAIL PROTECTED]> wrote:
> Basically, what I am looking for is if there is an easy way to store mutiple
> cookies in a single cookie using hash or something - easy writing and
> retrieval (updating the cookie value).
How about this for a start:
/*
** ++ Metho
On 11/01/06, Ryan Gahl <[EMAIL PROTECTED]> wrote:
> I know this isn't productive, but I must say that I absolutely hate the
> wiki. I've never been able to use it for more than a couple minutes before
> it completely farts out.
Yes, not a too nice situation. The other thing about it is that the
w
On 11/01/06, Jeremy Kitchen <[EMAIL PROTECTED]> wrote:
> On a side note, it appears that firefox is the most liberal about allowing the
> extension of DOM prototypes, since I had a similar issue previously with
> trying to add an instance method to the HTMLSelectElement prototype :(
In Internet E
On 27/12/05, Gregory Hill <[EMAIL PROTECTED]> wrote:
> document.write(' src="/javascript/prototype.js">');
> Unfortunately that makes Mozilla display this in the document:
> ') } catch (e) {};
You may not include a ETAGO (end tag) in the script.
document.write('<\/script>');
If it is ab
On 20/12/05, Nicolas Terray <[EMAIL PROTECTED]> wrote:
> 837c840,841
> < if (child.className.match(new RegExp("(^|\\s)" + className +
> "(\\s|$)")))
> ---
> > var re = new RegExp("(^|\\s)" + className + "(\\s|$)");
> > if (child.className.match(re))
One can even put the var re=... one
On 20/12/05, Gregory Hill <[EMAIL PROTECTED]> wrote:
> He's just
> copying a value to a local variable and using that instead and there's a
> big speed difference?
"foo.bar" or even "foo.bar.baz.qwertz" are more expensive to lookup
than "temp". So if you have to use the former multiple times (e.g.
47 matches
Mail list logo