tpbproxy/public/js/app.js
2024-01-06 18:09:23 -05:00

56 lines
908 B
JavaScript

// socket
// api
// auth
// user
// group
"use strict";
/* globals jQuery, Mustache, XRegExp, $, app */
var app = app || {};
( function($){
/*
delay calling document.ready until app is loaded.
*/
jQuery.holdReady(true);
app.includeScrip = function(path, base){
path = (base || JQapp_BASE_PATH || '') + path;
jQuery.ajax({
url: path,
dataType: 'script',
async: false
});
};
app.include = function(scripts, base){
scripts = $.isArray(scripts) ? scripts : [scripts];
for(let script of scripts){
app.includeScrip(script, base)
}
}
})(jQuery);
app.include([
'/utils.js',
'/pubsub.js',
'/api.js',
'/socket.js',
'/user.js',
'/group.js',
'/auth.js',
], JQapp_BASE_PATH)
/*
when the DOM is finished, start the app
*/
jQuery(document).on("DOMContentLoaded", function(event) {
app.publish("__dom-content-loaded-start");
app.publish("__dom-content-loaded-end");
});