-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from virginiacommonwealthuniversity/release/1.3.1
Release 1.3.1
- Loading branch information
Showing
7 changed files
with
61 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "t4-utils-2", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"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]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* T4Utils | ||
* @module | ||
* @author Ben Margevicius <[email protected]>, Joel Eisner <[email protected]> | ||
* @version 1.0.0 | ||
* @version 1.1.0 | ||
*/ | ||
var T4Utils = (function (utils) { | ||
|
||
|
@@ -77,6 +77,38 @@ var T4Utils = (function (utils) { | |
} | ||
}; | ||
|
||
/** | ||
* Sets the context of where the library is being executed from (i.e. null if from within a page-layout, content if from within a content-type) | ||
* @member context | ||
* @return {?Object} context - Either null if the context is from within a page-layout, and the content variable if from withing a content-type | ||
* T4Utils.context | ||
*/ | ||
utils.context = (function () { | ||
return typeof content == 'undefined' ? null : content; | ||
})(); | ||
|
||
/** | ||
* Boolean of whether the context of where the library is being executed from is within a page-layout | ||
* @member contextIsPage | ||
* @return {boolean} context - True if the library is executed within a page-layout, false if not | ||
* @example | ||
* T4Utils.contextIsPage | ||
*/ | ||
utils.contextIsPage = (function () { | ||
return typeof content == 'undefined' ? true : false; | ||
})(); | ||
|
||
/** | ||
* Boolean of whether the context of where the library is being executed from is within a content-type | ||
* @member contextIsContent | ||
* @return {boolean} context - True if the library is executed within a content-type, false if not | ||
* @example | ||
* T4Utils.contextIsContent | ||
*/ | ||
utils.contextIsContent = (function () { | ||
return typeof content == 'undefined' ? false : true; | ||
})(); | ||
|
||
/** | ||
* Writes a paragraph formatted HTML message to the browser | ||
* @member write | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
* brokerUtils - The Broker Utilities Module | ||
* @namespace brokerUtils | ||
* @extends T4Utils | ||
* @author Ben Margevicius <[email protected]> | ||
* @version 1.0.0 | ||
* @author Ben Margevicius <[email protected]>, Joel Eisner <[email protected]> | ||
* @version 1.1.0 | ||
* @example | ||
* T4Utils.brokerUtils | ||
*/ | ||
|
@@ -18,6 +18,5 @@ T4Utils.brokerUtils = T4Utils.brokerUtils || {}; | |
* T4Utils.brokerUtils.processT4tag(string); | ||
*/ | ||
T4Utils.brokerUtils.processT4Tag = function (t4Tag) { | ||
var context = content || null; | ||
return com.terminalfour.publish.utils.BrokerUtils.processT4Tags(dbStatement, publishCache, section, context, language, isPreview, t4Tag); | ||
return com.terminalfour.publish.utils.BrokerUtils.processT4Tags(dbStatement, publishCache, section, T4Utils.context, language, isPreview, t4Tag); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
* elementInfo - The Element Info Module | ||
* @namespace elementInfo | ||
* @extends T4Utils | ||
* @author Ben Margevicius <[email protected]> | ||
* @version 1.0.0 | ||
* @author Ben Margevicius <[email protected]>, Joel Eisner <[email protected]> | ||
* @version 1.1.0 | ||
* @example | ||
* T4Utils.elementInfo | ||
*/ | ||
|
@@ -17,8 +17,7 @@ T4Utils.elementInfo = T4Utils.elementInfo || {}; | |
* T4Utils.elementInfo.getElements(); | ||
*/ | ||
T4Utils.elementInfo.getElements = function () { | ||
var context = content || null; | ||
return context !== null ? context.getElements() : null ; | ||
return T4Utils.contextIsContent ? content.getElements() : null ; | ||
}; | ||
|
||
/** | ||
|
@@ -30,9 +29,8 @@ T4Utils.elementInfo.getElements = function () { | |
* T4Utils.elementInfo.getElementValue(string); | ||
*/ | ||
T4Utils.elementInfo.getElementValue = function (element) { | ||
var context = content || null; | ||
if (context !== null) { | ||
var el = context.get(element); | ||
if (T4Utils.contextIsContent) { | ||
var el = content.get(element); | ||
if (typeof el.publish === "function") { | ||
return el.publish(); | ||
} | ||
|
@@ -49,9 +47,8 @@ T4Utils.elementInfo.getElementValue = function (element) { | |
* T4Utils.elementInfo.getElementName(string); | ||
*/ | ||
T4Utils.elementInfo.getElementName = function (element) { | ||
var context = content || null; | ||
if (context !== null) { | ||
var el = context.get(element); | ||
if (T4Utils.contextIsContent) { | ||
var el = content.get(element); | ||
if (typeof el.getName === "function") { | ||
return c.get(element).getName(); | ||
} | ||
|
@@ -68,9 +65,8 @@ T4Utils.elementInfo.getElementName = function (element) { | |
* T4Utils.elementInfo.getElementID(string); | ||
*/ | ||
T4Utils.elementInfo.getElementID = function (element) { | ||
var context = content || null; | ||
if (context !== null) { | ||
var el = context.get(element); | ||
if (T4Utils.contextIsContent) { | ||
var el = content.get(element); | ||
if (typeof el.getID === "function") { | ||
return c.getID(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters