-
Notifications
You must be signed in to change notification settings - Fork 0
/
_engine.js
71 lines (62 loc) · 1.55 KB
/
_engine.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*jshint sub:true*/
/*jslint evil: true */
/*jslint esversion:6 */
function _m(jsonData, template, destContent)
{
/*
INTERNAL FUNCTIONS
*/
_m.about = function()
{
var about = {
Version: "0.79-B",
Author: "Liuzzi Stéphane Aka Shaan1974",
Started: "17-10-2019",
Updated: "12-12-2019"
};
return about;
};
/*
INTERNAL VARIABLES
CALL WITH "_m.version"
*/
_m.version = _m.about().Version;
if (typeof jsonData === "undefined") return _m.about();
/*
INTERNAL CALL
*/
if (jsonData)
{
if (window === this)
{
return new _m(jsonData, template, destContent);
}
var string_template = true;
try
{
if (document.querySelector("" + template + "").tagName === "SCRIPT")
{
template = document.querySelector("" + template + "").innerText;
}
else
{
template = document.querySelector("" + template + "").innerHTML;
}
// CORRECT HTML TO BE ABLE TO USE SUB TEMPLATE CALL
template = template.replace(/{{>\s/gi, "{{> ");
string_template = false;
}
catch (e)
{
}
_m.generateData = {
"template": template,
"dest": destContent,
"jsonData": jsonData
};
_m.generateTemplate();
_m.putInPlaceTemplate();
return;
}
return _m.about();
}