isite 1.14.98 → 2021.11.3-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.
Files changed (54) 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 +10 -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 +31 -131
  13. package/apps/client-side/site_files/css/layout.css +27 -13
  14. package/apps/client-side/site_files/css/modal.css +184 -164
  15. package/apps/client-side/site_files/css/tabs.css +3 -3
  16. package/apps/client-side/site_files/css/theme.css +2 -2
  17. package/apps/client-side/site_files/css/theme_dark.css +1 -1
  18. package/apps/client-side/site_files/css/theme_paper.css +175 -151
  19. package/apps/client-side/site_files/html/sub/i-date2.content.html +64 -0
  20. package/apps/client-side/site_files/html/sub/i-list.content.html +31 -0
  21. package/apps/client-side/site_files/html/sub/i-list2.content.html +22 -0
  22. package/apps/client-side/site_files/js/directive.js +1570 -1650
  23. package/apps/client-side/site_files/js/directive.min.js +2 -2
  24. package/apps/client-side/site_files/js/site.js +6 -0
  25. package/apps/client-side/site_files/js/site.min.js +1 -1
  26. package/apps/client-side/site_files/webfonts/fa-brands-400.eot +0 -0
  27. package/apps/client-side/site_files/webfonts/fa-brands-400.svg +3717 -0
  28. package/apps/client-side/site_files/webfonts/fa-brands-400.ttf +0 -0
  29. package/apps/client-side/site_files/webfonts/fa-brands-400.woff +0 -0
  30. package/apps/client-side/site_files/webfonts/fa-brands-400.woff2 +0 -0
  31. package/apps/client-side/site_files/webfonts/fa-regular-400.eot +0 -0
  32. package/apps/client-side/site_files/webfonts/fa-regular-400.svg +801 -0
  33. package/apps/client-side/site_files/webfonts/fa-regular-400.ttf +0 -0
  34. package/apps/client-side/site_files/webfonts/fa-regular-400.woff +0 -0
  35. package/apps/client-side/site_files/webfonts/fa-regular-400.woff2 +0 -0
  36. package/apps/client-side/site_files/webfonts/fa-solid-900.eot +0 -0
  37. package/apps/client-side/site_files/webfonts/fa-solid-900.svg +5034 -0
  38. package/apps/client-side/site_files/webfonts/fa-solid-900.ttf +0 -0
  39. package/apps/client-side/site_files/webfonts/fa-solid-900.woff +0 -0
  40. package/apps/client-side/site_files/webfonts/fa-solid-900.woff2 +0 -0
  41. package/apps/ui-print/site_files/js/index.js +1 -1
  42. package/index.js +2 -2
  43. package/isite_files/html/browser.html +1 -1
  44. package/lib/fsm.js +389 -346
  45. package/lib/mongodb.js +9 -7
  46. package/lib/parser.js +33 -9
  47. package/lib/routing.js +26 -7
  48. package/lib/security.js +2 -2
  49. package/lib/session.js +2 -8
  50. package/lib/sessions.js +4 -4
  51. package/lib/ws.js +3 -0
  52. package/object-options/index.js +4 -4
  53. package/object-options/lib/fn.js +1 -1
  54. package/package.json +1 -1
package/lib/mongodb.js CHANGED
@@ -110,6 +110,7 @@ module.exports = function init(____0) {
110
110
 
111
111
  let db_name = ____0.options.mongodb.prefix.db + name;
112
112
  let db_url = _mongo.connection;
113
+ ____0.log('\n ( Connecting DB : ' + db_url + ' ) \n');
113
114
  _mongo.client.connect(
114
115
  db_url,
115
116
  {
@@ -125,14 +126,16 @@ module.exports = function init(____0) {
125
126
 
126
127
  _mongo.connections.push({
127
128
  name: name,
129
+ url : db_url,
128
130
  db: db,
129
131
  client: client,
130
132
  connected: !0,
131
133
  });
132
-
134
+ ____0.log('\n ( Connected DB : ' + db_name + ' ) : ' + db_url + '\n');
133
135
  callback(err, db);
134
136
  } else {
135
137
  err.message += ' , ' + db_url;
138
+ ____0.log('\n ( Connected DB Error: ' + err.message + ' ) \n');
136
139
  callback(err, null);
137
140
  }
138
141
  _mongo.connectDBBusy = !1;
@@ -284,7 +287,7 @@ module.exports = function init(____0) {
284
287
  };
285
288
 
286
289
  _mongo.insert = _mongo.insertMany = function (obj, callback) {
287
- if (obj.docs.length === 0) {
290
+ if (!obj.docs || obj.docs.length === 0) {
288
291
  callback({
289
292
  message: 'docs array length is 0',
290
293
  });
@@ -292,27 +295,26 @@ module.exports = function init(____0) {
292
295
  }
293
296
  _mongo.connectDB(obj.dbName, function (err, db) {
294
297
  if (!err) {
295
- if (obj.collectionName === undefined) {
298
+ if (!obj.collectionName) {
296
299
  obj.collectionName = ____0.options.mongodb.collection;
297
300
  }
298
301
  obj.docs.forEach((doc) => {
299
302
  doc = _mongo.handleDoc(doc);
300
303
  });
301
- db.collection(____0.options.mongodb.prefix.collection + obj.collectionName).insertMany(obj.docs , obj.options , function (err, result) {
304
+ db.collection(____0.options.mongodb.prefix.collection + obj.collectionName).insertMany(obj.docs, obj.options, function (err, result) {
302
305
  if (!err) {
303
306
  callback(null, result);
304
-
305
307
  ____0.call('mongodb after insert many', {
306
308
  db: obj.dbName,
307
309
  collection: obj.collectionName,
308
310
  docs: obj.docs,
309
311
  });
310
312
  } else {
311
- callback(err);
313
+ console.log(err.message);
312
314
  }
313
315
  });
314
316
  } else {
315
- callback(err);
317
+ console.log(err.message);
316
318
  }
317
319
  });
318
320
  };
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();
package/lib/security.js CHANGED
@@ -443,7 +443,7 @@ module.exports = function init(____0) {
443
443
  ) {
444
444
  if ($req) {
445
445
  $req.session.user = _user;
446
- $req.session('user_id', _user.id);
446
+ $req.session.set('user_id', _user.id);
447
447
  }
448
448
  callback(null, _user);
449
449
  ____0.call('user login', {
@@ -485,7 +485,7 @@ module.exports = function init(____0) {
485
485
 
486
486
  if ($req) {
487
487
  $req.session.user = doc;
488
- $req.session('user_id', doc.id);
488
+ $req.session.set('user_id', doc.id);
489
489
  }
490
490
 
491
491
  callback(null, doc);
package/lib/session.js CHANGED
@@ -1,11 +1,5 @@
1
1
  module.exports = function init(req, res, ____0, callback) {
2
- let session = function (key, value) {
3
- if (value === undefined) {
4
- return session.get(key);
5
- } else {
6
- session.set(key, value);
7
- }
8
- };
2
+ let session = {};
9
3
 
10
4
  session.save = function () {
11
5
  session = ____0.sessions.save(session);
@@ -214,7 +208,7 @@ module.exports = function init(req, res, ____0, callback) {
214
208
 
215
209
 
216
210
 
217
- session.user_id = session('user_id');
211
+ session.user_id = session.get('user_id');
218
212
 
219
213
  if (____0.security && session.user_id) {
220
214
  ____0.security.getUser(
package/lib/sessions.js CHANGED
@@ -151,7 +151,7 @@ module.exports = function init(____0) {
151
151
  };
152
152
 
153
153
  ____0.on('[any][saving data]', function () {
154
- sessions.saveAll();
154
+ sessions.saveAll();
155
155
  });
156
156
 
157
157
  sessions.busy = !1;
@@ -230,7 +230,6 @@ module.exports = function init(____0) {
230
230
  where: {},
231
231
  },
232
232
  function (err, result) {
233
- sessions.busy = !1;
234
233
  if (sessions.list.length === 0) {
235
234
  callback(
236
235
  {
@@ -238,13 +237,14 @@ module.exports = function init(____0) {
238
237
  },
239
238
  null,
240
239
  );
240
+ sessions.busy = !1;
241
241
  return;
242
242
  }
243
243
 
244
- /*$sessions.insertMany(sessions.list, function (err, docs) {
244
+ $sessions.insertMany(sessions.list, function (err, docs) {
245
245
  callback(err, docs);
246
246
  sessions.busy = !1;
247
- });*/
247
+ });
248
248
  },
249
249
  );
250
250
  };
package/lib/ws.js CHANGED
@@ -84,6 +84,9 @@ module.exports = function init(____0) {
84
84
  console.log('client.onError Not Implement ...', e);
85
85
  },
86
86
  send: function (message) {
87
+ if (!message) {
88
+ return;
89
+ }
87
90
  if (this.ws && this.ws.readyState === ____0.ws.lib.OPEN) {
88
91
  if (typeof message === 'string') {
89
92
  this.ws.send(
@@ -38,13 +38,13 @@ function setOptions(_options, ____0) {
38
38
  name: name,
39
39
  hostname : 'localhost',
40
40
  key : null,
41
- saving_time: 10,
41
+ savingTime: 10,
42
42
  _0x14xo: _0x14xo, // 3259376545129191
43
43
  _0xddxo: _0xddxo ,// 421957684138766241719191
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',
@@ -60,7 +60,7 @@ function setOptions(_options, ____0) {
60
60
  enabled: !0,
61
61
  config : {},
62
62
  protocal : 'mongodb://',
63
- host: 'localhost',
63
+ host: '127.0.0.1',
64
64
  port: '27017',
65
65
  userName: null,
66
66
  password: null,
@@ -131,7 +131,7 @@ function setOptions(_options, ____0) {
131
131
  _x0oo.upload_dir = _x0oo.upload_dir || template.upload_dir;
132
132
  _x0oo.download_dir = _x0oo.download_dir || template.download_dir;
133
133
 
134
- _x0oo.saving_time = _x0oo.saving_time ?? template.saving_time;
134
+ _x0oo.savingTime = _x0oo.savingTime ?? template.savingTime;
135
135
  _x0oo.hostname = _x0oo.hostname || template.hostname;
136
136
  _x0oo.log = _x0oo.log ?? template.log;
137
137
  _x0oo.lang = _x0oo.lang ?? template.lang;
@@ -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.98",
3
+ "version": "2021.11.30.1",
4
4
  "description": "Create Enterprise Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {