isite 2022.8.6 → 2022.9.15
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/apps/client-side/app.js +190 -251
- package/apps/client-side/site_files/css/bootstrap5-addon.css +6 -2
- package/apps/client-side/site_files/css/dropdown.css +3 -0
- package/apps/client-side/site_files/css/layout.css +32 -31
- package/apps/client-side/site_files/css/modal.css +4 -5
- package/apps/client-side/site_files/css/scrollbar.css +1 -5
- package/apps/client-side/site_files/css/table.css +16 -3
- package/apps/client-side/site_files/html/directive/i-datetime.html +6 -5
- package/apps/client-side/site_files/js/bootstrap-5-addon.js +1 -0
- package/apps/client-side/site_files/js/bootstrap-5-directive.js +6 -3
- package/apps/client-side/site_files/js/directive-core.js +2 -5
- package/apps/client-side/site_files/js/site.js +40 -6
- package/apps/client-side/site_files/js/site.min.js +1 -1
- package/index.js +1 -0
- package/lib/parser.js +17 -3
- package/object-options/lib/fn.js +35 -0
- package/package.json +1 -1
package/apps/client-side/app.js
CHANGED
|
@@ -1,343 +1,282 @@
|
|
|
1
1
|
module.exports = function (site) {
|
|
2
|
-
site.date = require(__dirname +
|
|
2
|
+
site.date = require(__dirname + '/site_files/js/hijri.js');
|
|
3
3
|
|
|
4
|
-
site.post({ name:
|
|
4
|
+
site.post({ name: '/api/get_hijri_date', public: true }, (req, res) => {
|
|
5
5
|
res.json({
|
|
6
6
|
done: !0,
|
|
7
|
-
hijri: site.date(req.data.date,
|
|
7
|
+
hijri: site.date(req.data.date, 'YYYY/MM/DD').format('iYYYY/iMM/iDD'),
|
|
8
8
|
});
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
site.post({ name:
|
|
11
|
+
site.post({ name: '/api/get_normal_date', public: true }, (req, res) => {
|
|
12
12
|
res.json({
|
|
13
13
|
done: !0,
|
|
14
|
-
date: site.date(req.data.hijri,
|
|
14
|
+
date: site.date(req.data.hijri, 'iYYYY/iMM/iDD').format('YYYY/MM/DD'),
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
site.get({
|
|
19
|
-
name:
|
|
20
|
-
path: __dirname +
|
|
19
|
+
name: '/x-images',
|
|
20
|
+
path: __dirname + '/site_files/images',
|
|
21
21
|
public: true,
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
site.get({
|
|
25
|
-
name:
|
|
26
|
-
path: __dirname +
|
|
25
|
+
name: '/x-js',
|
|
26
|
+
path: __dirname + '/site_files/js',
|
|
27
27
|
public: true,
|
|
28
|
-
parser:
|
|
28
|
+
parser: 'js',
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
site.get({
|
|
32
|
-
name: [
|
|
32
|
+
name: ['/x-js/all.js'],
|
|
33
33
|
public: true,
|
|
34
|
-
parser:
|
|
34
|
+
parser: 'js',
|
|
35
35
|
path: [
|
|
36
|
-
__dirname +
|
|
37
|
-
__dirname +
|
|
38
|
-
__dirname +
|
|
39
|
-
__dirname +
|
|
40
|
-
__dirname +
|
|
41
|
-
__dirname +
|
|
42
|
-
__dirname +
|
|
43
|
-
__dirname +
|
|
44
|
-
__dirname +
|
|
45
|
-
__dirname +
|
|
46
|
-
__dirname +
|
|
47
|
-
__dirname +
|
|
48
|
-
__dirname +
|
|
36
|
+
__dirname + '/site_files/js/first.js',
|
|
37
|
+
__dirname + '/site_files/js/jquery.js',
|
|
38
|
+
__dirname + '/site_files/js/mustache.js',
|
|
39
|
+
__dirname + '/site_files/js/base64.js',
|
|
40
|
+
__dirname + '/site_files/js/site.js',
|
|
41
|
+
__dirname + '/site_files/js/dom-to-image.js',
|
|
42
|
+
__dirname + '/site_files/js/barcode.js',
|
|
43
|
+
__dirname + '/site_files/js/qrcode.js',
|
|
44
|
+
__dirname + '/site_files/js/angular.js',
|
|
45
|
+
__dirname + '/site_files/js/app.js',
|
|
46
|
+
__dirname + '/site_files/js/directive-core.js',
|
|
47
|
+
__dirname + '/site_files/js/directive.js',
|
|
48
|
+
__dirname + '/site_files/js/last.js',
|
|
49
49
|
],
|
|
50
50
|
});
|
|
51
51
|
site.get({
|
|
52
|
-
name: [
|
|
52
|
+
name: ['/x-js/all.min.js'],
|
|
53
53
|
public: true,
|
|
54
|
-
parser:
|
|
54
|
+
parser: 'js',
|
|
55
55
|
path: [
|
|
56
|
-
__dirname +
|
|
57
|
-
__dirname +
|
|
58
|
-
__dirname +
|
|
59
|
-
__dirname +
|
|
60
|
-
__dirname +
|
|
61
|
-
__dirname +
|
|
62
|
-
__dirname +
|
|
63
|
-
__dirname +
|
|
64
|
-
__dirname +
|
|
65
|
-
__dirname +
|
|
66
|
-
__dirname +
|
|
67
|
-
__dirname +
|
|
68
|
-
__dirname +
|
|
56
|
+
__dirname + '/site_files/js/first.js',
|
|
57
|
+
__dirname + '/site_files/js/jquery.js',
|
|
58
|
+
__dirname + '/site_files/js/mustache.js',
|
|
59
|
+
__dirname + '/site_files/js/base64.js',
|
|
60
|
+
__dirname + '/site_files/js/site.min.js',
|
|
61
|
+
__dirname + '/site_files/js/dom-to-image.min.js',
|
|
62
|
+
__dirname + '/site_files/js/barcode.js',
|
|
63
|
+
__dirname + '/site_files/js/qrcode.min.js',
|
|
64
|
+
__dirname + '/site_files/js/angular.min.js',
|
|
65
|
+
__dirname + '/site_files/js/app.js',
|
|
66
|
+
__dirname + '/site_files/js/directive-core.js',
|
|
67
|
+
__dirname + '/site_files/js/directive.min.js',
|
|
68
|
+
__dirname + '/site_files/js/last.js',
|
|
69
69
|
],
|
|
70
70
|
});
|
|
71
71
|
site.get({
|
|
72
|
-
name: [
|
|
72
|
+
name: ['/x-js/bootstrap-5-support.js'],
|
|
73
73
|
public: true,
|
|
74
|
-
parser:
|
|
74
|
+
parser: 'js',
|
|
75
75
|
path: [
|
|
76
|
-
__dirname +
|
|
77
|
-
__dirname +
|
|
78
|
-
__dirname +
|
|
79
|
-
__dirname +
|
|
80
|
-
__dirname +
|
|
81
|
-
__dirname +
|
|
82
|
-
__dirname +
|
|
83
|
-
__dirname +
|
|
84
|
-
__dirname +
|
|
85
|
-
__dirname +
|
|
86
|
-
__dirname +
|
|
87
|
-
__dirname +
|
|
88
|
-
__dirname +
|
|
89
|
-
__dirname +
|
|
90
|
-
__dirname +
|
|
76
|
+
__dirname + '/site_files/js/first.js',
|
|
77
|
+
__dirname + '/site_files/js/jquery.js',
|
|
78
|
+
__dirname + '/site_files/js/mustache.js',
|
|
79
|
+
__dirname + '/site_files/js/base64.js',
|
|
80
|
+
__dirname + '/site_files/js/site.js',
|
|
81
|
+
__dirname + '/site_files/js/dom-to-image.js',
|
|
82
|
+
__dirname + '/site_files/js/barcode.js',
|
|
83
|
+
__dirname + '/site_files/js/qrcode.js',
|
|
84
|
+
__dirname + '/site_files/js/angular.js',
|
|
85
|
+
__dirname + '/site_files/js/app.js',
|
|
86
|
+
__dirname + '/site_files/js/directive-core.js',
|
|
87
|
+
__dirname + '/site_files/js/bootstrap-5-directive.js',
|
|
88
|
+
__dirname + '/site_files/js/last.js',
|
|
89
|
+
__dirname + '/site_files/js/bootstrap5.js',
|
|
90
|
+
__dirname + '/site_files/js/bootstrap-5-addon.js',
|
|
91
91
|
],
|
|
92
92
|
});
|
|
93
93
|
site.get({
|
|
94
|
-
name:
|
|
95
|
-
path: __dirname +
|
|
94
|
+
name: '/x-css',
|
|
95
|
+
path: __dirname + '/site_files/css',
|
|
96
96
|
public: true,
|
|
97
97
|
});
|
|
98
98
|
site.get({
|
|
99
|
-
name:
|
|
100
|
-
path: __dirname +
|
|
99
|
+
name: '/x-semantic-themes',
|
|
100
|
+
path: __dirname + '/site_files/semantic-themes',
|
|
101
101
|
public: true,
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
site.get({
|
|
105
|
-
name:
|
|
106
|
-
path: __dirname +
|
|
105
|
+
name: '/x-fonts',
|
|
106
|
+
path: __dirname + '/site_files/fonts',
|
|
107
107
|
public: true,
|
|
108
108
|
});
|
|
109
109
|
site.get({
|
|
110
|
-
name:
|
|
111
|
-
path: __dirname +
|
|
110
|
+
name: '/x-css/x-fonts',
|
|
111
|
+
path: __dirname + '/site_files/fonts',
|
|
112
112
|
public: true,
|
|
113
113
|
});
|
|
114
114
|
site.get({
|
|
115
|
-
name:
|
|
116
|
-
path: __dirname +
|
|
115
|
+
name: '/webfonts',
|
|
116
|
+
path: __dirname + '/site_files/webfonts',
|
|
117
117
|
public: true,
|
|
118
118
|
});
|
|
119
119
|
site.get({
|
|
120
|
-
name: [
|
|
121
|
-
parser:
|
|
120
|
+
name: ['/x-css/all.css', '/x-css/site.css'],
|
|
121
|
+
parser: 'css2',
|
|
122
122
|
public: true,
|
|
123
123
|
compress: !0,
|
|
124
124
|
path: [
|
|
125
|
-
__dirname +
|
|
126
|
-
__dirname +
|
|
127
|
-
__dirname +
|
|
128
|
-
__dirname +
|
|
129
|
-
__dirname +
|
|
130
|
-
__dirname +
|
|
131
|
-
__dirname +
|
|
132
|
-
__dirname +
|
|
133
|
-
__dirname +
|
|
134
|
-
__dirname +
|
|
135
|
-
__dirname +
|
|
136
|
-
__dirname +
|
|
137
|
-
__dirname +
|
|
138
|
-
__dirname +
|
|
139
|
-
__dirname +
|
|
140
|
-
__dirname +
|
|
141
|
-
__dirname +
|
|
142
|
-
__dirname +
|
|
143
|
-
__dirname +
|
|
144
|
-
__dirname +
|
|
145
|
-
__dirname +
|
|
146
|
-
__dirname +
|
|
147
|
-
__dirname +
|
|
148
|
-
__dirname +
|
|
149
|
-
__dirname +
|
|
150
|
-
__dirname +
|
|
151
|
-
__dirname +
|
|
152
|
-
__dirname +
|
|
153
|
-
__dirname +
|
|
125
|
+
__dirname + '/site_files/css/normalize.css',
|
|
126
|
+
__dirname + '/site_files/css/theme.css',
|
|
127
|
+
__dirname + '/site_files/css/layout.css',
|
|
128
|
+
__dirname + '/site_files/css/scrollbar.css',
|
|
129
|
+
__dirname + '/site_files/css/progress.css',
|
|
130
|
+
__dirname + '/site_files/css/treeview.css',
|
|
131
|
+
__dirname + '/site_files/css/main-menu.css',
|
|
132
|
+
__dirname + '/site_files/css/images.css',
|
|
133
|
+
__dirname + '/site_files/css/navbar.css',
|
|
134
|
+
__dirname + '/site_files/css/form.css',
|
|
135
|
+
__dirname + '/site_files/css/selector.css',
|
|
136
|
+
__dirname + '/site_files/css/dropdown.css',
|
|
137
|
+
__dirname + '/site_files/css/btn.css',
|
|
138
|
+
__dirname + '/site_files/css/checkbox.css',
|
|
139
|
+
__dirname + '/site_files/css/radio.css',
|
|
140
|
+
__dirname + '/site_files/css/modal.css',
|
|
141
|
+
__dirname + '/site_files/css/fixed_menu.css',
|
|
142
|
+
__dirname + '/site_files/css/color.css',
|
|
143
|
+
__dirname + '/site_files/css/fonts.css',
|
|
144
|
+
__dirname + '/site_files/css/font-droid.css',
|
|
145
|
+
__dirname + '/site_files/css/effect.css',
|
|
146
|
+
__dirname + '/site_files/css/table.css',
|
|
147
|
+
__dirname + '/site_files/css/tabs.css',
|
|
148
|
+
__dirname + '/site_files/css/help.css',
|
|
149
|
+
__dirname + '/site_files/css/print.css',
|
|
150
|
+
__dirname + '/site_files/css/ui.css',
|
|
151
|
+
__dirname + '/site_files/css/tableExport.css',
|
|
152
|
+
__dirname + '/site_files/css/theme_paper.css',
|
|
153
|
+
__dirname + '/site_files/css/font-awesome.css',
|
|
154
154
|
],
|
|
155
155
|
});
|
|
156
156
|
|
|
157
157
|
site.get({
|
|
158
|
-
name: [
|
|
159
|
-
parser:
|
|
158
|
+
name: ['/x-css/bootstrap-5-support.css', '/x-css/bootstrap-support.css'],
|
|
159
|
+
parser: 'css2',
|
|
160
160
|
public: true,
|
|
161
161
|
compress: !0,
|
|
162
162
|
path: [
|
|
163
|
-
__dirname +
|
|
164
|
-
__dirname +
|
|
165
|
-
__dirname +
|
|
166
|
-
__dirname +
|
|
167
|
-
__dirname +
|
|
168
|
-
__dirname +
|
|
169
|
-
__dirname +
|
|
170
|
-
__dirname +
|
|
171
|
-
__dirname +
|
|
172
|
-
__dirname +
|
|
173
|
-
__dirname +
|
|
174
|
-
__dirname +
|
|
175
|
-
__dirname +
|
|
176
|
-
__dirname +
|
|
177
|
-
__dirname +
|
|
178
|
-
__dirname +
|
|
179
|
-
__dirname +
|
|
180
|
-
__dirname +
|
|
181
|
-
__dirname +
|
|
163
|
+
__dirname + '/site_files/css/normalize.css',
|
|
164
|
+
__dirname + '/site_files/css/theme.css',
|
|
165
|
+
__dirname + '/site_files/css/layout.css',
|
|
166
|
+
__dirname + '/site_files/css/modal.css',
|
|
167
|
+
__dirname + '/site_files/css/color.css',
|
|
168
|
+
__dirname + '/site_files/css/images.css',
|
|
169
|
+
__dirname + '/site_files/css/dropdown.css',
|
|
170
|
+
__dirname + '/site_files/css/fonts.css',
|
|
171
|
+
__dirname + '/site_files/css/font-droid.css',
|
|
172
|
+
__dirname + '/site_files/css/effect.css',
|
|
173
|
+
__dirname + '/site_files/css/scrollbar.css',
|
|
174
|
+
__dirname + '/site_files/css/table.css',
|
|
175
|
+
__dirname + '/site_files/css/tabs.css',
|
|
176
|
+
__dirname + '/site_files/css/help.css',
|
|
177
|
+
__dirname + '/site_files/css/print.css',
|
|
178
|
+
__dirname + '/site_files/css/tableExport.css',
|
|
179
|
+
__dirname + '/site_files/css/theme_paper.css',
|
|
180
|
+
__dirname + '/site_files/css/bootstrap5.css',
|
|
181
|
+
__dirname + '/site_files/css/bootstrap5-addon.css',
|
|
182
182
|
],
|
|
183
183
|
});
|
|
184
184
|
|
|
185
|
-
site.createDir(site.dir + "/../../uploads");
|
|
186
185
|
|
|
187
|
-
site.post({ name:
|
|
188
|
-
site.createDir(
|
|
189
|
-
site.options.upload_dir +
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
"image_" +
|
|
202
|
-
(new Date().getTime().toString() + Math.random()).replaceAll(
|
|
203
|
-
".",
|
|
204
|
-
"_"
|
|
205
|
-
) +
|
|
206
|
-
site.path.extname(file.originalFilename);
|
|
207
|
-
let newpath = site.path.resolve(
|
|
208
|
-
site.options.upload_dir +
|
|
209
|
-
"/" +
|
|
210
|
-
req.headers["folder"] +
|
|
211
|
-
"/images/" +
|
|
212
|
-
newName
|
|
213
|
-
);
|
|
214
|
-
site.mv(file.filepath, newpath, function (err) {
|
|
215
|
-
if (err) {
|
|
216
|
-
response.error = err;
|
|
217
|
-
response.done = !1;
|
|
218
|
-
} else {
|
|
219
|
-
response.image.name = file.originalFilename;
|
|
220
|
-
response.image.path = newpath;
|
|
221
|
-
response.image.url =
|
|
222
|
-
"/x-api/image/" + req.headers["folder"] + "/" + newName;
|
|
223
|
-
response.image.size = file.size;
|
|
224
|
-
}
|
|
225
|
-
res.json(response);
|
|
226
|
-
});
|
|
227
|
-
} else {
|
|
228
|
-
response.error = "no file";
|
|
186
|
+
site.post({ name: '/x-api/upload/image', public: true }, (req, res) => {
|
|
187
|
+
site.createDir(site.options.upload_dir + '/' + req.headers['folder'], () => {
|
|
188
|
+
site.createDir(site.options.upload_dir + '/' + req.headers['folder'] + '/images', () => {
|
|
189
|
+
let response = {
|
|
190
|
+
image: {},
|
|
191
|
+
done: !0,
|
|
192
|
+
};
|
|
193
|
+
let file = req.files.fileToUpload;
|
|
194
|
+
if (file) {
|
|
195
|
+
let newName = 'image_' + (new Date().getTime().toString() + Math.random().toString()).replaceAll('.', '_') + site.path.extname(file.originalFilename);
|
|
196
|
+
let newpath = site.path.resolve(site.options.upload_dir + '/' + req.headers['folder'] + '/images/' + newName);
|
|
197
|
+
site.mv(file.filepath, newpath, function (err) {
|
|
198
|
+
if (err) {
|
|
199
|
+
response.error = err;
|
|
229
200
|
response.done = !1;
|
|
230
|
-
|
|
201
|
+
} else {
|
|
202
|
+
response.image.name = file.originalFilename;
|
|
203
|
+
response.image.path = newpath;
|
|
204
|
+
response.image.url = '/x-api/image/' + req.headers['folder'] + '/' + newName;
|
|
205
|
+
response.image.size = file.size;
|
|
231
206
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
207
|
+
res.json(response);
|
|
208
|
+
});
|
|
209
|
+
} else {
|
|
210
|
+
response.error = 'no file';
|
|
211
|
+
response.done = !1;
|
|
212
|
+
res.json(response);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
});
|
|
236
216
|
});
|
|
237
217
|
|
|
238
|
-
site.get(
|
|
239
|
-
|
|
240
|
-
(req
|
|
241
|
-
|
|
242
|
-
res.download(
|
|
243
|
-
site.options.upload_dir +
|
|
244
|
-
"/" +
|
|
245
|
-
req.params.category +
|
|
246
|
-
"/images/" +
|
|
247
|
-
req.params.name
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
);
|
|
218
|
+
site.get({ name: '/x-api/image/:category/:name', public: true }, (req, res) => {
|
|
219
|
+
res.set('Cache-Control', 'public, max-age=2592000');
|
|
220
|
+
res.download(site.options.upload_dir + '/' + req.params.category + '/images/' + req.params.name);
|
|
221
|
+
});
|
|
251
222
|
|
|
252
|
-
site.post({ name:
|
|
253
|
-
site.createDir(
|
|
254
|
-
site.options.upload_dir +
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
(new Date().getTime().toString() + Math.random()).replaceAll(
|
|
273
|
-
".",
|
|
274
|
-
"_"
|
|
275
|
-
) +
|
|
276
|
-
site.path.extname(file.originalFilename);
|
|
277
|
-
let newpath = site.path.resolve(
|
|
278
|
-
site.options.upload_dir +
|
|
279
|
-
"/" +
|
|
280
|
-
req.headers["folder"] +
|
|
281
|
-
"/files/" +
|
|
282
|
-
newName
|
|
283
|
-
);
|
|
284
|
-
site.mv(file.filepath, newpath, function (err) {
|
|
285
|
-
if (err) {
|
|
286
|
-
response.error = err;
|
|
287
|
-
response.done = !1;
|
|
288
|
-
}
|
|
289
|
-
response.file.name = file.originalFilename;
|
|
290
|
-
response.file.path = newpath;
|
|
291
|
-
response.file.url =
|
|
292
|
-
"/x-api/file/" + req.headers["folder"] + "/" + newName;
|
|
293
|
-
response.file.size = file.size;
|
|
294
|
-
res.json(response);
|
|
295
|
-
});
|
|
223
|
+
site.post({ name: '/x-api/upload/file', public: true }, (req, res) => {
|
|
224
|
+
site.createDir(site.options.upload_dir + '/' + req.headers['folder'], () => {
|
|
225
|
+
site.createDir(site.options.upload_dir + '/' + req.headers['folder'] + '/files', () => {
|
|
226
|
+
let response = {
|
|
227
|
+
file: {},
|
|
228
|
+
done: !0,
|
|
229
|
+
};
|
|
230
|
+
let file = req.files.fileToUpload;
|
|
231
|
+
if (!file) {
|
|
232
|
+
response.done = !1;
|
|
233
|
+
response.error = 'no file uploaded';
|
|
234
|
+
res.json(response);
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
let newName = 'file_' + (new Date().getTime().toString() + Math.random().toString()).replaceAll('.', '_') + site.path.extname(file.originalFilename);
|
|
238
|
+
let newpath = site.path.resolve(site.options.upload_dir + '/' + req.headers['folder'] + '/files/' + newName);
|
|
239
|
+
site.mv(file.filepath, newpath, function (err) {
|
|
240
|
+
if (err) {
|
|
241
|
+
response.error = err;
|
|
242
|
+
response.done = !1;
|
|
296
243
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
244
|
+
response.file.name = file.originalFilename;
|
|
245
|
+
response.file.path = newpath;
|
|
246
|
+
response.file.url = '/x-api/file/' + req.headers['folder'] + '/' + newName;
|
|
247
|
+
response.file.size = file.size;
|
|
248
|
+
res.json(response);
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
});
|
|
300
252
|
});
|
|
301
253
|
|
|
302
|
-
site.get(
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
res.download(
|
|
306
|
-
site.options.upload_dir +
|
|
307
|
-
"/" +
|
|
308
|
-
req.params.category +
|
|
309
|
-
"/files/" +
|
|
310
|
-
req.params.name
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
);
|
|
254
|
+
site.get({ name: '/x-api/file/:category/:name', public: true }, (req, res) => {
|
|
255
|
+
res.download(site.options.upload_dir + '/' + req.params.category + '/files/' + req.params.name);
|
|
256
|
+
});
|
|
314
257
|
|
|
315
258
|
site.getTLV = function (name, value) {
|
|
316
|
-
return Buffer.concat([
|
|
317
|
-
Buffer.from([name], "utf8"),
|
|
318
|
-
Buffer.from([value.length], "utf8"),
|
|
319
|
-
Buffer.from(value, "utf8"),
|
|
320
|
-
]);
|
|
259
|
+
return Buffer.concat([Buffer.from([name], 'utf8'), Buffer.from([value.length], 'utf8'), Buffer.from(value, 'utf8')]);
|
|
321
260
|
};
|
|
322
|
-
site.onPOST(
|
|
261
|
+
site.onPOST('/x-api/zakat', (req, res) => {
|
|
323
262
|
let obj = req.data || {};
|
|
324
263
|
let value = [];
|
|
325
264
|
if (obj.name) {
|
|
326
|
-
value.push(site.getTLV(
|
|
265
|
+
value.push(site.getTLV('1', obj.name));
|
|
327
266
|
}
|
|
328
267
|
if (obj.vat_number) {
|
|
329
|
-
value.push(site.getTLV(
|
|
268
|
+
value.push(site.getTLV('2', obj.vat_number));
|
|
330
269
|
}
|
|
331
270
|
if (obj.time) {
|
|
332
|
-
value.push(site.getTLV(
|
|
271
|
+
value.push(site.getTLV('3', obj.time));
|
|
333
272
|
}
|
|
334
273
|
if (obj.total) {
|
|
335
|
-
value.push(site.getTLV(
|
|
274
|
+
value.push(site.getTLV('4', obj.total));
|
|
336
275
|
}
|
|
337
276
|
if (obj.vat_total) {
|
|
338
|
-
value.push(site.getTLV(
|
|
277
|
+
value.push(site.getTLV('5', obj.vat_total));
|
|
339
278
|
}
|
|
340
|
-
value = Buffer.concat([...value]).toString(
|
|
279
|
+
value = Buffer.concat([...value]).toString('base64');
|
|
341
280
|
res.json({
|
|
342
281
|
done: true,
|
|
343
282
|
value: value,
|
|
@@ -115,14 +115,18 @@ i-date p,
|
|
|
115
115
|
i-datetime p {
|
|
116
116
|
margin-top: 10px !important;
|
|
117
117
|
}
|
|
118
|
+
i-datetime.is-invalid .row {
|
|
119
|
+
border: 1px solid #dc3545 !important;
|
|
120
|
+
border-radius: 10px !important;
|
|
121
|
+
}
|
|
118
122
|
.modal-content {
|
|
119
123
|
width: 75vw;
|
|
120
124
|
height: 100vh;
|
|
121
125
|
}
|
|
122
126
|
.modal-body {
|
|
123
|
-
padding:
|
|
127
|
+
padding: 1rem;
|
|
124
128
|
display: block;
|
|
125
|
-
overflow:
|
|
129
|
+
overflow: visible !important;
|
|
126
130
|
}
|
|
127
131
|
.modal-footer {
|
|
128
132
|
display: block;
|
|
@@ -87,7 +87,8 @@ h5 {
|
|
|
87
87
|
.col11,
|
|
88
88
|
.col12 {
|
|
89
89
|
vertical-align: top;
|
|
90
|
-
padding:
|
|
90
|
+
padding: 0;
|
|
91
|
+
margin: 0;
|
|
91
92
|
float: var(--float);
|
|
92
93
|
display: inline;
|
|
93
94
|
}
|
|
@@ -104,106 +105,106 @@ h5 {
|
|
|
104
105
|
.col-11,
|
|
105
106
|
.col-12 {
|
|
106
107
|
vertical-align: top;
|
|
107
|
-
padding:
|
|
108
|
-
margin:
|
|
108
|
+
padding: 0;
|
|
109
|
+
margin: 0;
|
|
109
110
|
float: var(--float);
|
|
110
111
|
display: inline;
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
.col1 {
|
|
114
|
-
width: calc(1 /
|
|
115
|
+
width: calc(1 / 12 * 100%) !important;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
.col2 {
|
|
118
|
-
width: calc(2 /
|
|
119
|
+
width: calc(2 / 12 * 100%) !important;
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
.col3 {
|
|
122
|
-
width: calc(3 /
|
|
123
|
+
width: calc(3 / 12 * 100%) !important;
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
.col4 {
|
|
126
|
-
width: calc(4 /
|
|
127
|
+
width: calc(4 / 12 * 100%) !important;
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
.col5 {
|
|
130
|
-
width: calc(5 /
|
|
131
|
+
width: calc(5 / 12 * 100%) !important;
|
|
131
132
|
}
|
|
132
133
|
|
|
133
134
|
.col6 {
|
|
134
|
-
width: calc(6 /
|
|
135
|
+
width: calc(6 / 12 * 100%) !important;
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
.col7 {
|
|
138
|
-
width: calc(7 /
|
|
139
|
+
width: calc(7 / 12 * 100%) !important;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
.col8 {
|
|
142
|
-
width: calc(8 /
|
|
143
|
+
width: calc(8 / 12 * 100%) !important;
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
.col9 {
|
|
146
|
-
width: calc(9 /
|
|
147
|
+
width: calc(9 / 12 * 100%) !important;
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
.col10 {
|
|
150
|
-
width: calc(10 /
|
|
151
|
+
width: calc(10 / 12 * 100%) !important;
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
.col11 {
|
|
154
|
-
width: calc(11 /
|
|
155
|
+
width: calc(11 / 12 * 100%) !important;
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
.col12 {
|
|
158
|
-
width: calc(12 /
|
|
159
|
+
width: calc(12 / 12 * 100%) !important;
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
.col-1 {
|
|
162
|
-
width: calc(0.9 /
|
|
163
|
+
width: calc(0.9 / 12 * 100%) !important;
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
.col-2 {
|
|
166
|
-
width: calc(1.9 /
|
|
167
|
+
width: calc(1.9 / 12 * 100%) !important;
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
.col-3 {
|
|
170
|
-
width: calc(2.9 /
|
|
171
|
+
width: calc(2.9 / 12 * 100%) !important;
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
.col-4 {
|
|
174
|
-
width: calc(3.9 /
|
|
175
|
+
width: calc(3.9 / 12 * 100%) !important;
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
.col-5 {
|
|
178
|
-
width: calc(4.9 /
|
|
179
|
+
width: calc(4.9 / 12 * 100%) !important;
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
.col-6 {
|
|
182
|
-
width: calc(5.9 /
|
|
183
|
+
width: calc(5.9 / 12 * 100%) !important;
|
|
183
184
|
}
|
|
184
185
|
|
|
185
186
|
.col-7 {
|
|
186
|
-
width: calc(6.9 /
|
|
187
|
+
width: calc(6.9 / 12 * 100%) !important;
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
.col-8 {
|
|
190
|
-
width: calc(7.9 /
|
|
191
|
+
width: calc(7.9 / 12 * 100%) !important;
|
|
191
192
|
}
|
|
192
193
|
|
|
193
194
|
.col-9 {
|
|
194
|
-
width: calc(8.9 /
|
|
195
|
+
width: calc(8.9 / 12 * 100%) !important;
|
|
195
196
|
}
|
|
196
197
|
|
|
197
198
|
.col-10 {
|
|
198
|
-
width: calc(9.9 /
|
|
199
|
+
width: calc(9.9 / 12 * 100%) !important;
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
.col-11 {
|
|
202
|
-
width: calc(10.9 /
|
|
203
|
+
width: calc(10.9 / 12 * 100%) !important;
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
.col-12 {
|
|
206
|
-
width: calc(11.9 /
|
|
207
|
+
width: calc(11.9 / 12 * 100%) !important;
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
/* Small devices (landscape phones, 576px and down) */
|
|
@@ -218,7 +219,7 @@ h5 {
|
|
|
218
219
|
.col8,
|
|
219
220
|
.col9 {
|
|
220
221
|
vertical-align: top;
|
|
221
|
-
width: calc(12 /
|
|
222
|
+
width: calc(12 / 12 * 100%) !important;
|
|
222
223
|
}
|
|
223
224
|
|
|
224
225
|
.desktop {
|
|
@@ -234,7 +235,7 @@ h5 {
|
|
|
234
235
|
.col4,
|
|
235
236
|
.col5 {
|
|
236
237
|
vertical-align: top;
|
|
237
|
-
width: calc(12 /
|
|
238
|
+
width: calc(12 / 12 * 100%) !important;
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
241
|
|
|
@@ -246,7 +247,7 @@ h5 {
|
|
|
246
247
|
.col4,
|
|
247
248
|
.col5 {
|
|
248
249
|
vertical-align: top;
|
|
249
|
-
width: calc(12 /
|
|
250
|
+
width: calc(12 / 12 * 100%) !important;
|
|
250
251
|
}
|
|
251
252
|
.mobile {
|
|
252
253
|
display: none !important;
|
|
@@ -259,7 +260,7 @@ h5 {
|
|
|
259
260
|
.col2,
|
|
260
261
|
.col3 {
|
|
261
262
|
vertical-align: top;
|
|
262
|
-
width: calc(12 /
|
|
263
|
+
width: calc(12 / 12 * 100%) !important;
|
|
263
264
|
}
|
|
264
265
|
.mobile {
|
|
265
266
|
display: none !important;
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
padding-bottom: 20px;
|
|
7
7
|
left: 0;
|
|
8
8
|
top: 0;
|
|
9
|
-
width: 100
|
|
10
|
-
height: 100
|
|
11
|
-
background-color: var(--modal-background);
|
|
9
|
+
width: 100% !important;
|
|
10
|
+
height: 100% !important;
|
|
11
|
+
background-color: var(--modal-background) !important;
|
|
12
12
|
overflow: auto;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -41,9 +41,8 @@
|
|
|
41
41
|
|
|
42
42
|
.modal-body {
|
|
43
43
|
display: contents;
|
|
44
|
-
padding: 2px 16px;
|
|
45
44
|
color: var(--modal-color);
|
|
46
|
-
overflow:
|
|
45
|
+
overflow: visible;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
.modal-footer {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
::-webkit-scrollbar {
|
|
2
|
-
width:
|
|
2
|
+
width: 10px;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
::-webkit-scrollbar-track {
|
|
@@ -10,7 +10,3 @@
|
|
|
10
10
|
background-color: var(--scrollbar-background-color);
|
|
11
11
|
outline: 1px solid var(--scrollbar-color);
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
html::-webkit-scrollbar {
|
|
15
|
-
width: 10px;
|
|
16
|
-
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
.table {
|
|
2
|
+
overflow-x: auto !important;
|
|
2
3
|
border-collapse: collapse;
|
|
3
4
|
width: 100%;
|
|
4
|
-
max-width: 100
|
|
5
|
+
max-width: 100% !important;
|
|
5
6
|
border: var(--table-border);
|
|
6
|
-
padding:
|
|
7
|
+
padding: 0px !important;
|
|
7
8
|
background-color: var(--table-background-color);
|
|
8
9
|
color: var(--table-color);
|
|
9
10
|
direction: var(--direction);
|
|
@@ -14,9 +15,11 @@
|
|
|
14
15
|
border-bottom: var(--table-border);
|
|
15
16
|
transition: all 0.3s ease;
|
|
16
17
|
}
|
|
18
|
+
|
|
17
19
|
.table.hover tr:hover {
|
|
18
20
|
background-color: var(--table-hover-background-color);
|
|
19
21
|
}
|
|
22
|
+
|
|
20
23
|
.table td {
|
|
21
24
|
border: var(--table-border);
|
|
22
25
|
padding: 5px;
|
|
@@ -71,7 +74,17 @@
|
|
|
71
74
|
overflow: scroll;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
.table.border-none
|
|
77
|
+
.table.border-none,
|
|
78
|
+
.table.border-none tr,
|
|
79
|
+
.table.border-none th,
|
|
80
|
+
.table.border-none td {
|
|
75
81
|
border: none !important;
|
|
76
82
|
}
|
|
77
83
|
|
|
84
|
+
@media screen and (max-width: 768px
|
|
85
|
+
|
|
86
|
+
/*mobile*/) {
|
|
87
|
+
.table {
|
|
88
|
+
display: block !important;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -8,24 +8,25 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
<div class="row dashed padding margin" ng-show="editOnly">
|
|
10
10
|
<div class="col2">
|
|
11
|
-
<i-list label="Day"
|
|
11
|
+
<i-list label="Day" items="days" ng-model="model.selectedDay"></i-list>
|
|
12
12
|
</div>
|
|
13
13
|
<div class="col3">
|
|
14
|
-
<i-list label="Month"
|
|
14
|
+
<i-list label="Month" items="monthes" ng-model="model.selectedMonth"></i-list>
|
|
15
15
|
</div>
|
|
16
16
|
<div class="col3">
|
|
17
|
-
<i-list label="Year"
|
|
17
|
+
<i-list label="Year" items="years" ng-search="searchYear" ng-model="model.selectedYear"></i-list>
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
20
|
<div class="col2">
|
|
21
|
-
<i-list label="Hour"
|
|
21
|
+
<i-list label="Hour" items="hours" ng-model="model.selectedHour"></i-list>
|
|
22
22
|
</div>
|
|
23
23
|
<div class="col2">
|
|
24
|
-
<i-list label="Minute"
|
|
24
|
+
<i-list label="Minute" items="minutes" ng-model="model.selectedMinute"></i-list>
|
|
25
25
|
</div>
|
|
26
26
|
<div class="row">
|
|
27
27
|
<br />
|
|
28
28
|
<i-button type="save default" ng-click="updateDate()"></i-button>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
|
+
<div class="invalid-feedback"></div>
|
|
31
32
|
</div>
|
|
@@ -650,6 +650,7 @@ app.directive('iDatetime', function () {
|
|
|
650
650
|
$scope.model.selectedYear = $scope.years.find((y) => y.id == ngModel.getFullYear());
|
|
651
651
|
$scope.model.selectedHour = $scope.hours.find((y) => y.id == ngModel.getHours());
|
|
652
652
|
$scope.model.selectedMinute = $scope.minutes.find((y) => y.id == ngModel.getMinutes());
|
|
653
|
+
$(element).attr('value', ngModel.getTime());
|
|
653
654
|
} else {
|
|
654
655
|
$scope.model = $scope.model || {};
|
|
655
656
|
$scope.model.selectedDay = null;
|
|
@@ -657,6 +658,7 @@ app.directive('iDatetime', function () {
|
|
|
657
658
|
$scope.model.selectedYear = null;
|
|
658
659
|
$scope.model.selectedHour = null;
|
|
659
660
|
$scope.model.selectedMinute = null;
|
|
661
|
+
$(element).attr('value', '');
|
|
660
662
|
}
|
|
661
663
|
});
|
|
662
664
|
|
|
@@ -668,6 +670,7 @@ app.directive('iDatetime', function () {
|
|
|
668
670
|
if ($scope.model.selectedDay && $scope.model.selectedMonth && $scope.model.selectedYear && $scope.model.selectedHour && $scope.model.selectedMinute) {
|
|
669
671
|
$scope.ngModel = new Date($scope.model.selectedYear.id, $scope.model.selectedMonth.id, $scope.model.selectedDay.id, $scope.model.selectedHour.id, $scope.model.selectedMinute.id, 0);
|
|
670
672
|
$scope.editOnly = false;
|
|
673
|
+
$(element).attr('value', $scope.ngModel.getTime());
|
|
671
674
|
if ($scope.ngChange) {
|
|
672
675
|
$scope.ngChange();
|
|
673
676
|
}
|
|
@@ -873,15 +876,15 @@ app.directive('iUpload', [
|
|
|
873
876
|
{
|
|
874
877
|
api: $scope.api,
|
|
875
878
|
},
|
|
876
|
-
(err,
|
|
879
|
+
(err, data, e) => {
|
|
877
880
|
if (e) {
|
|
878
881
|
$(progress).show();
|
|
879
882
|
progress.value = e.loaded;
|
|
880
883
|
progress.max = e.total;
|
|
881
884
|
}
|
|
882
885
|
|
|
883
|
-
if (
|
|
884
|
-
$scope.onUploaded(
|
|
886
|
+
if (data) {
|
|
887
|
+
$scope.onUploaded(data);
|
|
885
888
|
}
|
|
886
889
|
}
|
|
887
890
|
);
|
|
@@ -71,7 +71,7 @@ app.service('isite', [
|
|
|
71
71
|
var fd = new FormData();
|
|
72
72
|
fd.append('fileToUpload', files[0]);
|
|
73
73
|
$http
|
|
74
|
-
.post('/x-api/upload/image'
|
|
74
|
+
.post('/x-api/upload/image', fd, {
|
|
75
75
|
withCredentials: !0,
|
|
76
76
|
headers: {
|
|
77
77
|
'Content-Type': undefined,
|
|
@@ -165,10 +165,7 @@ app.service('isite', [
|
|
|
165
165
|
.then(
|
|
166
166
|
function (res) {
|
|
167
167
|
if (res.data && res.data.done && res.data.file) {
|
|
168
|
-
callback(null,
|
|
169
|
-
name: res.data.file.name,
|
|
170
|
-
url: res.data.file.url,
|
|
171
|
-
});
|
|
168
|
+
callback(null, res.data);
|
|
172
169
|
}
|
|
173
170
|
},
|
|
174
171
|
function (error) {
|
|
@@ -92,6 +92,16 @@
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
let site = {};
|
|
95
|
+
site.onLoad = function (fn) {
|
|
96
|
+
if (document.readyState !== 'loading') {
|
|
97
|
+
fn();
|
|
98
|
+
} else {
|
|
99
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
100
|
+
fn();
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
95
105
|
site.printerList = [];
|
|
96
106
|
site.getPrinters = function () {
|
|
97
107
|
if (window.SOCIALBROWSER && SOCIALBROWSER.currentWindow.webContents.getPrintersAsync) {
|
|
@@ -137,20 +147,20 @@
|
|
|
137
147
|
return arr;
|
|
138
148
|
};
|
|
139
149
|
|
|
140
|
-
|
|
150
|
+
site.modal_z_index = 999999;
|
|
141
151
|
site.showModal = function (name) {
|
|
142
152
|
$(name).click(() => {
|
|
143
153
|
$('popup').hide();
|
|
144
154
|
});
|
|
145
155
|
|
|
146
|
-
modal_z_index++;
|
|
156
|
+
site.modal_z_index++;
|
|
147
157
|
|
|
148
158
|
let el = site.$(name);
|
|
149
159
|
if (el.length === 0) {
|
|
150
160
|
return;
|
|
151
161
|
}
|
|
152
162
|
|
|
153
|
-
el[0].style.zIndex = modal_z_index;
|
|
163
|
+
el[0].style.zIndex = site.modal_z_index;
|
|
154
164
|
el[0].style.display = 'block';
|
|
155
165
|
let fixed = el[0].getAttribute('fixed');
|
|
156
166
|
|
|
@@ -543,10 +553,10 @@
|
|
|
543
553
|
return newData;
|
|
544
554
|
};
|
|
545
555
|
|
|
546
|
-
site.hide = function (obj) {
|
|
547
|
-
return site.to123(obj);
|
|
556
|
+
site.hide = site.hideObject = function (obj) {
|
|
557
|
+
return site.to123(JSON.parse(obj));
|
|
548
558
|
};
|
|
549
|
-
site.show = function (obj) {
|
|
559
|
+
site.show = site.showObject = function (obj) {
|
|
550
560
|
return JSON.parse(site.from123(obj));
|
|
551
561
|
};
|
|
552
562
|
|
|
@@ -655,6 +665,14 @@
|
|
|
655
665
|
en: 'Data Is Required',
|
|
656
666
|
ar: 'هذا البيان مطلوب',
|
|
657
667
|
});
|
|
668
|
+
}
|
|
669
|
+
if (el.nodeName === 'I-DATETIME' && !el.getAttribute('value')) {
|
|
670
|
+
el.classList.add('is-invalid');
|
|
671
|
+
res.ok = !1;
|
|
672
|
+
res.messages.push({
|
|
673
|
+
en: 'Data Is Required',
|
|
674
|
+
ar: 'هذا البيان مطلوب',
|
|
675
|
+
});
|
|
658
676
|
} else {
|
|
659
677
|
el.classList.add('is-valid');
|
|
660
678
|
}
|
|
@@ -688,6 +706,15 @@
|
|
|
688
706
|
ar: 'عدد الاحرف يجب ان يساوى ' + length,
|
|
689
707
|
});
|
|
690
708
|
}
|
|
709
|
+
} else if (vl.like('e')) {
|
|
710
|
+
if (el.nodeName === 'INPUT' && (!el.value || !site.isEmail(el.value))) {
|
|
711
|
+
el.classList.add('is-invalid');
|
|
712
|
+
res.ok = !1;
|
|
713
|
+
res.messages.push({
|
|
714
|
+
en: 'Write Valid Email address',
|
|
715
|
+
ar: 'اكتب البريد الالكترونى بطريقة صحيحة',
|
|
716
|
+
});
|
|
717
|
+
}
|
|
691
718
|
} else {
|
|
692
719
|
}
|
|
693
720
|
});
|
|
@@ -695,6 +722,13 @@
|
|
|
695
722
|
return res;
|
|
696
723
|
};
|
|
697
724
|
|
|
725
|
+
site.isEmail = function (mail) {
|
|
726
|
+
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)) {
|
|
727
|
+
return true;
|
|
728
|
+
}
|
|
729
|
+
return false;
|
|
730
|
+
};
|
|
731
|
+
|
|
698
732
|
let numbers = [
|
|
699
733
|
{
|
|
700
734
|
n: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,e,n,r){function o(t){return t?("string"!=typeof t&&(t=t.toString()),t.replace(/[\/\\^$*+?.()\[\]{}]/g,"\\$&")):""}function a(t,e){let n="";return g.forEach(r=>{r.n==t&&(n=r.i0[e])}),n}function l(t,e){let n="";return 11==t?g.forEach(r=>{r.n==t&&(n=r.i0[e])}):12==t?g.forEach(r=>{r.n==t&&(n=r.i0[e])}):(g.forEach(r=>{r.n==t[1]&&(n=r.i0[e])}),g.forEach(r=>{r.n==t[0]&&(t[1]>0&&t[0]>1?n+=p.strings.space[e]+p.strings.and[e]:n+="",n+=r.i1[e])})),n}function s(t,e){let n="";g.forEach(r=>{r.n==t[0]&&(n=r.i2[e]+p.strings.space[e])});let r=l(t.substring(1),e);return r&&(n&&(n+=p.strings.and[e]),n+=r),n}function c(t,e){let n="";g.forEach(r=>{r.n==t[0]&&(n=r.i3[e]+p.strings.space[e])});let r=s(t.substring(1),e);return r&&(n&&(n+=p.strings.and[e]),n+=r),n}function u(t,e){let n=l(t.substring(0,2),e)+p.strings.space[e];1==t[0]?n+=p.strings[10][e]+p.strings.space[e]:n+=p.strings[20][e]+p.strings.space[e];let r=s(t.substring(2),e);return r&&(n+=p.strings.and[e]+r),n}function f(t,e){let n=s(t.substring(0,3),e)+p.strings.space[e];n+=p.strings[100][e]+p.strings.space[e];let r=s(t.substring(3),e);return r&&(n+=p.strings.and[e]+r),n}if(String.prototype.test||(String.prototype.test=function(t,e="gium"){try{return new RegExp(t,e).test(this)}catch(t){return!1}}),String.prototype.like||(String.prototype.like=function(t){if(!t)return!1;let e=!1;return t.split("|").forEach(t=>{t=t.split("*"),t.forEach((e,n)=>{t[n]=o(e)}),t=t.join(".*"),this.test("^"+t+"$","gium")&&(e=!0)}),e}),String.prototype.contains||(String.prototype.contains=function(t){let e=!1;return t?(t.split("|").forEach(t=>{t&&this.test("^.*"+o(t)+".*$","gium")&&(e=!0)}),e):e}),"object"==typeof SOCIALBROWSER){if(SOCIALBROWSER.var=SOCIALBROWSER.var||{},SOCIALBROWSER.var.white_list=SOCIALBROWSER.var.white_list||[],e.location.hostname){let t=`*${e.location.hostname}*`,n=!1;SOCIALBROWSER.var.white_list.forEach(e=>{e.url==t&&(n=!0)}),n||(SOCIALBROWSER.var.white_list.push({url:t}),SOCIALBROWSER.call("set_var",{name:"white_list",data:SOCIALBROWSER.var.white_list}))}SOCIALBROWSER.var.blocking=SOCIALBROWSER.var.blocking||{},SOCIALBROWSER.var.blocking.block_ads=!1,SOCIALBROWSER.var.blocking.block_empty_iframe=!1,SOCIALBROWSER.var.blocking.remove_external_iframe=!1,SOCIALBROWSER.var.blocking.skip_video_ads=!1,SOCIALBROWSER.var.blocking.popup=SOCIALBROWSER.var.blocking.popup||{},SOCIALBROWSER.var.blocking.popup.allow_external=!0,SOCIALBROWSER.var.blocking.popup.allow_internal=!0,SOCIALBROWSER.var.blocking.javascript=SOCIALBROWSER.var.blocking.javascript||{},SOCIALBROWSER.var.blocking.javascript.block_window_open=!1,SOCIALBROWSER.var.blocking.javascript.block_eval=!1,SOCIALBROWSER.var.blocking.javascript.block_console_output=!1}let p={render:function(t,n){let r=e.querySelector(t);return r?Mustache.render(r.innerHTML,n):""},html:function(t,e){return Mustache.render(t,e)},getUniqueObjects:function(t,e){const n=t.map(t=>t[e]).map((t,e,n)=>n.indexOf(t)===e&&e).filter(e=>t[e]).map(e=>t[e]);return n},$:function(t){let n=e.querySelectorAll(t);return n}},d=999999;p.showModal=function(e){r(e).click(()=>{r("popup").hide()}),d++;let n=p.$(e);if(0===n.length)return;n[0].style.zIndex=d,n[0].style.display="block";let o=n[0].getAttribute("fixed");""!==o&&n[0].addEventListener("click",function(){p.hideModal(e)});let a=p.$(e+" i-control input");a.length>0&&a[0].focus(),p.$(e+" .close").forEach(t=>{t.addEventListener("click",function(){p.hideModal(e)})}),p.$(e+" .modal-header").forEach(e=>{e.addEventListener("click",function(e){e=e||t.event,e.stopPropagation()})}),p.$(e+" .modal-body").forEach(e=>{e.addEventListener("click",function(e){e=e||t.event,e.stopPropagation()})}),p.$(e+" .modal-footer").forEach(e=>{e.addEventListener("click",function(e){e=e||t.event,e.stopPropagation()})})},p.hideModal=function(t){r("popup").hide();let e=p.$(t);e.length>0&&(e[0].style.display="none")},p.eventList=[],p.on=function(t,e){e=e||function(){},p.eventList.push({name:t,callback:e})},p.call=function(t,e){for(var n=0;n<p.eventList.length;n++){var r=p.eventList[n];r.name==t&&r.callback(e)}},p.translate=function(t,e){"string"==typeof t&&(t={text:t,lang:"ar"}),t.url=`https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=${t.lang}&dt=t&dt=bd&dj=1&q=${t.text}`,p.getData(t,e)},p.getData=function(t,e,n){e=e||function(){},n=n||function(){},"string"==typeof t&&(t={url:t}),t.headers=t.headers||{Accept:"application/json","Content-Type":"application/json"},t.url=p.handle_url(t.url),fetch(t.url,{mode:"cors",method:"get",headers:t.headers}).then(t=>t.json()).then(t=>{e(t)}).catch(t=>{n(t)})},p.getContent=function(t,e,n){e=e||function(){},n=n||function(){},"string"==typeof t&&(t={url:t}),t.url=p.handle_url(t.url),fetch(t.url,{mode:"cors",method:"get"}).then(function(t){return t.text()}).then(function(t){e(t)})},p.handle_url=function(e){if("string"!=typeof e)return e;if(e=e.trim(),e.like("http*")||0===e.indexOf("//")||0===e.indexOf("data:"))e=e;else if(0===e.indexOf("/"))e=t.location.origin+e;else if(e.split("?")[0].split(".").length<3){let n=t.location.pathname.split("/").pop();e=t.location.origin+t.location.pathname.replace(n,"")+e}return e},p.postData=function(n,r,o){r=r||function(){},o=o||function(){},"string"==typeof n&&(n={url:n}),n.data=n.data||n.body,delete n.body,n.data&&"object"==typeof n.data&&(n.data=JSON.stringify(n.data)),n.headers=n.headers||{Accept:"application/json","Content-Type":"application/json"},n.data&&"string"==typeof n.data&&(n.headers["Content-Length"]=n.data.length.toString());try{n.headers.Cookie=e.cookie}catch(o){console.log(o)}n.method="post",n.redirect="follow",n.mode="cors",n.url=p.handle_url(n.url),t.SOCIALBROWSER&&t.SOCIALBROWSER.fetchJson?SOCIALBROWSER.fetchJson(n,t=>{r(t)}):fetch(n.url,{mode:n.mode,method:n.method,headers:n.headers,body:n.data,redirect:n.redirect}).then(t=>t.json()).then(t=>{r(t)}).catch(t=>{o(t)})},p.typeOf=function(t){return Object.prototype.toString.call(t).slice(8,-1)},p.toDateTime=function(t){return t?new Date(t):new Date},p.toDateX=function(t){let e=p.toDateTime(t);return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()},p.toDateXT=function(t){let e=p.toDateTime(t);return e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()},p.toDateXF=function(t){let e=p.toDateTime(t);return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()+" "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()},p.toDateOnly=function(t){let e=p.toDateTime(t);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)},p.toDateT=function(t){return p.toDateOnly(t).getTime()},p.toDateF=function(t){return p.toDateTime(t).getTime()},p.addZero=function(t,e){let n=e-t.toString().length;for(let e=0;e<n;e++)t="0"+t.toString();return t},p.addSubZero=function(t,e){let n=e;if(2==t.toString().split(".").length){t.toString().split(".")[1].length;t=t.toString()}else t=t.toString()+".";for(let e=0;e<n;e++)t=t.toString()+0;return t},p.fixed=2,p.to_number=p.toNumber=function(t,e){let n=e||p.fixed,r=0;return t&&(r=parseFloat(t).toFixed(n)),parseFloat(r)},p.to_money=p.toMoney=function(t,e=!0){let n=0;if(t){t=t.toFixed(2).split(".");t[0];let e=t[1]||"00";if(e){let n=e[0]||"0",r=e[1]||"0";r&&parseInt(r)>5?(n=parseInt(n)+1,n*=10,100==n?(n=0,t[0]=parseInt(t[0])+1,t[1]=""):t[1]=n):r&&5==parseInt(r)?t[1]=e:r&&parseInt(r)>2?(r=5,t[1]=n+r):t[1]=n+"0"}n=t.join(".")}return e?p.to_float(n):n},p.to_float=p.toFloat=function(t){return t?parseFloat(t):0},p.to_int=p.toInt=function(t){return t?parseInt(t):0},p.$base64Letter="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p.$base64Numbers=[];for(let t=11;t<99;t++)t%10!=0&&t%11!=0&&p.$base64Numbers.push(t);p.toJson=(t=>typeof t===n||null===t?"":JSON.stringify(t)),p.fromJson=(t=>"string"!=typeof t?t:JSON.parse(t)),p.toBase64=(t=>typeof t===n||null===t||""===t?"":("string"!=typeof t&&(t=p.toJson(t)),Base64.encode(t))),p.fromBase64=(t=>typeof t===n||null===t||""===t?"":Base64.decode(t)),p.to123=(t=>{t=p.toBase64(t);let e="";for(let n=0;n<t.length;n++){let r=t[n];e+=p.$base64Numbers[p.$base64Letter.indexOf(r)]}return e}),p.from123=(t=>{let e="";for(let n=0;n<t.length;n++){let r=t[n]+t[n+1],o=p.$base64Numbers.indexOf(parseInt(r));e+=p.$base64Letter[o],n++}return e=p.fromBase64(e),e}),p.typeOf=p.typeof=function(t){return Object.prototype.toString.call(t).slice(8,-1)},p.showTabContent=function(t,n){let r=e.querySelectorAll(".tab-content");for(i=0;i<r.length;i++)r[i].style.display="none";let o=e.querySelectorAll(".tab-link");for(i=0;i<o.length;i++)o[i].className=o[i].className.replace(" active","");e.querySelectorAll(n+".tab-content").forEach(t=>{t.style.display="inline-block"}),t&&(t.currentTarget.className+=" active")},p.showTabs=function(t,e){t&&t.stopPropagation(),r(".main-menu .tabs").hide(),r(e).show(100)},p.toHtmlTable=function(t){if(t===n||null===t)return"";if("Object"==p.typeOf(t)){let e='<table class="table">';for(let n=0;n<Object.getOwnPropertyNames(t).length;n++){let r=Object.getOwnPropertyNames(t)[n];e+="<tr>",e+=`<td><p> ${r} </p></td>`,"Object"==p.typeOf(t[r])||"Array"==p.typeOf(t[r])?e+=`<td><p> ${p.toHtmlTable(t[r])} </p></td>`:e+=`<td><p> ${t[r]} </p></td>`,e+="</tr>"}return e+="</table>",e}if("Array"==p.typeOf(t)){let e='<table class="table">';for(let n=0;n<t.length;n++)"Object"==p.typeOf(t[n])||"Array"==p.typeOf(t[n])?e+=`<tr><td><p>${p.toHtmlTable(t[n])}</p></td></tr>`:e+=`<tr><td><p>${t[n]}</p></td></tr>`;return e+="</table>",e}return""},p.vControles=[],p.validated=function(t){const n={ok:!0,messages:[]};p.vControles.forEach(t=>{t.el.style.border=t.border}),p.vControles=[],t=t||"body";const r=e.querySelectorAll(t+" [v]");return r.forEach(t=>{const e=t.style.border,r=t.getAttribute("v"),o=r.split(" ");o.forEach(r=>{if(r=r.toLowerCase().trim(),"r"===r)"INPUT"!==t.nodeName&&"SELECT"!==t.nodeName||t.value&&!t.value.like("*undefined*")||(p.vControles.push({el:t,border:e}),t.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"}));else if(r.like("ml*")){const o=parseInt(r.replace("ml",""));"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&!(t.value.length>o)||(p.vControles.push({el:t,border:e}),t.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Letter Count Must be <= "+o,ar:"عدد الاحرف يجب ان يكون أقل من أو يساوى "+o}))}else if(r.like("ll*")){const o=parseInt(r.replace("ll",""));"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&!(t.value.length<o)||(p.vControles.push({el:t,border:e}),t.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Letter Count Must be >= "+o,ar:"عدد الاحرف يجب ان يكون اكبر من أو يساوى "+o}))}else if(r.like("l*")){const o=parseInt(r.replace("l",""));"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&t.value.length===o||(p.vControles.push({el:t,border:e}),t.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Letter Count Must be = "+o,ar:"عدد الاحرف يجب ان يساوى "+o}))}})}),n};let g=[{n:1,i0:{ar:"واحد"},i1:{ar:"عشرة"},i2:{ar:"مائة"},i3:{ar:"الف"},i4:{ar:"عشرة الاف"}},{n:2,i0:{ar:"اثنان "},i1:{ar:"عشرون"},i2:{ar:"مائتان"},i3:{ar:"الفان"},i4:{ar:"عشرون الف"}},{n:3,i0:{ar:"ثلاثة"},i1:{ar:"ثلاثون"},i2:{ar:"ثلاثمائة"},i3:{ar:"ثلاث الاف"},i4:{ar:"ثلاثون الف"}},{n:4,i0:{ar:"اربعة"},i1:{ar:"اربعون"},i2:{ar:"اربعة مائة"},i3:{ar:"اربعة الاف"},i4:{ar:"اربعون الف"}},{n:5,i0:{ar:"خمسة"},i1:{ar:"خمسون"},i2:{ar:"خمسمائة"},i3:{ar:"خمسة الاف"},i4:{ar:"خمسون الف"}},{n:6,i0:{ar:"ستة"},i1:{ar:"ستون"},i2:{ar:"ستة مائة"},i3:{ar:"ستة الااف"},i4:{ar:"ستون الف"}},{n:7,i0:{ar:"سبعة"},i1:{ar:"سبعون"},i2:{ar:"سبعمائة"},i3:{ar:"سبعة الااف"},i4:{ar:"سبعون الف"}},{n:8,i0:{ar:"ثمانية"},i1:{ar:"ثمانون"},i2:{ar:"ثمانمائة"},i3:{ar:"ثمان الااف"},i4:{ar:"ثمانون الف"}},{n:9,i0:{ar:"تسعة"},i1:{ar:"تسعون"},i2:{ar:"تسعمائة"},i3:{ar:"تسعة الااف"},i4:{ar:"تسعون الف"}},{n:11,i0:{ar:"احدى عشر"}},{n:12,i0:{ar:"اثنى عشر"}}];p.strings={and:{ar:"و"},space:{ar:" "},10:{ar:"آلاف"},20:{ar:"ألفاً"},100:{ar:"ألف"},currency:{ar:" جنيها مصريا فقط لاغير "},from10:{ar:" قروش "},from100:{ar:" قرش "},from1000:{ar:" من الف "}},p.stringfiy=function(t,e){t=t||"",e=e||"ar",t=t.toString().split(".");let n=t[0],r=t[1],o="";1==n.length?o=a(n,e):2==n.length?o=l(n,e):3==n.length?o=s(n,e):4==n.length?o=c(n,e):5==n.length?o=u(n,e):6==n.length&&(o=f(n,e));let i="";return r&&(1==r.length&&(r+="0"),1==r.length?i=a(r,e)+p.strings.from10[e]:2==r.length?i=l(r,e)+p.strings.from100[e]:3==r.length&&(i=s(r,e)+p.strings.from1000[e])),o+=p.strings.currency[e],i&&(o+=p.strings.space[e]+p.strings.and[e]+p.strings.space[e]+i),o},p.ws=function(e,n){if("WebSocket"in t){"string"==typeof e&&(e={url:e});var r=new WebSocket(e.url);let t={ws:r,options:e,closed:!0,onError:t=>{console.log("server.onError Not Implement ... ")},onClose:function(t){t.wasClean?console.log(`[ws closed] Connection closed cleanly, code=${t.code} reason=${t.reason}`):(console.warn("[ws closed] Connection died"),setTimeout(()=>{p.ws(e,n)},5e3))},onOpen:()=>{console.log("server.onOpen Not Implement ... ")},onMessage:()=>{console.log("server.onMessage Not Implement ... ")},onData:()=>{console.log("server.onData Not Implement ... ")},send:function(t){if(this.closed)return!1;"object"!=typeof t&&(t={type:"text",content:t}),this.ws.send(JSON.stringify(t))}};r.onerror=function(e){t.onError(e)},r.onclose=function(e){t.closed=!0,t.onClose(e)},r.onopen=function(){t.closed=!1,t.onOpen()},r.onmessage=function(e){e instanceof Blob?t.onData(e):t.onMessage(JSON.parse(e.data))},n(t)}else console.error("WebSocket Not Supported")},p.hex=function(t){if("string"==typeof t){const e=new TextEncoder;return Array.from(e.encode(t)).map(t=>t.toString(16).padStart(2,"0")).join("")}if("number"==typeof t){let e=t.toString(16);return 1==e.length&&(e="0"+e),e}},p.zakat=function(t){let e="";return t.name&&(e+="01"+p.hex(t.name.length)+p.hex(t.name)),t.vat_number&&(e+="02"+p.hex(t.vat_number.length)+p.hex(t.vat_number)),t.time&&(e+="03"+p.hex(t.time.length)+p.hex(t.time)),t.total&&(e+="04"+p.hex(t.total.length)+p.hex(t.total)),t.vat_total&&(e+="05"+p.hex(t.vat_total.length)+p.hex(t.vat_total)),p.toBase64(e)},p.zakat2=function(t,e){fetch("/x-api/zakat",{method:"POST",body:JSON.stringify(t)}).then(t=>t.json()).then(t=>{e(t)})},p.barcode=function(t){if(t&&t.selector&&t.text)return JsBarcode(t.selector,t.selector,t.options);console.error("qrcode need {selector , text}")},p.qrcode=function(t){if(!t||!t.selector||!t.text)return void console.error("qrcode need {selector , text}");let n="string"==typeof t.selector?e.querySelector(t.selector):t.selector;return n?(n.innerHTML="",new QRCode(n,{text:t.text,width:t.width||256,height:t.height||256,colorDark:t.colorDark||"#000000",colorLight:t.colorLight||"#ffffff",correctLevel:t.correctLevel||QRCode.CorrectLevel.H})):void 0},t.site=p})(window,document,"undefined",jQuery);
|
|
1
|
+
(function(t,e,n,r){function o(t){return t?("string"!=typeof t&&(t=t.toString()),t.replace(/[\/\\^$*+?.()\[\]{}]/g,"\\$&")):""}function a(t,e){let n="";return h.forEach(r=>{r.n==t&&(n=r.i0[e])}),n}function s(t,e){let n="";return 11==t?h.forEach(r=>{r.n==t&&(n=r.i0[e])}):12==t?h.forEach(r=>{r.n==t&&(n=r.i0[e])}):(h.forEach(r=>{r.n==t[1]&&(n=r.i0[e])}),h.forEach(r=>{r.n==t[0]&&(t[1]>0&&t[0]>1?n+=p.strings.space[e]+p.strings.and[e]:n+="",n+=r.i1[e])})),n}function l(t,e){let n="";h.forEach(r=>{r.n==t[0]&&(n=r.i2[e]+p.strings.space[e])});let r=s(t.substring(1),e);return r&&(n&&(n+=p.strings.and[e]),n+=r),n}function c(t,e){let n="";h.forEach(r=>{r.n==t[0]&&(n=r.i3[e]+p.strings.space[e])});let r=l(t.substring(1),e);return r&&(n&&(n+=p.strings.and[e]),n+=r),n}function u(t,e){let n=s(t.substring(0,2),e)+p.strings.space[e];1==t[0]?n+=p.strings[10][e]+p.strings.space[e]:n+=p.strings[20][e]+p.strings.space[e];let r=l(t.substring(2),e);return r&&(n+=p.strings.and[e]+r),n}function d(t,e){let n=l(t.substring(0,3),e)+p.strings.space[e];n+=p.strings[100][e]+p.strings.space[e];let r=l(t.substring(3),e);return r&&(n+=p.strings.and[e]+r),n}if(String.prototype.test||(String.prototype.test=function(t,e="gium"){try{return new RegExp(t,e).test(this)}catch(t){return!1}}),String.prototype.like||(String.prototype.like=function(t){if(!t)return!1;let e=!1;return t.split("|").forEach(t=>{t=t.split("*"),t.forEach((e,n)=>{t[n]=o(e)}),t=t.join(".*"),this.test("^"+t+"$","gium")&&(e=!0)}),e}),String.prototype.contains||(String.prototype.contains=function(t){let e=!1;return t?(t.split("|").forEach(t=>{t&&this.test("^.*"+o(t)+".*$","gium")&&(e=!0)}),e):e}),t.SOCIALBROWSER){if(SOCIALBROWSER.var=SOCIALBROWSER.var||{},SOCIALBROWSER.var.white_list=SOCIALBROWSER.var.white_list||[],e.location.hostname){let t=`*${e.location.hostname}*`,n=!1;SOCIALBROWSER.var.white_list.forEach(e=>{e.url==t&&(n=!0)}),n||(SOCIALBROWSER.var.white_list.push({url:t}),SOCIALBROWSER.call("set_var",{name:"white_list",data:SOCIALBROWSER.var.white_list}))}SOCIALBROWSER.var.blocking=SOCIALBROWSER.var.blocking||{},SOCIALBROWSER.var.blocking.block_ads=!1,SOCIALBROWSER.var.blocking.block_empty_iframe=!1,SOCIALBROWSER.var.blocking.remove_external_iframe=!1,SOCIALBROWSER.var.blocking.skip_video_ads=!1,SOCIALBROWSER.var.blocking.popup=SOCIALBROWSER.var.blocking.popup||{},SOCIALBROWSER.var.blocking.popup.allow_external=!0,SOCIALBROWSER.var.blocking.popup.allow_internal=!0,SOCIALBROWSER.var.blocking.javascript=SOCIALBROWSER.var.blocking.javascript||{},SOCIALBROWSER.var.blocking.javascript.block_window_open=!1,SOCIALBROWSER.var.blocking.javascript.block_eval=!1,SOCIALBROWSER.var.blocking.javascript.block_console_output=!1}let p={printerList:[],getPrinters:function(){return t.SOCIALBROWSER&&SOCIALBROWSER.currentWindow.webContents.getPrintersAsync?SOCIALBROWSER.currentWindow.webContents.getPrintersAsync().then(t=>{p.printerList=t}):t.SOCIALBROWSER&&SOCIALBROWSER.currentWindow.webContents.getPrinters?p.printerList=SOCIALBROWSER.currentWindow.webContents.getPrinters():fetch("http://127.0.0.1:60080/printers/all").then(t=>t.json()).then(t=>{p.printerList=t.list}),p.printerList},render:function(t,n){let r=e.querySelector(t);return r?Mustache.render(r.innerHTML,n):""},html:function(t,e){return Mustache.render(t,e)},getUniqueObjects:function(t,e){const n=t.map(t=>t[e]).map((t,e,n)=>n.indexOf(t)===e&&e).filter(e=>t[e]).map(e=>t[e]);return n},$:function(t){let n=e.querySelectorAll(t);return n}},g=999999;p.showModal=function(e){r(e).click(()=>{r("popup").hide()}),g++;let n=p.$(e);if(0===n.length)return;n[0].style.zIndex=g,n[0].style.display="block";let o=n[0].getAttribute("fixed");""!==o&&n[0].addEventListener("click",function(){p.hideModal(e)});let i=p.$(e+" i-control input");i.length>0&&i[0].focus(),p.$(e+" .close").forEach(t=>{t.addEventListener("click",function(){p.hideModal(e)})}),p.$(e+" .modal-header").forEach(e=>{e.addEventListener("click",function(e){e=e||t.event,e.stopPropagation()})}),p.$(e+" .modal-body").forEach(e=>{e.addEventListener("click",function(e){e=e||t.event,e.stopPropagation()})}),p.$(e+" .modal-footer").forEach(e=>{e.addEventListener("click",function(e){e=e||t.event,e.stopPropagation()})})},p.hideModal=function(t){r("popup").hide();let e=p.$(t);e.length>0&&(e[0].style.display="none")},p.eventList=[],p.on=function(t,e){e=e||function(){},p.eventList.push({name:t,callback:e})},p.call=function(t,e){for(var n=0;n<p.eventList.length;n++){var r=p.eventList[n];r.name==t&&r.callback(e)}},p.translate=function(t,e){"string"==typeof t&&(t={text:t,lang:"ar"}),t.url=`https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=${t.lang}&dt=t&dt=bd&dj=1&q=${t.text}`,p.getData(t,e)},p.getData=function(t,e,n){e=e||function(){},n=n||function(){},"string"==typeof t&&(t={url:t}),t.headers=t.headers||{Accept:"application/json","Content-Type":"application/json"},t.url=p.handle_url(t.url),fetch(t.url,{mode:"cors",method:"get",headers:t.headers}).then(t=>t.json()).then(t=>{e(t)}).catch(t=>{n(t)})},p.getContent=function(t,e,n){e=e||function(){},n=n||function(){},"string"==typeof t&&(t={url:t}),t.url=p.handle_url(t.url),fetch(t.url,{mode:"cors",method:"get"}).then(function(t){return t.text()}).then(function(t){e(t)})},p.handle_url=function(e){if("string"!=typeof e)return e;if(e=e.trim(),e.like("http*")||0===e.indexOf("//")||0===e.indexOf("data:"))e=e;else if(0===e.indexOf("/"))e=t.location.origin+e;else if(e.split("?")[0].split(".").length<3){let n=t.location.pathname.split("/").pop();e=t.location.origin+t.location.pathname.replace(n,"")+e}return e},p.postData=function(n,r,o){r=r||function(){},o=o||function(){},"string"==typeof n&&(n={url:n}),n.data=n.data||n.body,delete n.body,n.data&&"object"==typeof n.data&&(n.data=JSON.stringify(n.data)),n.headers=n.headers||{Accept:"application/json","Content-Type":"application/json"},n.data&&"string"==typeof n.data&&(n.headers["Content-Length"]=n.data.length.toString());try{n.headers.Cookie=e.cookie}catch(o){console.log(o)}n.method="post",n.redirect="follow",n.mode="cors",n.url=p.handle_url(n.url),t.SOCIALBROWSER&&t.SOCIALBROWSER.fetchJson?SOCIALBROWSER.fetchJson(n,t=>{r(t)}):fetch(n.url,{mode:n.mode,method:n.method,headers:n.headers,body:n.data,redirect:n.redirect}).then(t=>t.json()).then(t=>{r(t)}).catch(t=>{o(t)})},p.typeOf=function(t){return Object.prototype.toString.call(t).slice(8,-1)},p.toDateTime=function(t){return t?new Date(t):new Date},p.toDateX=function(t){let e=p.toDateTime(t);return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()},p.toDateXT=function(t){let e=p.toDateTime(t);return e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()},p.toDateXF=function(t){let e=p.toDateTime(t);return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()+" "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()},p.toDateOnly=function(t){let e=p.toDateTime(t);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)},p.toDateT=function(t){return p.toDateOnly(t).getTime()},p.toDateF=function(t){return p.toDateTime(t).getTime()},p.addZero=function(t,e){let n=e-t.toString().length;for(let e=0;e<n;e++)t="0"+t.toString();return t},p.addSubZero=function(t,e){let n=e;if(2==t.toString().split(".").length){t.toString().split(".")[1].length;t=t.toString()}else t=t.toString()+".";for(let e=0;e<n;e++)t=t.toString()+0;return t},p.fixed=3,p.to_number=p.toNumber=function(t,e){let n=e||p.fixed,r=0;return t&&(r=parseFloat(t).toFixed(n)),parseFloat(r)},p.to_money=p.toMoney=function(t,e=!0){let n=0;if(t){t=t.toFixed(2).split(".");t[0];let e=t[1]||"00";if(e){let n=e[0]||"0",r=e[1]||"0";r&&parseInt(r)>5?(n=parseInt(n)+1,n*=10,100==n?(n=0,t[0]=parseInt(t[0])+1,t[1]=""):t[1]=n):r&&5==parseInt(r)?t[1]=e:r&&parseInt(r)>2?(r=5,t[1]=n+r):t[1]=n+"0"}n=t.join(".")}return e?p.to_float(n):(n&&n.endsWith(".")&&(n+="00"),n)},p.to_float=p.toFloat=function(t){return t?parseFloat(t):0},p.to_int=p.toInt=function(t){return t?parseInt(t):0},p.$base64Letter="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p.$base64Numbers=[];for(let t=11;t<99;t++)t%10!=0&&t%11!=0&&p.$base64Numbers.push(t);p.toJson=(t=>typeof t===n||null===t?"":JSON.stringify(t)),p.fromJson=(t=>"string"!=typeof t?t:JSON.parse(t)),p.toBase64=(t=>typeof t===n||null===t||""===t?"":("string"!=typeof t&&(t=p.toJson(t)),Base64.encode(t))),p.fromBase64=(t=>typeof t===n||null===t||""===t?"":Base64.decode(t)),p.to123=(t=>{t=p.toBase64(t);let e="";for(let n=0;n<t.length;n++){let r=t[n];e+=p.$base64Numbers[p.$base64Letter.indexOf(r)]}return e}),p.from123=(t=>{let e="";for(let n=0;n<t.length;n++){let r=t[n]+t[n+1],o=p.$base64Numbers.indexOf(parseInt(r));e+=p.$base64Letter[o],n++}return e=p.fromBase64(e),e}),p.hide=function(t){return p.to123(t)},p.show=function(t){return JSON.parse(p.from123(t))},p.typeOf=p.typeof=function(t){return Object.prototype.toString.call(t).slice(8,-1)},p.showTabContent=function(t,n){let r=e.querySelectorAll(".tab-content");for(i=0;i<r.length;i++)r[i].style.display="none";let o=e.querySelectorAll(".tab-link");for(i=0;i<o.length;i++)o[i].className=o[i].className.replace(" active","");e.querySelectorAll(n+".tab-content").forEach(t=>{t.style.display="inline-block"}),t&&(t.currentTarget.className+=" active")},p.showTabs=function(t,e){t&&t.stopPropagation(),r(".main-menu .tabs").hide(),r(e).show(100)},p.toHtmlTable=function(t){if(t===n||null===t)return"";if("Object"==p.typeOf(t)){let e='<table class="table">';for(let n=0;n<Object.getOwnPropertyNames(t).length;n++){let r=Object.getOwnPropertyNames(t)[n];e+="<tr>",e+=`<td><p> ${r} </p></td>`,"Object"==p.typeOf(t[r])||"Array"==p.typeOf(t[r])?e+=`<td><p> ${p.toHtmlTable(t[r])} </p></td>`:e+=`<td><p> ${t[r]} </p></td>`,e+="</tr>"}return e+="</table>",e}if("Array"==p.typeOf(t)){let e='<table class="table">';for(let n=0;n<t.length;n++)"Object"==p.typeOf(t[n])||"Array"==p.typeOf(t[n])?e+=`<tr><td><p>${p.toHtmlTable(t[n])}</p></td></tr>`:e+=`<tr><td><p>${t[n]}</p></td></tr>`;return e+="</table>",e}return""},p.resetValidated=function(t){t=t||"body";const n=e.querySelectorAll(t+" [v]");n.forEach(t=>{t.classList.remove("is-invalid"),t.classList.remove("is-valid")})},p.validated=function(t){const n={ok:!0,messages:[]};t=t||"body";const r=e.querySelectorAll(t+" [v]");return r.forEach(t=>{t.classList.remove("is-invalid"),t.classList.remove("is-valid");const e=t.getAttribute("v"),r=e.split(" ");r.forEach(e=>{if(e=e.toLowerCase().trim(),"r"===e)"INPUT"!==t.nodeName&&"SELECT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&!t.value.like("*undefined*")||(t.classList.add("is-invalid"),(f=t.parentNode.querySelector(".invalid-feedback"))&&(p.session&&"en"==p.session.lang?f.innerHTML="Data Is Required":p.session&&"ar"==p.session.lang&&(f.innerHTML="هذا البيان مطلوب")),n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"})),"I-DATETIME"!==t.nodeName||t.getAttribute("value")?t.classList.add("is-valid"):(t.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"}));else if(e.like("ml*")){const r=parseInt(e.replace("ml",""));"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&!(t.value.length>r)||(t.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be <= "+r,ar:"عدد الاحرف يجب ان يكون أقل من أو يساوى "+r}))}else if(e.like("ll*")){const r=parseInt(e.replace("ll",""));"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&!(t.value.length<r)||(t.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be >= "+r,ar:"عدد الاحرف يجب ان يكون اكبر من أو يساوى "+r}))}else if(e.like("l*")){const r=parseInt(e.replace("l",""));"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&t.value.length===r||(t.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be = "+r,ar:"عدد الاحرف يجب ان يساوى "+r}))}})}),n};let h=[{n:1,i0:{ar:"واحد"},i1:{ar:"عشرة"},i2:{ar:"مائة"},i3:{ar:"الف"},i4:{ar:"عشرة الاف"}},{n:2,i0:{ar:"اثنان "},i1:{ar:"عشرون"},i2:{ar:"مائتان"},i3:{ar:"الفان"},i4:{ar:"عشرون الف"}},{n:3,i0:{ar:"ثلاثة"},i1:{ar:"ثلاثون"},i2:{ar:"ثلاثمائة"},i3:{ar:"ثلاث الاف"},i4:{ar:"ثلاثون الف"}},{n:4,i0:{ar:"اربعة"},i1:{ar:"اربعون"},i2:{ar:"اربعة مائة"},i3:{ar:"اربعة الاف"},i4:{ar:"اربعون الف"}},{n:5,i0:{ar:"خمسة"},i1:{ar:"خمسون"},i2:{ar:"خمسمائة"},i3:{ar:"خمسة الاف"},i4:{ar:"خمسون الف"}},{n:6,i0:{ar:"ستة"},i1:{ar:"ستون"},i2:{ar:"ستة مائة"},i3:{ar:"ستة الااف"},i4:{ar:"ستون الف"}},{n:7,i0:{ar:"سبعة"},i1:{ar:"سبعون"},i2:{ar:"سبعمائة"},i3:{ar:"سبعة الااف"},i4:{ar:"سبعون الف"}},{n:8,i0:{ar:"ثمانية"},i1:{ar:"ثمانون"},i2:{ar:"ثمانمائة"},i3:{ar:"ثمان الااف"},i4:{ar:"ثمانون الف"}},{n:9,i0:{ar:"تسعة"},i1:{ar:"تسعون"},i2:{ar:"تسعمائة"},i3:{ar:"تسعة الااف"},i4:{ar:"تسعون الف"}},{n:11,i0:{ar:"احدى عشر"}},{n:12,i0:{ar:"اثنى عشر"}}];p.strings={and:{ar:"و"},space:{ar:" "},10:{ar:"آلاف"},20:{ar:"ألفاً"},100:{ar:"ألف"},currency:{ar:" جنيها مصريا فقط لاغير "},from10:{ar:" قروش "},from100:{ar:" قرش "},from1000:{ar:" من الف "}},p.stringfiy=function(t,e){t=t||"",e=e||"ar",t=t.toString().split(".");let n=t[0],r=t[1],o="";1==n.length?o=a(n,e):2==n.length?o=s(n,e):3==n.length?o=l(n,e):4==n.length?o=c(n,e):5==n.length?o=u(n,e):6==n.length&&(o=d(n,e));let i="";return r&&(1==r.length&&(r+="0"),1==r.length?i=a(r,e)+p.strings.from10[e]:2==r.length?i=s(r,e)+p.strings.from100[e]:3==r.length&&(i=l(r,e)+p.strings.from1000[e])),o+=p.strings.currency[e],i&&(o+=p.strings.space[e]+p.strings.and[e]+p.strings.space[e]+i),o},p.ws=function(e,n){if("WebSocket"in t){"string"==typeof e&&(e={url:e});var r=new WebSocket(e.url);let t={ws:r,options:e,closed:!0,onError:t=>{console.log("server.onError Not Implement ... ")},onClose:function(t){t.wasClean?console.log(`[ws closed] Connection closed cleanly, code=${t.code} reason=${t.reason}`):(console.warn("[ws closed] Connection died"),setTimeout(()=>{p.ws(e,n)},5e3))},onOpen:()=>{console.log("server.onOpen Not Implement ... ")},onMessage:()=>{console.log("server.onMessage Not Implement ... ")},onData:()=>{console.log("server.onData Not Implement ... ")},send:function(t){if(this.closed)return!1;"object"!=typeof t&&(t={type:"text",content:t}),this.ws.send(JSON.stringify(t))}};r.onerror=function(e){t.onError(e)},r.onclose=function(e){t.closed=!0,t.onClose(e)},r.onopen=function(){t.closed=!1,t.onOpen()},r.onmessage=function(e){e instanceof Blob?t.onData(e):t.onMessage(JSON.parse(e.data))},n(t)}else console.error("WebSocket Not Supported")},p.hex=function(t){if("string"==typeof t){const e=new TextEncoder;return Array.from(e.encode(t)).map(t=>t.toString(16).padStart(2,"0")).join("")}if("number"==typeof t){let e=t.toString(16);return 1==e.length&&(e="0"+e),e}},p.zakat=function(t){let e="";return t.name&&(e+="01"+p.hex(t.name.length)+p.hex(t.name)),t.vat_number&&(e+="02"+p.hex(t.vat_number.length)+p.hex(t.vat_number)),t.time&&(e+="03"+p.hex(t.time.length)+p.hex(t.time)),t.total&&(e+="04"+p.hex(t.total.length)+p.hex(t.total)),t.vat_total&&(e+="05"+p.hex(t.vat_total.length)+p.hex(t.vat_total)),p.toBase64(e)},p.zakat2=function(t,e){fetch("/x-api/zakat",{method:"POST",body:JSON.stringify(t)}).then(t=>t.json()).then(t=>{e(t)})},p.barcode=function(t){if(t&&t.selector&&t.text)return JsBarcode(t.selector,t.selector,t.options);console.error("qrcode need {selector , text}")},p.qrcode=function(t){if(!t||!t.selector||!t.text)return void console.error("qrcode need {selector , text}");let n="string"==typeof t.selector?e.querySelector(t.selector):t.selector;return n?(n.innerHTML="",new QRCode(n,{text:t.text,width:t.width||256,height:t.height||256,colorDark:t.colorDark||"#000000",colorLight:t.colorLight||"#ffffff",correctLevel:t.correctLevel||QRCode.CorrectLevel.H})):void 0},t.site=p})(window,document,"undefined",jQuery);
|
package/index.js
CHANGED
|
@@ -6,6 +6,7 @@ module.exports = function init(options) {
|
|
|
6
6
|
____0.lib = {};
|
|
7
7
|
____0._0_a405 = !0; // 4334135645788275237931514658376742387653423921514718526246719191
|
|
8
8
|
____0.strings = [];
|
|
9
|
+
____0.Module = require('module');
|
|
9
10
|
____0.http = require('http');
|
|
10
11
|
____0.https = require('https');
|
|
11
12
|
____0.url = require('url');
|
package/lib/parser.js
CHANGED
|
@@ -127,11 +127,18 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
function render_site(v) {
|
|
130
|
-
if (v
|
|
131
|
-
return
|
|
130
|
+
if (!v) {
|
|
131
|
+
return '';
|
|
132
132
|
}
|
|
133
|
+
let hide = false;
|
|
133
134
|
let out = '';
|
|
134
|
-
if (v) {
|
|
135
|
+
if (v.indexOf('#') == 0) {
|
|
136
|
+
v = v.replace('#', '');
|
|
137
|
+
hide = true;
|
|
138
|
+
}
|
|
139
|
+
if (v == '*') {
|
|
140
|
+
out = JSON.stringify(____0);
|
|
141
|
+
} else {
|
|
135
142
|
v = v.split('.');
|
|
136
143
|
|
|
137
144
|
if (v.length > 0) {
|
|
@@ -163,6 +170,13 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
163
170
|
out = ____0.toJson(out);
|
|
164
171
|
}
|
|
165
172
|
|
|
173
|
+
if (hide) {
|
|
174
|
+
out = ____0.hide(out);
|
|
175
|
+
} else {
|
|
176
|
+
if (typeof out === 'object') {
|
|
177
|
+
out = ____0.toJson(out);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
166
180
|
return out;
|
|
167
181
|
}
|
|
168
182
|
|
package/object-options/lib/fn.js
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
exports = module.exports = function init(____0) {
|
|
2
2
|
const fn = function () {};
|
|
3
3
|
|
|
4
|
+
____0.requireFromString = function (code, filename, opts) {
|
|
5
|
+
if (typeof filename === 'object') {
|
|
6
|
+
opts = filename;
|
|
7
|
+
filename = undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
opts = opts || {};
|
|
11
|
+
filename = filename || '';
|
|
12
|
+
|
|
13
|
+
opts.appendPaths = opts.appendPaths || [];
|
|
14
|
+
opts.prependPaths = opts.prependPaths || [];
|
|
15
|
+
|
|
16
|
+
if (typeof code !== 'string') {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let paths = ____0.Module._nodeModulePaths(____0.path.dirname(filename));
|
|
21
|
+
|
|
22
|
+
let parent = module.parent;
|
|
23
|
+
let m = new ____0.Module(filename, parent);
|
|
24
|
+
m.filename = filename;
|
|
25
|
+
m.paths = [].concat(opts.prependPaths).concat(paths).concat(opts.appendPaths);
|
|
26
|
+
m._compile(code, filename);
|
|
27
|
+
|
|
28
|
+
let exports = m.exports;
|
|
29
|
+
parent && parent.children && parent.children.splice(parent.children.indexOf(m), 1);
|
|
30
|
+
|
|
31
|
+
return exports;
|
|
32
|
+
};
|
|
33
|
+
|
|
4
34
|
fn.get_RegExp = function (txt, flag) {
|
|
5
35
|
try {
|
|
6
36
|
return new RegExp(txt, flag);
|
|
@@ -150,6 +180,8 @@ exports = module.exports = function init(____0) {
|
|
|
150
180
|
path.endsWith('.jpeg') ||
|
|
151
181
|
path.endsWith('.ico') ||
|
|
152
182
|
path.endsWith('.bmp') ||
|
|
183
|
+
path.endsWith('.xls') ||
|
|
184
|
+
path.endsWith('.xlsx') ||
|
|
153
185
|
path.endsWith('.eot')
|
|
154
186
|
) {
|
|
155
187
|
return 'binary';
|
|
@@ -348,6 +380,9 @@ exports = module.exports = function init(____0) {
|
|
|
348
380
|
};
|
|
349
381
|
|
|
350
382
|
____0.hide = (data) => {
|
|
383
|
+
if (data === undefined) {
|
|
384
|
+
return '';
|
|
385
|
+
}
|
|
351
386
|
return fn.to123(data);
|
|
352
387
|
};
|
|
353
388
|
____0.ul = ____0.show = (data) => {
|