CHANGES

1.0 (2013-05-19)

  • Obviel 1.0 final! The code is identical to Obviel 1.0rc1.

1.0rc1 (2013-05-15)

  • Upgrade Obviel to work with jQuery 1.9.1. This didn’t affect much code except Obviel Template, which had a minor bug, and Obviel Forms.

    Obviel Forms had bigger problems as jquery-datalink breaks in modern versions of jQuery. To this end src/dependencies now contains a fixed version of jquery.datalink.js that you can use to make forms work again with a modern version of jQuery. On the longer term we’re looking to replace jquery.datalink with a better system for data binding.

    We also noticed that the optional jquery.ba-bbq dependency for dealing with browser hashchanges was incompatible with jQuery 1.9. Included is a fork of jquery.ba-bbq from https://github.com/joshlangner/jquery-bbq that fixes this incompatibility.

  • Fix an occasional test failure due to ordering issues in the tests for Obviel Forms.

  • Expose obviel.forms.defaultErrorAreaView so it can be re-registered with obviel.view during test cleanup (in case a test registered its own).

  • Add an obviel.unregisterView function which can be used to remove existing view registrations.

  • use ‘.on’ to bind events instead of ‘.bind’, in Obviel core and Obviel Template. This fixes at least one issue where ‘keyup’ events were not being handled with data-on on a textarea in FireFox, triggered by a user (the issue didn’t exist with firing with trigger).

  • Throw away some dependencies (datalink, qunit) that weren’t in use (anymore).

  • Add passwordField to Obviel Forms, which renders using <input type="password">. Otherwise it is like textlineField. Thank you Sjoerd van Elferen.

  • Add @repeat.first and @repeat.last variables. These are true when first/last in the repeat loop and can be used with data-if. Thank you Rob Gietema.

  • Named views didn’t work in data-render in combination with @., made it work. Thank you Michal Gajek for reporting this bug!

1.0b6 (2013-04-04)

  • Backwards incompatible! Template language renaming. The general pattern is to use imperative verbs where possible for directives (though data-on is an exception):

    • data-each was renamed to data-repeat and @each to @repeat.
    • data-view becomes data-render, as it really calls Obviel’s render() function to render an object.
    • data-func becomes data-call, as it really calls a function on the view.
    • data-handler becomes data-on as its shorter and on typically implies event handling.

    A simple search and replace in your templates for these names should be enough to update your templates.

  • If a dynamic class was in use (class=”{foo}”) this could break data-id, data-src, data-unwrap and data-el. Thanks to Daniel Havlik (nilo) for identifying the problem and providing a fix!

  • Start of sync documentation. Still science fiction though - implementation is lagging behind API changes in docs.

  • A cooldown feature for Obviel Forms controls which allows you to state a period of time in ms in which the button is unresponsive after clicking it first. This is useful in preventing fast multiple clicks.

  • A few documentation tweaks.

1.0b5 (2013-01-18)

  • The default HTTP error hook shouldn’t do an alert; it’s now quiet.
  • Fix a bug in obviel forms that caused errors not to be displayed properly for fields in Internet Explorer.

1.0b4 (2013-01-09)

  • the autocomplete widget was not sending ‘change’ events correctly when the autocomplete field received the ‘blur’ or ‘close’ event. With previous jQuery versions this was okay, but this broke with jQuery 1.7.x.
  • new functionality to set an httpErrorHook function, which is called when a HTTP error occurs when a URL is resolved using .render(). It is called with an xhr (jqXHR) object as the first argument.
  • The httpErrorHook functionality is also used by the autocomplete widget when a URL is in use as a data source.
  • The httpErrorHook functionality is also used by the validationUrl option for Obviel forms.
  • Now correctly make deferred returned by .render() fail when there is a problem resolving URLs during rendering, including when sub-views are in use.

1.0b3 (2012-12-06)

  • Switch to the Buster.JS test framework and the Sinon.JS mocking library. See the development documentation for more information.
  • obviel-forms now uses Bootstrap CSS classes. If Bootstrap CSS is included on a page, the forms will render with pretty form widgts.
  • Removed js.obviel Fanstatic packaging. Instead moved this to a separate project, just like other Fanstatic projects.
  • Make option:value configuration within JSON-Templates possible. (using fromString instead of using the Template constructor). You may need to upgrade to the latest version of JSON-Template (now included in src/dependencies) to make this work.
  • Upgraded JSON-Template in src/dependencies to the latest version (0.85).
  • Beginnings of Obviel Sync. This is as yet undocumented and incomplete, but the goal is to allow the developer to define declaratively how client models (and UI updates) interact with the server models.

1.0b2 (2012-07-19)

  • GREAT RENAMING: this one breaks backwards compatibility! Any names previously using under_scores now use camelCase, to better follow JavaScript conventions. This means your previous Obviel code will break. In particular:

    • html_url, jsont_url and obvt_url are now htmlUrl, jsontUrl and obvtUrl.
    • object_events becomes objectEvents.
    • API functions are also camel-case now, i.e. registerFormatter instead of register_formatter.
    • Form field names are now camel-case, so inputField, textlineField, textField, integerField, floatField, decimalField, booleanField, choiceField, displayField, hiddenField, datapickerField, autocompleteField.
    • validationUrl instead of validation_url for forms.
    • maxLength, minLength, maxLength, allowNegative, minBeforeSep, maxBeforeSep, minAfterSep, maxAfterSep, emptyOption, for widgets.

    In general you can straightforwardly translate under_score to camelCase everywhere.

    There are a few exceptions. _ is of course still to mark translations. Constants such as NAME_TOKEN also keep the underscore. We also recommend that if you have a variable named after a translation domain (i.e. en_US) you keep the underscore as well. Finally in Obviel template it is still used to refer to special variables when you loop through a dotted name (i.e. {@each.something_persons.number} if you are looping through something.persons.

    If you use Emacs you can translate the underscores to camelcase in a file automatically, using the following command:

    M-x replace-regexp
    Replace regexp: \(\w\)_\(\w\)
    with:           \1\,(upcase \2)
  • Backwards compatibility: $(el).render(obj) now returns a jQuery promise. This is a more modern alternative for the callback argument. To track whether a view is done rendering you can hook in with .done. The callback argument has been removed, breaking backwards compatibility. You can rewrite:

    $(el).render(obj, function() { this.el });
    

    to this:

    $(el).render(obj).done(function(view) { view.el });
    

    A view is only considered done rendering (its promise will be resolved) when all its data-view sub-views have been resolved too.

  • Backwards compatibility: previously when you implemented render in a view, it could optionally receive a number of arguments (el, obj, name, callback, errback). callback and errback have been removed. el, obj and name have been available already on this, and these are the preferred way to access them.

    This change also affects the cleanup method; if you implement it, it will not receive the el, obj, name arguments anymore.

  • Unfortunately <element>, <attribute> and <block> did not work well in IE. Instead you can now use data-el, data-attr and data-unwrap on any DOM element.

  • Introduce data-handler directive to hook up events directly from template. With Obviel, this will hook up events to view directly.

  • The template constructor now accepts templates that consist of multiple elements on top (“<p>first</p><p>second</p>”). It also accepts templates that are a piece of text and an element following (“text<p>following</p>”) or are an element followed by a piece of text (“<p>first</p>followed”).

  • Templates can be inlined in a <compilerName>Script section in the HTML document.

  • Fix a bug in data-id generation where data-id="not_a_variable" wasn’t correctly handled.

  • Change Obviel to be compatible with jQuery 1.7.2. There were two issues:

    • Obviel relied on document-level event handlers to be triggered even for disconnected events.
    • Obviel Forms used a cargo-culted pattern for sending ‘change’ events; replaced this with shorter el.trigger(‘change’).
  • While Obviel may continue to work with older jQuery versions for a while, we’re going to target jQuery 1.7.2 now for our testing.

  • the json2 dependency, which takes care of JSON generation compatibility for Internet Explorer, has been moved to the dependencies directory out of the Obviel directory; this is where it belonged all along.

  • Formatters and funcs can now be more flexibility plugged into Obviel Template, just like translations and event handlers. Obviel core makes use of this by looking up formatters and funcs on the view first, then if it cannot be found there, in the global registries.

  • Improved i18n infrastructure for translations. See the i18n documentation for more information.

  • Pluralization support both in JavaScript and in Obviel Templates. See i18n documentation for more information.

  • use Pygments to highlight HTML and JavaScript snippets properly in the docs.

  • Rewritten compiler loading and caching infrastructure. Caching has been generalized and improved. Also helps prepare for better template error reporting.

  • When an error happens during Obviel template rendering the exception will be logged to the console with location information to help with debugging.

  • You can optionally return a jQuery promise from a view’s render method. If you do, subview rendering and view rendering completion waits until that promise is resolved.

  • When there is a CompilationError or RenderError in an Obviel template, log error on console detailing iface, template and xpath in template where error occurred.

  • Added missing API docs for element.rerender(), element.view(), element.parentView() and element.unview().

  • Use mockjax for cleaner AJAX testing.

  • Remove pyobviel, obviel-datatables and obvielts. These were unfinished and can always be resurrected at some point in the future.

  • the src attribute is like the id attribute special in that it may not be directly used with variables in a template. This is because an image src for instance is directly loaded as soon as the template is parsed, and this does not work with variables and will result in a network error. Instead we force the developer to use data-src to set the src attribute, just like we force the developer to set data-id.

  • traject is now placed in the obviel namespace for consistency with the other modules. It can still be used stand-alone, however.

  • Fixed a bug where data-view could not be used with URLs.

  • Changed documentation theme.

  • Updated documentation for clarity in various areas.

1.0b (2012-05-31)

  • Added Obviel Template language implementation. This replaces JSON-Template as Obviel’s preferred template language. Obviel Forms makes use of it internally. Obviel Template supports features such as sub-views and i18n. See the Obviel Template documentation for more detail.
  • i18n documentation: how to do i18n with Obviel.
  • Added Traject library. This library allows routing of paths to objects and the inverse: constructing paths for objects. See the Traject documentation for more detail.
  • Added transformer hook. This allows Obviel to transform content it retrieves from the server using URLs and hyperlinks.
  • Added object_events structure, allowing you to declare events on the object the view is rendering. Also introduce rerender method on view.
  • Added before hook to views. You can now pass a before function when configuring a view. This function will be called before rendering (including before template rendering). This is useful to manipulate this.obj to add extra information before the template is rendered.
  • Obviel Forms now uses a special view for the iface obviel_forms_error_area to render error areas. You can define a view and render your own error area. In this view create an element with id this.obj.field_error_id to hold the field error message, and an element with id this.obj.global_error_id to hold the global error message.
  • Obviel Forms now sends an event soon as an error message is set or cleared. The event names are field-error.obviel-forms, field-error-clear.obviel-forms, global-error.obviel-forms, global-error-clear.obviel-forms. The events are sent to the element on which the error message is rendered, and will bubble up (so you can catch them on a higher level). The target property of the event will also have a reference to the element on which the message was set.

0.11.1 (2012-01-14)

  • Last release changed the obviel forms translation domain from obviel_forms to obviel-forms, but forgot to adjust the forms code to take this into account.

0.11 (2012-01-13)

  • Added js.obviel Fanstatic integration.
  • Added Python-based obvielts test server for testing Obviel with a “live” test server.
  • Included jslex_prepare script to help with i18n process. See updated doc/i18n.txt for notes.
  • Updated translations to include support for obviel-forms-datepicker and obviel-forms-autocomplete.

0.10 (2011-11-04)

  • Obviel models may now have an iface or an ifaces property, but not both. ifaces may be a string instead of an array. This makes the common mistake to make a model object with iface not a mistake anymore.
  • Update test dependencies to newer version of jQuery and jQuery-ui. These are also used by the demo code. Made it so that the version number of dependencies not in the URL anymore, so that it’s easier to update in the future.
  • Included datatables as a dependency, though haven’t integrated code using it yet.
  • Add Obviel patterns multi, event and redirect to new obviel-patterns.js. See the pattern demo page in the documentation for a demo of these.
  • Integrate support for simple jGrowl messages in obviel-jgrowl.js; see the pattern demo page for examples.
  • Reorganized directory structure: everything, including tests and demos are in ‘src’ now, which in turn is included in the documentation so we can link to demos (and its dependencies) from there.

0.9.1 (2011-11-03)

  • Include form demo in documentation.

0.9 (2011-11-02)

Initial public release.