andyMatthews.net

jQuery and AIR: AIR methods abstracted into jQuery plugin

Before getting your hopes up, no this isn't a post with real code, or even pseudo code. It's meant more of a challenge, either to myself, or to someone else, to take this idea and run with it. You know about my love for jQuery and AIR and so don't take this as a complaint. AIR (with jQuery) makes it easy for traditional web developers to build high impact desktop applications. But it could be even easier. Take the following examples...

Even though the AIR method for minimizing a window to the system tray is short:


nativeWindow.minimize();

It still has to be bound to something:

$('#minimize').bind('click', function(event) {
	iface.minimize();
});

Wouldn't it be cool if you could do something like this:

$('#minimize').air('minimize');

Obviously that's not a great example, but the code for adding a menu to an icon running in the task bar is much lengthier. You can see how this might benefit from an abstraction layer:


setupIconTray: function() {
	var app = air.NativeApplication.nativeApplication;
	app.addEventListener(air.Event.COMPLETE, iconLoadComplete);
	var iconLoader = new air.Loader();
	if(air.NativeApplication.supportsSystemTrayIcon){
		iconLoader.contentLoaderInfo.addEventListener(air.Event.COMPLETE,iconLoadComplete);
		iconLoader.load(new air.URLRequest("images/AIRApp_16.png"));
		app.icon.addEventListener(window.runtime.flash.events.MouseEvent.CLICK, this.restore);
		app.icon.tooltip = "Shrinkadoo";
	}
	function iconLoadComplete(event) {
		app.icon.bitmaps = new runtime.Array(event.target.content.bitmapData);
	}
}

Possibly it could look something like this:

$.air('addToIconTray',{
	iconLoadComplete: fn,
	restoreFromTray: fn,
	trayIcon: "images/AIRApp_16.png",
	trayTooltip: "Shrinkadoo"
});

So, dear readers, tell me. Does something like this already exist? Would anyone care to create it on their own? I've yet to try my hand at writing a jQuery plugin, but this could be the time to start. I can do it on my own, but I'd love some input, guidance, spiritual assistance, etc. How about a Google code project that can be shared amongst interested developers? Let's do it!

Chaussures Nike Pas Cher, Nike Air Force 1 Pas Cher, Nike Air VaporMax Pas Cher, Nike Air VaporMax Flyknit 3 Pas Cher, Nike Air VaporMax Plus Pas Cher, Nike Air VaporMax 360 Pas Cher, Nike Air VaporMax 2020 Pas Cher, Nike Air VaporMax 2021 Pas Cher, Nike Air VaporMax EVO Pas Cher, Nike Air Max Pas Cher, Nike Air Max 90 Pas Cher, Nike Air Max 95 Pas Cher, Nike Air Max 97 Pas Cher, Nike Air Max 2021 Pas Cher, Nike Air Max TN Pas Cher, Nike Air Max Plus Pas Cher, Nike Air Max Plus 3 Pas Cher | Zapatillas Nike Baratas, Nike Air Force 1 Baratas, Nike Air VaporMax Baratas, Nike Air VaporMax Flyknit 3 Baratas, Nike Air VaporMax Plus Baratas, Nike Air VaporMax 360 Baratas, Nike Air VaporMax 2020 Baratas, Nike Air VaporMax 2021 Baratas, Nike Air VaporMax EVO Baratas, Nike Air Max Plus Baratas, Nike Air Max Plus 3 Baratas, Nike Air Max 90 Baratas, Nike Air Max 97 Baratas, Nike Air Max 95 Baratas, Nike Air Max 1 Baratas