-
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 #4 from virginiacommonwealthuniversity/release/1.4.0
Release 1.4.0
- Loading branch information
Showing
10 changed files
with
100 additions
and
59 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
var datestamp = require('./datestamp.js'), | ||
header = require('./header.js'), | ||
include = require('gulp-include'), | ||
pkg = require('../package.json'), | ||
rename = require('gulp-rename'), | ||
replace = require('gulp-replace'), | ||
uglify = require('gulp-uglify'); | ||
|
||
var api = { | ||
content_type_id: { | ||
'8.1': 'content.getContentTypeID()', | ||
'7.4': 'content.getTemplateID()' | ||
}, | ||
ocm: { | ||
'8.1': 'com.terminalfour.spring.ApplicationContextProvider.getBean(com.terminalfour.content.IContentManager)', | ||
'7.4': 'ContentManager.getManager()' | ||
}, | ||
ocm_get_id: { | ||
'8.1': 'oCM.get(contentInSection[i], \'en\').getID()', | ||
'7.4': 'oCM.get(dbStatement, contentInSection[i], \'en\').getID()' | ||
}, | ||
ocm_next_content_type_id: { | ||
'8.1': 'oCM.get(contentInSection[i + 1], \'en\').getContentTypeID()', | ||
'7.4': 'oCM.get(dbStatement, contentInSection[i + 1], \'en\').getTemplateID()' | ||
}, | ||
ocm_prev_content_type_id: { | ||
'8.1': 'oCM.get(contentInSection[i - 1], \'en\').getContentTypeID()', | ||
'7.4': 'oCM.get(dbStatement, contentInSection[i - 1], \'en\').getTemplateID()' | ||
} | ||
}; | ||
|
||
module.exports = function(gulp, config, version) { | ||
gulp.task('build-' + version, function() { | ||
return gulp.src(config.src) // Grab the source files | ||
.pipe(include()) // Include javascript modules | ||
.pipe(replace(/\{\{version\}\}/g, pkg.version)) // Replace {{version}} with the package.json version | ||
.pipe(replace(/\{\{t4_version\}\}/g, version)) // Replace {{t4_version}} with the passed in version | ||
.pipe(replace(/\{\{datestamp\}\}/g, datestamp())) // Replace {{datestamp}} with a YYYY.mm.dd datestamp | ||
.pipe(replace(/'\{\{api:content_type_id\}\}'/g, api.content_type_id[version])) // Replace {{api:content_type_id}} with the version specific JS | ||
.pipe(replace(/'\{\{api:ocm\}\}'/g, api.ocm[version])) // Replace {{api:ocm}} with the version specific JS | ||
.pipe(replace(/'\{\{api:ocm_get_id\}\}'/g, api.ocm_get_id[version])) // Replace {{api:ocm_get_id}} with the version specific JS | ||
.pipe(replace(/'\{\{api:ocm_next_content_type_id\}\}'/g, api.ocm_next_content_type_id[version])) // Replace {{api:ocm_next_content_type_id}} with the version specific JS | ||
.pipe(replace(/'\{\{api:ocm_prev_content_type_id\}\}'/g, api.ocm_prev_content_type_id[version])) // Replace {{api:ocm_prev_content_type_id}} with the version specific JS | ||
.pipe(header(version)) // Inject library header | ||
.pipe(rename({suffix:'.' + version})) // Give the filename a version suffix | ||
.pipe(gulp.dest(config.dest)) // Save to the destination folder | ||
.pipe(uglify()) // Uglify the code | ||
.pipe(header(version)) // Re-inject library header | ||
.pipe(rename({suffix:'.min'})) // Give the filename a .min suffix | ||
.pipe(gulp.dest(config.dest)); // Save to the destination folder | ||
}); | ||
}; |
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
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.1", | ||
"version": "1.4.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]>", | ||
|
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.1.0 | ||
* @version 1.2.0 | ||
*/ | ||
var T4Utils = (function (utils) { | ||
|
||
|
@@ -13,7 +13,7 @@ var T4Utils = (function (utils) { | |
* @example | ||
* T4Utils.version; | ||
*/ | ||
utils.version = '{{version}}_{{datestamp}}'; | ||
utils.version = '{{version}}_{{t4_version}}_{{datestamp}}'; | ||
|
||
/** | ||
* The version of TerminalFour this library is intended for | ||
|
@@ -22,7 +22,7 @@ var T4Utils = (function (utils) { | |
* @example | ||
* T4Utils.t4; | ||
*/ | ||
utils.t4 = '8.1'; | ||
utils.t4 = '{{t4_version}}'; | ||
|
||
/** | ||
* Writes the specified message type to the browser console | ||
|
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* @namespace ordinalIndicators | ||
* @extends T4Utils | ||
* @author Joel Eisner <[email protected]> | ||
* @version 1.1.0 | ||
* @version 1.2.0 | ||
* @example | ||
* T4Utils.ordinalIndicators | ||
*/ | ||
|
@@ -61,9 +61,9 @@ T4Utils.ordinalIndicators.pageInfo = (function() { | |
if (ctID === contentTypeID.key) contentTypeID.pieces.push(uID); | ||
} | ||
} | ||
// Get the current content's... | ||
var this_ctID = content.getContentTypeID(), /* Content-type ID */ | ||
this_uID = content.getID(); /* Unique ID */ | ||
// Get the current content's content-type and unique ID's | ||
var this_ctID = '{{api:content_type_id}}', | ||
this_uID = content.getID(); | ||
// For each key/pieces object... | ||
for (var m = 0; m < listContentTypeIDs.length; m++) { | ||
// ... create a reference, ... | ||
|
@@ -153,16 +153,16 @@ T4Utils.ordinalIndicators.pageLast = T4Utils.ordinalIndicators.pageInfo.last; | |
T4Utils.ordinalIndicators.groupInfo = (function() { | ||
// If content is defined... | ||
if (T4Utils.contextIsContent) { | ||
var ctid = content.getContentTypeID(), | ||
var ctid = '{{api:content_type_id}}', | ||
sid = section.getID(), | ||
oCH = new ContentHierarchy(), | ||
oCM = com.terminalfour.spring.ApplicationContextProvider.getBean(com.terminalfour.content.IContentManager), | ||
oCM = '{{api:ocm}}', | ||
contentInSection = oCH.getContent(dbStatement, sid, 'en'), | ||
groupFirst, groupLast; | ||
for (var i = 0; i < contentInSection.length; i++) { | ||
if (content.getID() === oCM.get(contentInSection[i], 'en').getID()) { | ||
groupFirst = i === 0 ? true : ctid !== oCM.get(contentInSection[i - 1], 'en').getContentTypeID() ? true : false; | ||
groupLast = i === contentInSection.length - 1 ? true : ctid !== oCM.get(contentInSection[i + 1], 'en').getContentTypeID() ? true : false; | ||
if (content.getID() === '{{api:ocm_get_id}}') { | ||
groupFirst = i === 0 ? true : ctid !== '{{api:ocm_prev_content_type_id}}' ? true : false; | ||
groupLast = i === contentInSection.length - 1 ? true : ctid !== '{{api:ocm_next_content_type_id}}' ? true : false; | ||
} | ||
} | ||
// Return an object that contains... | ||
|