isite 2023.1.2 → 2023.1.3

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.
@@ -207,14 +207,16 @@
207
207
  font-size: xx-large !important;
208
208
  }
209
209
 
210
- .rtl, .rtl input{
210
+ .rtl,
211
+ .rtl input {
211
212
  direction: rtl;
212
213
  }
213
-
214
- .ltr , .ltr input{
214
+
215
+ .ltr,
216
+ .ltr input {
215
217
  direction: ltr;
216
218
  }
217
-
219
+
218
220
  .height-auto {
219
221
  height: auto !important;
220
222
  }
@@ -249,6 +251,14 @@
249
251
  white-space: pre-wrap;
250
252
  }
251
253
 
254
+ .currency {
255
+ font-size: smaller;
256
+ font-weight: bold;
257
+ color: black;
258
+ text-shadow: 0 0 white;
259
+ text-transform: uppercase;
260
+ }
261
+
252
262
  .ww {
253
263
  width: 250px !important;
254
264
  white-space: pre-line !important;
@@ -140,7 +140,16 @@ app.directive('iButton', function () {
140
140
  } else if ($scope.type.like('*save*')) {
141
141
  $scope.fa = 'fas fa-save';
142
142
  $scope.class = 'btn-success';
143
- } else if ($scope.type.like('*view*') || $scope.type.like('*details*')) {
143
+ } else if ($scope.type.like('*list*')) {
144
+ $scope.fa = 'fas fa-list';
145
+ $scope.class = 'btn-info';
146
+ } else if ($scope.type.like('unapprove')) {
147
+ $scope.fa = 'fas fa-eject';
148
+ $scope.class = 'btn-danger';
149
+ } else if ($scope.type.like('approve')) {
150
+ $scope.fa = 'fas fa-check-double';
151
+ $scope.class = 'btn-primary';
152
+ }else if ($scope.type.like('*view*') || $scope.type.like('*details*')) {
144
153
  $scope.fa = 'fas fa-eye';
145
154
  $scope.class = 'btn-info';
146
155
  } else if ($scope.type.like('*delete*') || $scope.type.like('*remove*')) {
package/lib/parser.js CHANGED
@@ -289,12 +289,7 @@ module.exports = function init(req, res, ____0, route) {
289
289
  }
290
290
 
291
291
  function renderWord(name) {
292
- let w = ____0.word(name);
293
- if (w.done) {
294
- return w[req.session.lang] || name;
295
- } else {
296
- return name;
297
- }
292
+ return ____0.words.get(name)[req.session.lang] || name;
298
293
  }
299
294
 
300
295
  function getContent(name) {
package/lib/words.js CHANGED
@@ -1,127 +1,87 @@
1
1
  module.exports = function init(____0) {
2
- const words = function () {};
3
- words.list = [];
4
- words.db_list = [];
5
- words.$collectoin = ____0.connectCollection('app_options');
2
+ let app = function () {};
3
+ app.list = [];
4
+ app.$collectoin = ____0.connectCollection('app_words');
6
5
 
7
- words.$collectoin.findAll({ app_name: 'words' }, (err, docs) => {
8
- if (!err && docs && docs.length > 0) {
9
- words.db_list = docs;
10
- }
11
- });
6
+ app.$collectoin.findAll({ limit: 10000 }, (err, docs) => {
7
+ if (!err && docs && docs.length > 0) {
8
+ docs.forEach((doc) => {
9
+ app.list.unshift(doc);
10
+ });
11
+ }
12
+ });
12
13
 
13
- words.word = function (obj) {
14
- if (typeof obj === 'string') {
15
- return words.get(obj);
16
- }
17
- if (typeof obj === 'object') {
18
- return words.add(obj);
19
- }
20
- };
14
+ app.word = function (obj) {
15
+ if (typeof obj === 'string') {
16
+ return app.get(obj);
17
+ }
18
+ if (typeof obj === 'object') {
19
+ return app.add(obj);
20
+ }
21
+ };
21
22
 
22
- words.get = function (name) {
23
- let response = { done: !1, name: name };
24
- for (let i = 0; i < words.db_list.length; i++) {
25
- if (response.done) {
26
- break;
27
- }
28
- if (words.db_list[i].name == name) {
29
- response.done = !0;
30
- response.index = i;
31
- response.source = 'db_list';
32
- response = { ...response, ...words.db_list[i] };
33
- }
34
- }
35
- for (let i = 0; i < words.list.length; i++) {
36
- if (response.done) {
37
- break;
38
- }
39
- if (words.list[i].name == name) {
40
- response.done = !0;
41
- response.index = i;
42
- response.source = 'list';
43
- response = { ...response, ...words.list[i] };
44
- }
45
- }
46
- return response;
47
- };
23
+ app.get = function (name) {
24
+ if ((w = app.list.find((ww) => ww.name === name))) {
25
+ return w;
26
+ } else {
27
+ return app.add({ name: name });
28
+ }
29
+ };
48
30
 
49
- words.add = function (word) {
50
- word.app_name = 'words';
51
- let response = { done: !1, source: 'db_list', word: word };
52
- let w = words.get(word.name);
53
- if (w.done) {
54
- if (w.source == 'db_list') {
55
- response.done = !0;
56
- response.action = 'update';
57
- words.db_list[w.index] = { ...words.db_list[w.index], ...word };
58
- words.$collectoin.update(words.db_list[w.index]);
59
- } else if (w.source == 'list') {
60
- response.done = !0;
61
- response.action = 'add';
62
- words.$collectoin.add(word, (err, doc) => {
63
- if (!err && doc) {
64
- words.db_list.push(doc);
65
- }
66
- });
67
- }
68
- } else {
69
- response.done = !0;
70
- response.action = 'add';
71
- words.$collectoin.add(word, (err, doc) => {
72
- if (!err && doc) {
73
- words.db_list.push(doc);
74
- }
75
- });
31
+ app.add = app.set = function (word) {
32
+ let index = app.list.findIndex((w) => w.name === word.name);
33
+ if (index === -1) {
34
+ app.$collectoin.add(word, (err, doc) => {
35
+ if (!err && doc) {
36
+ app.list.push(doc);
76
37
  }
77
- return response;
78
- };
38
+ });
39
+ } else {
40
+ app.list[index] = word;
41
+ app.$collectoin.update(app.list[index]);
42
+ }
43
+
44
+ return word;
45
+ };
79
46
 
80
- words.addList = function (list, db = false) {
81
- if (typeof list === 'string') {
82
- ____0.readFile(list, (err, data) => {
83
- if (!err) {
84
- let arr = ____0.fromJson(data);
85
- for (let i = 0; i < arr.length; i++) {
86
- let word = arr[i];
87
- word.is_default = !0;
88
- word.file_path = list;
89
- if (db) {
90
- words.add(word);
91
- } else {
92
- words.list.push(arr[i]);
93
- }
94
- }
95
- }
96
- });
97
- } else if (Array.isArray(list)) {
98
- for (let i = 0; i < list.length; i++) {
99
- words.list.push(list[i]);
100
- }
101
- } else if (typeof list === 'object') {
102
- words.list.push(list);
47
+ app.addList = function (list) {
48
+ if (typeof list === 'string') {
49
+ ____0.readFile(list, (err, data) => {
50
+ if (!err) {
51
+ let arr = ____0.fromJson(data);
52
+ arr.forEach((doc) => {
53
+ app.add(doc);
54
+ });
103
55
  }
104
- };
56
+ });
57
+ } else if (Array.isArray(list)) {
58
+ list.forEach((doc) => {
59
+ app.add(doc);
60
+ });
61
+ } else if (typeof list === 'object') {
62
+ app.add(list);
63
+ }
64
+ };
105
65
 
106
- words.addPath = function (app_path) {
107
- words.addList(app_path + '/site_files/json/words.json' , false);
108
- };
66
+ app.addPath = function (app_path) {
67
+ app.addList(app_path + '/site_files/json/app.json', false);
68
+ };
109
69
 
110
- ____0.on(____0.strings[9], () => {
111
- ____0.get({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
112
- res.json({ done: !0, words: [...words.db_list, ...words.list] });
113
- });
70
+ ____0.on(____0.strings[9], () => {
71
+ ____0.get({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
72
+ res.json({ done: !0, words: app.list });
73
+ });
114
74
 
115
- ____0.post({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
116
- res.json(words.add(req.data.word));
117
- });
75
+ ____0.post({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
76
+ res.json(app.add(req.data.word));
77
+ });
118
78
 
119
- ____0.get('/x-api/words/get/:name', (req, res) => {
120
- res.json({
121
- word: words.get(req.params.name),
122
- });
123
- });
79
+ ____0.get('/x-api/words/get/:name', (req, res) => {
80
+ res.json({
81
+ word: app.get(req.params.name),
82
+ });
124
83
  });
84
+ });
125
85
 
126
- return words;
86
+ return app;
127
87
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2023.01.02",
3
+ "version": "2023.01.03",
4
4
  "description": "Create Secure Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {