glib-web 0.6.2 → 0.6.9
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/action.js +7 -4
- package/actions/analytics/logEvent.js +1 -1
- package/actions/auth/creditCard.js +4 -4
- package/actions/auth/saveCsrfToken.js +4 -4
- package/actions/cables/push.js +0 -12
- package/actions/commands/copy.js +12 -0
- package/actions/dialogs/alert.js +2 -2
- package/actions/dialogs/close.js +2 -4
- package/actions/dialogs/notification.js +2 -2
- package/actions/dialogs/open.js +2 -4
- package/actions/dialogs/show.js +3 -2
- package/actions/forms/submit.js +2 -12
- package/actions/http/delete.js +1 -1
- package/actions/http/patch.js +1 -1
- package/actions/http/post.js +1 -1
- package/actions/http/put.js +1 -1
- package/actions/runMultiple.js +2 -2
- package/actions/timeouts/set.js +2 -2
- package/actions/windows/close.js +2 -2
- package/actions/windows/closeAll.js +2 -2
- package/actions/windows/closeWithReload.js +1 -1
- package/actions/windows/open.js +1 -1
- package/actions/windows/reload.js +1 -1
- package/actions/ws/push.js +1 -1
- package/app.vue +5 -3
- package/components/button.vue +9 -2
- package/components/calendar.vue +1 -1
- package/components/component.vue +4 -0
- package/components/fields/googlePlace.vue +80 -52
- package/components/fields/radioGroup.vue +1 -0
- package/components/markdown.vue +7 -0
- package/components/mixins/dataset.js +10 -0
- package/components/mixins/events.js +4 -5
- package/components/mixins/generic.js +6 -0
- package/components/mixins/list/autoload.js +2 -3
- package/components/mixins/table/autoload.js +2 -2
- package/components/mixins/tour.js +75 -0
- package/components/mixins/ws/actionCable.js +1 -1
- package/components/multimedia/video.vue +87 -0
- package/components/panels/form.vue +13 -3
- package/components/panels/list.vue +1 -1
- package/components/switch.vue +2 -2
- package/index.js +3 -0
- package/nav/appbar.vue +1 -1
- package/nav/dialog.vue +2 -2
- package/nav/drawer.vue +38 -8
- package/nav/sheet.vue +1 -2
- package/nav/snackbar.vue +1 -2
- package/package.json +3 -2
- package/utils/form.js +1 -5
- package/utils/http.js +2 -2
- package/utils/launch.js +25 -18
- package/utils/mime_type.js +78 -0
- package/utils/private/ws.js +1 -1
- package/utils/uploader.js +9 -36
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
aac: "audio/aac",
|
|
3
|
+
abw: "application/x-abiword",
|
|
4
|
+
ai: "application/postscript",
|
|
5
|
+
arc: "application/octet-stream",
|
|
6
|
+
avi: "video/x-msvideo",
|
|
7
|
+
azw: "application/vnd.amazon.ebook",
|
|
8
|
+
bin: "application/octet-stream",
|
|
9
|
+
bz: "application/x-bzip",
|
|
10
|
+
bz2: "application/x-bzip2",
|
|
11
|
+
csh: "application/x-csh",
|
|
12
|
+
css: "text/css",
|
|
13
|
+
csv: "text/csv",
|
|
14
|
+
doc: "application/msword",
|
|
15
|
+
dll: "application/octet-stream",
|
|
16
|
+
eot: "application/vnd.ms-fontobject",
|
|
17
|
+
epub: "application/epub+zip",
|
|
18
|
+
gif: "image/gif",
|
|
19
|
+
htm: "text/html",
|
|
20
|
+
html: "text/html",
|
|
21
|
+
ico: "image/x-icon",
|
|
22
|
+
ics: "text/calendar",
|
|
23
|
+
jar: "application/java-archive",
|
|
24
|
+
jpeg: "image/jpeg",
|
|
25
|
+
jpg: "image/jpeg",
|
|
26
|
+
js: "application/javascript",
|
|
27
|
+
json: "application/json",
|
|
28
|
+
mid: "audio/midi",
|
|
29
|
+
midi: "audio/midi",
|
|
30
|
+
mp2: "audio/mpeg",
|
|
31
|
+
mp3: "audio/mpeg",
|
|
32
|
+
mp4: "video/mp4",
|
|
33
|
+
mpa: "video/mpeg",
|
|
34
|
+
mpe: "video/mpeg",
|
|
35
|
+
mpeg: "video/mpeg",
|
|
36
|
+
mpkg: "application/vnd.apple.installer+xml",
|
|
37
|
+
odp: "application/vnd.oasis.opendocument.presentation",
|
|
38
|
+
ods: "application/vnd.oasis.opendocument.spreadsheet",
|
|
39
|
+
odt: "application/vnd.oasis.opendocument.text",
|
|
40
|
+
oga: "audio/ogg",
|
|
41
|
+
ogv: "video/ogg",
|
|
42
|
+
ogx: "application/ogg",
|
|
43
|
+
otf: "font/otf",
|
|
44
|
+
png: "image/png",
|
|
45
|
+
ppt: "application/vnd.ms-powerpoint",
|
|
46
|
+
rar: "application/x-rar-compressed",
|
|
47
|
+
rtf: "application/rtf",
|
|
48
|
+
sh: "application/x-sh",
|
|
49
|
+
svg: "image/svg+xml",
|
|
50
|
+
swf: "application/x-shockwave-flash",
|
|
51
|
+
tar: "application/x-tar",
|
|
52
|
+
tif: "image/tiff",
|
|
53
|
+
tiff: "image/tiff",
|
|
54
|
+
ts: "application/typescript",
|
|
55
|
+
ttf: "font/ttf",
|
|
56
|
+
txt: "text/plain",
|
|
57
|
+
vsd: "application/vnd.visio",
|
|
58
|
+
wav: "audio/x-wav",
|
|
59
|
+
weba: "audio/webm",
|
|
60
|
+
webm: "video/webm",
|
|
61
|
+
webp: "image/webp",
|
|
62
|
+
woff: "font/woff",
|
|
63
|
+
woff2: "font/woff2",
|
|
64
|
+
xhtml: "application/xhtml+xml",
|
|
65
|
+
xls: "application/vnd.ms-excel",
|
|
66
|
+
xlsx: "application/vnd.ms-excel",
|
|
67
|
+
xlsx_OLD: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
68
|
+
xml: "application/xml",
|
|
69
|
+
xul: "application/vnd.mozilla.xul+xml",
|
|
70
|
+
"3gp": "video/3gpp",
|
|
71
|
+
"3gp_DOES_NOT_CONTAIN_VIDEO": "audio/3gpp",
|
|
72
|
+
"3gp2": "video/3gpp2",
|
|
73
|
+
"3gp2_DOES_NOT_CONTAIN_VIDEO": "audio/3gpp2",
|
|
74
|
+
"7z": "application/x-7z-compressed",
|
|
75
|
+
image: "image/*",
|
|
76
|
+
pdf: "application/pdf",
|
|
77
|
+
zip: "application/(zip|x-zip-compressed|octet-stream)"
|
|
78
|
+
};
|
package/utils/private/ws.js
CHANGED
package/utils/uploader.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DirectUpload } from "@rails/activestorage";
|
|
2
2
|
import Type from "../utils/type";
|
|
3
|
+
import mimeType from "../utils/mime_type";
|
|
3
4
|
|
|
4
5
|
const MB_SIZE = 1000;
|
|
5
6
|
|
|
@@ -63,47 +64,19 @@ export default class Uploader {
|
|
|
63
64
|
|
|
64
65
|
validateFile(spec) {
|
|
65
66
|
return this.validateFileAccordingToRules(spec.accepts);
|
|
66
|
-
|
|
67
|
-
// if (Type.isString(spec.accepts)) {
|
|
68
|
-
// if (spec.accepts) {
|
|
69
|
-
// const acceptsRegex = new RegExp(spec.accepts);
|
|
70
|
-
|
|
71
|
-
// if (!acceptsRegex.test(this.file.type)) {
|
|
72
|
-
// alert("Invalid file type.");
|
|
73
|
-
// return false;
|
|
74
|
-
// }
|
|
75
|
-
// }
|
|
76
|
-
|
|
77
|
-
// if (spec.file_size_limit) {
|
|
78
|
-
// if (this.file.size > spec.file_size_limit * MB_SIZE) {
|
|
79
|
-
// alert(spec.file_size_limit_alert_text);
|
|
80
|
-
// return false;
|
|
81
|
-
// }
|
|
82
|
-
// }
|
|
83
|
-
// } else {
|
|
84
|
-
// return this.validateFileAccordingToRules(spec.accepts);
|
|
85
|
-
// }
|
|
86
|
-
|
|
87
|
-
// return true;
|
|
88
67
|
}
|
|
89
68
|
|
|
90
69
|
validateFileAccordingToRules(spec) {
|
|
91
70
|
if (Type.isObject(spec)) {
|
|
92
|
-
let
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
mimeType = "application/pdf";
|
|
100
|
-
break;
|
|
101
|
-
default:
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
71
|
+
let validFileType = false;
|
|
72
|
+
[spec.fileType].flat().forEach(key => {
|
|
73
|
+
const acceptsRegex = new RegExp(mimeType[key]);
|
|
74
|
+
if (acceptsRegex.test(this.file.type)) {
|
|
75
|
+
validFileType = true;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
104
78
|
|
|
105
|
-
|
|
106
|
-
if (!acceptsRegex.test(this.file.type)) {
|
|
79
|
+
if (!validFileType) {
|
|
107
80
|
alert(spec.fileTypeErrorText || "Invalid file type");
|
|
108
81
|
return false;
|
|
109
82
|
}
|