Posts

Showing posts with the label events

Introducing ObjectHandler

since the discussion about a better Function#bind will probably never end, and since a must have dependency would be the ES6 WeakMap which is in any existent shim leak prone due lack of control via ES5+, I have proposed another way to solve the problem. ObjectHandler IDL Like /** * interface ObjectHandler implements EventListener { * void handleEvent(in Event evt); * void remitEvent(in Event evt); * attribute Object events; * }; * * @link http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener */ var ObjectHandler = { handleEvent: function handleEvent(e) { var events = this.events, type = e.type ; if (events.hasOwnProperty(type)) { events[type].call(this, e); } }, // it could be called removeEvent too, as you wish remitEvent: function cancelEvent(e) { e.currentTarget.removeEventListener( e.type, this, e.eventPhase === e.CAPTURING_PHASE ); } }; Above ob...

Android DOM "Finger" Events

Image
This is the Android based device I am talking about and the installed software is version 1.6, apparently with multi-touch support for more recent devices so mine is not the case. Disclaimer The reason I am writing this post is my attempt to reproduce the Android OS interface via browser, hilariously possible with every browser except the original one: the WebKit in Android. Why would I do that? The mouse has been around for ages, thanks Xerox, but later these years we've seen so many touch screen based devices without common mouse pattern. Since I think both Android, iPhone, and others, have done an excellent work with the way we use the device UI I thought: Why not! It could be a great time to start analysis and piece of libraries to replicate in a cross browser way some device independent event. Well, as I've already said, and as you'll see next, right now it is not possible! Mouse Events .. ahem, Finger Events Every mouse related event we know does not make much sense ...

W3 HTML5 Storage - What Works, What Does Not

My last sessionStorage is basically ready to implement storage events but apparently I cannot implement them right now. Why not? Doing some test I just discovered a lot of inconsistency for each browser which supports Web Storage in core, so here I am with a little report and some suggestion. The Correct Way To Set or Get Items Every single example I've read so far about Web Storage is not respecting standards defined by the official draft , even if related browsers respect the official API. // bad sessionStorage usage example if(sessionStorage.myKey !== null){ // not implementable with old browsers // it could inherit from a modified Storage prototype // it could be a false positive with native API } else { sessionStorage.myKey = "myValue"; // requires getter/setter, improbable with other browsers // it could overwrite native properties or methods // sessionStorage.key = "value"; will *break* the object }; // W3 standard sugges...

ExtJS And The Bloody TreePanel Arrow

First of all I am sorry for choose title, but I kinda lost dunno how many minutes to figure out what was wrong , and it was not me ! Please let me try to explain what was the requirement, and how I had to force ExtJS to act as I want, version 2.2.1 or 3.0RC2 , it does not matter. The Problem ... The reason you or your company choose ExtJS is most likely because of its Office $uite / Window$ look and feel, closer than many others to a proper Desktop Application, perfect under Adobe Air, and one step forward about stability, performances, and documentation, even with the old enemy: Internet Explorer 6 . Fair enough, it's a good library but, there is always a but, at the same time it does not replicate 100% same Window$ behaviors. As example, try to click Start and Run a prompt command, explorer . This is the typical Window$ file browser, something we deal with since ages, something still a user habit. ... In Details How does it work? It is really simple, we have a representation of o...