@saltcorn/server 0.7.2 → 0.7.3-beta.2
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/package.json +8 -8
- package/public/saltcorn-common.js +18 -6
- package/public/saltcorn.css +4 -0
- package/public/saltcorn.js +8 -4
- package/routes/files.js +6 -2
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/server",
|
|
3
|
-
"version": "0.7.2",
|
|
3
|
+
"version": "0.7.3-beta.2",
|
|
4
4
|
"description": "Server app for Saltcorn, open-source no-code platform",
|
|
5
5
|
"homepage": "https://saltcorn.com",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@saltcorn/base-plugin": "0.7.2",
|
|
10
|
-
"@saltcorn/builder": "0.7.2",
|
|
11
|
-
"@saltcorn/data": "0.7.2",
|
|
12
|
-
"@saltcorn/admin-models": "0.7.2",
|
|
13
|
-
"@saltcorn/markup": "0.7.2",
|
|
14
|
-
"@saltcorn/sbadmin2": "0.7.2",
|
|
9
|
+
"@saltcorn/base-plugin": "0.7.3-beta.2",
|
|
10
|
+
"@saltcorn/builder": "0.7.3-beta.2",
|
|
11
|
+
"@saltcorn/data": "0.7.3-beta.2",
|
|
12
|
+
"@saltcorn/admin-models": "0.7.3-beta.2",
|
|
13
|
+
"@saltcorn/markup": "0.7.3-beta.2",
|
|
14
|
+
"@saltcorn/sbadmin2": "0.7.3-beta.2",
|
|
15
15
|
"@socket.io/cluster-adapter": "^0.1.0",
|
|
16
16
|
"@socket.io/sticky": "^1.0.1",
|
|
17
17
|
"aws-sdk": "^2.1037.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"pg": "^8.2.1",
|
|
49
49
|
"pluralize": "^8.0.0",
|
|
50
50
|
"qrcode": "1.5.0",
|
|
51
|
-
"sharp": "0.
|
|
51
|
+
"resize-with-sharp-or-jimp": "0.1.3",
|
|
52
52
|
"socket.io": "4.2.0",
|
|
53
53
|
"thirty-two": "1.0.2",
|
|
54
54
|
"tmp-promise": "^3.0.2",
|
|
@@ -471,7 +471,7 @@ function common_done(res, isWeb = true) {
|
|
|
471
471
|
|
|
472
472
|
const repeaterCopyValuesToForm = (form, editor) => {
|
|
473
473
|
const vs = JSON.parse(editor.getString());
|
|
474
|
-
|
|
474
|
+
|
|
475
475
|
const setVal = (k, ix, v) => {
|
|
476
476
|
const $e = form.find(`input[name="${k}_${ix}"]`);
|
|
477
477
|
if ($e.length) $e.val(v);
|
|
@@ -483,16 +483,22 @@ const repeaterCopyValuesToForm = (form, editor) => {
|
|
|
483
483
|
vs.forEach((v, ix) => {
|
|
484
484
|
Object.entries(v).forEach(([k, v]) => {
|
|
485
485
|
//console.log(ix, k, typeof v, v)
|
|
486
|
-
allNames.add(k);
|
|
487
486
|
if (typeof v === "boolean") setVal(k, ix, v ? "on" : "");
|
|
488
487
|
else setVal(k, ix, v);
|
|
489
488
|
});
|
|
490
489
|
});
|
|
491
490
|
//delete
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
491
|
+
//for (let ix = vs.length; ix < vs.length + 20; ix++) {
|
|
492
|
+
// $(`input[name="${k}_${ix}"]`).remove();
|
|
493
|
+
//}
|
|
494
|
+
$(`input[type=hidden]`).each(function () {
|
|
495
|
+
const name = $(this).attr("name");
|
|
496
|
+
if (!name) return;
|
|
497
|
+
const m = name.match(/_(\d+)$/);
|
|
498
|
+
if (!m || !m[1]) return;
|
|
499
|
+
const ix = parseInt(m[1], 10);
|
|
500
|
+
if (typeof ix !== "number" || isNaN(ix)) return;
|
|
501
|
+
if (ix >= vs.length) $(this).remove();
|
|
496
502
|
});
|
|
497
503
|
};
|
|
498
504
|
function align_dropdown(id) {
|
|
@@ -576,3 +582,9 @@ function unique_field_from_rows(
|
|
|
576
582
|
}
|
|
577
583
|
}
|
|
578
584
|
}
|
|
585
|
+
|
|
586
|
+
function cancel_form(form) {
|
|
587
|
+
if (!form) return;
|
|
588
|
+
$(form).append(`<input type="hidden" name="_cancel" value="on">`);
|
|
589
|
+
$(form).submit();
|
|
590
|
+
}
|
package/public/saltcorn.css
CHANGED
package/public/saltcorn.js
CHANGED
|
@@ -162,6 +162,13 @@ function globalErrorCatcher(message, source, lineno, colno, error) {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
function close_saltcorn_modal() {
|
|
166
|
+
var myModalEl = document.getElementById("scmodal");
|
|
167
|
+
if (!myModalEl) return;
|
|
168
|
+
var modal = bootstrap.Modal.getInstance(myModalEl);
|
|
169
|
+
if (modal) modal.dispose();
|
|
170
|
+
}
|
|
171
|
+
|
|
165
172
|
function ajax_modal(url, opts = {}) {
|
|
166
173
|
if ($("#scmodal").length === 0) {
|
|
167
174
|
$("body").append(`<div id="scmodal", class="modal">
|
|
@@ -179,9 +186,7 @@ function ajax_modal(url, opts = {}) {
|
|
|
179
186
|
</div>
|
|
180
187
|
</div>`);
|
|
181
188
|
} else if ($("#scmodal").hasClass("show")) {
|
|
182
|
-
|
|
183
|
-
var modal = bootstrap.Modal.getInstance(myModalEl);
|
|
184
|
-
modal.dispose();
|
|
189
|
+
close_saltcorn_modal();
|
|
185
190
|
}
|
|
186
191
|
if (opts.submitReload === false) $("#scmodal").addClass("no-submit-reload");
|
|
187
192
|
else $("#scmodal").removeClass("no-submit-reload");
|
|
@@ -429,7 +434,6 @@ async function fill_formula_btn_click(btn, k) {
|
|
|
429
434
|
if (k) k();
|
|
430
435
|
}
|
|
431
436
|
|
|
432
|
-
|
|
433
437
|
/*
|
|
434
438
|
https://github.com/jeffdavidgreen/bootstrap-html5-history-tabs/blob/master/bootstrap-history-tabs.js
|
|
435
439
|
Copyright (c) 2015 Jeff Green
|
package/routes/files.js
CHANGED
|
@@ -10,7 +10,7 @@ const File = require("@saltcorn/data/models/file");
|
|
|
10
10
|
const User = require("@saltcorn/data/models/user");
|
|
11
11
|
const { getState } = require("@saltcorn/data/db/state");
|
|
12
12
|
const s3storage = require("../s3storage");
|
|
13
|
-
const
|
|
13
|
+
const resizer = require("resize-with-sharp-or-jimp");
|
|
14
14
|
|
|
15
15
|
const {
|
|
16
16
|
mkTable,
|
|
@@ -214,7 +214,11 @@ router.get(
|
|
|
214
214
|
}
|
|
215
215
|
const fnm = `${file.location}_w${width}`;
|
|
216
216
|
if (!fs.existsSync(fnm)) {
|
|
217
|
-
await
|
|
217
|
+
await resizer({
|
|
218
|
+
fromFileName: file.location,
|
|
219
|
+
width,
|
|
220
|
+
toFileName: fnm,
|
|
221
|
+
});
|
|
218
222
|
}
|
|
219
223
|
res.sendFile(fnm);
|
|
220
224
|
}
|