/** * Filemanager JS core * * filemanager.js * * @license MIT License * @author Jason Huck - Core Five Labs * @author Simon Georget * @copyright Authors */ (function($) { // function to retrieve GET params $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); if (results) return results[1]; else return 0; }; /*-----------------------------------------------------$('#level-up').click---- Setup, Layout, and Status Functions ---------------------------------------------------------*/ // We retrieve config settings from filemanager.config.js var loadConfigFile = function (type) { var json = null; type = (typeof type === "undefined") ? "user" : type; if(type == 'user') { if($.urlParam('config') != 0) { var url = './scripts/' + $.urlParam('config'); userconfig = $.urlParam('config'); } else { var url = './scripts/filemanager.config.json'; userconfig = 'filemanager.config.json'; } } else { var url = './scripts/filemanager.config.default.json'; } $.ajax({ 'async': false, 'url': url, 'dataType': "json", cache: false, 'success': function (data) { json = data; } }); return json; }; // loading default configuration file var configd = loadConfigFile('default'); // loading user configuration file var config = loadConfigFile(); // we remove version from user config file if (config !== null) delete config.version; // we merge default config and user config file var config = $.extend({}, configd, config); if(config.options.logger) var start = new Date().getTime(); // included files collector HEAD_included_files = new Array(); /** * function to load a given css file into header * if not already included */ loadCSS = function(href) { // we check if already included if($.inArray(href, HEAD_included_files) == -1) { var cssLink = $(""); $("head").append(cssLink); HEAD_included_files.push(href); } }; /** * function to load a given js file into header * if not already included */ loadJS = function(src) { // we check if already included if($.inArray(src, HEAD_included_files) == -1) { var jsLink = $("