Misplaced Pages

XULJet

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Open-source JavaScript framework
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "XULJet" – news · newspapers · books · scholar · JSTOR (February 2018) (Learn how and when to remove this message)
XULJet
Final releaseXULJet-3.0.5 / September 7, 2011 (2011-09-07)
Written inJavaScript
Operating systemCross-platform
TypeJavaScript library
LicenseMIT License
Websitehttps://code.google.com/p/xuljet/

XULJet was 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.

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.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

  1. "Implementations/XULJet - CommonJS Spec Wiki". wiki.commonjs.org. Retrieved 2018-09-08.

External links

Category: