glib-web 0.5.98 → 0.6.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/LICENSE +0 -0
- package/README.md +0 -0
- package/action.js +167 -167
- package/actions/analytics/logEvent.js +0 -0
- package/actions/auth/creditCard.js +0 -0
- package/actions/auth/restart.js +0 -0
- package/actions/auth/saveCsrfToken.js +0 -0
- package/actions/cables/push.js +0 -0
- package/actions/dialogs/alert.js +0 -0
- package/actions/dialogs/notification.js +0 -0
- package/actions/dialogs/oauth.js +0 -0
- package/actions/dialogs/open.js +0 -0
- package/actions/dialogs/options.js +0 -0
- package/actions/dialogs/show.js +0 -0
- package/actions/forms/submit.js +0 -0
- package/actions/http/delete.js +0 -0
- package/actions/http/patch.js +0 -0
- package/actions/http/post.js +0 -0
- package/actions/http/put.js +0 -0
- package/actions/panels/scrollTo.js +18 -18
- package/actions/panels/scrollToBottom.js +0 -0
- package/actions/runMultiple.js +0 -0
- package/actions/sheets/select.js +0 -0
- package/actions/snackbars/alert.js +0 -0
- package/actions/snackbars/select.js +0 -0
- package/actions/timeouts/set.js +20 -20
- package/actions/windows/close.js +0 -0
- package/actions/windows/closeAll.js +0 -0
- package/actions/windows/closeWithReload.js +0 -0
- package/actions/windows/open.js +0 -0
- package/actions/windows/openWeb.js +0 -0
- package/actions/windows/refreshState.js +5 -5
- package/actions/windows/reload.js +0 -0
- package/actions/ws/push.js +0 -0
- package/app.vue +180 -180
- package/components/_badge.vue +23 -23
- package/components/_button.vue +107 -107
- package/components/_dropdownMenu.vue +76 -76
- package/components/_icon.vue +50 -50
- package/components/_message.vue +0 -0
- package/components/avatar.vue +18 -18
- package/components/banners/alert.vue +0 -0
- package/components/banners/select.vue +82 -82
- package/components/button.vue +33 -40
- package/components/calendar.vue +0 -0
- package/components/charts/column.vue +47 -34
- package/components/charts/line.vue +67 -65
- package/components/chip.vue +51 -26
- package/components/component.vue +225 -225
- package/components/datetime.vue +0 -0
- package/components/fab.vue +0 -0
- package/components/fields/_patternText.vue +65 -65
- package/components/fields/_select.vue +86 -86
- package/components/fields/autocomplete.vue +73 -73
- package/components/fields/check.vue +91 -81
- package/components/fields/checkGroup.vue +58 -58
- package/components/fields/country/countries.js +0 -0
- package/components/fields/country/field.vue +0 -0
- package/components/fields/country/regions.js +0 -0
- package/components/fields/creditCard.vue +22 -13
- package/components/fields/date.vue +24 -24
- package/components/fields/datetime.vue +0 -0
- package/components/fields/dynamicGroup.vue +0 -0
- package/components/fields/dynamicSelect.vue +0 -0
- package/components/fields/file.vue +0 -0
- package/components/fields/googlePlace.vue +0 -0
- package/components/fields/hidden.vue +0 -0
- package/components/fields/location.vue +198 -198
- package/components/fields/newRichText.vue +0 -0
- package/components/fields/phone/countries.js +315 -315
- package/components/fields/phone/field.vue +351 -351
- package/components/fields/phone/sprite.css +1071 -1071
- package/components/fields/radio.vue +16 -16
- package/components/fields/radioGroup.vue +42 -42
- package/components/fields/rating.vue +0 -0
- package/components/fields/richText.vue +0 -0
- package/components/fields/select.vue +17 -17
- package/components/fields/stripe/stripeFields.vue +93 -93
- package/components/fields/stripe/stripeIndividualFields.vue +207 -207
- package/components/fields/stripeExternalAccount.vue +135 -135
- package/components/fields/text.vue +0 -0
- package/components/fields/textarea.vue +0 -0
- package/components/fields/timeZone.vue +22 -22
- package/components/fields/timer.vue +83 -83
- package/components/h1.vue +28 -28
- package/components/h2.vue +28 -20
- package/components/h3.vue +29 -22
- package/components/h4.vue +28 -20
- package/components/h5.vue +28 -20
- package/components/h6.vue +28 -20
- package/components/hr.vue +0 -0
- package/components/html.vue +0 -0
- package/components/icon.vue +25 -25
- package/components/image.vue +0 -0
- package/components/label.vue +62 -62
- package/components/map.vue +0 -0
- package/components/markdown.vue +0 -0
- package/components/mixins/{chart.js → chart/annotation.js} +73 -73
- package/components/mixins/chart/tooltip.js +31 -0
- package/components/mixins/events.js +178 -178
- package/components/mixins/generic.js +0 -0
- package/components/mixins/list/autoload.js +0 -0
- package/components/mixins/longClick.js +0 -0
- package/components/mixins/scrolling.js +0 -0
- package/components/mixins/styles.js +222 -222
- package/components/mixins/table/autoload.js +0 -0
- package/components/mixins/table/export.js +0 -0
- package/components/mixins/table/import.js +0 -0
- package/components/mixins/text.js +20 -20
- package/components/mixins/tooltip.js +11 -0
- package/components/mixins/ws/actionCable.js +48 -48
- package/components/mixins/ws/phoenixSocket.js +0 -0
- package/components/p.vue +0 -0
- package/components/panels/carousel.vue +55 -55
- package/components/panels/column.vue +0 -0
- package/components/panels/custom.vue +0 -0
- package/components/panels/flow.vue +81 -81
- package/components/panels/form.vue +130 -130
- package/components/panels/horizontal.vue +0 -0
- package/components/panels/list.vue +247 -247
- package/components/panels/responsive.vue +94 -94
- package/components/panels/scroll.vue +0 -0
- package/components/panels/split.vue +0 -0
- package/components/panels/table.vue +0 -0
- package/components/panels/ul.vue +34 -34
- package/components/panels/vertical.vue +0 -0
- package/components/panels/web.vue +11 -11
- package/components/progressbar.vue +36 -36
- package/components/spacer.vue +0 -0
- package/components/switch.vue +42 -42
- package/components/tabBar.vue +68 -68
- package/extensions/array.js +0 -0
- package/extensions/string.js +21 -21
- package/index.js +199 -199
- package/keys.js +0 -0
- package/nav/appbar.vue +136 -136
- package/nav/content.vue +0 -0
- package/nav/dialog.vue +127 -127
- package/nav/drawer.vue +105 -105
- package/nav/drawerButton.vue +31 -31
- package/nav/drawerLabel.vue +0 -0
- package/nav/sheet.vue +0 -0
- package/nav/snackbar.vue +0 -0
- package/package.json +44 -44
- package/settings.json.example +0 -0
- package/static/plugins/alignment/alignment.js +0 -0
- package/static/plugins/alignment/alignment.min.js +0 -0
- package/static/plugins/beyondgrammar/beyondgrammar.js +0 -0
- package/static/plugins/beyondgrammar/beyondgrammar.min.js +0 -0
- package/static/plugins/blockcode/blockcode.js +0 -0
- package/static/plugins/blockcode/blockcode.min.js +0 -0
- package/static/plugins/clips/clips.js +0 -0
- package/static/plugins/clips/clips.min.js +0 -0
- package/static/plugins/counter/counter.js +0 -0
- package/static/plugins/counter/counter.min.js +0 -0
- package/static/plugins/definedlinks/definedlinks.js +0 -0
- package/static/plugins/definedlinks/definedlinks.min.js +0 -0
- package/static/plugins/handle/handle.js +0 -0
- package/static/plugins/handle/handle.min.js +0 -0
- package/static/plugins/icons/icons.js +0 -0
- package/static/plugins/icons/icons.min.js +0 -0
- package/static/plugins/imageposition/imageposition.js +0 -0
- package/static/plugins/imageposition/imageposition.min.js +0 -0
- package/static/plugins/inlineformat/inlineformat.js +0 -0
- package/static/plugins/inlineformat/inlineformat.min.js +0 -0
- package/static/plugins/removeformat/removeformat.js +0 -0
- package/static/plugins/removeformat/removeformat.min.js +0 -0
- package/static/plugins/selector/selector.js +0 -0
- package/static/plugins/selector/selector.min.js +0 -0
- package/static/plugins/specialchars/specialchars.js +0 -0
- package/static/plugins/specialchars/specialchars.min.js +0 -0
- package/static/plugins/textdirection/textdirection.js +0 -0
- package/static/plugins/textdirection/textdirection.min.js +0 -0
- package/static/plugins/textexpander/textexpander.js +0 -0
- package/static/plugins/textexpander/textexpander.min.js +0 -0
- package/static/plugins/underline/underline.js +0 -0
- package/static/plugins/underline/underline.min.js +0 -0
- package/static/redactorx.css +0 -0
- package/static/redactorx.js +0 -0
- package/static/redactorx.min.css +0 -0
- package/static/redactorx.min.js +0 -0
- package/static/redactorx.usm.min.js +0 -0
- package/styles/test.sass +0 -0
- package/styles/test.scss +0 -0
- package/templates/_menu.vue +38 -38
- package/templates/comment.vue +202 -202
- package/templates/featured.vue +32 -32
- package/templates/thumbnail.vue +145 -145
- package/templates/unsupported.vue +12 -12
- package/utils/app.js +0 -0
- package/utils/dom.js +0 -0
- package/utils/form.js +0 -0
- package/utils/hash.js +0 -0
- package/utils/helper.js +0 -0
- package/utils/history.js +70 -70
- package/utils/http.js +209 -209
- package/utils/launch.js +135 -135
- package/utils/private/ws.js +0 -0
- package/utils/public.js +0 -0
- package/utils/settings.js +0 -0
- package/utils/storage.js +0 -0
- package/utils/type.js +0 -0
- package/utils/uploader.js +0 -0
- package/utils/url.js +136 -136
package/components/label.vue
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a
|
|
3
|
-
v-if="spec.onClick"
|
|
4
|
-
:href="$href()"
|
|
5
|
-
:rel="$rel()"
|
|
6
|
-
:style="textStyles()"
|
|
7
|
-
:class="$classes()"
|
|
8
|
-
@click="$onClick()"
|
|
9
|
-
>{{ text }}</a
|
|
10
|
-
>
|
|
11
|
-
<span v-else :style="$styles()" :class="$classes()">{{ text }}</span>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
import actionCableMixin from "./mixins/ws/actionCable";
|
|
16
|
-
import textMixin from "./mixins/text.js";
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
mixins: [actionCableMixin, textMixin],
|
|
20
|
-
props: {
|
|
21
|
-
spec: { type: Object, required: true }
|
|
22
|
-
},
|
|
23
|
-
data: function() {
|
|
24
|
-
return {
|
|
25
|
-
text: " "
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
methods: {
|
|
29
|
-
$ready() {
|
|
30
|
-
this.$wsInitActionCable(this.spec.actionCable);
|
|
31
|
-
|
|
32
|
-
this.text = this.spec.text;
|
|
33
|
-
},
|
|
34
|
-
action_set(spec) {
|
|
35
|
-
if (spec.user_id !== spec.filterKey) {
|
|
36
|
-
this.text = spec.text;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<style lang="scss" scoped>
|
|
44
|
-
span,
|
|
45
|
-
a {
|
|
46
|
-
/* white-space: pre-line; */
|
|
47
|
-
white-space: pre-wrap;
|
|
48
|
-
|
|
49
|
-
/* Without this, padding-top doesn't work */
|
|
50
|
-
display: inline-block;
|
|
51
|
-
line-height: 1;
|
|
52
|
-
}
|
|
53
|
-
span.muted {
|
|
54
|
-
opacity: 0.7;
|
|
55
|
-
}
|
|
56
|
-
span.small {
|
|
57
|
-
font-size: 80%;
|
|
58
|
-
}
|
|
59
|
-
a:hover {
|
|
60
|
-
text-decoration: none;
|
|
61
|
-
}
|
|
62
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a
|
|
3
|
+
v-if="spec.onClick"
|
|
4
|
+
:href="$href()"
|
|
5
|
+
:rel="$rel()"
|
|
6
|
+
:style="textStyles()"
|
|
7
|
+
:class="$classes()"
|
|
8
|
+
@click="$onClick()"
|
|
9
|
+
>{{ text }}</a
|
|
10
|
+
>
|
|
11
|
+
<span v-else :style="$styles()" :class="$classes()">{{ text }}</span>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import actionCableMixin from "./mixins/ws/actionCable";
|
|
16
|
+
import textMixin from "./mixins/text.js";
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
mixins: [actionCableMixin, textMixin],
|
|
20
|
+
props: {
|
|
21
|
+
spec: { type: Object, required: true }
|
|
22
|
+
},
|
|
23
|
+
data: function() {
|
|
24
|
+
return {
|
|
25
|
+
text: " "
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
methods: {
|
|
29
|
+
$ready() {
|
|
30
|
+
this.$wsInitActionCable(this.spec.actionCable);
|
|
31
|
+
|
|
32
|
+
this.text = this.spec.text;
|
|
33
|
+
},
|
|
34
|
+
action_set(spec) {
|
|
35
|
+
if (spec.user_id !== spec.filterKey) {
|
|
36
|
+
this.text = spec.text;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style lang="scss" scoped>
|
|
44
|
+
span,
|
|
45
|
+
a {
|
|
46
|
+
/* white-space: pre-line; */
|
|
47
|
+
white-space: pre-wrap;
|
|
48
|
+
|
|
49
|
+
/* Without this, padding-top doesn't work */
|
|
50
|
+
display: inline-block;
|
|
51
|
+
line-height: 1;
|
|
52
|
+
}
|
|
53
|
+
span.muted {
|
|
54
|
+
opacity: 0.7;
|
|
55
|
+
}
|
|
56
|
+
span.small {
|
|
57
|
+
font-size: 80%;
|
|
58
|
+
}
|
|
59
|
+
a:hover {
|
|
60
|
+
text-decoration: none;
|
|
61
|
+
}
|
|
62
|
+
</style>
|
package/components/map.vue
CHANGED
|
File without changes
|
package/components/markdown.vue
CHANGED
|
File without changes
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
data() {
|
|
3
|
-
return {
|
|
4
|
-
options: {
|
|
5
|
-
annotation: {
|
|
6
|
-
drawTime: "afterDraw",
|
|
7
|
-
events: ["mouseleave", "mouseenter"],
|
|
8
|
-
annotations: []
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
created() {
|
|
14
|
-
if (this.spec.lineVertical) {
|
|
15
|
-
this.options.annotation.annotations = this.spec.lineVertical.map(
|
|
16
|
-
(element, index) => this.annotation(element, index)
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
methods: {
|
|
21
|
-
annotation(options, index) {
|
|
22
|
-
const { text, x } = options;
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
type: "line",
|
|
26
|
-
mode: "vertical",
|
|
27
|
-
scaleID: "x-axis-0",
|
|
28
|
-
value: new Date(x).getTime(),
|
|
29
|
-
borderColor: "rgba(0,0,255,0.3)",
|
|
30
|
-
borderWidth: 3,
|
|
31
|
-
borderDash: [5, 10],
|
|
32
|
-
label: {
|
|
33
|
-
content: text,
|
|
34
|
-
enabled: true,
|
|
35
|
-
position: "top",
|
|
36
|
-
backgroundColor: "rgba(0,0,0,0.3)"
|
|
37
|
-
},
|
|
38
|
-
onMouseenter: function(e) {
|
|
39
|
-
Object.assign(
|
|
40
|
-
this.chartInstance.options.annotation.annotations[index],
|
|
41
|
-
{ borderColor: "rgba(0,0,255,0.8)" },
|
|
42
|
-
{
|
|
43
|
-
label: {
|
|
44
|
-
content: text,
|
|
45
|
-
enabled: true,
|
|
46
|
-
position: "top",
|
|
47
|
-
backgroundColor: "rgba(0,0,0,0.8)"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
this.chartInstance.update();
|
|
53
|
-
},
|
|
54
|
-
onMouseleave: function(e) {
|
|
55
|
-
Object.assign(
|
|
56
|
-
this.chartInstance.options.annotation.annotations[index],
|
|
57
|
-
{ borderColor: "rgba(0,0,255,0.3)" },
|
|
58
|
-
{
|
|
59
|
-
label: {
|
|
60
|
-
content: text,
|
|
61
|
-
enabled: true,
|
|
62
|
-
position: "top",
|
|
63
|
-
backgroundColor: "rgba(0,0,0,0.3)"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
this.chartInstance.update();
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
1
|
+
export default {
|
|
2
|
+
data() {
|
|
3
|
+
return {
|
|
4
|
+
options: {
|
|
5
|
+
annotation: {
|
|
6
|
+
drawTime: "afterDraw",
|
|
7
|
+
events: ["mouseleave", "mouseenter"],
|
|
8
|
+
annotations: []
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
created() {
|
|
14
|
+
if (this.spec.lineVertical) {
|
|
15
|
+
this.options.annotation.annotations = this.spec.lineVertical.map(
|
|
16
|
+
(element, index) => this.annotation(element, index)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
annotation(options, index) {
|
|
22
|
+
const { text, x } = options;
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
type: "line",
|
|
26
|
+
mode: "vertical",
|
|
27
|
+
scaleID: "x-axis-0",
|
|
28
|
+
value: new Date(x).getTime(),
|
|
29
|
+
borderColor: "rgba(0,0,255,0.3)",
|
|
30
|
+
borderWidth: 3,
|
|
31
|
+
borderDash: [5, 10],
|
|
32
|
+
label: {
|
|
33
|
+
content: text,
|
|
34
|
+
enabled: true,
|
|
35
|
+
position: "top",
|
|
36
|
+
backgroundColor: "rgba(0,0,0,0.3)"
|
|
37
|
+
},
|
|
38
|
+
onMouseenter: function(e) {
|
|
39
|
+
Object.assign(
|
|
40
|
+
this.chartInstance.options.annotation.annotations[index],
|
|
41
|
+
{ borderColor: "rgba(0,0,255,0.8)" },
|
|
42
|
+
{
|
|
43
|
+
label: {
|
|
44
|
+
content: text,
|
|
45
|
+
enabled: true,
|
|
46
|
+
position: "top",
|
|
47
|
+
backgroundColor: "rgba(0,0,0,0.8)"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
this.chartInstance.update();
|
|
53
|
+
},
|
|
54
|
+
onMouseleave: function(e) {
|
|
55
|
+
Object.assign(
|
|
56
|
+
this.chartInstance.options.annotation.annotations[index],
|
|
57
|
+
{ borderColor: "rgba(0,0,255,0.3)" },
|
|
58
|
+
{
|
|
59
|
+
label: {
|
|
60
|
+
content: text,
|
|
61
|
+
enabled: true,
|
|
62
|
+
position: "top",
|
|
63
|
+
backgroundColor: "rgba(0,0,0,0.3)"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
this.chartInstance.update();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
data() {
|
|
3
|
+
return {
|
|
4
|
+
options: {
|
|
5
|
+
dataName: "",
|
|
6
|
+
tooltips: {
|
|
7
|
+
intersect: false,
|
|
8
|
+
callbacks: {
|
|
9
|
+
afterLabel: this.afterLabel
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
afterLabel(tooltipItem) {
|
|
17
|
+
if (!this.dataName) {
|
|
18
|
+
console.error("dataName is empty");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const selectedSeries = this.spec[this.dataName][tooltipItem.datasetIndex];
|
|
22
|
+
const point = selectedSeries.points.find(
|
|
23
|
+
point => point.x == tooltipItem.xLabel
|
|
24
|
+
);
|
|
25
|
+
const tooltip = point ? point.tooltip : null;
|
|
26
|
+
if (tooltip) {
|
|
27
|
+
return tooltip;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
import Action from "../../action";
|
|
2
|
-
import UrlUtils from "../../utils/url";
|
|
3
|
-
import TypeUtils from "../../utils/type";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
data() {
|
|
7
|
-
return {
|
|
8
|
-
// TODO: Consider replacing with an enum, e.g. executing with predefined values ('post', 'get', null)
|
|
9
|
-
// The complexity with this is that 'get' that comes after 'post' needs to show an indicator, e.g.
|
|
10
|
-
// Submit button needs to be disabled when redirecting after form submission
|
|
11
|
-
_isBusy: false,
|
|
12
|
-
_events: [],
|
|
13
|
-
_typingTimer: null
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
computed: {
|
|
17
|
-
_pageBody() {
|
|
18
|
-
return document.getElementById("page_body");
|
|
19
|
-
},
|
|
20
|
-
$isBusy() {
|
|
21
|
-
// Properties starting with $ or _ can only be accessed via $data
|
|
22
|
-
return this.$data._isBusy;
|
|
23
|
-
},
|
|
24
|
-
$isReady() {
|
|
25
|
-
return this.$data._events === null;
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
mounted() {
|
|
29
|
-
this._executeIfReady(false);
|
|
30
|
-
this.$mounted();
|
|
31
|
-
},
|
|
32
|
-
updated() {
|
|
33
|
-
this._executeIfReady(true);
|
|
34
|
-
this.$updated();
|
|
35
|
-
},
|
|
36
|
-
destroyed() {
|
|
37
|
-
this.$tearDown();
|
|
38
|
-
},
|
|
39
|
-
watch: {
|
|
40
|
-
// See Utils.http
|
|
41
|
-
"$root.vueApp.isStale": function(val, oldVal) {
|
|
42
|
-
// Make sure $ready() will be called in the next update
|
|
43
|
-
this._mountedUrl = null;
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
methods: {
|
|
47
|
-
$href: function(spec) {
|
|
48
|
-
const properties = spec || this.spec;
|
|
49
|
-
const onClick = properties.onClick;
|
|
50
|
-
if (TypeUtils.isObject(onClick)) {
|
|
51
|
-
switch (onClick.action) {
|
|
52
|
-
case "windows/open-v1":
|
|
53
|
-
case "windows/openWeb-v1":
|
|
54
|
-
case "windows/reload-v1":
|
|
55
|
-
return UrlUtils.htmlUrl(onClick.url);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return null;
|
|
59
|
-
},
|
|
60
|
-
$onClick: function(explicitEvent, spec) {
|
|
61
|
-
const properties = spec || this.spec;
|
|
62
|
-
const e = explicitEvent || event;
|
|
63
|
-
|
|
64
|
-
if (!properties.onClick) {
|
|
65
|
-
return; // Avoid blocking the event for parents.
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Ignore middle/right clicks
|
|
69
|
-
if (!e.metaKey && !e.ctrlKey && e.button === 0) {
|
|
70
|
-
e.preventDefault();
|
|
71
|
-
e.stopPropagation();
|
|
72
|
-
// Action.execute(properties.onClick, target || event.target, this);
|
|
73
|
-
Action.execute(properties.onClick, null, this);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
$rel: function(spec) {
|
|
77
|
-
const properties = spec || this.spec;
|
|
78
|
-
const onClick = properties.onClick;
|
|
79
|
-
if (TypeUtils.isObject(onClick)) {
|
|
80
|
-
if (onClick.action === "windows/openWeb-v1") {
|
|
81
|
-
return "nofollow";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return null;
|
|
85
|
-
},
|
|
86
|
-
// Can be used for optimization, but not needed for now.
|
|
87
|
-
// $onLongPressFunction() {
|
|
88
|
-
// return this.spec.onLongPress ? this.$onLongPress : null;
|
|
89
|
-
// },
|
|
90
|
-
$onLongPress() {
|
|
91
|
-
GLib.action.execute(this.spec.onLongPress, null, this);
|
|
92
|
-
},
|
|
93
|
-
$addViewportChangeListeners: function(handler) {
|
|
94
|
-
window.addEventListener("load", handler);
|
|
95
|
-
window.addEventListener("resize", handler);
|
|
96
|
-
this._pageBody.addEventListener("scroll", handler);
|
|
97
|
-
},
|
|
98
|
-
$removeViewportChangeListeners: function(handler) {
|
|
99
|
-
window.removeEventListener("load", handler);
|
|
100
|
-
window.removeEventListener("resize", handler);
|
|
101
|
-
this._pageBody.removeEventListener("scroll", handler);
|
|
102
|
-
},
|
|
103
|
-
_executeIfReady(updated) {
|
|
104
|
-
if (updated) {
|
|
105
|
-
if (!this._renderingTheSamePage()) {
|
|
106
|
-
this.$tearDown();
|
|
107
|
-
this._ready();
|
|
108
|
-
}
|
|
109
|
-
} else {
|
|
110
|
-
this._ready();
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
_renderingTheSamePage() {
|
|
114
|
-
return this._mountedUrl === window.location.href;
|
|
115
|
-
},
|
|
116
|
-
_ready() {
|
|
117
|
-
this._mountedUrl = window.location.href;
|
|
118
|
-
this._updatedAt = new Date().getTime();
|
|
119
|
-
|
|
120
|
-
this.$data._events = [];
|
|
121
|
-
|
|
122
|
-
// Has to be executed before $ready()
|
|
123
|
-
this._linkFieldModels();
|
|
124
|
-
|
|
125
|
-
this.$ready();
|
|
126
|
-
|
|
127
|
-
// Make sure events are dispatched after $ready(). Dispatching them during $ready() causes errors.
|
|
128
|
-
for (const event of this.$data._events) {
|
|
129
|
-
// Execute later to ensure the parent has registered its event listener
|
|
130
|
-
// setTimeout(() => {
|
|
131
|
-
this.$el.dispatchEvent(event);
|
|
132
|
-
// }, 100)
|
|
133
|
-
}
|
|
134
|
-
this.$data._events = null;
|
|
135
|
-
},
|
|
136
|
-
$ready() {
|
|
137
|
-
// To be overridden
|
|
138
|
-
},
|
|
139
|
-
$tearDown() {
|
|
140
|
-
// To be overridden
|
|
141
|
-
},
|
|
142
|
-
$mounted() {
|
|
143
|
-
// To be overridden
|
|
144
|
-
},
|
|
145
|
-
$updated() {
|
|
146
|
-
// To be overridden
|
|
147
|
-
},
|
|
148
|
-
$dispatchEvent(name, data) {
|
|
149
|
-
const event = new Event(name, { bubbles: true });
|
|
150
|
-
|
|
151
|
-
// TODO: Deprecate
|
|
152
|
-
event.spec = data;
|
|
153
|
-
|
|
154
|
-
event.data = data;
|
|
155
|
-
|
|
156
|
-
if (this.$data._events) {
|
|
157
|
-
this.$data._events.push(event);
|
|
158
|
-
} else {
|
|
159
|
-
this.$el.dispatchEvent(event);
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
$onEvent(name, handler) {
|
|
163
|
-
this.$el.addEventListener(name, handler);
|
|
164
|
-
},
|
|
165
|
-
$onTyping({ duration = 2000 }) {
|
|
166
|
-
GLib.action.execute(this.spec.onTypeStart, null, this);
|
|
167
|
-
clearTimeout(this.timer);
|
|
168
|
-
|
|
169
|
-
this.timer = setTimeout(() => {
|
|
170
|
-
this._typingTimer = null;
|
|
171
|
-
GLib.action.execute(this.spec.onTypeEnd, null, this);
|
|
172
|
-
}, duration);
|
|
173
|
-
}
|
|
174
|
-
// $onZero() {
|
|
175
|
-
// GLib.action.execute(this.spec.onZero, null, this);
|
|
176
|
-
// },
|
|
177
|
-
}
|
|
178
|
-
};
|
|
1
|
+
import Action from "../../action";
|
|
2
|
+
import UrlUtils from "../../utils/url";
|
|
3
|
+
import TypeUtils from "../../utils/type";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
data() {
|
|
7
|
+
return {
|
|
8
|
+
// TODO: Consider replacing with an enum, e.g. executing with predefined values ('post', 'get', null)
|
|
9
|
+
// The complexity with this is that 'get' that comes after 'post' needs to show an indicator, e.g.
|
|
10
|
+
// Submit button needs to be disabled when redirecting after form submission
|
|
11
|
+
_isBusy: false,
|
|
12
|
+
_events: [],
|
|
13
|
+
_typingTimer: null
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
computed: {
|
|
17
|
+
_pageBody() {
|
|
18
|
+
return document.getElementById("page_body");
|
|
19
|
+
},
|
|
20
|
+
$isBusy() {
|
|
21
|
+
// Properties starting with $ or _ can only be accessed via $data
|
|
22
|
+
return this.$data._isBusy;
|
|
23
|
+
},
|
|
24
|
+
$isReady() {
|
|
25
|
+
return this.$data._events === null;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
mounted() {
|
|
29
|
+
this._executeIfReady(false);
|
|
30
|
+
this.$mounted();
|
|
31
|
+
},
|
|
32
|
+
updated() {
|
|
33
|
+
this._executeIfReady(true);
|
|
34
|
+
this.$updated();
|
|
35
|
+
},
|
|
36
|
+
destroyed() {
|
|
37
|
+
this.$tearDown();
|
|
38
|
+
},
|
|
39
|
+
watch: {
|
|
40
|
+
// See Utils.http
|
|
41
|
+
"$root.vueApp.isStale": function(val, oldVal) {
|
|
42
|
+
// Make sure $ready() will be called in the next update
|
|
43
|
+
this._mountedUrl = null;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
methods: {
|
|
47
|
+
$href: function(spec) {
|
|
48
|
+
const properties = spec || this.spec;
|
|
49
|
+
const onClick = properties.onClick;
|
|
50
|
+
if (TypeUtils.isObject(onClick)) {
|
|
51
|
+
switch (onClick.action) {
|
|
52
|
+
case "windows/open-v1":
|
|
53
|
+
case "windows/openWeb-v1":
|
|
54
|
+
case "windows/reload-v1":
|
|
55
|
+
return UrlUtils.htmlUrl(onClick.url);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
},
|
|
60
|
+
$onClick: function(explicitEvent, spec) {
|
|
61
|
+
const properties = spec || this.spec;
|
|
62
|
+
const e = explicitEvent || event;
|
|
63
|
+
|
|
64
|
+
if (!properties.onClick) {
|
|
65
|
+
return; // Avoid blocking the event for parents.
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Ignore middle/right clicks
|
|
69
|
+
if (!e.metaKey && !e.ctrlKey && e.button === 0) {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
e.stopPropagation();
|
|
72
|
+
// Action.execute(properties.onClick, target || event.target, this);
|
|
73
|
+
Action.execute(properties.onClick, null, this);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
$rel: function(spec) {
|
|
77
|
+
const properties = spec || this.spec;
|
|
78
|
+
const onClick = properties.onClick;
|
|
79
|
+
if (TypeUtils.isObject(onClick)) {
|
|
80
|
+
if (onClick.action === "windows/openWeb-v1") {
|
|
81
|
+
return "nofollow";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
},
|
|
86
|
+
// Can be used for optimization, but not needed for now.
|
|
87
|
+
// $onLongPressFunction() {
|
|
88
|
+
// return this.spec.onLongPress ? this.$onLongPress : null;
|
|
89
|
+
// },
|
|
90
|
+
$onLongPress() {
|
|
91
|
+
GLib.action.execute(this.spec.onLongPress, null, this);
|
|
92
|
+
},
|
|
93
|
+
$addViewportChangeListeners: function(handler) {
|
|
94
|
+
window.addEventListener("load", handler);
|
|
95
|
+
window.addEventListener("resize", handler);
|
|
96
|
+
this._pageBody.addEventListener("scroll", handler);
|
|
97
|
+
},
|
|
98
|
+
$removeViewportChangeListeners: function(handler) {
|
|
99
|
+
window.removeEventListener("load", handler);
|
|
100
|
+
window.removeEventListener("resize", handler);
|
|
101
|
+
this._pageBody.removeEventListener("scroll", handler);
|
|
102
|
+
},
|
|
103
|
+
_executeIfReady(updated) {
|
|
104
|
+
if (updated) {
|
|
105
|
+
if (!this._renderingTheSamePage()) {
|
|
106
|
+
this.$tearDown();
|
|
107
|
+
this._ready();
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
this._ready();
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
_renderingTheSamePage() {
|
|
114
|
+
return this._mountedUrl === window.location.href;
|
|
115
|
+
},
|
|
116
|
+
_ready() {
|
|
117
|
+
this._mountedUrl = window.location.href;
|
|
118
|
+
this._updatedAt = new Date().getTime();
|
|
119
|
+
|
|
120
|
+
this.$data._events = [];
|
|
121
|
+
|
|
122
|
+
// Has to be executed before $ready()
|
|
123
|
+
this._linkFieldModels();
|
|
124
|
+
|
|
125
|
+
this.$ready();
|
|
126
|
+
|
|
127
|
+
// Make sure events are dispatched after $ready(). Dispatching them during $ready() causes errors.
|
|
128
|
+
for (const event of this.$data._events) {
|
|
129
|
+
// Execute later to ensure the parent has registered its event listener
|
|
130
|
+
// setTimeout(() => {
|
|
131
|
+
this.$el.dispatchEvent(event);
|
|
132
|
+
// }, 100)
|
|
133
|
+
}
|
|
134
|
+
this.$data._events = null;
|
|
135
|
+
},
|
|
136
|
+
$ready() {
|
|
137
|
+
// To be overridden
|
|
138
|
+
},
|
|
139
|
+
$tearDown() {
|
|
140
|
+
// To be overridden
|
|
141
|
+
},
|
|
142
|
+
$mounted() {
|
|
143
|
+
// To be overridden
|
|
144
|
+
},
|
|
145
|
+
$updated() {
|
|
146
|
+
// To be overridden
|
|
147
|
+
},
|
|
148
|
+
$dispatchEvent(name, data) {
|
|
149
|
+
const event = new Event(name, { bubbles: true });
|
|
150
|
+
|
|
151
|
+
// TODO: Deprecate
|
|
152
|
+
event.spec = data;
|
|
153
|
+
|
|
154
|
+
event.data = data;
|
|
155
|
+
|
|
156
|
+
if (this.$data._events) {
|
|
157
|
+
this.$data._events.push(event);
|
|
158
|
+
} else {
|
|
159
|
+
this.$el.dispatchEvent(event);
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
$onEvent(name, handler) {
|
|
163
|
+
this.$el.addEventListener(name, handler);
|
|
164
|
+
},
|
|
165
|
+
$onTyping({ duration = 2000 }) {
|
|
166
|
+
GLib.action.execute(this.spec.onTypeStart, null, this);
|
|
167
|
+
clearTimeout(this.timer);
|
|
168
|
+
|
|
169
|
+
this.timer = setTimeout(() => {
|
|
170
|
+
this._typingTimer = null;
|
|
171
|
+
GLib.action.execute(this.spec.onTypeEnd, null, this);
|
|
172
|
+
}, duration);
|
|
173
|
+
}
|
|
174
|
+
// $onZero() {
|
|
175
|
+
// GLib.action.execute(this.spec.onZero, null, this);
|
|
176
|
+
// },
|
|
177
|
+
}
|
|
178
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|