function SystemCore() { } SystemCore.BASE_URL = "http://www.smileysportclub.ro/"; SystemCore.LIB_URL = "http://www.smileysportclub.ro/eob-libs/"; SystemCore.MODULES_PATH = SystemCore.LIB_URL + "com/sds/eob/Modules/"; SystemCore.MODULES_GATEWAY = SystemCore.BASE_URL + "moduleGateway.php"; SystemCore.ADAPTERS_GATEWAY = SystemCore.BASE_URL + "adaptersGateway.php"; SystemCore.JS_LIB = SystemCore.BASE_URL + "";SystemCore.TITAN_GATEWAY = "http://www.smileysportclub.ro/galileo/Application ERP2/jqueryGateway.php"; function ColorUtils() { } ColorUtils.getFontColorForBackground = function(bgHex) { if (bgHex.indexOf('#') === 0) { bgHex = bgHex.substr(1,10); } res = parseInt(bgHex, 16); if (res < 7368816) { color = "#ffffff"; } else { color = "#000000"; } return color; } /** * Get instances as containers */ SystemCore.instances = {}; SystemCore.getInstances = function() { var rez = $("div[id^=inst_]"); var key = ''; var obj; for(var i=0; i'; this.tpl; this.activePage = 0; this.tpl = $.template(this.templateName,this.tplWrapper); this.setTotal = function(total,perPage) { this.total = total; this.perPage = perPage ? perPage : 30; this.totalPages = Math.ceil(this.total / this.perPage); } this.clearTemplate = function() { $(this.container).empty(); } this.render = function(activePage) { // tplPaginationPlaceHolder if (!this.tpl) { this.tpl = $.template(this.templateName,this.tplRow); } var pages = []; this.activePage = activePage>=0 ? activePage : 0; var obj = {}; for(var i=0; i'); $(this.container).append(''); //console.log($(this.container)); } this.registerField = function(name,servicePath,params,encodeToJSON) { var paramsStr = params.join(","); var fieldStr = ''; fieldStr += ''; fieldStr += ''; fieldStr += ''; $(this.container).append(fieldStr); } this.setParams = function(fieldName,params) { var paramsStr = params.join(","); $(this.container + " [name="+fieldName+"Params]").val(paramsStr); } } /** * Load an array of .js and execute the callback function * When all scripts 100% loaded * * @return */ function Includes() { } Includes.scriptStack = {} Includes.loadedCounter = 0; Includes.len = 0; //Includes.handler; Includes.load = function(scripts, handler) { Includes.len = scripts.length; Includes.handler = handler; var scripts = scripts; var concatChar = "?"; for (var i=0; i