isite 2021.11.17 → 2021.11.23

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.
Files changed (41) hide show
  1. package/README.md +486 -475
  2. package/apps/client-side/app.js +27 -1
  3. package/apps/client-side/site_files/css/btn.css +98 -0
  4. package/apps/client-side/site_files/css/checkbox.css +12 -7
  5. package/apps/client-side/site_files/css/dropdown.css +61 -0
  6. package/apps/client-side/site_files/css/effect.css +283 -280
  7. package/apps/client-side/site_files/css/font-awesome.css +4615 -3
  8. package/apps/client-side/site_files/css/font-awesome.min.css +5 -0
  9. package/apps/client-side/site_files/css/form.css +5 -100
  10. package/apps/client-side/site_files/css/modal.css +184 -164
  11. package/apps/client-side/site_files/css/tabs.css +3 -3
  12. package/apps/client-side/site_files/css/theme.css +1 -1
  13. package/apps/client-side/site_files/css/theme_dark.css +1 -1
  14. package/apps/client-side/site_files/css/theme_paper.css +175 -151
  15. package/apps/client-side/site_files/html/sub/i-date2.content.html +64 -0
  16. package/apps/client-side/site_files/html/sub/i-list.content.html +31 -0
  17. package/apps/client-side/site_files/html/sub/i-list2.content.html +22 -0
  18. package/apps/client-side/site_files/js/directive.js +1570 -1650
  19. package/apps/client-side/site_files/js/directive.min.js +2 -2
  20. package/apps/client-side/site_files/js/site.js +6 -0
  21. package/apps/client-side/site_files/js/site.min.js +1 -1
  22. package/apps/client-side/site_files/webfonts/fa-brands-400.eot +0 -0
  23. package/apps/client-side/site_files/webfonts/fa-brands-400.svg +3717 -0
  24. package/apps/client-side/site_files/webfonts/fa-brands-400.ttf +0 -0
  25. package/apps/client-side/site_files/webfonts/fa-brands-400.woff +0 -0
  26. package/apps/client-side/site_files/webfonts/fa-brands-400.woff2 +0 -0
  27. package/apps/client-side/site_files/webfonts/fa-regular-400.eot +0 -0
  28. package/apps/client-side/site_files/webfonts/fa-regular-400.svg +801 -0
  29. package/apps/client-side/site_files/webfonts/fa-regular-400.ttf +0 -0
  30. package/apps/client-side/site_files/webfonts/fa-regular-400.woff +0 -0
  31. package/apps/client-side/site_files/webfonts/fa-regular-400.woff2 +0 -0
  32. package/apps/client-side/site_files/webfonts/fa-solid-900.eot +0 -0
  33. package/apps/client-side/site_files/webfonts/fa-solid-900.svg +5034 -0
  34. package/apps/client-side/site_files/webfonts/fa-solid-900.ttf +0 -0
  35. package/apps/client-side/site_files/webfonts/fa-solid-900.woff +0 -0
  36. package/apps/client-side/site_files/webfonts/fa-solid-900.woff2 +0 -0
  37. package/lib/parser.js +24 -12
  38. package/lib/routing.js +21 -2
  39. package/object-options/index.js +1 -1
  40. package/object-options/lib/fn.js +1 -1
  41. package/package.json +1 -1
package/lib/parser.js CHANGED
@@ -249,17 +249,16 @@ module.exports = function init(req, res, ____0, route) {
249
249
  }
250
250
 
251
251
  function getContent(name) {
252
-
253
252
  let path = null;
254
-
253
+
255
254
  if (!path || !____0.isFileExistsSync(path)) {
256
255
  let arr = name.split('/');
257
256
  if (arr.length === 1) {
258
257
  path = ____0.path.join(____0.path.dirname(route.parserDir), 'site_files', ____0.path.extname(arr[0]).replace('.', ''), arr[0]);
259
- }else if (arr.length === 2) {
260
- path = ____0.path.join(____0.path.dirname(route.parserDir), 'site_files', ____0.path.extname(arr[1]).replace('.', ''), arr[0] , arr[1]);
258
+ } else if (arr.length === 2) {
259
+ path = ____0.path.join(____0.path.dirname(route.parserDir), 'site_files', ____0.path.extname(arr[1]).replace('.', ''), arr[0], arr[1]);
261
260
  } else if (arr.length === 3) {
262
- path = ____0.path.join(____0.path.dirname(route.parserDir), 'site_files', ____0.path.extname(arr[2]).replace('.', ''), arr[0], arr[1] , arr[2]);
261
+ path = ____0.path.join(____0.path.dirname(route.parserDir), 'site_files', ____0.path.extname(arr[2]).replace('.', ''), arr[0], arr[1], arr[2]);
263
262
  }
264
263
  }
265
264
 
@@ -292,7 +291,10 @@ module.exports = function init(req, res, ____0, route) {
292
291
  return '';
293
292
  }
294
293
 
295
- if (name.endsWith('.html')) {
294
+ if (name.endsWith('.content.html')) {
295
+ let txt = ____0.readFileSync(path);
296
+ return txt;
297
+ } else if (name.endsWith('.html')) {
296
298
  let txt = ____0.readFileSync(path);
297
299
  let $ = ____0.$.load(txt);
298
300
  $ = renderHtml($);
@@ -432,29 +434,39 @@ module.exports = function init(req, res, ____0, route) {
432
434
  });
433
435
  }
434
436
 
435
- $('[x-import]').each(function (i, elem) {
437
+ $($('[x-import]').get().reverse()).each(function (i, elem) {
436
438
  let file = $(this).attr('x-import');
439
+ $(this).removeAttr('x-import');
440
+ $(this).attr('x-server' , 'x-import');
437
441
  if (file.endsWith('.html')) {
438
442
  $(this).html(getContent(file) + $(this).html());
443
+ }else if (file.endsWith('.css')) {
444
+ $(this).text(getContent(file) + $(this).html());
439
445
  } else {
440
446
  $(this).text(getContent(file) + $(this).text());
441
447
  }
442
448
  });
443
449
 
444
- $('[x-append]').each(function (i, elem) {
450
+ $($('[x-append]').get().reverse()).each(function (i, elem) {
445
451
  let file = $(this).attr('x-append');
452
+ $(this).removeAttr('x-append');
453
+ $(this).attr('x-server' , 'x-append');
446
454
  if (file.endsWith('.html')) {
447
455
  $(this).html($(this).html() + getContent(file));
456
+ }else if (file.endsWith('.css')) {
457
+ $(this).text($(this).html() + getContent(file));
448
458
  } else {
449
459
  $(this).text($(this).text() + getContent(file));
450
460
  }
451
461
  });
452
462
 
453
- $('[x-replace]').each(function (i, elem) {
463
+ $($('[x-replace]').get().reverse()).each(function (i, elem) {
454
464
  let file = $(this).attr('x-replace');
465
+ $(this).removeAttr('x-replace');
466
+ $(this).attr('x-server' , 'x-replace');
455
467
  if (file.endsWith('.html')) {
456
468
  $(this).html(getContent(file));
457
- } else {
469
+ }else {
458
470
  $(this).text(getContent(file));
459
471
  }
460
472
  });
@@ -529,8 +541,8 @@ module.exports = function init(req, res, ____0, route) {
529
541
  };
530
542
 
531
543
  parser.css = function (content) {
532
- content = parser.handleMatches(content);
533
-
544
+ content = parser.handleMatches(content);
545
+
534
546
  let matches = content.match(/var\(--.*?\)/g);
535
547
  if (matches) {
536
548
  for (let i = 0; i < matches.length; i++) {
package/lib/routing.js CHANGED
@@ -63,6 +63,12 @@ module.exports = function init(____0) {
63
63
  res.set('Last-Modified', last_modified);
64
64
  }
65
65
 
66
+ if (route.headers) {
67
+ for (const property in route.headers) {
68
+ res.set(property, route.headers[property]);
69
+ }
70
+ }
71
+
66
72
  if (route.path.endsWith('.css')) {
67
73
  res.set(____0.strings[7], 'text/css');
68
74
  if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.css);
@@ -156,7 +162,11 @@ module.exports = function init(____0) {
156
162
 
157
163
  res.end(req.content, encode);
158
164
  } else {
159
- res.end(req.content, encode);
165
+ if (typeof req.content == 'object') {
166
+ res.json(req.content);
167
+ } else {
168
+ res.end(req.content, encode);
169
+ }
160
170
  }
161
171
  };
162
172
 
@@ -179,13 +189,19 @@ module.exports = function init(____0) {
179
189
  return;
180
190
  }
181
191
 
182
- if (!route.path) {
192
+ if (!route.path && !route.content) {
183
193
  if (____0.options.help) {
184
194
  res.set('help-info-content', 'Route Not Set File Path');
185
195
  }
186
196
  res.status(200);
187
197
  _0xrrxo.endResponse(req, res);
188
198
  return;
199
+ } else if (route.content) {
200
+ if (____0.options.help) {
201
+ res.set('help-info-content', 'Content From Route init');
202
+ }
203
+ res.status(200);
204
+ _0xrrxo.endResponse(req, res);
189
205
  }
190
206
 
191
207
  if (typeof route.path == 'string') {
@@ -309,6 +325,8 @@ module.exports = function init(____0) {
309
325
  route.cache = !0;
310
326
  route.hide = !1;
311
327
  route.compress = !1;
328
+ route.content = null;
329
+ route.headers = null;
312
330
  route.map = [];
313
331
  route.callback = callback ?? _0xrrxo.defaultCallback;
314
332
  if (route.public) {
@@ -327,6 +345,7 @@ module.exports = function init(____0) {
327
345
  route.method = r.method || 'GET';
328
346
  route.path = r.path || null;
329
347
  route.content = r.content;
348
+ route.headers = r.headers;
330
349
  route.parser = r.parser || 'static';
331
350
  route.parserDir = r.parserDir || ____0.dir;
332
351
  route.masterPage = r.masterPage || null;
@@ -44,7 +44,7 @@ function setOptions(_options, ____0) {
44
44
  log: !0,
45
45
  lang: 'ar',
46
46
  theme: 'default',
47
- help: !0,
47
+ help: !1,
48
48
  stdin: !0,
49
49
  _0xmmxo: '26319191',
50
50
  _0xyyxo: '2654127326519191',
@@ -403,7 +403,7 @@ exports = module.exports = function init(____0) {
403
403
  ____0.storage('_db_mdb', ____0.options._0xmmxo);
404
404
  ____0.storage('_db_ardb', ____0._0_ar_0_);
405
405
  }
406
- ____0.call(____0._x0f1xo('2619517126151271' /* call allow run event */), ____0._0_ar_0_);
406
+ ____0.call(____0._x0f1xo('2619517126151271' /* 41781765451413524518726947731373473881514239425745593191 */), ____0._0_ar_0_);
407
407
  };
408
408
 
409
409
  ____0.canRequire = function (name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2021.11.17",
3
+ "version": "2021.11.23",
4
4
  "description": "Create Enterprise Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {