XULJet
Encyclopedia
XULJet is an open-source
Open-source software
Open-source software is computer software that is available in source code form: the source code and certain other rights normally reserved for copyright holders are provided under a software license that permits users to study, change, improve and at times also to distribute the software.Open...

 JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 framework
Software framework
In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by user code, thus providing application specific software...

 for the Mozilla XULRunner
XULRunner
XULRunner is a runtime environment developed by the Mozilla Foundation to provide a common back-end for XUL-based applications. It replaced the Gecko Runtime Environment, a stalled project with a similar purpose....

 run-time environment. It is intended for writing desktop applications in pure JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

.

XULJet provides a component architecture and user interface
User interface
The user interface, in the industrial design field of human–machine interaction, is the space where interaction between humans and machines occurs. The goal of interaction between a human and a machine at the user interface is effective operation and control of the machine, and feedback from the...

 elements description inspired by Seaside. It implements some CommonJS
CommonJS
CommonJS is a project with the goal of specifying an ecosystem for JavaScript outside the browser . The project was started by Kevin Dangoor in January 2009 and initially named ServerJS....

 specifications.

Examples

Hello world
Hello world program
A "Hello world" program is a computer program that outputs "Hello world" on a display device. Because it is typically one of the simplest programs possible in most programming languages, it is by tradition often used to illustrate to beginners the most basic syntax of a programming language, or to...

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;
}

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK