wrapper `toElement`/`toHTML` methods
(since `update`/`insert` delegate to those when available)
Definitely.
--
kangax
Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post
.)
+--ObjectRange (ListWrapper + overrides)
+--Ajax.Responders (ListWrapper + register, unregister, dispatch)
+--Hash (Enumerable + get, set, keys, toQueryString, etc.)
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed
instances and maybe even
using a double-duty constructor instead of Class.create? See what I mean
below.
- Ken Snyder
Prototype.Element = function(element) {
if (this instanceof Prototype.Element) {
// constructor
element.__prototypeWrapper = this;
this.raw = element;
} else
Is avoiding document.write() for IE dom:loaded included in 1.6.1? I
think the core team concluded that doScroll was the way to go, but I'm
not sure.
What about fixing String#escapeHTML for IE and WebKit?
What about enhancing Element#siblings to accept a selector?
dobby wrote:
Hi,
The show, hide, toggle methods are great on the element object but it
would also be nice to have a setVisisble(boolean) method. This allows
you to set the visibility of an element depending on a Boolean
expression. With the current api you have to if else this behavior.
Diodeus wrote:
I've seen a few posts about this, but no answers.
I would like to be able to call a function when a draggable revert
occurs. What I'm trying to do is replace a photo with an icon on drag
(which I've accomplished), but I need to swap it back if the revert
fires.
I really,
describes it as an abstraction
layer above a framework. As an abstraction, it makes sense that each Ext
feature would be limited by the library with the weakest implementation of
that particular feature.
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message
perplexing in most situations.
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group
disccomp wrote:
Please see this excellent breakdown of this function on cross-browser
performance to better understand the available solutions.
http://blog.stevenlevithan.com/archives/faster-trim-javascript
Awesome analysis!
I wonder if trim12 might be improved by avoiding calling slice
Diego Perini wrote:
...
I believe the last comment in the following related thread by
liorean says something too (having a separate CSSLoaded event):
http://my.opera.com/nicomen/blog/2007/07/08/domcontentloaded-gotcha-with-external-stylesheets
...
+1 for a separate CSSLoaded event. I'm
.
The others may be simple, but probably not used often enough for a place
in the Core library. And as Richard says, there are a bazillion
variations of these types of functions. Feel free to maintain a plugin
and submit it to scripteka.com.
- Ken Snyder
On Fri, Apr 4, 2008 at 11:48 PM, John-David Dalton
[EMAIL PROTECTED] wrote:
This ticket here: http://dev.rubyonrails.org/ticket/11434 mentions
asolution for dropped connections in Firefox. It might work on other
browsers as well. Basically they attach a callback to the onError
native
, as
you can see from tobie's comments, does not handle all situations in
all browsers.
http://dev.rubyonrails.org/attachment/ticket/10191/ajax.js.diff
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype
On Fri, Apr 4, 2008 at 11:01 PM, John-David Dalton
[EMAIL PROTECTED] wrote:
Also a different patch for solving the same problem.
I check the window.location.href and the url of the ajax call to
determin if its file or ftp protocol then allow zero or not.
koozdra wrote:
Thanks for the quick reply.
I ran some tests in ruby:
array = [1,2,3,4]
p array.insert(-3, 'one', 'two')
array = [1,2,3,4]
p array.insert(-1, 'one', 'two')
array = [1,2,3,4]
p array.insert(0, 'one', 'two')
array = [1,2,3,4]
p array.insert(1, 'one', 'two')
array =
is an academic stab at implementing your idea.
My only question is what to do when the index is too low or too high.
I'm not sure what Ruby does; the code below just defaults to 0 when the
index is too low or too high.
- Ken Snyder
Array.prototype.insert = function() {
var args = $A(arguments
Based on this thread, I created flexible Event delegation functions for
attaching and removing delegation rules:
http://kendsnyder.com/sandbox/delegate/
http://scripteka.com/script/element-delegate
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message
kangax wrote:
Ken,
take a look at my implementation [1] - it looks very much alike,
except for the syntax : )
[1]
http://code.google.com/p/protolicious/source/browse/trunk/src/event.register.js
- kangax
Cool! So if I understand it correctly, register() has three differences
from
(...);
this.formElements might be a HTML node collection object and not an array.
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core
John-David Dalton wrote:
ticket + patch for the bug:
http://dev.rubyonrails.org/ticket/11092
Spiffy use of clone. Won't the line /name|id/.test(name) catch
attributes such as myid? Would ['name', 'id'].include(name) be
better? Or you could just add ^ and $.
- Ken
support for onmouseenter and onmouseleave
- Add intuitive Prototype methods for checkbox- and radio-group form
elements (e.g. a method to get the value of the currently checked
item(s) in based on a group name)
Can you confirm these and give us some insight?
Ken Snyder
Mislav Marohnić wrote:
...
- Expand Prototype custom events to fire callbacks for Element methods
such as update, setStyle, remove, replace, insert, wrap,
writeAttribute,
addClassName, removeClassName, scrollTo, etc.
That is planned for the next major release. Based on
Mislav Marohnić wrote:
...
- Add Prototype support for onmouseenter and onmouseleave
This is definitely useful to the majority of users. We are still
discussing if it's going to become core and in which version.
Meanwhile, read the very insightful article by Andrew about why
Michael Peters wrote:
Mislav Marohnić wrote:
On Jan 7, 2008 9:25 PM, Ken Snyder [EMAIL PROTECTED]
Some ideas
are shared with the community while some are kept private for further
discussions among core members.
Why the secrecy? This is an open source project after all.
So
This is great. Kudos to Kangax for compiling it!
I'm probably dreaming too big, but it would be great if the code was
submitted so that it could be hosted on the site and required unit tests
to be certified for a certain Prototype version. Plus demos on the
site would be fantastic. I really
Mislav Marohnić wrote:
...
- Add intuitive Prototype methods for checkbox- and radio-group form
elements ( e.g. a method to get the value of the currently checked
item(s) in based on a group name)
Hmm, we have it for select boxes and multiple selects, why not radio
(BUMP)
Original Message
Subject:[prototype-core] Event#unloadCache not available in 1.6.0
Date: Mon, 03 Dec 2007 15:07:03 -0700
From: Ken Snyder [EMAIL PROTECTED]
To: prototype-core@googlegroups.com
http://groups.google.com/group/rubyonrails-spinoffs
() was
before 1.6.0. Some consider this a compatibility issue and even a bug
that should be fixed in 1.6.1.
What are your thoughts?
Thank you,
Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype
keep lots of files with small snippets. The snippets are
compiled into one file for global use. In my environment, firebug +
yslow showed an enormous improvement with 1 http request instead of 12
http requests. The primed-cache comparison also showed improvement.
- Ken Snyder
as a status between
200 and 299
Seems to test fine. Feed back is welcomed.
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core
the file protocol to always trigger onSuccess, but
what status code should it return? 200? I'm assuming we don't want
files to trigger on0
I'll try to submit a patch this week.
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you
/1e657fad735d86de/3f25679d7451b816?lnk=gstq=ken+snyder+ajax#3f25679d7451b816
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core
not use noscript? What are the use cases?
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from
/json.js
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL
. My question is: Is it possible to detect when local files
fail to load?
- Ken Snyder
Index: ajax.js
===
--- ajax.js(revision 7468)
+++ ajax.js(working copy)
@@ -74,6 +74,9 @@
request: function(url) {
this.url
protocol behavior, especially across OSs and Browsers.
I'm just thinking it would be best to submit a patch that addresses both
issues since you mention that requesting local files looks like a
network error due to transport.status = 0.
- Ken Snyder
Ajax.Request = Class.create(Ajax.Base
jdalton wrote:
I like the idea of having one handle for those cryptic error codes.
Would onNetworkError be different than onException ( does the
onException get called as well??)
In my current implementation, a network error triggers onNetworkError,
onLoaded, onComplete, then onFailure.
.
references:
http://dev.rubyonrails.org/changeset/7265
http://developer.yahoo.com/yui/docs/connection.js.html
http://www.thescripts.com/forum/thread573352.html
http://trac.dojotoolkit.org/ticket/2418
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because
things _more_
readable, so, for consistency, the idea is to use it everywhere within
the framework.
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email
that the wrapper account for situations where
events are attached to onDOMContentLoaded after onDOMContentLoaded has
fired.
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group
Don't forget other forms such as -3000 +3000 and 3e4
An alternative to regexes:
function isNumeric(str) {
return parseFloat(str) == str;
}
It will return true for strings that JS would automatically convert to a
number.
- Ken Snyder
Frederic Gaus wrote:
Hi eggie
eggie5 schrieb
Mislav Marohnic' wrote:
...
Ken, these are nice and certainly useful, but I don't think most of
the people have a need for them. Most of the heavy-duty date/time
logic should be kept in your application (server-side). But I'll let
other core members speak for themselves.
You're
methods (below).
- Ken Snyder
// format
var d = new Date().format('%Y-%m-%d'); // 2007-08-17
// create(static)
Date.create('8-17-07').format('%Y-%m-%d'); // 2007-08-17
// add
var d = new Date().add(2, 'month').format('%Y-%m-%d'); // 2007-10-17
// diff
new Date().diff(d, 'month'); // 2
// succ
new
.html. I'm working on making it more robust,
but it is completely extensible and would allow you to add simple
functions to give the table functionality you mention. When I finish,
I'll do a full write-up on my web site.
- Ken Snyder
--~--~-~--~~~---~--~~
You
methods (below).
- Ken Snyder
// format
var d = new Date().format('%Y-%m-%d'); // 2007-08-17
// create(static)
Date.create('8-17-07').format('%Y-%m-%d'); // 2007-08-17
// add
var d = new Date().add(2, 'month').format('%Y-%m-%d'); // 2007-10-17
// diff
new Date().diff(d, 'month'); // 2
// succ
new
is the exact opposite of pluck? Pin? Place? Affix? :P
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe
Sam Stephenson wrote:
...
Good idea. Ruby has this, too, and I've missed it in JavaScript.
Could you submit a tested patch to trac?
-sam
Patch with tests are posted. (http://dev.rubyonrails.org/ticket/9094)
- ken
--~--~-~--~~~---~--~~
You received
Tobie Langel wrote:
...
I'm also concerned about naming the method adequately. Sam suggested
Element#denominate which looks nicer than (generate|assign)Id but
which I fear could be confused with setting the name attribute. The
only other option I came up with is Element#identify. Thoughts on
), prefix);
};
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email
for object
hashing--being able to look up some data by element. It looks like the
YUI library uses a similar function called generateId() in their drag
and drop, menus, treeviews and more.
- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you
--I
think we need to prove its real-world value.
--Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe
Mislav Marohnic' wrote:
On 6/25/07, *Andrew Dupont* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Perhaps someone could volunteer to convert a piece of Scriptaculous or
Rico just for illustration purposes?
Stuff in Prototype that benefits from inheritance:
TimedObserver,
in succession. See examples below.
Thanks,
Ken Snyder
$$('div.thumbnail')
.invoke('observe','mouseover',thumbMouseOver)
.invoke('observe','mouseout',thumbMouseOut);
$$('#windows div.close')
.invoke('addClassName','active')
.invoke('show
Mislav Marohnić wrote:
Thanks. It's not obvious to all, so I added one of your examples to
the doc.
Awesome! That was faster than approving a wiki edit :P
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
[EMAIL PROTECTED] wrote:
You are correct in your assumption of the functionality and
unfortunately came to the same conclusion as me in that it can't be
done. I do like your idea of setting a cookie maybe once the page is
loaded saving wether the browser has JS enabled. Then my server side
in mind. Note that browser image caching rules
apply according to the HTTP headers sent with the image.
--Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send
[EMAIL PROTECTED] wrote:
A simple unobtrusive approach would be to have a drawer of thumbnails
with a link to view more images. For JavaScript enabled browsers,
simply override the functionality of that link to load a list of image
locations from memory or by AJAX.
The only problem
Mislav Marohnic' wrote:
On 5/17/07, *Ken Snyder* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Would the Prototype Core Team endorse an official repository
Probably, but only with scripts and plugins actually *maintained* by
the Core team.
...
I'm sure that we could find
in such a patch, or is there some drawbacks I'm
missing? Too much overhead maybe?
-- Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core
syntactically appealing than Dean
Edward's Base. It seems like a convention that Prototype could easily
embrace.
--Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send
That would certainly be unique and powerful. What would this
hypothetical class allow? Consider the following:
Create and Append at Position-- new Element('#content div#mynode.someClass')
Define Attributes-- new Element('[EMAIL PROTECTED]text]')
Create an Array of Nodes-- new
; they
create a JSON object with methods stringify and parse. Pick your favorite:
http://www.google.com/search?q=json+stringify+parse
Regards,
Ken Snyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group
Andrew Dupont wrote:
...
I just submitted #7585: http://dev.rubyonrails.org/ticket/7585
This patch also serves as an example of how I'd like to overhaul
Prototype's browser detection.
This looks beautiful. Great work!
--~--~-~--~~~---~--~~
You received
Colin Mollenhour wrote:
But, I don't think the overhead of a bind call and the storage of an
object with a function for EACH event observed is justifiable, just to
have the convenience of:
handle.stopObserving();
rather than:
Event.stopObserving(handle);
Colin, your patch is superb.
the
handle's stopObserving function remove its own entry from the
Event.observers array, but that isn't technically necessary.
--Ken Snyder
Object.extend(Event, {
//...
// the cache of observers
observers: [],
//
// replacements for observe, stopObserving, unloadCache with
enhanced
Ken Snyder wrote:
Along with all this Event handling discussion, I'd like to throw in my
ideas for a rewrite of Event.observe et al before I test and submit as a
patch. My proposed changes allow the traditional Event.stopObserving()
and simplify some of the current messaging ideas
;
}
}
}
a[a.length] = ']';
//
// Addition by Ken Snyder
//
} else if (x instanceof HTMLElement || x==window || x==opener) {
return;
//
// End Addition
//
} else if (x
67 matches
Mail list logo