XULJet

XULJet
Stable release
XULJet-3.0.3 / September 5, 2011 (2011-09-05)
Development status Active
Written in JavaScript
Operating system Cross-platform
Type JavaScript library
License MIT License
Website https://code.google.com/p/xuljet/

XULJet is an open-source JavaScript framework for the Mozilla XULRunner run-time environment. It is intended for writing desktop applications in pure JavaScript.

XULJet provides a component architecture and user interface elements description inspired by Seaside. It implements some CommonJS specifications.[1]

Examples

Hello world in XULJet:

var xuljet = require('lib/xuljet');

var Main = function(aWindow)
{
  xuljet.Component.call(this, aWindow);
  this.message = "Hello World!";
}
xuljet.inherits(Main, xuljet.Component);

Main.prototype.render = function(xul)
{
    xul.vbox({flex: 1}, 
      xul.toolbox(
        xul.menubar(
          xul.menu({label: "File", accesskey: "f"},
            xul.menupopup(
              xul.menuitem({label: "Close", oncommand: "window.close()"}))))), 
      xul.vbox({align: "center", pack: "center", flex: 1}, 
        xul.description({bind: "desc"}, "Press the button"),
        xul.button({label: "OK", oncommand: function() {
          this["desc"].value = this.message}})),
      xul.statusbar(
        xul.statusbarpanel({flex: 1, label: 'Ready...'})))
  }
}

function main()
{
  var rootComponent = new Main(window);
  window.setTitle("XULJet");
  rootComponent.beMainWindowComponent();
}

See also

References

This article is issued from Wikipedia - version of the 9/11/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.