Thanks Jack...that's not quite what I meant.

For example, even though the AIR method for minimizing a window to the
system tray is short:
nativeWindow.minimize();

It would be cool if this functionality was packaged up so that you
could apply the minimize method directly to an object. Here's what I
do now:

// this assigns the minimize functionality to the minimize button
$('#minimize').bind('click', function(event) {
        iface.minimize();
});

and here's how it could look:
// this assigns the minimize functionality to the minimize button
$('#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() {

        // shortcut to the nativeApplication object
        var app = air.NativeApplication.nativeApplication;
        app.addEventListener(air.Event.COMPLETE, iconLoadComplete);

        // create new instance of icon loader
        var iconLoader = new air.Loader();

//              these lines let me add a menu to the system tray.
//              we're not going to use this for now, but I want to keep it 
around
//              icontray.menu = new air.NativeMenu();
//              var exitCommand = icontray.menu.addItem(new air.NativeMenuItem
("Exit Bullhorn"));
//              exitCommand.addEventListener(air.Event.SELECT, winmgr.close);

        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";
                // app.icon.menu = icontray.menu;
        }

//              if(air.NativeApplication.supportsMenu) {
//                      app.menu.addSubmenu(icontray.menu, "Windows");

        function iconLoadComplete(event) {
                app.icon.bitmaps = new runtime.Array
(event.target.content.bitmapData);
        }

}


Anyway...I might start writing one, but would love to get input from
others who would be interested in helping out.




On Jun 12, 11:52 am, Jack Killpatrick <j...@ihwy.com> wrote:
> This may be of interest, though it's not jQuery encapsulation, it does
> provide an abstraction layer:
>
> http://www.activerecordjs.org/index.html
>
> I've been using the ActiveRecord js implementation in AIR for a while
> now and it's proven to be solid so far:
>
> http://www.activerecordjs.org/record.html
>
> - Jack
>
>
>
> Andy Matthews wrote:
> > Does anyone know of a plugin for jQuery that encapsulates some, or
> > all, of the AIR API?
>
> > andy

Reply via email to