-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsHelper.js
34 lines (30 loc) · 998 Bytes
/
jsHelper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* CONCENTRADOR DE DEPENDENCIAS
*/
console.log('Core Active');
var cScripts, rutaScript;
cScripts = document.getElementsByTagName('script');
Array.from(cScripts).forEach(function(script){
if (script.src.indexOf('jsHelper') > -1) {
var fileName = script.src.substr(script.src.lastIndexOf('/') + 1);
rutaScript = script.src.replace(fileName, '');
}
});
const jsFiles = [
'ciValidators/ciValidator.js',
'domManager/jsCheckers.js',
'domManager/jsMessages.js',
'domManager/jsTableHelper.js',
'domManager/jsPaginator.js',
'domManager/jsLoader.js',
'responseManager/jsTranslatorAPI.js'
];
jsFiles.forEach(function(scriptLocation){
var scriptTag = document.createElement('script');
scriptTag.src = rutaScript + scriptLocation;
document.head.appendChild(scriptTag);
});
var jsStyle = document.createElement('link');
jsStyle.ref = "";
jsStyle.href = `${rutaScript}Styles/jshelper-style-file.css`;
document.head.appendChild(jsStyle);