JSFiddle - React, Tailwind, and code Playground
by Cwalkdawg
JavaScript
var global = this;
/**
* PacAPP is a base object to be used by all PAC scripting services.
* It creates items that will be required for external js files.
*
* g is the global object passed to the anonymous which creates PacAPP
*
* @type {Object}
*/
var PacAPP = (function (g) {
function Base(g) {
var context = this;
/**
* A namespacing pattern function for auto assigning the values of a
* String array into namedspaces in an object
* @param {Object} parent The parent object for which a namespace will be assigned
* @param {Array} namespaces An array of string holding the hierarchy
* @return {Object} Returns a references the namespace
*/
this.extend = function (parent, ns) {
for (i = 0; i < ns.length; i++) {
//create a property if it doesnt exist
if (typeof parent[ns[i]] == 'undefined') {
parent[ns[i]] = {};
}
parent = parent[ns[i]];
}
return parent;
}
/**
* Grab text from a file using the File System Object to eval it and return an object.
* Auto assigns to modules in require object, but returns the RequireObject created which
* includes the library
* @param {String} src File name of library
* @param {String} base Base folder name of script, not required if it lives in libs/
*/
this.require = function (src, base) {
base = typeof base !== 'undefined' ? base : path.base_libraries;
var RequireObject = function (src, base) {
this.src = src;
if (this.src.slice(this.src.lastIndexOf('.'), this.src.length) !== ".js") {
this.src += ".js";
}
this.name = this.src.substring(this.src.lastIndexOf('/') + 1, this.src.lastIndexOf('.'));
this.fullPath =...