isite 2024.8.18 → 2024.8.20

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/lib/sessions.js CHANGED
@@ -101,6 +101,7 @@ module.exports = function init(____0) {
101
101
  let index = sessions.list.findIndex((s) => s && s.accessToken && s.accessToken === session.accessToken);
102
102
  if (index > -1) {
103
103
  sessions.list[index].requestesCount++;
104
+ sessions.list[index].language = sessions.list[index].language || ____0.options.language;
104
105
  session.$exists = !0;
105
106
  session.$index = index;
106
107
  callback(sessions.list[index]);
@@ -114,11 +115,14 @@ module.exports = function init(____0) {
114
115
  session = { ...session, ...doc };
115
116
  session.requestesCount++;
116
117
  session.$index = sessions.list.length;
118
+ session.language = session.language || ____0.options.language;
119
+
117
120
  sessions.list.push(session);
118
121
  callback(sessions.list[session.$index]);
119
122
  } else {
120
123
  session.$new = !0;
121
- session.lang = ____0.options.lang;
124
+ session.language = ____0.options.language;
125
+ session.lang = ____0.options.language.id;
122
126
  session.theme = ____0.options.theme;
123
127
  session.data = [];
124
128
  session.requestesCount = 1;
@@ -132,7 +136,8 @@ module.exports = function init(____0) {
132
136
  );
133
137
  } else {
134
138
  session.$new = !0;
135
- session.lang = ____0.options.lang;
139
+ session.language = ____0.options.language;
140
+ session.lang = ____0.options.language.id;
136
141
  session.theme = ____0.options.theme;
137
142
  session.data = [];
138
143
  session.requestesCount = 1;
@@ -144,7 +149,8 @@ module.exports = function init(____0) {
144
149
  }
145
150
  } else {
146
151
  session.$new = !0;
147
- session.lang = ____0.options.lang;
152
+ session.language = ____0.options.language;
153
+ session.lang = ____0.options.language.id;
148
154
  session.theme = ____0.options.theme;
149
155
  session.data = [];
150
156
  session.requestesCount = 1;
@@ -158,12 +164,12 @@ module.exports = function init(____0) {
158
164
  ____0.saveSession = sessions.save = function (session, callback) {
159
165
  callback = callback || function () {};
160
166
  session.$exists = !1;
161
- let index = sessions.list.findIndex(s=> s.accessToken && s.accessToken == session.accessToken)
167
+ let index = sessions.list.findIndex((s) => s.accessToken && s.accessToken == session.accessToken);
162
168
  if (index !== -1) {
163
169
  sessions.list[index] = { ...sessions.list[index], ...session };
164
170
  callback(sessions.list[index]);
165
171
  return sessions.list[index];
166
- }
172
+ }
167
173
  };
168
174
 
169
175
  ____0.on('[session][update]', (session) => {
@@ -208,15 +214,9 @@ module.exports = function init(____0) {
208
214
  });
209
215
 
210
216
  ____0.onPOST({ name: '/x-language/change', public: true }, (req, res) => {
211
- req.session.lang = req.data.name;
212
- req.session.langDir = req.data.dir;
213
- if (!req.session.langDir) {
214
- if (req.session.lang.contains('ar')) {
215
- req.session.langDir = 'rtl';
216
- } else {
217
- req.session.langDir = 'ltr';
218
- }
219
- }
217
+ req.session.language = req.data;
218
+ req.session.lang = req.session.language?.id || req.data.name;
219
+ req.session.langDir = req.session.language?.dir;
220
220
 
221
221
  ____0.saveSession(req.session);
222
222
  res.json({
@@ -39,6 +39,7 @@ function setOptions(_options, ____0) {
39
39
  _0xddxo: _0xddxo, // 421957684138766241719191
40
40
  log: !0,
41
41
  lang: 'en',
42
+ language: { id: 'En', dir: 'ltr', text: 'left' },
42
43
  theme: 'default',
43
44
  public: false,
44
45
  help: !1,
@@ -177,6 +178,7 @@ function setOptions(_options, ____0) {
177
178
  _x0oo.hostname = _x0oo.hostname || template.hostname;
178
179
  _x0oo.log = _x0oo.log ?? template.log;
179
180
  _x0oo.lang = _x0oo.lang ?? template.lang;
181
+ _x0oo.language = _x0oo.language ?? template.language;
180
182
  _x0oo.theme = _x0oo.theme ?? template.theme;
181
183
  _x0oo.help = _x0oo.help ?? template.help;
182
184
  _x0oo.stdin = _x0oo.stdin ?? template.stdin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2024.08.18",
3
+ "version": "2024.08.20",
4
4
  "description": "Create High Level Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {