Changed JS extension support to be more flexible.
Review Request #5375 — Created Feb. 1, 2014 and submitted
This replaces the old
Extension.js_model_class
attribute with a list
ofJSExtension
subclasses stored inExtension.js_extensions
.Each
JSExtension
subclass lists a JS model class. It also has an
apply_to
field that works like those in bundles andTemplateHook
. If not
provided, the extension will be initialized on all pages.
get_js_model_data
has also moved toJSExtension
, renamed to
get_model_data
.Extensions taking advantage of
js_model_class
in the Djblets 0.8 alphas
will need to be updated for this change.
Updated the rbseverity extension for this change, taking advantage of
apply_to
, and saw the extension's initialization appear only on the
pages listed.
Description | From | Last Updated |
---|---|---|
This might be more readable as: return url_name in (self.apply_to or []) |
david |