OK, yeah, that's what I figured you were looking for. I haven't seen anything like that, but it would be cool if it existed. Doesn't seem like it would be a "ton" of work (famous last words). Have you got any thoughts about how it might work across the sandbox bridges? I use the bridges and build the non-app sandbox stuff very much like a regular web app and create and expose certain functions via the bridges to/from the app and non-app sandbox, since all the direct air API access can only happen in the app sandbox.

I haven't really thought it out, but wondering if maybe you have. Maybe you're looking maybe for something that would just be used in the app sandbox and it'd be up to the end user to create the bridge stuff that they need?

- Jack


Andy Matthews wrote:
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