isite 1.14.97 → 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 (47) hide show
  1. package/README.md +486 -475
  2. package/apps/client-side/app.js +28 -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/font-cairo.css +14 -0
  10. package/apps/client-side/site_files/css/font-droid.css +19 -0
  11. package/apps/client-side/site_files/css/fonts.css +6 -34
  12. package/apps/client-side/site_files/css/form.css +5 -100
  13. package/apps/client-side/site_files/css/modal.css +184 -164
  14. package/apps/client-side/site_files/css/tabs.css +3 -3
  15. package/apps/client-side/site_files/css/theme.css +1 -1
  16. package/apps/client-side/site_files/css/theme_dark.css +1 -1
  17. package/apps/client-side/site_files/css/theme_paper.css +175 -151
  18. package/apps/client-side/site_files/html/sub/i-date2.content.html +64 -0
  19. package/apps/client-side/site_files/html/sub/i-list.content.html +31 -0
  20. package/apps/client-side/site_files/html/sub/i-list2.content.html +22 -0
  21. package/apps/client-side/site_files/js/directive.js +1570 -1650
  22. package/apps/client-side/site_files/js/directive.min.js +2 -2
  23. package/apps/client-side/site_files/js/site.js +49 -15
  24. package/apps/client-side/site_files/js/site.min.js +1 -1
  25. package/apps/client-side/site_files/webfonts/fa-brands-400.eot +0 -0
  26. package/apps/client-side/site_files/webfonts/fa-brands-400.svg +3717 -0
  27. package/apps/client-side/site_files/webfonts/fa-brands-400.ttf +0 -0
  28. package/apps/client-side/site_files/webfonts/fa-brands-400.woff +0 -0
  29. package/apps/client-side/site_files/webfonts/fa-brands-400.woff2 +0 -0
  30. package/apps/client-side/site_files/webfonts/fa-regular-400.eot +0 -0
  31. package/apps/client-side/site_files/webfonts/fa-regular-400.svg +801 -0
  32. package/apps/client-side/site_files/webfonts/fa-regular-400.ttf +0 -0
  33. package/apps/client-side/site_files/webfonts/fa-regular-400.woff +0 -0
  34. package/apps/client-side/site_files/webfonts/fa-regular-400.woff2 +0 -0
  35. package/apps/client-side/site_files/webfonts/fa-solid-900.eot +0 -0
  36. package/apps/client-side/site_files/webfonts/fa-solid-900.svg +5034 -0
  37. package/apps/client-side/site_files/webfonts/fa-solid-900.ttf +0 -0
  38. package/apps/client-side/site_files/webfonts/fa-solid-900.woff +0 -0
  39. package/apps/client-side/site_files/webfonts/fa-solid-900.woff2 +0 -0
  40. package/apps/ui-print/site_files/js/index.js +2 -2
  41. package/isite_files/html/browser.html +1 -1
  42. package/lib/fsm.js +389 -346
  43. package/lib/parser.js +33 -9
  44. package/lib/routing.js +26 -7
  45. package/object-options/index.js +1 -1
  46. package/object-options/lib/fn.js +1 -1
  47. package/package.json +1 -1
package/lib/parser.js CHANGED
@@ -249,7 +249,18 @@ module.exports = function init(req, res, ____0, route) {
249
249
  }
250
250
 
251
251
  function getContent(name) {
252
- let path = ____0.path.join(route.parserDir, ____0.path.extname(name).replace('.', ''), name);
252
+ let path = null;
253
+
254
+ if (!path || !____0.isFileExistsSync(path)) {
255
+ let arr = name.split('/');
256
+ if (arr.length === 1) {
257
+ path = ____0.path.join(____0.path.dirname(route.parserDir), 'site_files', ____0.path.extname(arr[0]).replace('.', ''), arr[0]);
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]);
260
+ } else if (arr.length === 3) {
261
+ path = ____0.path.join(____0.path.dirname(route.parserDir), 'site_files', ____0.path.extname(arr[2]).replace('.', ''), arr[0], arr[1], arr[2]);
262
+ }
263
+ }
253
264
 
254
265
  if (!____0.isFileExistsSync(path)) {
255
266
  let arr = name.split('/');
@@ -276,11 +287,14 @@ module.exports = function init(req, res, ____0, route) {
276
287
  }
277
288
 
278
289
  if (!____0.isFileExistsSync(path)) {
279
- ____0.log(path, 'PATH NOT EXISTS');
290
+ ____0.log(path, 'PATH NOT EXISTS parser.getContent()');
280
291
  return '';
281
292
  }
282
293
 
283
- 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')) {
284
298
  let txt = ____0.readFileSync(path);
285
299
  let $ = ____0.$.load(txt);
286
300
  $ = renderHtml($);
@@ -420,29 +434,39 @@ module.exports = function init(req, res, ____0, route) {
420
434
  });
421
435
  }
422
436
 
423
- $('[x-import]').each(function (i, elem) {
437
+ $($('[x-import]').get().reverse()).each(function (i, elem) {
424
438
  let file = $(this).attr('x-import');
439
+ $(this).removeAttr('x-import');
440
+ $(this).attr('x-server' , 'x-import');
425
441
  if (file.endsWith('.html')) {
426
442
  $(this).html(getContent(file) + $(this).html());
443
+ }else if (file.endsWith('.css')) {
444
+ $(this).text(getContent(file) + $(this).html());
427
445
  } else {
428
446
  $(this).text(getContent(file) + $(this).text());
429
447
  }
430
448
  });
431
449
 
432
- $('[x-append]').each(function (i, elem) {
450
+ $($('[x-append]').get().reverse()).each(function (i, elem) {
433
451
  let file = $(this).attr('x-append');
452
+ $(this).removeAttr('x-append');
453
+ $(this).attr('x-server' , 'x-append');
434
454
  if (file.endsWith('.html')) {
435
455
  $(this).html($(this).html() + getContent(file));
456
+ }else if (file.endsWith('.css')) {
457
+ $(this).text($(this).html() + getContent(file));
436
458
  } else {
437
459
  $(this).text($(this).text() + getContent(file));
438
460
  }
439
461
  });
440
462
 
441
- $('[x-replace]').each(function (i, elem) {
463
+ $($('[x-replace]').get().reverse()).each(function (i, elem) {
442
464
  let file = $(this).attr('x-replace');
465
+ $(this).removeAttr('x-replace');
466
+ $(this).attr('x-server' , 'x-replace');
443
467
  if (file.endsWith('.html')) {
444
468
  $(this).html(getContent(file));
445
- } else {
469
+ }else {
446
470
  $(this).text(getContent(file));
447
471
  }
448
472
  });
@@ -517,8 +541,8 @@ module.exports = function init(req, res, ____0, route) {
517
541
  };
518
542
 
519
543
  parser.css = function (content) {
520
- content = parser.handleMatches(content);
521
-
544
+ content = parser.handleMatches(content);
545
+
522
546
  let matches = content.match(/var\(--.*?\)/g);
523
547
  if (matches) {
524
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') {
@@ -301,7 +317,7 @@ module.exports = function init(____0) {
301
317
  if (typeof r == 'string') {
302
318
  route.name = r.toLowerCase();
303
319
  route.name0 = r;
304
- route.public = false;
320
+ route.public = ____0.options.public || false;
305
321
  route.method = 'GET';
306
322
  route.path = null;
307
323
  route.parser = 'static';
@@ -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) {
@@ -323,10 +341,11 @@ module.exports = function init(____0) {
323
341
  } else {
324
342
  route.name = r.name.toLowerCase();
325
343
  route.name0 = r.name;
326
- route.public = r.public ?? false;
344
+ route.public = r.public ?? (____0.options.public || false);
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;
@@ -899,7 +918,7 @@ module.exports = function init(____0) {
899
918
  });
900
919
  };
901
920
 
902
- res.css = (name , _data) => {
921
+ res.css = (name, _data) => {
903
922
  ____0.fsm.getContent(name, (content) => {
904
923
  if (!content) {
905
924
  return res.status(404).end();
@@ -916,7 +935,7 @@ module.exports = function init(____0) {
916
935
  });
917
936
  };
918
937
 
919
- res.js = (name , _data) => {
938
+ res.js = (name, _data) => {
920
939
  ____0.fsm.getContent(name, (content) => {
921
940
  if (!content) {
922
941
  return res.status(404).end();
@@ -933,7 +952,7 @@ module.exports = function init(____0) {
933
952
  });
934
953
  };
935
954
 
936
- res.jsonFile = (name , _data) => {
955
+ res.jsonFile = (name, _data) => {
937
956
  ____0.fsm.getContent(name, (content) => {
938
957
  if (!content) {
939
958
  return res.status(404).end();
@@ -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": "1.14.97",
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": {