UNPKG

zpt

Version:

Zenon Page Templates - JS (ZPT-JS)

602 lines (548 loc) 27.9 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>ZPT-JS change log</title> <script type="text/javascript" src="lib/zpt.min.js" defer></script> <script type="text/javascript" src="js/zpt.js" defer></script> <link rel="stylesheet" type="text/css" href="docs.css"> </head> <body> <div data-use-macro="'page@templates.html'"> <div data-fill-slot="'page-header'"> <h1>ZPT-JS change log</h1> </div> <article data-fill-slot="'article'"> <h2> 0.40.9 <span class="changes-date">3 Jun 2025</span> </h2> <ul> <li>Bug fixed: exception thrown when no i18n resource was found in i18nHelper.</li> </ul> <h2> 0.40.8 <span class="changes-date">26 May 2025</span> </h2> <ul> <li>Bug fixed: problem with npm solved.</li> </ul> <h2> 0.40.7 <span class="changes-date">1 May 2025</span> </h2> <ul> <li>Bug fixed: talOmitTag wasn't adding new nodes in the right position.</li> </ul> <h2> 0.40.6 <span class="changes-date">22 Dec 2020</span> </h2> <ul> <li>Bug fixed: talCondition did not update properly.</li> </ul> <h2> 0.40.5 <span class="changes-date">12 Dec 2020</span> </h2> <ul> <li>Bug fixed: attributeIndex class did not treat properly removing nodes outside ZPT; now it does not remove nodes explicitily, removes them if they are not found in DOM.</li> </ul> <h2> 0.40.4 <span class="changes-date">17 Nov 2020</span> </h2> <ul> <li>Bug fixed: jsdom dependency moved from dependencies to devDependencies in package.json file.</li> <li>Jquery dependency in devDependencies replaced by <a href="https://www.npmjs.com/package/zzdom">zzDOM</a>.</li> </ul> <h2> 0.40.3 <span class="changes-date">13 Sep 2020</span> </h2> <ul> <li>Bug fixed: problem with log4javascript fixed.</li> </ul> <h2> 0.40.2 <span class="changes-date">26 May 2020</span> </h2> <ul> <li>Bugs fixed: some errors about updating and effects fixed.</li> </ul> <h2> 0.40.1 <span class="changes-date">24 May 2020</span> </h2> <ul> <li>Bug fixed: update errors using tables fixed.</li> </ul> <h2> 0.40.0 <span class="changes-date">17 May 2020</span> </h2> <ul> <li>Update effects initial support.</li> </ul> <h2> 0.39.0 <span class="changes-date">7 May 2020</span> </h2> <ul> <li>Update command improved: support of array and object operations added using a new configuration option (dictionaryActions).</li> <li>Partial reactive support added: only supports change of properties directly in dictionary (not includes nested objects).</li> </ul> <h2> 0.38.2 <span class="changes-date">25 Feb 2020</span> </h2> <ul> <li>Some errors about non declared variables fixed.</li> </ul> <h2> 0.38.1 <span class="changes-date">8 Aug 2019</span> </h2> <ul> <li>Bug fixed: problem with npm solved.</li> </ul> <h2> 0.38.0 <span class="changes-date">8 Aug 2019</span> </h2> <ul> <li>New configuration option added: goToURLHash. It is a boolean value (default to true the first execution of ZPT, the rest executions are default to false). If it is true ZPT-JS updates the location.href to the current URL hash. This is needed because normal behaviour does not work, ids generated by ZPT-JS are not available when the browser try to use the URL hash.</li> </ul> <h2> 0.37.1 <span class="changes-date">8 Aug 2019</span> </h2> <ul> <li>Bug fixed: an error occurs when strict mode is set to true and a var is defined using tal:define.</li> </ul> <h2> 0.37.0 <span class="changes-date">6 Aug 2019</span> </h2> <ul> <li>Removed jquery dependency in non dev.</li> <li>Jquery expressions replaced by query expressions.</li> <li>Bug fixed: jsdom dependency added.</li> <li> Added support to run tests using the console: <ul> <li>npm run testBrowser // Run the related to browser tests</li> <li>npm run testNode // Run the related to node.js tests</li> <li>npm run test // Run all tests</li> </ul> </li> </ul> <h2> 0.36.1 <span class="changes-date">30 Jul 2019</span> </h2> <ul> <li>Dependencies updated.</li> <li>Replaced node-jsdom dependency by jsdom due it is no longer maintained (install of ZPT-JS failed using some recent versions of node).</li> </ul> <h2> 0.36.0 <span class="changes-date">23 Jul 2019</span> </h2> <ul> <li>Added new command: update.</li> <li>Added options.updatedDictionary (object) to set the list of properties to bind.</li> </ul> <h2> 0.35.0 <span class="changes-date">4 Jun 2019</span> </h2> <ul> <li>Added new tag: data-declare. It declares a list of items, each item is a variable name, a variable type (optional) and a default value expression (optional too). Optionally a 'required' suffix can be added. A strict mode is set to true inside the node with this attribute.</li> <li> Added some methods to context: <ul> <li>setStrictMode( strictMode ). Set the value of strictMode (default value is false). If it is set to true all variables must be declared; if ZPT-JS finds a non declared variable in an expression an error occurs.</li> <li>isStrictMode(). Get the value of strictMode.</li> </ul> </li> <li>Variable expression must match a regular expression. It is defined by zpt.context.getConf().variableNameRE and it is /^[A-Za-z0-9_/-]+$/ by default.</li> <li>errorFunction method of Context now is invoked when any error occurs except if the error is related to async preloading (in this case the asyncError method is invoked).</li> <li> Added a prefix to private vars to avoid name collision: '_'. The renamed vars are: <ul> <li>onErrorVarName: <em>_on-error</em></li> <li>onErrorStructureVarName: <em>_on-error-structure</em></li> <li>i18nDomainVarName: <em>_i18nDomain</em></li> <li>i18nLanguageVarName: <em>_i18nLanguage</em></li> <li>externalMacroUrlVarName: <em>_externalMacroUrl</em></li> <li>strictModeVarName: <em>_strictMode</em></li> <li>declaredVarsVarName: <em>_declaredVars</em></li> <li>repeatVarName: <em>_repeat</em></li> </ul> </li> </ul> <h2> 0.34.0 <span class="changes-date">23 May 2019</span> </h2> <ul> <li>Now exists expression returns true when the path expressions following its expression returns a value and it is not undefined. It is false when the path expression cannot locate an object or if it evaluates to undefined.</li> <li> Some exports added: <ul> <li>exports.I18nBundle</li> <li>exports.expressionBuilder</li> <li>exports.evaluateHelper</li> <li>exports.ExpressionTokenizer</li> </ul> </li> <li> Name of tags simplified. The new name of attributes are: <ul> <li>talCondition: <em>data-condition</em></li> <li>talRepeat: <em>data-repeat</em></li> <li>talAttributes: <em>data-attributes</em></li> <li>talContent: <em>data-content</em></li> <li>talDefine: <em>data-define</em></li> <li>talOmitTag: <em>data-omit-tag</em></li> <li>talReplace: <em>data-replace</em></li> <li>talOnError: <em>data-on-error</em></li> <li>metalDefineMacro: <em>data-define-macro</em></li> <li>metalUseMacro: <em>data-use-macro</em></li> <li>metalDefineSlot: <em>data-define-slot</em></li> <li>metalFillSlot: <em>data-fill-slot</em></li> <li>i18nDomain: <em>data-domain</em></li> <li>i18nLanguage: <em>data-language</em></li> </ul> </li> </ul> <h2> 0.33.0 <span class="changes-date">8 May 2019</span> </h2> <ul> <li>Added support of folder dictionaries.</li> </ul> <h2> 0.32.1 <span class="changes-date">3 May 2019</span> </h2> <ul> <li>Bug fixed: contents of metalFillSlot must not be evaluated.</li> </ul> <h2> 0.32.0 <span class="changes-date">25 Apr 2019</span> </h2> <ul> <li>New configuration option added: dictionaryExtension.</li> </ul> <h2> 0.31.1 <span class="changes-date">24 Apr 2019</span> </h2> <ul> <li>Bug fixed: malformed auto define tag in autoDefineHelper in some cases.</li> </ul> <h2> 0.31.0 <span class="changes-date">23 Apr 2019</span> </h2> <ul> <li>Nocall expression replaced by suffix in data-tdefine.</li> <li>Rerun bugs fixed using data-idomain, data-ilanguage, data-ton-error, data-trepeat, internal and external macros.</li> </ul> <h2> 0.30.0 <span class="changes-date">21 Apr 2019</span> </h2> <ul> <li>scopeCache class removed, replaced by scopeBuilder: it traverses the DOM from a node to its parents to get all data-tdefine tags and execute them in reverse order.</li> <li>Added command configuration option. Valid values are preload, fullRender or partialRender.</li> </ul> <h2> 0.29.0 <span class="changes-date">21 Apr 2019</span> </h2> <ul> <li>Save every scope into a cache, set an id to it and put it in HTML using a data-tscope tag to make it easy to re-render.</li> <li>Exported method removed: buildParser. The only exported method is run. First invokation preloads external resources (i18n files and external macros files), the next ones parser the DOM.</li> </ul> <h2> 0.28.0 <span class="changes-date">20 Dec 2018</span> </h2> <ul> <li>Added setErrorFunction method to context. It manages initialization errors (trying to load external files like external template files or i18n files).</li> <li>Added errorCallback parameter to init method of Parser class. It also manages initialization errors. If an errorCallback is defined is used; otherwise errorFunction in context is used.</li> </ul> <h2> 0.27.0 <span class="changes-date">28 Nov 2018</span> </h2> <ul> <li>Add to dictionary context object.</li> <li>Name of window and context vars in dictionary can be configured in context.</li> </ul> <h2> 0.26.0 <span class="changes-date">27 Nov 2018</span> </h2> <ul> <li>setExternalMacroPrefixURL method in context replaced by externalMacroPrefixURL conf property.</li> </ul> <h2> 0.25.0 <span class="changes-date">23 Nov 2018</span> </h2> <ul> <li>Auto load of i18n files at init.</li> <li>Bug fixed: undefined attributtes crashed.</li> <li>Bug fixed: render elements generated outside the container (macros and loops).</li> </ul> <h2> 0.24.0 <span class="changes-date">19 Nov 2018</span> </h2> <ul> <li>Added setExternalMacroPrefixURL method to context.</li> </ul> <h2> 0.23.0 <span class="changes-date">16 Nov 2018</span> </h2> <ul> <li>Add to dictionary window object.</li> </ul> <h2> 0.22.5 <span class="changes-date">9 Oct 2018</span> </h2> <ul> <li>Bug fixed: jquery plugin was not working using standalone version.</li> <li>Uglify and jshint tasks added to gruntfile. All files lint free.</li> </ul> <h2> 0.22.4 <span class="changes-date">23 Aug 2018</span> </h2> <ul> <li>Bug fixed: all toString methods fixed (improved error messages).</li> </ul> <h2> 0.22.3 <span class="changes-date">2 Jul 2018</span> </h2> <ul> <li>Bug fixed: macro calls overwrite define attributes of macro definitions.</li> </ul> <h2> 0.22.2 <span class="changes-date">12 Jun 2018</span> </h2> <ul> <li>Bug fixed: local macro calls not working properly when using them in remote macros.</li> </ul> <h2> 0.22.1 <span class="changes-date">10 May 2018</span> </h2> <ul> <li>Bug fixed: scope errors in loops fixed.</li> </ul> <h2> 0.22.0 <span class="changes-date">12 Mar 2018</span> </h2> <ul> <li>Version of Jquery updated to 3.0.0.</li> </ul> <h2> 0.21.1 <span class="changes-date"></span> </h2> <ul> <li>Bug fixed: don't render a attribute with an undefined value.</li> </ul> <h2> 0.21.0 <span class="changes-date">31 Dec 2017</span> </h2> <ul> <li>Full support of boolean attributes (checked, compact, declare, defer, disabled, ismap, multiple, nohref, noresize, noshade, nowrap, readonly and selected).</li> </ul> <h2> 0.20.5 <span class="changes-date">15 Nov 2017</span> </h2> <ul> <li>Problem with version number of npmjs.</li> </ul> <h2> 0.20.4 <span class="changes-date">15 Nov 2017</span> </h2> <ul> <li>Bug fixed: value of notRemoveGeneratedTags option was not updated when zpt was invoked several times.</li> </ul> <h2> 0.20.3 <span class="changes-date">10 Nov 2017</span> </h2> <ul> <li>Bug fixed: offset added to loops to prevent buggy index properties when using dynamic loops.</li> <li>Updated userguide about web server for testing purposes.</li> </ul> <h2> 0.20.2 <span class="changes-date">13 Oct 2017</span> </h2> <ul> <li>Bug fixed: callback executed in processAllRootElements method of Parser class.</li> </ul> <h2> 0.20.1 <span class="changes-date">13 Oct 2017</span> </h2> <ul> <li>Bug fixed: dictionary not updated when calling several times to run method in Parser class.</li> <li>Bug fixed: node test fixed.</li> </ul> <h2> 0.20.0 <span class="changes-date">1 Oct 2017</span> </h2> <ul> <li>Some changes in Parser class: run method removed, runSync method renamed to run. This makes run method is always sync, so all code is in init method.</li> </ul> <h2> 0.19.0 <span class="changes-date">26 Sep 2017</span> </h2> <ul> <li>Makes it easy to separate async code (for loading external macros files) from sync code.</li> <li>Resolver class now is singleton.</li> <li>New exported method: buildParser.</li> <li>Added init and runSync methods to Parser class.</li> </ul> <h2> 0.18.0 <span class="changes-date">14 Sep 2017</span> </h2> <ul> <li>Added http-server dev dependency for testing purposes: now it is possible to run tests using the HTTP server in port 9000. Run 'npm run start' in your console and then open 'http://localhost:9000/test/' in your browser.</li> </ul> <h2> 0.17.0 <span class="changes-date">11 Sep 2017</span> </h2> <ul> <li>Make it easy to use ZPT's original attributes. Added useOriginalTags method to context.</li> <li>New exported method: logHelper.</li> <li>Some logs changed from info to debug.</li> <li>Added try-catch to run method in parser.</li> </ul> <h2> 0.16.0 <span class="changes-date">6 Sep 2017</span> </h2> <ul> <li>Bug fixed: local macros now work when defining one in an external file.</li> <li>Better error messages: error messages now show the source attribute or string expression.</li> </ul> <h2> 0.15.1 <span class="changes-date">31 Aug 2017</span> </h2> <ul> <li>Bug fixed: buildRemotePageUrlList could throw an exception trying to resolve an expression which can't be resolved before rendering the document.</li> </ul> <h2> 0.15.0 <span class="changes-date">31 Aug 2017</span> </h2> <ul> <li>New exported method: context.</li> <li> Better logging support: <ul> <li>It can be activated or deactivated setting context.getConf().loggingOn (default is off).</li> <li>The log level can be customized setting context.getConf().loggingLevel (default is ERROR).</li> <li>It can be fully customized using context.setLogger( log4javascriptInstance ). See http://log4javascript.org/ for details.</li> </ul> </li> </ul> <h2> 0.14.0 <span class="changes-date">11 Aug 2017</span> </h2> <ul> <li>Now data-idomain tags can be set to an array of I18n instances.</li> </ul> <h2> 0.13.2 <span class="changes-date">9 Aug 2017</span> </h2> <ul> <li>Bug fixed: generated tags not removed before loading remote pages.</li> </ul> <h2> 0.13.1 <span class="changes-date">8 Aug 2017</span> </h2> <ul> <li>Bug fixed: generated tags not removed when needed.</li> </ul> <h2> 0.13.0 <span class="changes-date">8 Aug 2017</span> </h2> <ul> <li>Added support of multiroot: root now can be a string or an array of them.</li> </ul> <h2> 0.12.0 <span class="changes-date">27 Jul 2017</span> </h2> <ul> <li>Added support of map attributtes.</li> </ul> <h2> 0.11.0 <span class="changes-date">25 Jul 2017</span> </h2> <ul> <li>Added support of expressions in use-macro.</li> <li>Default delemiter character in external macros updated from '/' to '@'.</li> </ul> <h2> 0.10.0 <span class="changes-date">19 Jul 2017</span> </h2> <ul> <li>Added in expressions.</li> </ul> <h2> 0.9.2 <span class="changes-date">3 Jul 2017</span> </h2> <ul> <li>Bug fixed: wrong order in tal:repeat.</li> </ul> <h2> 0.9.1 <span class="changes-date">1 Jun 2017</span> </h2> <ul> <li>Standalone version fixed. Using browserify-derequire.</li> </ul> <h2> 0.9.0 <span class="changes-date">30 May 2017</span> </h2> <ul> <li>Added support of object members (using array delimiters).</li> </ul> <h2> 0.8.0 <span class="changes-date">7 Apr 2017</span> </h2> <ul> <li>Added help to select the correct I18n instance. Add data-ilanguage tag.</li> </ul> <h2> 0.7.0 <span class="changes-date">1 Apr 2017</span> </h2> <ul> <li>Support of custom expressions. Refactoring of expressionEvaluator class.</li> <li>Cache of expressions and ZPT attributes.</li> <li>Some logging support.</li> <li>Support of Node.js. Sample and tests added.</li> </ul> <h2> 0.6.0 <span class="changes-date">16 Nov 2016 </span> </h2> <ul> <li>Migrate to Browserify (CommonJS modules).</li> </ul> <h2> 0.5.0 <span class="changes-date">7 Nov 2016</span> </h2> <ul> <li>Use ZPT namespace.</li> <li>Change signature of ZPT.run to use options instead of several arguments.</li> </ul> <h2> 0.4.0 <span class="changes-date">3 Nov 2016</span> </h2> <ul> <li>Added number formatting L10n using Intl.</li> <li>Added currency formatting L10n using Intl (currency codes from ISO 4217).</li> <li>Added date/time formatting L10n using Intl.</li> <li>Added tr, trNumber, trCurrency and trDate expressions.</li> <li>Remove all i18n tags except data-idomain.</li> </ul> <h2> 0.3.0 <span class="changes-date">24 October 2016</span> </h2> <ul> <li>Added i18n capabilities (only for text) using messageformat.js.</li> <li> Added i18n tags: <ul> <li>data-idomain. Register a list of I18n instances to do i18n.</li> <li>data-idefine. Search the specified value into the available I18n instances and save the value to a variable.</li> <li>data-icontent. It works as data-tcontent, but searching the specified value into the availablbeefye I18n instances.</li> <li>data-ireplace. As data-treplace.</li> <li>data-iattributes. As data-tattributes.</li> <li>data-ion-error. As data-ton-error.</li> </ul> </li> </ul> <h2> 0.2.0 <span class="changes-date">3 October 2016</span> </h2> <ul> <li>Initial version. Initially a fork of Distal but finally nearly all code removed. Added some code from JPT (migrated from Java).</li> </ul> </article> </div> </body> </html>