Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Add forEach(), map(), reduce() to Sandbox array API


Replace 'a = has(a)? a: b' with 'a = or(a,b)'


Add or() to Sandbox utils API


Add no() to Sandbox utils API
The implementation of no() is located in, and is now used
instead of !is() in the base layer of the framework.


Project deleted by Legal-Box, moved to eric-brechemier
The project is now hosted at:


Upgraded jslint4java and JSLint, updated Ant macro
In new versions of JSLint, the meaning of options changed. The new options
were not supported by jslint4java, which we needed to upgrade too.

We updated the ant macro to define common options for all scripts.


Now using RequireJS to manage module dependencies
All modules in source and unit tests have been converted to use the CommonJS
Asynchronous Module Definition format expected by RequireJS.

Tests page for each module have been modified to use RequireJS to load modules
dynamically, based on dependencies declared in each module.

The "all tests" page for the combined/minified script uses an alternate
implementation of CommonJS AMD, located in src/amd/define.js. We developed this
null implementation does not load modules; it only runs the factory functions
registered in define() calls with expected arguments.

We modified the build process to use the RequireJS optimization tool, which
looks up dependencies in each module by parsing the script files. RequireJS
itself is not included in the combined script; it is replaced with our lighter
alternative "amd/define".

Both the combined (lb-full.js) and the minified (lb-min.js) scripts maintain
the backward compatibility with existing projects: each module still registers
itself in a namespace hierarchy in the global variable

In addition, modules can now be loaded dynamically; lb modules must be prefixed
by "lb/", e.g. "lb/lb.core.application" in define() and require() calls.


Moved Ant macros to a separate file to facilitate reuse


Removed Combiner tool, cleaned-up build script
The Combiner tool was no longer used: because it fails to order dependencies
correctly, it was replaced with concat.


Upgraded Closure Library to add support for IE9
The parts of Google Closure Library included so far were dated from a version
nearly one year old, using browser detection to trigger specific behaviors for
IE, no longer relevant in IE9. Exceptions have been put in place in this
updated version, but the fix still relies on browser detection, and a new
upgrade will be require to support future versions of IE.


Enhancement: speed up build using jslint4java
I added jslint4java by Dominic Mitchell, and defined an updated macro to check
either a single file or all JavaScript files in a directory.

The old macro used to fork the VM and spawn a different process for each file
to check, which was very long. The new macro is much faster, which reduces the
whole build to about 30s.


Enhancement: return null when function fails in getString


Fixed build: removed duplicate script in combine task$
Thanks to rumpl [1].

[1] rumpl (Djordje Lukic)


Modular Sandbox API using Sandbox Builder and Plug-ins
It is now possible to customize the Sandbox API by defining a custom Sandbox
Builder and loading a selection of pre-defined and custom plug-ins.


Fixed issue in build process on Windows (Cygwin/Mingw)


Avoid type coercion in module definition: override


Added has() and is() methods to Sandbox utils API
These two utilities are also used internally. has() checks for the existence of
a property, with a non-null, non-undefined value. is() does the same, and
verifies the type of the value as well. These two methods avoid relying on
type coercion or using the typeof operator, which is broken.

is() is based on the internal class of values, which reflects more accurately
the type of a value (e.g. 'array' instead of 'object' for arrays).


Parameter replacement in getString() is now recursive
Also, getString() is now used to replace parameters recursively in HTML
templates for internationalization.

I added an extension point in getString(): a function can be set as the value
of a parameter in language properties. This allows to customize a value, by
computing it based on param name, data for context, and language code, instead
of providing a fixed string value.


Bug fix: Fixed replacement of parameters in src and href in IE7
In IE7, the base location of the page was left at the start of the src and href
attributes, after replacement.

For example, a parameter #url# in a link href ended up as:
instead of

I applied a known fix which I had developed for the JavaScript
library: the base location of the page is removed from the start of the URL
before replacement. The fix is applied both to src and href attributes.


Bug fix: replaceParams() only sets nodeValue if different from existi…
…ng value

This change in the behavior of replaceParams() in base HTML templates avoids
triggering errors in IE when applying filters to an input element already
part of the DOM (as setting the nodeValue of the type attribute throws an
exception in this case).


Enhancement: log errors from filters in topDownParsing()
These logs help to catch errors when a filter fails for an unknown reason,
e.g. for the type attribute of input elements in IE, which can only be written
once, before the element is part of the DOM...

In order to reduce this kind of error, I will modify the behavior of the
replaceParams() filter in base HTML templates module, to set the new nodeValue
only when it differs from the previous nodeValue.


Enhancement: added explicit string conversion for Module
I declared toString() as an alias for getId(), which enhances log messages
printed for the failure of a module during startAll() or endAll().

This mechanism is flexible enough that if the failure is due to the module
being null undefined or the wrong kind of object, the native toString()
function is used instead.


Enhancement: catch and go on when a module fails to start
A failure occuring just before a module started (e.g. in the initialization
code of a custom widget) would prevent further start of following modules.
This is now taken care of.


Enhanced internationalization: fallback to language properties in tem…

In getString() and filterHtml(), values for the replacement of parameters may
now come either from the given data object, or if not found, from language
properties in the scope of given/selected language.

This enhancement is the fruit of several refactoring of i18n APIs in the
base modules. There is no change to the public Sandbox API.


Refactoring: moved filterHtml code to base i18n templates
This is a minor update, without any change in public API. The filterHtml()
method, which was only defined in the Sandbox API, is now available for reuse
at the core application level. We intend to use the method in an i18n widget,
for Legal-Box webmail.


Added support for internationalization (i18n)
This is a major version. I completed the support for i18n methods in the
Sandbox API:
- i18n.getLanguageList()
- i18n.getSelectedLanguage()
- i18n.selectLanguage()
- i18n.addLanguageProperties()
- i18n.get()
- i18n.getString()
- i18n.filterHtml()

Also, new in this version:
- added HTML index file in doc/ as entry point to the documentation
- enhancements and bug fixes in base modules for i18n and templates
- added hasAttribute() and constants in base dom module

In the next major version, I plan to add support for plugins to the Sandbox API
which should make it easier to extend and customize the API for the specific
needs of an application. I also intend to document the different extension
points of the library:
- configuration properties and custom factory
- custom modules with a custom sandbox
- Sandbox API plugins


Bug fix: language code comparison is now case-insensitive
This is a bug fix with reference to the documented behavior of the base i18n
API in the previous release (v1.4.1).


Refactored base i18n API: simpler yet powerful
This is an intermediate milestone release preparing support for


Added confirm method in sandbox.utils API


Added clearTimeout and getTimestamp in sandbox.utils API


Enhancement: disabled debug logs (too noisy in XHR)
Using goog.debug.Logger.ENABLE_HIERARCHY = false, the log level is
shared by all loggers. The base logger used to set the level ALL on its
instance of logger, which had the side effect of enabling very low-level
trace logs in Google Closure XhrIO and xhrMonitor.

I changed this log level to INFO, which is the level where all the
messages are logged using the sandbox or the base log module. This level
still allows to get warnings and errors logged by Google Closure module.


Bug fix: added content-type declaration in AJAX calls


added initElement() extension point for custom factories
This is an optional method for custom factories which is called before
a module starts with the box element as argument.

This extension points gives an occasion to initialize widgets for markup
already present in the page in the box for a module.


more lenient destroyEvent() now ignores custom events
I updated the destroyEvent() method in the base factory to do nothing
when the event is undefined or both expected methods are missing.

As a result, the default behavior is now to do nothing on custom events,
which provides a better default for custom factories.


Sandbox is now using factory to create/destroy listeners
Bug fix: the sandbox used to create and destroy listeners all by itself.
It is now correctly using the configured DOM factory to do it, as
expected. This change allows to replace the default behavior in a custom
factory, e.g. to manage different kinds of listeners for widgets.


fixes and updates in Google Closure (base,array,debug)


onHashChange listener can now be removed or replaced.


Minor additions in base DOM Listener


Major fixes in history manager and local navigation


Minor fix: replaced Combiner tool with concat task
There is an issue in version 0.0.1 of combiner, which does not preserve
the order of dependencies. I fallback to using the concat task, listing
all scripts in expect order explicitly. This is (hopefully) only a
temporary solution.


Introduction of Semantic Versioning
Under this set of conventions, the versions will be tagged as vM.m.b
  M a major version - adds backward incompatible functionality
  m a minor version - adds backward compatible functionality
  b a bug fix version - fixes bugs in the API without new functionality



Introduction of Semantic Versioning
Under this set of conventions, the versions will be tagged as vM.m.b
  M a major version - adds backward incompatible functionality
  m a minor version - adds backward compatible functionality
  b a bug fix version - fixes bugs in the API without new functionality

Something went wrong with that request. Please try again.