isite 2023.1.2 → 2023.1.4
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 +36 -1
- package/apps/client-side/site_files/css/WebShareEditor.css +1 -0
- package/apps/client-side/site_files/css/bootstrap5-addon.css +3 -1
- package/apps/client-side/site_files/css/effect.css +14 -4
- package/apps/client-side/site_files/css/font-cairo.css +15 -11
- package/apps/client-side/site_files/css/font-droid.css +21 -18
- package/apps/client-side/site_files/css/font-saudi.css +92 -0
- package/apps/client-side/site_files/css/layout.css +2 -1
- package/apps/client-side/site_files/css/modal.css +4 -0
- package/apps/client-side/site_files/css/tabs.css +0 -1
- package/apps/client-side/site_files/css/theme_paper.css +2 -1
- package/apps/client-side/site_files/css/treeview.css +4 -2
- package/apps/client-side/site_files/fonts/DINNextLTW05-Bold.woff2 +0 -0
- package/apps/client-side/site_files/fonts/DINNextLTW05-Regular.woff2 +0 -0
- package/apps/client-side/site_files/fonts/DINNextLTW23-Light.woff2 +0 -0
- package/apps/client-side/site_files/fonts/DINNextLTW23-Medium.woff2 +0 -0
- package/apps/client-side/site_files/fonts/HelveticaNeueLTStd45Light_22520.woff +0 -0
- package/apps/client-side/site_files/fonts/HelveticaNeueLTStd55Roman_22526.woff +0 -0
- package/apps/client-side/site_files/fonts/HelveticaNeueLTStd75Bold_22539.woff +0 -0
- package/apps/client-side/site_files/fonts/HelveticaNeueLTStd85Heavy_22545.woff +0 -0
- package/apps/client-side/site_files/fonts/HelveticaNeueLTStd95Black_22551.woff +0 -0
- package/apps/client-side/site_files/fonts/HelveticaNeueLTStdMd1.woff +0 -0
- package/apps/client-side/site_files/html/directive/i-content.html +4 -0
- package/apps/client-side/site_files/html/directive/i-date.html +1 -1
- package/apps/client-side/site_files/html/directive/i-list.html +1 -1
- package/apps/client-side/site_files/js/WebShareEditor.js +1 -0
- package/apps/client-side/site_files/js/bootstrap-5-directive.js +88 -6
- package/index.js +2 -2
- package/lib/email.js +18 -17
- package/lib/parser.js +1 -6
- package/lib/routing.js +3 -0
- package/lib/session.js +1 -0
- package/lib/words.js +78 -112
- package/object-options/index.js +1 -7
- package/object-options/lib/fn.js +42 -0
- package/package.json +1 -1
|
@@ -63,6 +63,81 @@ app.directive('iTextarea', function () {
|
|
|
63
63
|
template: `/*##client-side/directive/i-textarea.html*/`,
|
|
64
64
|
};
|
|
65
65
|
});
|
|
66
|
+
app.directive('iContent', function ($timeout, $interval) {
|
|
67
|
+
return {
|
|
68
|
+
restrict: 'E',
|
|
69
|
+
scope: {
|
|
70
|
+
v: '@',
|
|
71
|
+
label: '@',
|
|
72
|
+
id2: '@',
|
|
73
|
+
disabled: '@',
|
|
74
|
+
rows: '@',
|
|
75
|
+
ngModel: '=',
|
|
76
|
+
ngChange: '&',
|
|
77
|
+
},
|
|
78
|
+
link: function ($scope, element, attrs, ctrl) {
|
|
79
|
+
if (typeof attrs.disabled !== 'undefined') {
|
|
80
|
+
attrs.disabled = 'disabled';
|
|
81
|
+
} else {
|
|
82
|
+
attrs.disabled = '';
|
|
83
|
+
}
|
|
84
|
+
$scope.rows = $scope.rows || 10;
|
|
85
|
+
$scope.id2 = $scope.id2 || 'textarea_' + Math.random().toString().replace('0.', '');
|
|
86
|
+
$(element)
|
|
87
|
+
.find('textarea')
|
|
88
|
+
.focus(() => {
|
|
89
|
+
$('.popup').hide();
|
|
90
|
+
});
|
|
91
|
+
$timeout(() => {
|
|
92
|
+
window['content_' + attrs.id] = WebShareEditor.create($scope.id2, {
|
|
93
|
+
toolbarItem: [
|
|
94
|
+
['undo', 'redo'],
|
|
95
|
+
['font', 'fontSize', 'formatBlock'],
|
|
96
|
+
['bold', 'underline', 'italic', 'strike', 'subscript', 'superscript'],
|
|
97
|
+
['removeFormat'],
|
|
98
|
+
['fontColor', 'hiliteColor'],
|
|
99
|
+
['outdent', 'indent'],
|
|
100
|
+
['align', 'horizontalRule', 'list', 'table'],
|
|
101
|
+
['link', 'image', 'video'],
|
|
102
|
+
/* ['fullScreen', 'showBlocks', 'codeView'],
|
|
103
|
+
['preview', 'print'],
|
|
104
|
+
['save', 'template'], */
|
|
105
|
+
],
|
|
106
|
+
width: '100%',
|
|
107
|
+
minHeight: '300px',
|
|
108
|
+
});
|
|
109
|
+
if ($scope.ngModel) {
|
|
110
|
+
window['content_' + attrs.id].setContents($scope.ngModel);
|
|
111
|
+
}
|
|
112
|
+
$interval(() => {
|
|
113
|
+
$scope.ngModel2 = window['content_' + attrs.id].getContents();
|
|
114
|
+
if ($scope.ngModel !== $scope.ngModel2) {
|
|
115
|
+
$scope.ngModel = $scope.ngModel2;
|
|
116
|
+
$scope.changed();
|
|
117
|
+
}
|
|
118
|
+
}, 1000);
|
|
119
|
+
}, 500);
|
|
120
|
+
|
|
121
|
+
$scope.changed = function () {
|
|
122
|
+
$timeout(() => {
|
|
123
|
+
if ($scope.ngChange) {
|
|
124
|
+
$scope.ngChange();
|
|
125
|
+
}
|
|
126
|
+
}, 100);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
$scope.$watch('ngModel', (ngModel) => {
|
|
130
|
+
if (ngModel && window['content_' + attrs.id]) {
|
|
131
|
+
if ($scope.ngModel !== $scope.ngModel2) {
|
|
132
|
+
$scope.ngModel = $scope.ngModel2;
|
|
133
|
+
window['content_' + attrs.id].setContents($scope.ngModel);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
template: `/*##client-side/directive/i-content.html*/`,
|
|
139
|
+
};
|
|
140
|
+
});
|
|
66
141
|
|
|
67
142
|
app.directive('iCheckbox', function ($timeout) {
|
|
68
143
|
return {
|
|
@@ -140,6 +215,15 @@ app.directive('iButton', function () {
|
|
|
140
215
|
} else if ($scope.type.like('*save*')) {
|
|
141
216
|
$scope.fa = 'fas fa-save';
|
|
142
217
|
$scope.class = 'btn-success';
|
|
218
|
+
} else if ($scope.type.like('*list*')) {
|
|
219
|
+
$scope.fa = 'fas fa-list';
|
|
220
|
+
$scope.class = 'btn-info';
|
|
221
|
+
} else if ($scope.type.like('unapprove')) {
|
|
222
|
+
$scope.fa = 'fas fa-eject';
|
|
223
|
+
$scope.class = 'btn-danger';
|
|
224
|
+
} else if ($scope.type.like('approve')) {
|
|
225
|
+
$scope.fa = 'fas fa-check-double';
|
|
226
|
+
$scope.class = 'btn-primary';
|
|
143
227
|
} else if ($scope.type.like('*view*') || $scope.type.like('*details*')) {
|
|
144
228
|
$scope.fa = 'fas fa-eye';
|
|
145
229
|
$scope.class = 'btn-info';
|
|
@@ -229,7 +313,6 @@ app.directive('iList', [
|
|
|
229
313
|
$scope.fa_add = 'fa-plus';
|
|
230
314
|
}
|
|
231
315
|
|
|
232
|
-
|
|
233
316
|
if ($scope.ngSearch) {
|
|
234
317
|
$scope.showSearch = !0;
|
|
235
318
|
}
|
|
@@ -335,16 +418,15 @@ app.directive('iList', [
|
|
|
335
418
|
}
|
|
336
419
|
});
|
|
337
420
|
|
|
338
|
-
$scope.searchElement.on('input'
|
|
339
|
-
|
|
421
|
+
$scope.searchElement.on('input', () => {
|
|
422
|
+
$timeout(() => {
|
|
340
423
|
if ($scope.ngGet) {
|
|
341
424
|
$scope.ngGet({ $search: $scope.searchElement.val() });
|
|
342
425
|
} else if ($scope.ngSearch) {
|
|
343
|
-
$scope
|
|
426
|
+
$scope.$filter = $scope.searchElement.val();
|
|
344
427
|
}
|
|
345
428
|
}, 100);
|
|
346
|
-
})
|
|
347
|
-
|
|
429
|
+
});
|
|
348
430
|
|
|
349
431
|
$scope.updateModel = function (item) {
|
|
350
432
|
$scope.ngModel = $scope.getNgValue(item, $scope.ngValue);
|
package/index.js
CHANGED
|
@@ -188,7 +188,7 @@ module.exports = function init(options) {
|
|
|
188
188
|
|
|
189
189
|
____0.words = require('./lib/words.js')(____0);
|
|
190
190
|
____0.word = ____0.words.word;
|
|
191
|
-
____0.words.
|
|
191
|
+
____0.words.addFile(____0.dir + '/json/words.json');
|
|
192
192
|
|
|
193
193
|
____0.storage = require('./lib/storage.js')(____0).fn;
|
|
194
194
|
____0.logs = require('./lib/logs.js')(____0).fn;
|
|
@@ -250,7 +250,7 @@ module.exports = function init(options) {
|
|
|
250
250
|
____0.importApp = function (app_path, name2) {
|
|
251
251
|
____0.log('=== Importing App : ' + app_path);
|
|
252
252
|
if (____0.isFileExistsSync(app_path + '/site_files/json/words.json')) {
|
|
253
|
-
____0.words.
|
|
253
|
+
____0.words.addFile(app_path + '/site_files/json/words.json');
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
if (____0.isFileExistsSync(app_path + '/site_files/json/vars.json')) {
|
package/lib/email.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
module.exports = function init(____0) {
|
|
2
|
-
|
|
3
2
|
____0.sendFreeMail = function (mail, callback) {
|
|
4
3
|
callback =
|
|
5
4
|
callback ||
|
|
@@ -30,6 +29,7 @@ module.exports = function init(____0) {
|
|
|
30
29
|
};
|
|
31
30
|
|
|
32
31
|
____0.sendSmptMail = function (mail, callback) {
|
|
32
|
+
console.log(mail);
|
|
33
33
|
callback =
|
|
34
34
|
callback ||
|
|
35
35
|
function (err, res) {
|
|
@@ -43,11 +43,14 @@ module.exports = function init(____0) {
|
|
|
43
43
|
var transporter = ____0.nodemailer.createTransport({
|
|
44
44
|
host: mail.host,
|
|
45
45
|
port: mail.port || 587,
|
|
46
|
+
service: "Mandrill",
|
|
46
47
|
secure: mail.secure, // true for 465, false for other ports
|
|
47
48
|
auth: {
|
|
48
49
|
user: mail.username, // generated ethereal user
|
|
49
50
|
pass: mail.password, // generated ethereal password
|
|
51
|
+
apiKey : mail.password
|
|
50
52
|
},
|
|
53
|
+
logger: true, // log to console
|
|
51
54
|
});
|
|
52
55
|
|
|
53
56
|
var mailOptions = {
|
|
@@ -58,11 +61,11 @@ module.exports = function init(____0) {
|
|
|
58
61
|
subject: mail.subject,
|
|
59
62
|
html: mail.message,
|
|
60
63
|
text: mail.message.replace(/<[^>]+>/g, ''),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
// headers: {
|
|
65
|
+
// 'x-lib': 'isite',
|
|
66
|
+
// },
|
|
64
67
|
date: new Date(),
|
|
65
|
-
|
|
68
|
+
// attachments: [{ filename: 'isite.txt', content: 'test attachment', contentType: 'text/plain' }],
|
|
66
69
|
};
|
|
67
70
|
|
|
68
71
|
transporter.sendMail(mailOptions, function (err, info) {
|
|
@@ -93,16 +96,14 @@ module.exports = function init(____0) {
|
|
|
93
96
|
});
|
|
94
97
|
};
|
|
95
98
|
|
|
96
|
-
// let transporter = nodemailer.createTransport({
|
|
97
|
-
// host: "smtp.gmail.com",
|
|
98
|
-
// port: 465,
|
|
99
|
-
// secure: true,
|
|
100
|
-
// auth: {
|
|
101
|
-
// type: "OAuth2",
|
|
102
|
-
// user: "user@example.com",
|
|
103
|
-
// accessToken: "ya29.Xx_XX0xxxxx-xX0X0XxXXxXxXXXxX0x",
|
|
104
|
-
// },
|
|
105
|
-
// });
|
|
106
|
-
|
|
107
|
-
|
|
99
|
+
// let transporter = nodemailer.createTransport({
|
|
100
|
+
// host: "smtp.gmail.com",
|
|
101
|
+
// port: 465,
|
|
102
|
+
// secure: true,
|
|
103
|
+
// auth: {
|
|
104
|
+
// type: "OAuth2",
|
|
105
|
+
// user: "user@example.com",
|
|
106
|
+
// accessToken: "ya29.Xx_XX0xxxxx-xX0X0XxXXxXxXXXxX0x",
|
|
107
|
+
// },
|
|
108
|
+
// });
|
|
108
109
|
};
|
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
|
-
|
|
293
|
-
if (w.done) {
|
|
294
|
-
return w[req.session.lang] || name;
|
|
295
|
-
} else {
|
|
296
|
-
return name;
|
|
297
|
-
}
|
|
292
|
+
return req.word(name);
|
|
298
293
|
}
|
|
299
294
|
|
|
300
295
|
function getContent(name) {
|
package/lib/routing.js
CHANGED
|
@@ -676,6 +676,9 @@ module.exports = function init(____0) {
|
|
|
676
676
|
|
|
677
677
|
return userFinger;
|
|
678
678
|
};
|
|
679
|
+
req.word = function(name){
|
|
680
|
+
return ____0.word(name)[req.session.lang] || name;
|
|
681
|
+
}
|
|
679
682
|
|
|
680
683
|
res.code = null;
|
|
681
684
|
req.socket.remoteAddress = req.socket.remoteAddress || '';
|
package/lib/session.js
CHANGED
package/lib/words.js
CHANGED
|
@@ -1,127 +1,93 @@
|
|
|
1
1
|
module.exports = function init(____0) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
let app = function () {};
|
|
3
|
+
app.list = [];
|
|
4
|
+
app.$collectoin = ____0.connectCollection('app_words');
|
|
5
|
+
app.ready = false;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
app.$collectoin.findAll({ limit: 10000 }, (err, docs) => {
|
|
8
|
+
if (!err && docs && docs.length > 0) {
|
|
9
|
+
docs.forEach((doc) => {
|
|
10
|
+
doc.$isDB = true;
|
|
11
|
+
app.list.unshift(doc);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
app.ready = true;
|
|
15
|
+
});
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
app.word = function (obj) {
|
|
18
|
+
if (typeof obj === 'string') {
|
|
19
|
+
return app.get(obj);
|
|
20
|
+
}
|
|
21
|
+
if (typeof obj === 'object') {
|
|
22
|
+
return app.add(obj);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
};
|
|
26
|
+
app.get = function (name) {
|
|
27
|
+
if ((w = app.list.find((w2) => w2.name === name))) {
|
|
28
|
+
return w;
|
|
29
|
+
} else {
|
|
30
|
+
if (!app.ready) {
|
|
31
|
+
return { name: name };
|
|
32
|
+
}
|
|
33
|
+
return app.add({ name: name });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
48
36
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
});
|
|
37
|
+
app.add = app.set = function (word) {
|
|
38
|
+
let index = app.list.findIndex((w) => w.name === word.name);
|
|
39
|
+
if (index === -1) {
|
|
40
|
+
app.list.push(word);
|
|
41
|
+
app.$collectoin.add(word, (err, doc) => {
|
|
42
|
+
if (!err && doc) {
|
|
43
|
+
let index = app.list.findIndex((w) => w.name === doc.name);
|
|
44
|
+
app.list[index] = doc;
|
|
76
45
|
}
|
|
77
|
-
|
|
78
|
-
}
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
if (!app.list[index].$isDB || word.$isDB) {
|
|
49
|
+
app.list[index] = word;
|
|
50
|
+
app.$collectoin.update(app.list[index]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
79
53
|
|
|
80
|
-
|
|
81
|
-
|
|
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);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
54
|
+
return word;
|
|
55
|
+
};
|
|
105
56
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
57
|
+
app.addList = function (list) {
|
|
58
|
+
if (Array.isArray(list)) {
|
|
59
|
+
list.forEach((doc) => {
|
|
60
|
+
app.add(doc);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
109
64
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
65
|
+
app.addFile = function (path) {
|
|
66
|
+
____0.readFile(path, (err, data) => {
|
|
67
|
+
if (!err) {
|
|
68
|
+
let arr = ____0.fromJson(data);
|
|
69
|
+
arr.forEach((doc) => {
|
|
70
|
+
app.add(doc);
|
|
113
71
|
});
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
114
75
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
76
|
+
____0.on(____0.strings[9], () => {
|
|
77
|
+
____0.get({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
|
|
78
|
+
res.json({ done: !0, words: app.list });
|
|
79
|
+
});
|
|
118
80
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
81
|
+
____0.post({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
|
|
82
|
+
res.json(app.add(req.data.word));
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
____0.get('/x-api/words/get/:name', (req, res) => {
|
|
86
|
+
res.json({
|
|
87
|
+
word: app.get(req.params.name),
|
|
88
|
+
});
|
|
124
89
|
});
|
|
90
|
+
});
|
|
125
91
|
|
|
126
|
-
|
|
92
|
+
return app;
|
|
127
93
|
};
|
package/object-options/index.js
CHANGED
|
@@ -37,7 +37,7 @@ function setOptions(_options, ____0) {
|
|
|
37
37
|
_0x14xo: _0x14xo, // 3259376545129191
|
|
38
38
|
_0xddxo: _0xddxo, // 421957684138766241719191
|
|
39
39
|
log: !0,
|
|
40
|
-
lang: '
|
|
40
|
+
lang: 'en',
|
|
41
41
|
theme: 'default',
|
|
42
42
|
help: !1,
|
|
43
43
|
stdin: !0,
|
|
@@ -45,9 +45,6 @@ function setOptions(_options, ____0) {
|
|
|
45
45
|
_0xyyxo: '2654127326719191',
|
|
46
46
|
ipLookup: false,
|
|
47
47
|
www: true,
|
|
48
|
-
subDomainIntegration: false,
|
|
49
|
-
domainIntegration: false,
|
|
50
|
-
portIntegration: false,
|
|
51
48
|
https: {
|
|
52
49
|
enabled: !1,
|
|
53
50
|
port: null,
|
|
@@ -161,9 +158,6 @@ function setOptions(_options, ____0) {
|
|
|
161
158
|
_x0oo.apps_dir = _x0oo.apps_dir || template.apps_dir;
|
|
162
159
|
_x0oo._0x14xo = _x0oo._0x14xo ?? !1;
|
|
163
160
|
_x0oo.ipLookup = _x0oo.ipLookup ?? !1;
|
|
164
|
-
_x0oo.subDomainIntegration = _x0oo.subDomainIntegration ?? !1;
|
|
165
|
-
_x0oo.domainIntegration = _x0oo.domainIntegration ?? !1;
|
|
166
|
-
_x0oo.portIntegration = _x0oo.portIntegration ?? !1;
|
|
167
161
|
_x0oo.www = _x0oo.www ?? template.www;
|
|
168
162
|
|
|
169
163
|
_x0oo.https = _x0oo.https || template.https;
|
package/object-options/lib/fn.js
CHANGED
|
@@ -127,6 +127,47 @@ exports = module.exports = function init(____0) {
|
|
|
127
127
|
}
|
|
128
128
|
return 0;
|
|
129
129
|
};
|
|
130
|
+
|
|
131
|
+
fn.toMoney = function (_num, float = true) {
|
|
132
|
+
let n = 0;
|
|
133
|
+
if (_num) {
|
|
134
|
+
_num = _num.toFixed(2).split('.');
|
|
135
|
+
let n1 = _num[0];
|
|
136
|
+
let n2 = _num[1] || '00';
|
|
137
|
+
if (n2) {
|
|
138
|
+
let n3 = n2[0] || '0';
|
|
139
|
+
let n4 = n2[1] || '0';
|
|
140
|
+
if (n4 && parseInt(n4) > 5) {
|
|
141
|
+
n3 = parseInt(n3) + 1;
|
|
142
|
+
n3 = n3 * 10;
|
|
143
|
+
if (n3 == 100) {
|
|
144
|
+
n3 = 0;
|
|
145
|
+
_num[0] = parseInt(_num[0]) + 1;
|
|
146
|
+
_num[1] = '';
|
|
147
|
+
} else {
|
|
148
|
+
_num[1] = n3;
|
|
149
|
+
}
|
|
150
|
+
} else if (n4 && parseInt(n4) == 5) {
|
|
151
|
+
_num[1] = n2;
|
|
152
|
+
} else if (n4 && parseInt(n4) > 2) {
|
|
153
|
+
n4 = 5;
|
|
154
|
+
_num[1] = n3 + n4;
|
|
155
|
+
} else {
|
|
156
|
+
_num[1] = n3 + '0';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
n = _num.join('.');
|
|
160
|
+
}
|
|
161
|
+
if (!float) {
|
|
162
|
+
if (n && n.endsWith('.')) {
|
|
163
|
+
n = n + '00';
|
|
164
|
+
}
|
|
165
|
+
return n;
|
|
166
|
+
} else {
|
|
167
|
+
return fn.toFloat(n);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
130
171
|
fn.toInt = function (_num) {
|
|
131
172
|
if (_num) {
|
|
132
173
|
return parseInt(_num);
|
|
@@ -469,6 +510,7 @@ exports = module.exports = function init(____0) {
|
|
|
469
510
|
____0.fromBase64 = fn.fromBase64;
|
|
470
511
|
____0.to123 = fn.to123;
|
|
471
512
|
____0.toBase64 = fn.toBase64;
|
|
513
|
+
____0.toMoney = fn.toMoney;
|
|
472
514
|
____0.getContentType = fn.getContentType;
|
|
473
515
|
____0.getFileEncode = fn.getFileEncode;
|
|
474
516
|
____0.typeof = ____0.typeOf = fn.typeOf;
|