++i; is a little more efficient in C language,
in javascript difference in performance of all these operators is tiny
On Dec 16, 3:21 pm, RQuadling wrote:
> Hi.
>
> Is there any consensus on which is more efficient in a for() loop?
>
> I was taught that for ++i being the most efficient.
>
> I've
I'm waiting prototype.js 1.7 too.
--
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
prototype-core-unsubscr...@googlegroups.com
Add this code after prototype.js =). Also this code replaces FF 3.5
Native JSON.stringify with ES compatible...
It breaks compatibility!
delete String.prototype.toJSON; //! deleting this properties required
to save FF 3.5 Native JSON.stringify
delete Array.prototype.toJSON; //!
delete Number.prot
+1 for REMOVE this methods
--~--~-~--~~~---~--~~
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
May I ask you about localStorage?
I want to update some property, but no space left on device and
FireFox throws error "NS_ERROR_FILE_NO_DEVICE_SPACE",
so "localStorage[property]" stays unchanged.
try{
localStorage[property] = value; //throws
"NS_ERROR_FILE_NO_DEVICE_SPACE"
}catch(e){
localS
Yes that's is, but Safari and Chrome isn't popular browsers.(depends
on site audience)
--~--~-~--~~~---~--~~
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@goog
I use "small" (40 lines of code) storage class, that uses cookies or
localStorage.
IMHO, userData and databases not so usefull:
IE userData behavior relies on DOM.
database works in webkit, which supports localStorage.
--~--~-~--~~~---~--~~
You received this messa
https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/810-fix-eventstopobserving-to-return-element
On 25 сен, 19:17, "T.J. Crowder" wrote:
> Hi,
>
> > I didn't find the other way to report bugs in prototype.js
>
> It's described here:http://prototypejs.org/contribute
>
> > i am qui
https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/807-fix-hash-class-to-use-prefix
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to protot
base2.js uses prefix for it's "Map" Class
On 14 сен, 19:53, Yaffle wrote:
> > > Sorry, I'm not following again :) What's not necessary? Which requests
> > > will be more expensive?
>
> May be, for-in loop will iterate a little more ...
--~--~--
http://groups.google.com/group/prototype-core/browse_thread/thread/d8faa05113019c23?hl=en
On Sep 21, 7:58 am, Vaie Lab wrote:
> Hi,
>
> I have this code:
>
> my_element.observe('click', function(event) {
> event.stop();
> if (event.isLeftClick()) {
> alert('test');
>
> > Sorry, I'm not following again :) What's not necessary? Which requests
> > will be more expensive?
May be, for-in loop will iterate a little more ...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Prototype: C
There is an issue with Hash#toObject method...
I think, Ajax.Base#parameters can be Hash instead of object to avoid
call to Hash#toObject...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
T
var Hash = Class.create(Enumerable, (function() {
function specialClone(source,propertyFunc){
propertyFunc = propertyFunc || Prototype.K;
var destination = {};
for (var property in source) {
destination[propertyFunc(property)] = source[property];
}
return destination;
What object creation?
javascript:alert(window.localStorage.__proto__)
On 14 сен, 05:56, kangax wrote:
> On Sep 13, 6:38 pm, Tobie Langel wrote:
>
> > > Why not to patch Hash to use some prefix for keys?
>
> > That was my plan for 1.7, actually.
>
> > It fixes that issue and also avoids creat
You're right, `hasOwnProperty` can be useless, and
`propertyIsEnumerable` is useless becauseof dontEnum IE bug...
Why not to patch Hash to use some prefix for keys?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Pr
++IE dontEnum bug =)
var h = $H({});
h.set('toString',1);
alert(h.toJSON());
--~--~-~--~~~---~--~~
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.
var h = $H({});
h.set('__proto__','sadfdsf');
alert( typeof( h.get('__proto__') ));
Also try these:
alert(Object.toQueryString('hasOwnProperty=1'.toQueryParams()));
// hasOwnProperty=function%20()%20%7B%20%5Bnative%20code%5D
%20%7D&hasOwnProperty=1
May be "Object.prototype.hasOwnProperty.call(
May I ask you ?
Can I use Hash or vanilla objects for storing [key,value] with
key==='constructor' or key==='prototype' ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this grou
; complexity.
> > > It uses `String#replace` instead of `String#gsub` and thus performs
> > > better.
> > > Do you guys see any enhancements (in terms of performance or code
> > > size) that could be made ?
>
> > > Diff:http://github.com/samleb/prot
???
--~--~-~--~~~---~--~~
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
prototype-core-unsubscr.
You should use Strings interpolate function for this. A template is
> meant to be reused many times with many different filler values.
>
> On Jun 14, 10:41 am, Yaffle wrote:
>
>
>
> > var Template = Class.create({
> > initialize: function(template, pattern){
> >
I use Function.prototype.watch instead of Abstract.TimedObserver
Function.prototype.watch = function(delay,onChange){
var __method = this,
value= __method();
return setInterval(function(){
var v = __method();
if(v!==value){
onChange(v);
value = v;
Why you can't use closure or Function#curry based on it?
(new PeriodicalExecuter(function(someData){
var x = someData.num;
//
}.curry({ num: 1, text: "string" })));
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
var Template = Class.create({
initialize: function(template, pattern){
var parts = template.toString().split(pattern ||
Template.Pattern),
pl = parts.length,
pattern2 = /^([^.\[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
for(var i=1,k=1;ihttp://groups.google.com/group/prototype-
var Template = Class.create({
initialize: function(template, pattern) {
this.template = template.toString();
pattern = pattern || Template.Pattern;
if (!Object.isString(pattern) && pattern.global)
pattern = new RegExp(pattern.source);
this.pattern = pattern;
var parts
Why Template Class can't split template string when initializing?
Example:
function xTemplate(template){
var a = template.split(Template.Pattern),
l = a.length;
return function(object){
var x = a[0];
for(var i=1;ihttp://blog.stevenlevithan.com/archives/cross-browser-split .
-
function update(array, args) {
var arrayLength = array.length, length = args.length;
while (length--) array[arrayLength + length] = args[length];
return array;
}
Array.prototype.push.apply(array,args) == update(array,args) ?
--~--~-~--~~~---~--~~
Y
String#prototype#split Great Fix
http://blog.stevenlevithan.com/archives/cross-browser-split
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to prototype-c
var tag = /<\/?\w+(?:\s+\w+(?:\s*=\s*(?:(?:"(?:\\.|[^"])*")|
(?:'(?:\\.|[^'])*')|[^>\s]+))?)*\s*\/?>/gim;
var tagName = /^<\/?(\w+)/im;
String.prototype.stripHTMLTags = function(tagsToKeep){
if(tagsToKeep)
tagsToKeep = tagsToKeep.invoke('toLowerCase');
return this.repla
In this example may be used "new Element(..."
But I have page, where I can't use it.
--~--~-~--~~~---~--~~
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@goog
Thanks for your answer.
Yes, that example may be very specific and so not fore core, but:
http://prototypejs.org/assets/
2009/3/27/prototype.js">
// asd');
(function(){
Should I use "defer" method for browsers, which doesn't need a moment
to update "new markup"?
May be Function.prototype could contain method, that will use defer
for IE and run function immediately for other browsers?
The defer method may slow page loading and may be cause errors.
Sorry, for my "
Hm i am stupid.., why this ticket is for 1.6.0.3 milestone?
--~--~-~--~~~---~--~~
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 unsubs
Hm i am stupid.., why this ticket is for 1.6.0.3 milestone?
--~--~-~--~~~---~--~~
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 unsub
Good!
My searching it on lighthouse was not succeful...
kangax:
> On Feb 16, 8:56 am, Yaffle wrote:
> > Function.prototype.bind may work 2 times faster, if when calling bind
> > with one argument,it would return function without "arg.concat"
> >
>
Sorry, It's not bind optimization.
It's optimization of function returned by "bind".
--~--~-~--~~~---~--~~
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@google
Function.prototype.bind may work 2 times faster, if when calling bind
with one argument,it would return function without "arg.concat"
bind: function() {
if (arguments.length < 2 && Object.isUndefined(arguments[0]))
return this;
var __method = this, args = $A(arguments), object = args.sh
Hello,
Why with JavaScript <= 1.5, Array.prototype._each method doesn't use
a context object
like
Array.prototype.forEach(callback[, thisObject]) in JavaScript 1.6
or
Enumerable.prototype.each(iterator[, context]) ?
thank you.
--~--~-~--~~~---~--~~
You recei
May be it's time to make 1.6.0.4 version?
--~--~-~--~~~---~--~~
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,
А Смысл? В API вроде все по-русски написано, Все равно надо код
смотреть чаще, если что не понятно.
Вот в коде уже есть вопросы зачем
On Jan 5, 6:58 pm, Cyril CHARLIER wrote:
> Hi all,
>
> is there a way to translate the API or Doc to French ?
>
> I started a translation when it was version 1
Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { $super();
this.onComplete = this.options.onComplete;
this.frequency = (this.options.frequency || 2);
this.decay = (this.options.decay || 1);
}
I don't undestand...
Why Ajax.PeriodicalUpdater should inherit Ajax.Base propertie
You may use Packer at
http://dean.edwards.name/packer/
Better use Minifer (or don't use "Base62 encode" for Packer) and gzip
js files on you server.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Prototype: Core"
hello
I can't find in prototype.js function, that can load javascript such
as jsload
http://code.google.com/p/jsload/downloads/list
It may be very useful.
How about add to prototype "lite version" of this function?
--~--~-~--~~~---~--~~
You received this messag
Oh, Who would be a hero and make good scrollTo and smoothscroll code?
than will work on this example?
http://hostel6.ru/cht/js/
prototype.js">
Prototype ScrollTo
#red
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
sorry, for my english and thanks for your answer.
--~--~-~--~~~---~--~~
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 thi
var Prototype = {
//
ScriptFragment: ']*>([\\S\\s]*?)<\/script>',
//
}
May be next code would a little better?
var Prototype = {
//
ScriptFragment: ']*>(?:)?<
\/script>',
//
}
and for:
evalScripts: function() {
return this.extractScripts().map(function(script) { return
47 matches
Mail list logo