glib-web 0.5.77
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/.eslintrc.js +37 -0
- package/LICENSE +201 -0
- package/README.md +33 -0
- package/action.js +167 -0
- package/actions/analytics/logEvent.js +26 -0
- package/actions/auth/creditCard.js +29 -0
- package/actions/auth/restart.js +5 -0
- package/actions/auth/saveCsrfToken.js +12 -0
- package/actions/cables/push.js +38 -0
- package/actions/dialogs/alert.js +15 -0
- package/actions/dialogs/close.js +7 -0
- package/actions/dialogs/notification.js +14 -0
- package/actions/dialogs/oauth.js +6 -0
- package/actions/dialogs/open.js +7 -0
- package/actions/dialogs/options.js +5 -0
- package/actions/dialogs/show.js +5 -0
- package/actions/forms/submit.js +15 -0
- package/actions/http/delete.js +7 -0
- package/actions/http/patch.js +7 -0
- package/actions/http/post.js +7 -0
- package/actions/http/put.js +7 -0
- package/actions/panels/scrollTo.js +18 -0
- package/actions/panels/scrollToBottom.js +11 -0
- package/actions/runMultiple.js +11 -0
- package/actions/sheets/select.js +5 -0
- package/actions/snackbars/alert.js +15 -0
- package/actions/snackbars/select.js +5 -0
- package/actions/timeouts/set.js +20 -0
- package/actions/windows/close.js +13 -0
- package/actions/windows/closeAll.js +16 -0
- package/actions/windows/closeWithReload.js +18 -0
- package/actions/windows/open.js +5 -0
- package/actions/windows/openWeb.js +5 -0
- package/actions/windows/refreshState.js +5 -0
- package/actions/windows/reload.js +24 -0
- package/actions/ws/push.js +35 -0
- package/app.vue +180 -0
- package/components/_button.vue +101 -0
- package/components/_dropdownMenu.vue +76 -0
- package/components/_icon.vue +50 -0
- package/components/_message.vue +25 -0
- package/components/avatar.vue +16 -0
- package/components/banners/alert.vue +49 -0
- package/components/banners/select.vue +82 -0
- package/components/button.vue +13 -0
- package/components/calendar.vue +105 -0
- package/components/charts/column.vue +26 -0
- package/components/charts/line.vue +61 -0
- package/components/chip.vue +24 -0
- package/components/component.vue +222 -0
- package/components/datetime.vue +54 -0
- package/components/fab.vue +33 -0
- package/components/fields/_patternText.vue +61 -0
- package/components/fields/_select.vue +86 -0
- package/components/fields/autocomplete.vue +73 -0
- package/components/fields/check.vue +104 -0
- package/components/fields/checkGroup.vue +51 -0
- package/components/fields/country/countries.js +251 -0
- package/components/fields/country/field.vue +81 -0
- package/components/fields/country/regions.js +12 -0
- package/components/fields/creditCard.vue +105 -0
- package/components/fields/date.vue +24 -0
- package/components/fields/datetime.vue +49 -0
- package/components/fields/dynamicGroup.vue +106 -0
- package/components/fields/dynamicSelect.vue +173 -0
- package/components/fields/file.vue +166 -0
- package/components/fields/googlePlace.vue +158 -0
- package/components/fields/hidden.vue +18 -0
- package/components/fields/location.vue +223 -0
- package/components/fields/newRichText.vue +191 -0
- package/components/fields/phone/countries.js +315 -0
- package/components/fields/phone/field.vue +348 -0
- package/components/fields/phone/sprite.css +1071 -0
- package/components/fields/radio.vue +64 -0
- package/components/fields/radioGroup.vue +93 -0
- package/components/fields/rating.vue +26 -0
- package/components/fields/richText.vue +172 -0
- package/components/fields/select.vue +17 -0
- package/components/fields/stripe/stripeFields.vue +93 -0
- package/components/fields/stripe/stripeIndividualFields.vue +207 -0
- package/components/fields/stripeExternalAccount.vue +135 -0
- package/components/fields/stripeToken.vue +59 -0
- package/components/fields/submit.vue +23 -0
- package/components/fields/text.vue +144 -0
- package/components/fields/textarea.vue +59 -0
- package/components/fields/timeZone.vue +22 -0
- package/components/fields/timer.vue +83 -0
- package/components/h1.vue +28 -0
- package/components/h2.vue +20 -0
- package/components/h3.vue +22 -0
- package/components/h4.vue +20 -0
- package/components/h5.vue +20 -0
- package/components/h6.vue +20 -0
- package/components/hr.vue +13 -0
- package/components/html.vue +13 -0
- package/components/icon.vue +25 -0
- package/components/image.vue +87 -0
- package/components/label.vue +62 -0
- package/components/map.vue +206 -0
- package/components/markdown.vue +52 -0
- package/components/mixins/events.js +178 -0
- package/components/mixins/generic.js +58 -0
- package/components/mixins/list/autoload.js +144 -0
- package/components/mixins/longClick.js +56 -0
- package/components/mixins/scrolling.js +35 -0
- package/components/mixins/styles.js +221 -0
- package/components/mixins/table/autoload.js +131 -0
- package/components/mixins/table/export.js +52 -0
- package/components/mixins/table/import.js +106 -0
- package/components/mixins/text.js +20 -0
- package/components/mixins/ws/actionCable.js +48 -0
- package/components/mixins/ws/phoenixSocket.js +117 -0
- package/components/p.vue +36 -0
- package/components/panels/carousel.vue +55 -0
- package/components/panels/column.vue +117 -0
- package/components/panels/custom.vue +52 -0
- package/components/panels/flow.vue +81 -0
- package/components/panels/form.vue +126 -0
- package/components/panels/horizontal.vue +73 -0
- package/components/panels/list.vue +241 -0
- package/components/panels/responsive.vue +88 -0
- package/components/panels/scroll.vue +68 -0
- package/components/panels/split.vue +52 -0
- package/components/panels/table.vue +234 -0
- package/components/panels/ul.vue +34 -0
- package/components/panels/vertical.vue +71 -0
- package/components/panels/web.vue +11 -0
- package/components/spacer.vue +11 -0
- package/components/switch.vue +42 -0
- package/components/tabBar.vue +44 -0
- package/extensions/array.js +20 -0
- package/extensions/string.js +21 -0
- package/index.js +195 -0
- package/keys.js +12 -0
- package/nav/appbar.vue +117 -0
- package/nav/content.vue +40 -0
- package/nav/dialog.vue +127 -0
- package/nav/drawer.vue +88 -0
- package/nav/drawerButton.vue +28 -0
- package/nav/drawerLabel.vue +21 -0
- package/nav/sheet.vue +57 -0
- package/nav/snackbar.vue +72 -0
- package/package.json +42 -0
- package/settings.json.example +21 -0
- package/static/plugins/alignment/alignment.js +76 -0
- package/static/plugins/alignment/alignment.min.js +1 -0
- package/static/plugins/beyondgrammar/beyondgrammar.js +46 -0
- package/static/plugins/beyondgrammar/beyondgrammar.min.js +1 -0
- package/static/plugins/blockcode/blockcode.js +110 -0
- package/static/plugins/blockcode/blockcode.min.js +1 -0
- package/static/plugins/clips/clips.js +44 -0
- package/static/plugins/clips/clips.min.js +1 -0
- package/static/plugins/counter/counter.js +60 -0
- package/static/plugins/counter/counter.min.js +1 -0
- package/static/plugins/definedlinks/definedlinks.js +64 -0
- package/static/plugins/definedlinks/definedlinks.min.js +1 -0
- package/static/plugins/handle/handle.js +173 -0
- package/static/plugins/handle/handle.min.js +1 -0
- package/static/plugins/icons/icons.js +72 -0
- package/static/plugins/icons/icons.min.js +1 -0
- package/static/plugins/imageposition/imageposition.js +85 -0
- package/static/plugins/imageposition/imageposition.min.js +1 -0
- package/static/plugins/inlineformat/inlineformat.js +85 -0
- package/static/plugins/inlineformat/inlineformat.min.js +1 -0
- package/static/plugins/removeformat/removeformat.js +28 -0
- package/static/plugins/removeformat/removeformat.min.js +1 -0
- package/static/plugins/selector/selector.js +96 -0
- package/static/plugins/selector/selector.min.js +1 -0
- package/static/plugins/specialchars/specialchars.js +63 -0
- package/static/plugins/specialchars/specialchars.min.js +1 -0
- package/static/plugins/textdirection/textdirection.js +55 -0
- package/static/plugins/textdirection/textdirection.min.js +1 -0
- package/static/plugins/textexpander/textexpander.js +46 -0
- package/static/plugins/textexpander/textexpander.min.js +1 -0
- package/static/plugins/underline/underline.js +27 -0
- package/static/plugins/underline/underline.min.js +1 -0
- package/static/redactorx.css +1344 -0
- package/static/redactorx.js +14254 -0
- package/static/redactorx.min.css +1 -0
- package/static/redactorx.min.js +1 -0
- package/static/redactorx.usm.min.js +2 -0
- package/styles/test.sass +3 -0
- package/styles/test.scss +5 -0
- package/templates/_menu.vue +38 -0
- package/templates/comment.vue +202 -0
- package/templates/featured.vue +32 -0
- package/templates/thumbnail.vue +138 -0
- package/templates/unsupported.vue +12 -0
- package/utils/app.js +14 -0
- package/utils/dom.js +13 -0
- package/utils/form.js +34 -0
- package/utils/format.js +14 -0
- package/utils/hash.js +29 -0
- package/utils/helper.js +44 -0
- package/utils/history.js +70 -0
- package/utils/http.js +209 -0
- package/utils/launch.js +135 -0
- package/utils/private/ws.js +22 -0
- package/utils/public.js +23 -0
- package/utils/settings.js +48 -0
- package/utils/storage.js +9 -0
- package/utils/type.js +69 -0
- package/utils/uploader.js +121 -0
- package/utils/url.js +132 -0
package/utils/url.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import TypeUtils from "./type";
|
|
2
|
+
|
|
3
|
+
export default class {
|
|
4
|
+
static htmlUrl(originalUrl) {
|
|
5
|
+
if (TypeUtils.isString(originalUrl)) {
|
|
6
|
+
let url;
|
|
7
|
+
if (originalUrl.indexOf("?") > -1) {
|
|
8
|
+
url = originalUrl.replace(/.json\?/, "?");
|
|
9
|
+
} else {
|
|
10
|
+
url = originalUrl.replace(/.json$/, "");
|
|
11
|
+
}
|
|
12
|
+
url = url.replace(/[\&\?]format=json/, "");
|
|
13
|
+
return url;
|
|
14
|
+
}
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static jsonUrl(originalUrl) {
|
|
19
|
+
if (typeof originalUrl === "string") {
|
|
20
|
+
let url = originalUrl;
|
|
21
|
+
if (originalUrl.indexOf("?") > -1) {
|
|
22
|
+
if (
|
|
23
|
+
originalUrl.indexOf(".json?") == -1 &&
|
|
24
|
+
originalUrl.search(/[\&\?]format=json/) == -1
|
|
25
|
+
) {
|
|
26
|
+
url = originalUrl + "&format=json";
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
if (!originalUrl.endsWith(".json")) {
|
|
30
|
+
url = originalUrl + "?format=json";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return url;
|
|
34
|
+
}
|
|
35
|
+
return "";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static toFormData(params) {
|
|
39
|
+
const formData = new FormData();
|
|
40
|
+
for (const key in params) {
|
|
41
|
+
formData.append(key, params[key]);
|
|
42
|
+
}
|
|
43
|
+
return formData;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static toMap(formData) {
|
|
47
|
+
return this._extractUrlParams(new URLSearchParams(formData).toString());
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static appendParams(url, params) {
|
|
51
|
+
if (params instanceof FormData) {
|
|
52
|
+
const queryString = new URLSearchParams(params).toString();
|
|
53
|
+
if (queryString.length <= 0) {
|
|
54
|
+
return url;
|
|
55
|
+
}
|
|
56
|
+
if (url.contains("?")) {
|
|
57
|
+
return url + `&${queryString}`;
|
|
58
|
+
} else {
|
|
59
|
+
return url + `?${queryString}`;
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
return this.appendParams(url, this.toFormData(params));
|
|
63
|
+
// throw "Invalid params"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// static asQueryString(obj) {
|
|
68
|
+
// if (!TypeUtils.isObject(obj)) {
|
|
69
|
+
// return ""
|
|
70
|
+
// }
|
|
71
|
+
//
|
|
72
|
+
// var str = [];
|
|
73
|
+
// for (var p in obj) {
|
|
74
|
+
// if (obj.hasOwnProperty(p)) {
|
|
75
|
+
// str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]))
|
|
76
|
+
// }
|
|
77
|
+
// }
|
|
78
|
+
// return str.join("&")
|
|
79
|
+
// }
|
|
80
|
+
|
|
81
|
+
static extractFormActionData(originalUrl, local) {
|
|
82
|
+
if (typeof originalUrl === "string") {
|
|
83
|
+
const substitute = local ? "" : ".json";
|
|
84
|
+
let url;
|
|
85
|
+
if (originalUrl.indexOf("?") > -1) {
|
|
86
|
+
url = originalUrl.replace(/.json\?.*/, substitute);
|
|
87
|
+
} else {
|
|
88
|
+
url = originalUrl.replace(/.json$/, substitute);
|
|
89
|
+
}
|
|
90
|
+
return { url: url, params: this._extractUrlParams(originalUrl) };
|
|
91
|
+
}
|
|
92
|
+
return {};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// // https://gist.github.com/pirate/9298155edda679510723
|
|
96
|
+
static _extractUrlParams(search) {
|
|
97
|
+
const hashes = search.slice(search.indexOf("?") + 1).split("&");
|
|
98
|
+
return hashes.reduce((params, hash) => {
|
|
99
|
+
const split = hash.indexOf("=");
|
|
100
|
+
|
|
101
|
+
if (split < 0) {
|
|
102
|
+
return Object.assign(params, {
|
|
103
|
+
[hash]: null
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const name = hash.slice(0, split);
|
|
108
|
+
const val = hash.slice(split + 1);
|
|
109
|
+
const key = decodeURIComponent(name);
|
|
110
|
+
if (key.endsWith("[]")) {
|
|
111
|
+
if (params[key]) {
|
|
112
|
+
params[key].push(val);
|
|
113
|
+
return params;
|
|
114
|
+
} else {
|
|
115
|
+
return Object.assign(params, {
|
|
116
|
+
[key]: [this._decodeParamValue(val)]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
return Object.assign(params, {
|
|
121
|
+
[key]: this._decodeParamValue(val)
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}, {});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
static _decodeParamValue(value) {
|
|
128
|
+
// See https://stackoverflow.com/questions/18717557/remove-plus-sign-in-url-query-string/24417399
|
|
129
|
+
const encodedSpaces = value.replace(/\+/g, "%20");
|
|
130
|
+
return decodeURIComponent(encodedSpaces);
|
|
131
|
+
}
|
|
132
|
+
}
|