Skip to content

Commit

Permalink
Merge pull request #5 from virginiacommonwealthuniversity/release/1.5.0
Browse files Browse the repository at this point in the history
Release 1.5.0
  • Loading branch information
samyerkes authored Dec 9, 2016
2 parents a68e5ba + c4b8f18 commit ae7a0a4
Show file tree
Hide file tree
Showing 7 changed files with 1,863 additions and 11 deletions.
11 changes: 11 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Changelog
T4Utils 2 utilizes [GitHub's releases feature](https://github.com/blog/1547-release-your-software) for its changelogs, but this document serves as static duplicate of that content.

## [v1.5.0_2016.12.09 - generateT4Tag()](https://github.com/virginiacommonwealthuniversity/T4Utils2/releases/tag/v1.5.0_2016.12.09)
The `brokerUtils` module has been extended to include `generateT4Tag()`!
* Create/process T4 tags by passing in a configuration object
* Defaults are established to simplify configuration object creation
* type - "content"
* name - ""
* output - "normal"
* modifiers - []
* id - 0
* formatter - ""

## [v1.4.0_2016.10.31 - v7.4 Support](https://github.com/virginiacommonwealthuniversity/T4Utils2/releases/tag/v1.4.0_2016.10.31)
T4Utils2 now officially supports both TerminalFour v7.4 and v8.1. Here's what's changed:
* The Gulp build system now compiles 2 versions of the library (for TerminalFour v7.4 and v8.1)
Expand Down
2 changes: 1 addition & 1 deletion gulp/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function(version) {
'/**',
' * T4Utils 2',
' * @author <%= pkg.author %>',
' * @version <%= pkg.version %>_<%= info.version %>_<%= info.date %>',
' * @version <%= pkg.version %>_<%= info.date %> (<%= info.version %>)',
' * @license <%= pkg.license %>',
' */',
'\n'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "t4-utils-2",
"version": "1.4.0",
"version": "1.5.0",
"description": "A Javascript Library of Utility Classes and Extensions for TerminalFour Programmable Layouts",
"main": "dist/8.4/T4Utils.min.js",
"author": "Joel Eisner <[email protected]>",
Expand Down
18 changes: 10 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ A Javascript library of utility classes and extensions for TerminalFour Programm

## Latest Version

## [v1.4.0_2016.10.31 - v7.4 Support](https://github.com/virginiacommonwealthuniversity/T4Utils2/releases/tag/v1.4.0_2016.10.31)
T4Utils2 now officially supports both TerminalFour v7.4 and v8.1. Here's what's changed:
* The Gulp build system now compiles 2 versions of the library (for TerminalFour v7.4 and v8.1)
* The main `gulpfile.js` now uses a build module to simplify and bootstrap library compilation code
* The `ordinalIndicators` module now uses replaceable strings for any v7.1/v8.1 API discrepancies
* These replaceable strings are changed to the correct API calls during the build process
* The `elementInfo` module has had undefined variable issues fixed
* The `media` module's `getImageVariantsIds` method is now wrapped in a `T4Utils.contextIsContent` conditional
### [v1.5.0_2016.12.09 - generateT4Tag()](https://github.com/virginiacommonwealthuniversity/T4Utils2/releases/tag/v1.5.0_2016.12.09)
The `brokerUtils` module has been extended to include `generateT4Tag()`!
* Create/process T4 tags by passing in a configuration object
* Defaults are established to simplify configuration object creation
* type - "content"
* name - ""
* output - "normal"
* modifiers - []
* id - 0
* formatter - ""

Check out the [changelog](changelog.md) for previous release information.

Expand Down
2 changes: 1 addition & 1 deletion src/modules/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var T4Utils = (function (utils) {
* @example
* T4Utils.version;
*/
utils.version = '{{version}}_{{t4_version}}_{{datestamp}}';
utils.version = '{{version}}_{{datestamp}}';

/**
* The version of TerminalFour this library is intended for
Expand Down
30 changes: 30 additions & 0 deletions src/modules/brokerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,33 @@ T4Utils.brokerUtils = T4Utils.brokerUtils || {};
T4Utils.brokerUtils.processT4Tag = function (t4Tag) {
return com.terminalfour.publish.utils.BrokerUtils.processT4Tags(dbStatement, publishCache, section, T4Utils.context, language, isPreview, t4Tag);
};

/**
* Creates and processes a T4 tag from a configuration object and returns its computed value
* @function brokerUtils.generateT4Tag
* @param {Object} userSettings - The configuration object for creating the T4 tag
* @returns {string} the string of the computed value
* T4Utils.brokerUtils.generateT4Tag(object);
*/
T4Utils.brokerUtils.generateT4Tag = function(userConfig) {
var config = userConfig || {},
settings = {
type: config.type || 'content', // Default: "content"
name: config.name || '', // Default: ""
output: config.output || 'normal', // Default: "normal"
modifiers: config.modifiers || [], // Default: []
id: config.id || 0, // Default: 0
formatter: config.formatter || '' // Default: ""
},
tag = '';
// Type: Content; Required: Name
if (settings.type == 'content' && settings.name) tag += '<t4 type="' + settings.type + '" name="' + settings.name + '" output="' + settings.output + '" modifiers="' + settings.modifiers.join(',') + '"' + (settings.formatter ? ' formatter="' + settings.formatter + '"' : '') + ' />';
// Type: Media; Required: Formatter, ID
if (settings.type == 'media' && settings.formatter && settings.id) tag += '<t4 type="' + settings.type + '" id="' + settings.id + '" formatter="' + settings.formatter + '" />';
// Type: Navigation; Required: ID
if (settings.type == 'navigation' && settings.id) tag += '<t4 type="' + settings.type + '" id="' + settings.id + '" />';
// Type: Title
if (settings.type == 'title') tag += '<t4 type="' + settings.type + '" />';
// If a tag was generated, return its computed value; Otherwise, return an empty string
return tag ? T4Utils.brokerUtils.processT4Tag(tag) : '';
};
Loading

0 comments on commit ae7a0a4

Please sign in to comment.