[Prototype-core] onHashChange implementation?

2009-12-18 Thread Ngan Pham
Are there any plans for prototype to implement and standardize the
onHashChange call back?
https://developer.mozilla.org/en/DOM/window.onhashchange

IE8, Firefox 3.6 supports it

I think this would be a good tool to have and since browsers are slowly
implementing it--we can check for it existence.  I believe the best way to
implement this is to check the URL every X milliseconds.  The great thing
about this is that we don't have to actually set up this checking until
there is an observe placed on window: window.observe('hashchange', ...)
reallysimplehistory does a good job with this (
http://code.google.com/p/reallysimplehistory/)

I'm going to be to implementing something like this for my project soon, and
was wondering if there is something planned, or if prototype would like to
have this addition?

Thanks.

-- 
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en

Re: [Prototype-core] Support full HTML set in (un)escapeHTML

2009-11-20 Thread Ngan Pham
I came across this problem myself.  I think prototype should provide some
type of API for things like this.  In all my apps, I have a prototype_ext.js
file that make small modifications/enhancements to prototype.  It would be
nice to be able to do something like this:

prototype_ext.js:
Prototype.HTMLEntities.add('blah;', '0x0039');
or
Prototype.HTMLEntities.add({
  'foo;': '0x0039',
  'bar;': '0x0040'
});

Kind of like Rails and its custom inflections.

On Fri, Nov 20, 2009 at 12:47 PM, disccomp discc...@gmail.com wrote:

 I was using unescapeHTML when I noticed that it was missing many of
 the encoded characters in this string I passed it. I went and checked
 the code, it seems that these functions only deal with about 3 out of
 hundreds of characters. quot; #39; for example.

 I came across a script which handles the named entities, maybe we can
 build on it: http://pastie.org/708114

 Ideas, thoughts, complaints?

 --
 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
 For more options, visit this group at
 http://groups.google.com/group/prototype-core?hl=en

-- 
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en

[Prototype-core] Element#insert taking multiple contents

2009-11-05 Thread Ngan Pham
Would it be reasonable to implement it so that Element.insert takes as many
content as you pass it?  This will exclude insertion points of course...

container.insert(part1);
container.insert(part2);
container.insert(part3);

would be:

container.insert(part1, part2, part3);

Thanks.

--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Multiple eventName's for Event observe?

2009-10-22 Thread Ngan Pham
It would be nice if Event#observe's eventName argument was able to take an
array, or perhaps a comma delimited string so that it can attach to multiple
events in one call:
Event.observe(something, 'keyup,mouseup', this.blah.bind(this));
or
Event.observe(something, ['keyup', 'mouseup'], this.blah.bind(this));

--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Event#element deprecated?

2009-10-06 Thread Ngan Pham
Sorry for getting off topic, but I completely agree with Jim.  I'm currently
writing a complicated WYSIWYG editor and one of the annoyances I'm faced
with is the fact that only elements are able to fire events.  This makes my
Models use the window.document element to fire/observe events.

On Tue, Oct 6, 2009 at 1:00 AM, Jim Higson j...@wikizzle.org wrote:


 On Tuesday 06 October 2009 08:09:21 Tobie Langel wrote:
  Finally, Sam is working on a new API for event delegation in 1.7 /
  2.0. If changes are to be made, they should be discussed once he's
  posted his initial implementation.

 If I could suggest...

 The biggest problem with events at the moment is only Elements can fire
 them.
 This makes MVC difficult because the Model (javascript objects) not the
 view
 (HTML elements) would ideally fire the events.

 For Prototype2, maybe there should be an observable mixin. When mixed in,
 any
 object can fire events.

 Jim

 --
 Jim
 my wiki ajaxification thing: http://wikizzle.org
 my blog: http://jimhigson.blogspot.com/

 


--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Event#element deprecated?

2009-10-06 Thread Ngan Pham
Thanks Tobie!  That is a very nice way of doing it.
Many thanks to you and the prototype team for making something, for free,
for everyone to use and putting up us (well, me). :-)

On Tue, Oct 6, 2009 at 9:57 AM, Tobie Langel tobie.lan...@gmail.com wrote:


 Jim, Ngan.

 This is already possible with our current event system using the
 `document` object as broker.

 Please see a basic, untested implementation here:

 http://gist.github.com/203193

 If you ant to discuss this in more details, please do kindly start
 another thread.

 Thank you.

 Tobie
 


--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Event#element deprecated?

2009-10-05 Thread Ngan Pham
I just found out that Event#findElement == Event#element if no arguments are
passed in.
On Mon, Oct 5, 2009 at 8:55 AM, Ngan nganp...@gmail.com wrote:


 Hi everyone,

 In the new docs, it says that Event#element is deprecated.  Is there a
 reason for this? The doc says to use Event#findElement instead.
 However, this doesn't give you the exact element the effect originated
 from.  Or are we having to go back to using target and srcElement?

 Thanks!
 


--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Event#element deprecated?

2009-10-05 Thread Ngan

Hi everyone,

In the new docs, it says that Event#element is deprecated.  Is there a
reason for this? The doc says to use Event#findElement instead.
However, this doesn't give you the exact element the effect originated
from.  Or are we having to go back to using target and srcElement?

Thanks!
--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Private methods for prototype class

2009-09-10 Thread Ngan

Hi, I apologize if this question has been asked before. I've tried
googling for this, but did find a good answer.

What's the best way to have private methods using prototype's
Class.create?

I've tried...

var Worker = Class.create((function() {
  function initialize() {
this.someVar = var;
privateMethod();
  }

  function publicMethod() {
privateMethod();
  }

  function privateMethod() {
console.info(this.someVar);
console.info(this)
  }

  return {
initialize: initialize
  };
})());

Running this will give me:
console.info(this.someVar)  #= undefined
console.info(this.someVar)  #= DOMWindow

However:
aWorker = new Worker();
aWorker.publicMethod() #= WORKS!

Thank you for your time!
--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Private methods for prototype class

2009-09-10 Thread Ngan

opps, i had typo.  return should be:

return {
  initialize: initialize,
  publicMethod: publicMethod
}

On Sep 10, 9:37 am, Ngan nganp...@gmail.com wrote:
 Hi, I apologize if this question has been asked before. I've tried
 googling for this, but did find a good answer.

 What's the best way to have private methods using prototype's
 Class.create?

 I've tried...

 var Worker = Class.create((function() {
   function initialize() {
     this.someVar = var;
     privateMethod();
   }

   function publicMethod() {
     privateMethod();
   }

   function privateMethod() {
     console.info(this.someVar);
     console.info(this)
   }

   return {
     initialize: initialize
   };

 })());

 Running this will give me:
 console.info(this.someVar)  #= undefined
 console.info(this.someVar)  #= DOMWindow

 However:
 aWorker = new Worker();
 aWorker.publicMethod() #= WORKS!

 Thank you for your time!
--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Private methods for prototype class

2009-09-10 Thread Ngan Pham
Ah! thank you! sorry for the inconvenience!

On Thu, Sep 10, 2009 at 10:04 AM, T.J. Crowder t...@crowdersoftware.comwrote:


 Hi Ngan,

 This question is probably more appropriate for the user's group[1],
 rather than the core development group.  If you'll repost over there,
 there are a couple of things to point out in that stuff...

 [1] http://groups.google.com/group/prototype-scriptaculous
 --
 T.J. Crowder
 tj / crowder software / com
 www.crowdersoftware.com


 On Sep 10, 5:39 pm, Ngan nganp...@gmail.com wrote:
  opps, i had typo.  return should be:
 
  return {
initialize: initialize,
publicMethod: publicMethod
 
  }
 
  On Sep 10, 9:37 am, Ngan nganp...@gmail.com wrote:
 
 
 
   Hi, I apologize if this question has been asked before. I've tried
   googling for this, but did find a good answer.
 
   What's the best way to have private methods using prototype's
   Class.create?
 
   I've tried...
 
   var Worker = Class.create((function() {
 function initialize() {
   this.someVar = var;
   privateMethod();
 }
 
 function publicMethod() {
   privateMethod();
 }
 
 function privateMethod() {
   console.info(this.someVar);
   console.info(this)
 }
 
 return {
   initialize: initialize
 };
 
   })());
 
   Running this will give me:
   console.info(this.someVar)  #= undefined
   console.info(this.someVar)  #= DOMWindow
 
   However:
   aWorker = new Worker();
   aWorker.publicMethod() #= WORKS!
 
   Thank you for your time!
 


--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] mouseenter and mouseleave events don't fire when an element is resized from under it.

2009-08-26 Thread Ngan

I'm only having problems with mouseleave (mouseenter doesn't concern
me as much).  If an element is resized to be smaller and the mouse is
no longer over the element, the element fails to fire a mouseleave
event.  I've tested this in FF 3.5x, Safari 4.0.3, and IE8.  IE8 works
properly, but FF and Safari does not.

Is this a bug? or how it's suppose to be?

Thanks!
--~--~-~--~~~---~--~~
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
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---