@zeesoft/i18n-verify 1.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/config.js +3 -0
- package/dist/utils/configFile.js +2 -1
- package/dist/utils/reportFactory/html/index.js +3 -3
- package/dist/utils/reportFactory/html/template/css.js +289 -8
- package/dist/utils/reportFactory/html/template/html.js +95 -16
- package/dist/utils/reportFactory/html/template/javascript/data.js +8 -0
- package/dist/utils/reportFactory/html/template/javascript/grid.js +155 -0
- package/dist/utils/reportFactory/html/template/javascript/index.js +20 -0
- package/dist/utils/reportFactory/html/template/javascript/insight.js +224 -0
- package/dist/utils/reportFactory/html/template/javascript/menuBar.js +118 -0
- package/dist/utils/reportFactory/html/template/javascript/overview.js +626 -0
- package/dist/utils/reports.js +1 -1
- package/package.json +1 -1
- package/dist/utils/reportFactory/html/template/javascript.js +0 -106
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = () => `
|
|
8
|
+
//grid view
|
|
9
|
+
(() => {
|
|
10
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
11
|
+
let table;
|
|
12
|
+
document.querySelectorAll(".sub-menu-item").forEach((menu) => {
|
|
13
|
+
menu.addEventListener("click", (e) => {
|
|
14
|
+
render(e.currentTarget.dataset.locale);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const updateTitle = (locale) => {
|
|
19
|
+
document.querySelector(
|
|
20
|
+
"#locale .title"
|
|
21
|
+
).textContent = \`\${locale} I18n Coverage Details\`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const buildGrid = (_locale) => {
|
|
25
|
+
const data = DataStore.getDataByLocale(_locale);
|
|
26
|
+
$.fn.dataTable.ext.errMode = "none";
|
|
27
|
+
const locale = ["en_US", "fr_FR"];
|
|
28
|
+
const type = [
|
|
29
|
+
"I18n Str",
|
|
30
|
+
"Not I18n Str",
|
|
31
|
+
"Parially Localized",
|
|
32
|
+
"Utranslated",
|
|
33
|
+
"Encoding",
|
|
34
|
+
"DNT",
|
|
35
|
+
"I18n Date",
|
|
36
|
+
"I18n Number",
|
|
37
|
+
"Not I18n DateTime",
|
|
38
|
+
];
|
|
39
|
+
const testPages = [
|
|
40
|
+
"Welcome-Page",
|
|
41
|
+
"Settings-Page",
|
|
42
|
+
"User-Profile-Page",
|
|
43
|
+
"Dashboard-Page",
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const dataSet = Array(100)
|
|
47
|
+
.fill()
|
|
48
|
+
.map((i, v) => [
|
|
49
|
+
\`sample text \${v}\`,
|
|
50
|
+
locale[Math.floor(Math.random() * 2)],
|
|
51
|
+
type[Math.floor(Math.random() * 9)],
|
|
52
|
+
testPages[Math.floor(Math.random() * 3)],
|
|
53
|
+
\`link-\${v}.png\`,
|
|
54
|
+
]);
|
|
55
|
+
table = new DataTable("#locale .coverage-info table", {
|
|
56
|
+
columns: [
|
|
57
|
+
{ title: "String" },
|
|
58
|
+
{ title: "Locale" },
|
|
59
|
+
{ title: "Type" },
|
|
60
|
+
{ title: "Page" },
|
|
61
|
+
{ title: "Screenshot" },
|
|
62
|
+
],
|
|
63
|
+
columnDefs: [
|
|
64
|
+
{
|
|
65
|
+
targets: 4,
|
|
66
|
+
orderable: false,
|
|
67
|
+
searchable: false,
|
|
68
|
+
data: null,
|
|
69
|
+
render: function (data) {
|
|
70
|
+
return \`<a href="#" class="view-screenshot-btn" onclick="openImageViewer('\${data[4]}')">View Screenshot</a>\`;
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
data: dataSet,
|
|
75
|
+
initComplete: function () {
|
|
76
|
+
this.api()
|
|
77
|
+
.columns()
|
|
78
|
+
.every(function () {
|
|
79
|
+
const column = this;
|
|
80
|
+
|
|
81
|
+
if (column[0][0] === 4) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const select = $(
|
|
86
|
+
'<select class="filter dt-input"><option value="">Filter By</option></select>'
|
|
87
|
+
)
|
|
88
|
+
.appendTo($(column.header()).before())
|
|
89
|
+
.on("change", function () {
|
|
90
|
+
const val = $.fn.dataTable.util.escapeRegex(
|
|
91
|
+
$(this).val()
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
column
|
|
95
|
+
.search(val ? "^" + val + "$" : "", true, false)
|
|
96
|
+
.draw();
|
|
97
|
+
})
|
|
98
|
+
.on("click", function (e) {
|
|
99
|
+
e.stopPropagation();
|
|
100
|
+
e.stopImmediatePropagation();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
column
|
|
104
|
+
.data()
|
|
105
|
+
.unique()
|
|
106
|
+
.sort()
|
|
107
|
+
.each(function (d, j) {
|
|
108
|
+
select.append(
|
|
109
|
+
'<option value="' + d + '">' + d + "</option>"
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
sScrollY:
|
|
115
|
+
document
|
|
116
|
+
.querySelector("#locale .coverage-info")
|
|
117
|
+
.getBoundingClientRect().height - 142,
|
|
118
|
+
pageLength: 25,
|
|
119
|
+
lengthMenu: [10, 25, 50, 100],
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Event handler when position select is changed
|
|
123
|
+
$(table.columns(1).header())
|
|
124
|
+
.find("select")
|
|
125
|
+
.on("change", function () {
|
|
126
|
+
var nextSelect = $(table.columns(2).header()).find("select");
|
|
127
|
+
var nextColumn = table.column(2);
|
|
128
|
+
var nextColumnResults = table.column(2, { search: "applied" });
|
|
129
|
+
nextColumn.search("").draw();
|
|
130
|
+
nextSelect.empty();
|
|
131
|
+
nextSelect.append('<option value="">Filter By</option>');
|
|
132
|
+
nextColumnResults
|
|
133
|
+
.data()
|
|
134
|
+
.unique()
|
|
135
|
+
.sort()
|
|
136
|
+
.each(function (d, j) {
|
|
137
|
+
nextSelect.append(
|
|
138
|
+
'<option value="' + d + '">' + d + "</option>"
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const render = (locale) => {
|
|
145
|
+
updateTitle(locale);
|
|
146
|
+
buildGrid(locale);
|
|
147
|
+
if (table) {
|
|
148
|
+
$($(table.columns(1).header()).find("select")).val(locale);
|
|
149
|
+
table.columns(1).search(locale).draw();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
})();
|
|
154
|
+
`;
|
|
155
|
+
exports.default = _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _menuBar = _interopRequireDefault(require("./menuBar.js"));
|
|
8
|
+
var _overview = _interopRequireDefault(require("./overview.js"));
|
|
9
|
+
var _insight = _interopRequireDefault(require("./insight.js"));
|
|
10
|
+
var _grid = _interopRequireDefault(require("./grid.js"));
|
|
11
|
+
var _data = _interopRequireDefault(require("./data.js"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
var _default = metaData => `
|
|
14
|
+
${(0, _data.default)(metaData.locales, metaData.stats, metaData.statsByLocale, metaData.stringData)}
|
|
15
|
+
${(0, _menuBar.default)()}
|
|
16
|
+
${(0, _overview.default)()}
|
|
17
|
+
${(0, _insight.default)()}
|
|
18
|
+
${(0, _grid.default)()}
|
|
19
|
+
`;
|
|
20
|
+
exports.default = _default;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = () => `
|
|
8
|
+
//Cards of locales
|
|
9
|
+
(() => {
|
|
10
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
11
|
+
renderCards();
|
|
12
|
+
|
|
13
|
+
// helper methods to generate cards and its sections
|
|
14
|
+
function createStatSection(data) {
|
|
15
|
+
const isDefaultLocale = false; // dynamically pass
|
|
16
|
+
const holder = document.createElement("div");
|
|
17
|
+
const table = document.createElement("table");
|
|
18
|
+
const tbody = document.createElement("tbody");
|
|
19
|
+
const name = document.createElement("div");
|
|
20
|
+
const tableData = {
|
|
21
|
+
Reviewed: 1000,
|
|
22
|
+
"Internationlized Strings": 600,
|
|
23
|
+
"Not Internationlized Strings": 100,
|
|
24
|
+
"Untranslated Strings": 50,
|
|
25
|
+
"Encoding Issue Strings": 15,
|
|
26
|
+
"DNT Strings": 15,
|
|
27
|
+
"Auto Ignored Strings": 20,
|
|
28
|
+
"Internationlized Numbers": 20,
|
|
29
|
+
"Not Internationlized Numbers": 20,
|
|
30
|
+
"Internationlized Currency": 20,
|
|
31
|
+
"Not Internationlized Currency": 20,
|
|
32
|
+
"Internationlized Date": 20,
|
|
33
|
+
"Not Internationlized Date": 20,
|
|
34
|
+
"Internationlized Time": 20,
|
|
35
|
+
"Not Internationlized Time": 20,
|
|
36
|
+
"Internationlized DateTime": 20,
|
|
37
|
+
"Not Internationlized DateTime": 20,
|
|
38
|
+
};
|
|
39
|
+
const addRow = (name, value) => {
|
|
40
|
+
const row = document.createElement("tr");
|
|
41
|
+
|
|
42
|
+
const col1 = document.createElement("td");
|
|
43
|
+
col1.classList.add("name");
|
|
44
|
+
col1.textContent = name;
|
|
45
|
+
|
|
46
|
+
const col2 = document.createElement("td");
|
|
47
|
+
col2.classList.add("value");
|
|
48
|
+
col2.textContent = value;
|
|
49
|
+
|
|
50
|
+
row.appendChild(col1);
|
|
51
|
+
row.appendChild(col2);
|
|
52
|
+
return row;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
for (const rowData of Object.entries(tableData)) {
|
|
56
|
+
if (!isDefaultLocale || rowData[0] !== "Untranslated Strings") {
|
|
57
|
+
tbody.appendChild(addRow(rowData[0], rowData[1]));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
holder.classList.add("stat");
|
|
62
|
+
name.classList.add("name");
|
|
63
|
+
name.textContent = "Summary";
|
|
64
|
+
holder.append(name);
|
|
65
|
+
|
|
66
|
+
table.appendChild(tbody);
|
|
67
|
+
holder.appendChild(table);
|
|
68
|
+
return holder;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function createStatusBarSection(data) {
|
|
72
|
+
const holder = document.createElement("div");
|
|
73
|
+
holder.classList.add("status-bar");
|
|
74
|
+
|
|
75
|
+
const generateBarEl = (name, total, current) => {
|
|
76
|
+
current = (current / total) * 100;
|
|
77
|
+
const holder = document.createElement("div");
|
|
78
|
+
holder.classList.add("bar-container");
|
|
79
|
+
|
|
80
|
+
const nameHolder = document.createElement("div");
|
|
81
|
+
nameHolder.classList.add("name");
|
|
82
|
+
nameHolder.textContent = name;
|
|
83
|
+
|
|
84
|
+
const barHolder = document.createElement("div");
|
|
85
|
+
barHolder.classList.add("bar-holder");
|
|
86
|
+
|
|
87
|
+
const bar = document.createElement("div");
|
|
88
|
+
bar.classList.add("bar");
|
|
89
|
+
bar.style.width = \`\${current}%\`;
|
|
90
|
+
bar.textContent = \`\${current}%\`;
|
|
91
|
+
|
|
92
|
+
barHolder.appendChild(bar);
|
|
93
|
+
holder.appendChild(nameHolder);
|
|
94
|
+
holder.appendChild(barHolder);
|
|
95
|
+
|
|
96
|
+
return holder;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const isDefaultLocale = false; // should be dynamically passed
|
|
100
|
+
const totalStrings = isDefaultLocale ? 100 : 100; // reviewed - ignore - dnt - autoignore - encoding
|
|
101
|
+
const totalI18nedStr = isDefaultLocale ? 100 : 70;
|
|
102
|
+
const totalLocStr = isDefaultLocale ? 100 : 90;
|
|
103
|
+
const totalI18nedNum = isDefaultLocale ? 100 : 50;
|
|
104
|
+
const totalI18nedDateTime = isDefaultLocale ? 100 : 80;
|
|
105
|
+
|
|
106
|
+
holder.appendChild(
|
|
107
|
+
generateBarEl("String I18n level", totalStrings, totalI18nedStr)
|
|
108
|
+
);
|
|
109
|
+
holder.appendChild(
|
|
110
|
+
generateBarEl("String L10n level", totalStrings, totalLocStr)
|
|
111
|
+
);
|
|
112
|
+
holder.appendChild(
|
|
113
|
+
generateBarEl("Number I18n level", totalStrings, totalI18nedNum)
|
|
114
|
+
);
|
|
115
|
+
holder.appendChild(
|
|
116
|
+
generateBarEl(
|
|
117
|
+
"DateTime I18n level",
|
|
118
|
+
totalStrings,
|
|
119
|
+
totalI18nedDateTime
|
|
120
|
+
)
|
|
121
|
+
);
|
|
122
|
+
return holder;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function generateCardContents(data) {
|
|
126
|
+
const cardContent = document.createElement("div");
|
|
127
|
+
cardContent.classList.add("card-content");
|
|
128
|
+
|
|
129
|
+
cardContent.appendChild(createStatusBarSection(data));
|
|
130
|
+
cardContent.appendChild(createStatSection(data));
|
|
131
|
+
return cardContent;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function createCardEl(locale, data) {
|
|
135
|
+
const card = document.createElement("div");
|
|
136
|
+
const title = document.createElement("div");
|
|
137
|
+
card.classList.add("card");
|
|
138
|
+
card.dataset.locale = locale;
|
|
139
|
+
title.classList.add("title");
|
|
140
|
+
title.textContent = \`\${locale} details\`;
|
|
141
|
+
|
|
142
|
+
// fire menu selection event on clicking the card
|
|
143
|
+
card.addEventListener("click", () => {
|
|
144
|
+
const previousSelectedSubMenu = document.querySelector(
|
|
145
|
+
'.sub-menu-item.selected'
|
|
146
|
+
);
|
|
147
|
+
if (previousSelectedSubMenu) {
|
|
148
|
+
window.previousSelectedLocale =
|
|
149
|
+
previousSelectedSubMenu.dataset.locale;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
document
|
|
153
|
+
.querySelector(\`.sub-menu-item[data-locale="\${locale}"]\`)
|
|
154
|
+
.click();
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
card.appendChild(title);
|
|
158
|
+
card.appendChild(generateCardContents(data));
|
|
159
|
+
return card;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function renderCards() {
|
|
163
|
+
// read from global variable appData;
|
|
164
|
+
const localeInfo = {
|
|
165
|
+
en_US: {
|
|
166
|
+
total: 1000,
|
|
167
|
+
localized: 700,
|
|
168
|
+
notLocalized: 100,
|
|
169
|
+
untranslated: 50,
|
|
170
|
+
encodingIssue: 20,
|
|
171
|
+
dnt: 15,
|
|
172
|
+
ignored: 10,
|
|
173
|
+
autoIgnored: 5,
|
|
174
|
+
currency: 20,
|
|
175
|
+
number: 20,
|
|
176
|
+
percentage: 15,
|
|
177
|
+
dateTime: 15,
|
|
178
|
+
date: 15,
|
|
179
|
+
time: 15,
|
|
180
|
+
notLocalizedcurrency: 20,
|
|
181
|
+
notLocalizednumber: 20,
|
|
182
|
+
notLocalizedpercentage: 15,
|
|
183
|
+
notLocalizeddateTime: 15,
|
|
184
|
+
notLocalizeddate: 15,
|
|
185
|
+
notLocalizedtime: 15,
|
|
186
|
+
},
|
|
187
|
+
fr_FR: {
|
|
188
|
+
total: 1000,
|
|
189
|
+
localized: 700,
|
|
190
|
+
notLocalized: 100,
|
|
191
|
+
untranslated: 50,
|
|
192
|
+
encodingIssue: 20,
|
|
193
|
+
dnt: 15,
|
|
194
|
+
ignored: 10,
|
|
195
|
+
autoIgnored: 5,
|
|
196
|
+
currency: 20,
|
|
197
|
+
number: 20,
|
|
198
|
+
percentage: 15,
|
|
199
|
+
dateTime: 15,
|
|
200
|
+
date: 15,
|
|
201
|
+
time: 15,
|
|
202
|
+
notLocalizedCurrency: 20,
|
|
203
|
+
notLocalizedNumber: 20,
|
|
204
|
+
notLocalizedPercentage: 15,
|
|
205
|
+
notLocalizedDateTime: 15,
|
|
206
|
+
notLocalizedDate: 15,
|
|
207
|
+
notLocalizedTime: 15,
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
if (Object.keys(localeInfo).length) {
|
|
212
|
+
const cardHolder = document.querySelector(
|
|
213
|
+
"#insights .cards .holder"
|
|
214
|
+
);
|
|
215
|
+
for (const locale in localeInfo) {
|
|
216
|
+
const cardEl = createCardEl(locale, localeInfo[locale]);
|
|
217
|
+
cardHolder.appendChild(cardEl);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
})();
|
|
223
|
+
`;
|
|
224
|
+
exports.default = _default;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = () => `(() => {
|
|
8
|
+
// for sidebar menu
|
|
9
|
+
const loadContent = (section, highlightMenu = false) => {
|
|
10
|
+
if (highlightMenu) {
|
|
11
|
+
document
|
|
12
|
+
.querySelector('li[data-page="overview"]')
|
|
13
|
+
?.classList.add("selected");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const contents = document.querySelectorAll(".content");
|
|
17
|
+
contents.forEach((content) => {
|
|
18
|
+
content.id !== section
|
|
19
|
+
? content.classList.remove("active")
|
|
20
|
+
: content.classList.add("active");
|
|
21
|
+
|
|
22
|
+
section === "overview" &&
|
|
23
|
+
window.persistOverviewCharts &&
|
|
24
|
+
window.persistOverviewCharts();
|
|
25
|
+
|
|
26
|
+
window.currentPage = section;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
31
|
+
const createMenuItems = (() => {
|
|
32
|
+
const ul = document.querySelector(".sidebar .submenu");
|
|
33
|
+
const createListItems = (locale) => {
|
|
34
|
+
const li = document.createElement("li");
|
|
35
|
+
li.classList.add("sub-menu-item");
|
|
36
|
+
li.dataset.locale = locale;
|
|
37
|
+
|
|
38
|
+
const a = document.createElement("a");
|
|
39
|
+
a.href = "#";
|
|
40
|
+
a.textContent = locale;
|
|
41
|
+
|
|
42
|
+
li.appendChild(a);
|
|
43
|
+
return li;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
for (const locale of Object.keys(DataStore.getLocalesData())) {
|
|
47
|
+
ul.appendChild(createListItems(locale));
|
|
48
|
+
}
|
|
49
|
+
})();
|
|
50
|
+
|
|
51
|
+
const menuItems = document.querySelectorAll(".menu-item"),
|
|
52
|
+
submenuItems = document.querySelectorAll(".sub-menu-item");
|
|
53
|
+
|
|
54
|
+
menuItems.forEach((item) => {
|
|
55
|
+
item.addEventListener("click", function (event) {
|
|
56
|
+
const selectedMenuItem = document.querySelector(
|
|
57
|
+
".menu-item.selected"
|
|
58
|
+
),
|
|
59
|
+
selectedSubmenu = document.querySelector(".submenu.active"),
|
|
60
|
+
page = item.dataset.page;
|
|
61
|
+
|
|
62
|
+
if (selectedMenuItem) {
|
|
63
|
+
selectedMenuItem.classList.remove("selected");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (selectedSubmenu) {
|
|
67
|
+
selectedSubmenu.classList.remove("active");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (item.classList.contains("has-submenu")) {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
item.classList.add("selected");
|
|
73
|
+
const submenu = item.querySelector(".submenu");
|
|
74
|
+
submenu.classList.add("active");
|
|
75
|
+
} else {
|
|
76
|
+
item.classList.add("selected");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (selectedSubmenu) {
|
|
80
|
+
selectedSubmenu
|
|
81
|
+
.querySelectorAll(".sub-menu-item")
|
|
82
|
+
.forEach((submenuItem) => {
|
|
83
|
+
submenuItem.textContent !== item.textContent &&
|
|
84
|
+
submenuItem.classList.remove("selected");
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
loadContent(page);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
loadContent("overview", true);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
submenuItems.forEach((sItem) => {
|
|
95
|
+
sItem.addEventListener("click", function (event) {
|
|
96
|
+
const selectedSubMenuItem = document.querySelector(
|
|
97
|
+
".sub-menu-item.selected"
|
|
98
|
+
);
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
event.stopPropagation();
|
|
101
|
+
|
|
102
|
+
if (selectedSubMenuItem) {
|
|
103
|
+
selectedSubMenuItem.classList.remove("selected");
|
|
104
|
+
window.previousSelectedLocale =
|
|
105
|
+
selectedSubMenuItem.dataset.locale;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
sItem.classList.add("selected");
|
|
109
|
+
loadContent("locale");
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// update footer info
|
|
114
|
+
const footer = document.querySelector(".sidebar .footer");
|
|
115
|
+
footer.textContent = \`${new Date().getFullYear()} @ Zeesoft. All rights reserved.\`;
|
|
116
|
+
});
|
|
117
|
+
})();`;
|
|
118
|
+
exports.default = _default;
|