Browse files

deprecate bindRefreshTo statement

  • Loading branch information...
1 parent e448869 commit 7a461876dd24884351d63edeb4937b8bb2af2208 @jakub-g committed Mar 4, 2013
View
10 src/aria/templates/ITemplate.js
@@ -90,8 +90,8 @@ Aria.interfaceDefinition({
$getFocusedWidget : function () {},
/**
- * Retrieves the currently focused widget, and extracts the widget Id and template Ids which combined form
- * the widget path. This is then set into a property of the templates context.
+ * Retrieves the currently focused widget, and extracts the widget Id and template Ids which combined form the
+ * widget path. This is then set into a property of the templates context.
*/
$setFocusedWidget : function () {},
@@ -233,8 +233,9 @@ Aria.interfaceDefinition({
* developper code. A call to this method is generated for the {/section} closing statement.
* @private
*/
- __$endSection : function () {},
+ __$endSection : function () {}
+ /* BACKWARD-COMPATIBILITY-BEGIN */,
/**
* Bind an automatic refresh to a section or the template. This method is intended to be called only from the
* generated code of templates (created in aria.templates.ClassGenerator) and never directly from developper
@@ -245,5 +246,6 @@ Aria.interfaceDefinition({
* @param {Number} linNumber
*/
__$bindAutoRefresh : function () {}
+ /* BACKWARD-COMPATIBILITY-END */
}
-});
+});
View
3 src/aria/templates/Statements.js
@@ -209,6 +209,7 @@ Aria.classDefinition({
out.writeln("this.__$statementOnEvent(", out.stringify(eventName), ",this.$normCallback(", callback, "),", statement.lineNumber, ');');
}
},
+ /* BACKWARD-COMPATIBILITY-BEGIN */
"bindRefreshTo" : {
inMacro : true,
container : false,
@@ -226,7 +227,7 @@ Aria.classDefinition({
}
out.writeln("this.__$bindAutoRefresh(", container, ", ", param, ", ", statement.lineNumber, ");");
}
- },
+ },/* BACKWARD-COMPATIBILITY-END */
"if" : {
inMacro : true,
container : true,
View
12 src/aria/templates/TemplateCtxt.js
@@ -24,7 +24,8 @@
var methodMapping = ["$refresh", "$getChild", "$getElementById", "$focus", "$hdim", "$vdim", "getContainerScroll",
"setContainerScroll", "__$writeId", "__$processWidgetMarkup", "__$beginContainerWidget", "$getId",
"__$endContainerWidget", "__$statementOnEvent", "__$statementRepeater", "__$createView", "__$beginSection",
- "__$endSection", "__$bindAutoRefresh", "$setFocusedWidget", "$getFocusedWidget"];
+ "__$endSection", /* BACKWARD-COMPATIBILITY-BEGIN */"__$bindAutoRefresh",/* BACKWARD-COMPATIBILITY-END */
+ "$setFocusedWidget", "$getFocusedWidget"];
// list of parameters to map between the template and the template context
var paramMapping = ["data", "moduleCtrl", "flowCtrl", "moduleRes"];
@@ -280,7 +281,10 @@
INVALID_STATE_FOR_REFRESH : "Error in template '%1': calling $refresh while the template is being refreshed is not allowed.",
SECTION_OUTPUT_NOT_FOUND : "Error while refreshing template '%1': output section '%2' was not found.",
VAR_NULL_OR_UNDEFINED : "Template %2 \nLine %1: expression is null or undefined.",
+ /* BACKWARD-COMPATIBILITY-BEGIN */
SECTION_BINDING_ERROR_SINGLE_VAR : "line %1: Cannot bind section to single variable except data. Binding must be something like container.parameter",
+ BINDREFRESHTO_STATEMENT_DEPRECATED : "Template '%1', line %2:\nThe {bindRefreshTo} statement is deprecated. It will be removed in Aria Templates 1.5.1. Please use 'bindRefreshTo' property of a {section} statement instead.",
+ /* BACKWARD-COMPATIBILITY-END */
SECTION_MACRO_MISUSED : "Template %1 \nline %2: section statement must either be a container or have a non-null macro property.",
TEMPLATE_EXCEPTION_REMOVING_LISTENERS : "Error in template '%1' while removing module or flow listeners.",
TEMPLATE_NOT_READY_FOR_REFRESH : "Error in template '%1': the $refresh method was called, but the template is not yet ready to be refreshed.",
@@ -1638,8 +1642,9 @@
}
},
+ /* BACKWARD-COMPATIBILITY-BEGIN */
/**
- * Bind an automatic refresh to the template or section
+ * [DEPRECATED] Bind an automatic refresh to the template or section
* @private
* @implements aria.templates.ITemplate
* @param {Object} container object containing the parameter a section or template is bound to, or data
@@ -1648,6 +1653,8 @@
*/
__$bindAutoRefresh : function (container, param, lineNumber) {
+ this.$logWarn(this.BINDREFRESHTO_STATEMENT_DEPRECATED, [this.tplClasspath, lineNumber]);
+
// de not register for partial refresh if section is not in the refresh
if (this._out._currentSection) {
var boundCfg = {
@@ -1667,6 +1674,7 @@
this._out._currentSection.registerBinding(boundCfg);
}
},
+ /* BACKWARD-COMPATIBILITY-END */
/**
* Get the list of CSS classpath on which the template depends on
View
3 src/aria/templates/TmlClassGenerator.js
@@ -26,7 +26,8 @@ Aria.classDefinition({
this.$ClassGenerator.constructor.call(this);
// Load the Template specific statements
- this._loadStatements(["Library", "id", "on", "createView", "section", "@", "bindRefreshTo", "repeater"]);
+ this._loadStatements(["Library", "id", "on", "createView", "section", "@", "repeater"
+ /* BACKWARD-COMPATIBILITY-BEGIN */, "bindRefreshTo"/* BACKWARD-COMPATIBILITY-END */]);
// Redefine the protected parser
this._parser = aria.templates.TplParser;
View
3 src/aria/templates/TplClassGenerator.js
@@ -26,7 +26,8 @@ Aria.classDefinition({
this.$ClassGenerator.constructor.call(this);
// Load the Template specific statements
- this._loadStatements(["Template", "id", "on", "createView", "section", "@", "bindRefreshTo", "repeater"]);
+ this._loadStatements(["Template", "id", "on", "createView", "section", "@", "repeater"
+ /* BACKWARD-COMPATIBILITY-BEGIN */, "bindRefreshTo"/* BACKWARD-COMPATIBILITY-END */]);
// Redefine the protected parser
this._parser = aria.templates.TplParser;

0 comments on commit 7a46187

Please sign in to comment.