@dejwcake/craftable 0.1.10 → 2.0.0
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/README.md +117 -3
- package/dist/buildMatchPatternFn-BV4I8r8j.js +63 -0
- package/dist/buildMatchPatternFn-T5KjFTBQ.cjs +1 -0
- package/dist/craftable.css +2 -0
- package/dist/cs-B5QMxFrl.js +682 -0
- package/dist/cs-MAoetkhe.cjs +1 -0
- package/dist/de-BlQ2ZKmc.js +526 -0
- package/dist/de-BoVLAn6U.cjs +1 -0
- package/dist/en-US-BLvEnhs4.js +443 -0
- package/dist/en-US-Dz8vkDZ_.cjs +1 -0
- package/dist/en-US-X9gX759i.cjs +1 -0
- package/dist/es-DBHDeXHI.cjs +1 -0
- package/dist/es-YEqfkBY2.js +437 -0
- package/dist/fr-B7MHC2AN.js +407 -0
- package/dist/fr-DLs3QoNB.cjs +1 -0
- package/dist/hu-BKZPI9jH.cjs +1 -0
- package/dist/hu-reoJgNxD.js +425 -0
- package/dist/index.cjs +1 -0
- package/dist/index.mjs +3866 -0
- package/dist/isSameWeek-CC6GX_zp.js +40 -0
- package/dist/isSameWeek-Mctj6Tdj.cjs +1 -0
- package/dist/pl-B5A0Rjp7.js +628 -0
- package/dist/pl-BMyrOO-Q.cjs +1 -0
- package/dist/sk-B7JF2MoV.cjs +1 -0
- package/dist/sk-Btro3W4S.js +602 -0
- package/package.json +68 -40
- package/scripts/publish-components.js +118 -0
- package/scss/_images.scss +1 -1
- package/scss/_variables.scss +13 -6
- package/scss/app.scss +4 -4
- package/scss/overrides/_alerts.scss +0 -2
- package/scss/overrides/_badges.scss +1 -17
- package/scss/overrides/_buttons.scss +64 -7
- package/scss/overrides/_cards.scss +4 -51
- package/scss/overrides/_checkboxes.scss +54 -59
- package/scss/overrides/_forms.scss +270 -176
- package/scss/overrides/_index.scss +18 -18
- package/scss/overrides/_keyframes.scss +6 -4
- package/scss/overrides/_layout.scss +24 -30
- package/scss/overrides/_media-wysiwyg.scss +9 -111
- package/scss/overrides/_modal.scss +0 -18
- package/scss/overrides/_multiselect.scss +63 -7
- package/scss/overrides/_nav.scss +55 -33
- package/scss/overrides/_notifications.scss +6 -1
- package/scss/overrides/_pagination.scss +3 -3
- package/scss/overrides/_sidebar.scss +84 -0
- package/scss/overrides/_tables.scss +52 -37
- package/scss/overrides/_text.scss +1 -3
- package/scss/overrides/_wysiwyg.scss +151 -48
- package/scss/styles/_auth.scss +32 -37
- package/scss/styles/_custom.scss +44 -1
- package/scss/styles/_index.scss +4 -4
- package/scss/styles/_legacy.scss +5 -81
- package/scss/styles/_others.scss +232 -337
- package/scss/vendor/_index.scss +5 -4
- package/src/auth/ActivationError.vue +23 -0
- package/src/auth/ActivationForm.vue +69 -0
- package/src/auth/ForgotPasswordForm.vue +74 -0
- package/src/auth/LoginForm.vue +107 -0
- package/src/auth/ResetPasswordForm.vue +122 -0
- package/src/components/ConfirmModal.vue +65 -0
- package/src/components/UserDetailTooltip.vue +88 -0
- package/src/components/form/CkeditorEditor.vue +205 -0
- package/src/components/form/FormCheckbox.vue +29 -0
- package/src/components/form/FormDatePicker.vue +52 -0
- package/src/components/form/FormEmail.vue +17 -0
- package/src/components/form/FormInput.vue +31 -0
- package/src/components/form/FormLocalizedInput.vue +47 -0
- package/src/components/form/FormLocalizedWysiwyg.vue +55 -0
- package/src/components/form/FormLocalizedWysiwygSimple.vue +55 -0
- package/src/components/form/FormMultiSelect.vue +36 -0
- package/src/components/form/FormPasswordConfirm.vue +49 -0
- package/src/components/form/FormSelect.vue +35 -0
- package/src/components/form/FormSubmit.vue +13 -0
- package/src/components/form/FormTextarea.vue +31 -0
- package/src/components/form/FormWysiwyg.vue +31 -0
- package/src/components/form/FormWysiwygSimple.vue +31 -0
- package/src/components/form/LocalizationBar.vue +90 -0
- package/src/components/form/MediaUpload.vue +317 -0
- package/src/components/form/TiptapEditor.vue +238 -0
- package/src/components/listing/BulkCheckboxHeader.vue +18 -0
- package/src/components/listing/BulkCheckboxRow.vue +21 -0
- package/src/components/listing/BulkOperationsBar.vue +41 -0
- package/src/components/listing/DeleteButton.vue +46 -0
- package/src/components/listing/EditButton.vue +17 -0
- package/src/components/listing/EmptyState.vue +25 -0
- package/src/components/listing/ListingHeader.vue +24 -0
- package/src/components/listing/Pagination.vue +158 -0
- package/src/components/listing/PerPage.vue +15 -0
- package/src/components/listing/PublishedAtColumn.vue +226 -0
- package/src/components/listing/Search.vue +81 -0
- package/src/components/listing/Sortable.vue +28 -0
- package/src/components/listing/ToggleSwitch.vue +47 -0
- package/src/composables/useAdmin.js +39 -0
- package/src/composables/useBaseAuth.js +81 -0
- package/src/composables/useBaseForm.js +265 -0
- package/src/composables/useBaseListing.js +316 -0
- package/src/composables/useResponsiveColumns.js +62 -0
- package/src/index.js +62 -0
- package/src/translation/TranslationListing.vue +230 -0
- package/src/translation/modals/TranslationEditModal.vue +86 -0
- package/src/translation/modals/TranslationExportModal.vue +74 -0
- package/src/translation/modals/TranslationImportModal.vue +255 -0
- package/src/ui/index.js +99 -0
- package/src/utils/ckeditorHelpers.js +36 -0
- package/src/utils/dateFnsLocale.js +24 -0
- package/src/utils/dateFormatters.js +30 -0
- package/src/utils/mediaProps.js +14 -0
- package/src/utils/notify.js +22 -0
- package/dist/admin/Admin.js +0 -42
- package/dist/auth/Form.js +0 -15
- package/dist/base-components/Form/BaseForm.js +0 -395
- package/dist/base-components/Form/BaseUpload.js +0 -188
- package/dist/base-components/Form/bootstrap.js +0 -21
- package/dist/base-components/Listing/BaseListing.js +0 -454
- package/dist/base-components/Listing/components/Pagination.js +0 -105
- package/dist/base-components/Listing/components/Sortable.js +0 -48
- package/dist/base-components/Listing/components/UserDetailTooltip.js +0 -55
- package/dist/index.js +0 -70
- package/dist/overrides/trumbowyg.edit-embed-template.js +0 -72
- package/dist/overrides/trumbowyg.reupload.js +0 -146
- package/dist/overrides/trumbowyg.template.js +0 -67
- package/dist/translation/Form.js +0 -15
- package/dist/translation/Listing.js +0 -283
- package/dist/ui/index.js +0 -33
- package/scss/overrides/_switches.scss +0 -25
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var Pagination = {
|
|
7
|
-
template: '<nav>\n <ul class="pagination sizeClass" v-if="pagination.last_page > 1">\n <li v-if="showPrevious()" :class="{ \'disabled\' : pagination.current_page <= 1, \'page-item\': true }">\n <span v-if="pagination.current_page <= 1" class="page-link">\n <span aria-hidden="true">{{ config.previousText }}</span>\n </span>\n\n <a href="#" v-if="pagination.current_page > 1 " :aria-label="config.ariaPrevioius" @click.prevent="changePage(pagination.current_page - 1)" class="page-link">\n <span aria-hidden="true">{{ config.previousText }}</span>\n </a>\n </li>\n\n <li v-for="num in array" :class="{ \'active\': num === pagination.current_page, \'page-item\': true }">\n <a href="#" @click.prevent="changePage(num)" class="page-link">{{ num }}</a>\n </li>\n\n <li v-if="showNext()" :class="{ \'disabled\' : pagination.current_page === pagination.last_page || pagination.last_page === 0, \'page-item\': true }">\n <span v-if="pagination.current_page === pagination.last_page || pagination.last_page === 0" class="page-link">\n <span aria-hidden="true">{{ config.nextText }}</span>\n </span>\n\n <a href="#" v-if="pagination.current_page < pagination.last_page" :aria-label="config.ariaNext" @click.prevent="changePage(pagination.current_page + 1)" class="page-link">\n <span aria-hidden="true">{{ config.nextText }}</span>\n </a>\n </li>\n </ul>\n </nav>',
|
|
8
|
-
props: {
|
|
9
|
-
pagination: {
|
|
10
|
-
type: Object,
|
|
11
|
-
default: function _default() {
|
|
12
|
-
return this.$parent.pagination.state;
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
callback: {
|
|
16
|
-
type: Function,
|
|
17
|
-
default: function _default() {
|
|
18
|
-
return this.$parent.loadData();
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
options: {
|
|
22
|
-
type: Object,
|
|
23
|
-
default: function _default() {
|
|
24
|
-
if (!!this.$parent.pagination.options) {
|
|
25
|
-
return this.$parent.pagination.options;
|
|
26
|
-
} else {
|
|
27
|
-
return {};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
size: {
|
|
32
|
-
type: String
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
computed: {
|
|
36
|
-
array: function array() {
|
|
37
|
-
if (this.pagination.last_page <= 0) {
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var from = this.pagination.current_page - this.config.offset;
|
|
42
|
-
if (from < 1) {
|
|
43
|
-
from = 1;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var to = from + this.config.offset * 2;
|
|
47
|
-
if (to >= this.pagination.last_page) {
|
|
48
|
-
to = this.pagination.last_page;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
var arr = [];
|
|
52
|
-
while (from <= to) {
|
|
53
|
-
arr.push(from);
|
|
54
|
-
from++;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return arr;
|
|
58
|
-
},
|
|
59
|
-
config: function config() {
|
|
60
|
-
return Object.assign({
|
|
61
|
-
offset: 3,
|
|
62
|
-
ariaPrevious: 'Previous',
|
|
63
|
-
ariaNext: 'Next',
|
|
64
|
-
previousText: '«',
|
|
65
|
-
nextText: '»',
|
|
66
|
-
alwaysShowPrevNext: false
|
|
67
|
-
}, this.options);
|
|
68
|
-
},
|
|
69
|
-
sizeClass: function sizeClass() {
|
|
70
|
-
if (this.size === 'large') {
|
|
71
|
-
return 'pagination-lg';
|
|
72
|
-
} else if (this.size === 'small') {
|
|
73
|
-
return 'pagination-sm';
|
|
74
|
-
} else {
|
|
75
|
-
return '';
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
watch: {
|
|
80
|
-
'pagination.per_page': function paginationPer_page(newVal, oldVal) {
|
|
81
|
-
if (+newVal !== +oldVal) {
|
|
82
|
-
this.$cookie.set('per_page', newVal);
|
|
83
|
-
this.callback();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
methods: {
|
|
88
|
-
showPrevious: function showPrevious() {
|
|
89
|
-
return this.config.alwaysShowPrevNext || this.pagination.current_page > 1;
|
|
90
|
-
},
|
|
91
|
-
showNext: function showNext() {
|
|
92
|
-
return this.config.alwaysShowPrevNext || this.pagination.current_page < this.pagination.last_page;
|
|
93
|
-
},
|
|
94
|
-
changePage: function changePage(page) {
|
|
95
|
-
if (this.pagination.current_page === page) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
this.$set(this.pagination, 'current_page', page);
|
|
100
|
-
this.callback();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
exports.default = Pagination;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var Sortable = {
|
|
7
|
-
props: {
|
|
8
|
-
'column': {
|
|
9
|
-
type: String,
|
|
10
|
-
required: true
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
'orderBy': {
|
|
14
|
-
type: Object,
|
|
15
|
-
default: function _default() {
|
|
16
|
-
return this.$parent.orderBy;
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
'callback': {
|
|
21
|
-
type: Function,
|
|
22
|
-
default: function _default() {
|
|
23
|
-
return this.$parent.loadData();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
methods: {
|
|
29
|
-
|
|
30
|
-
sort: function sort(column) {
|
|
31
|
-
if (this.orderBy.column == column) {
|
|
32
|
-
this.orderBy.direction = this.orderBy.direction == 'asc' ? 'desc' : 'asc';
|
|
33
|
-
} else {
|
|
34
|
-
this.orderBy.column = column;
|
|
35
|
-
this.orderBy.direction = 'asc'; // I guess we do want to reset direction when changing column, but I'm not sure :)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
this.callback();
|
|
39
|
-
|
|
40
|
-
// FIXME callback should have return a Promise which can success or end with an error
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
template: '<th>' + '<a @click.stop="sort(column)"><span class="fa" :class="{\'fa-sort-amount-asc\': orderBy.column == column && orderBy.direction == \'asc\', \'fa-sort-amount-desc\': orderBy.column == column && orderBy.direction == \'desc\' }"></span> <slot></slot></a>' + '</th>'
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
exports.default = Sortable;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var UserDetailTooltip = {
|
|
7
|
-
template: '\n\t<v-popover class="avatar-tooltip-trigger"\n\t\ttrigger="click" \n :placement="placement"\n\t\toffset="5"\n\t\tcontainer="body"\n\t\t:auto-hide="true"\n\t>\n\n <img :src="user.avatar_thumb_url" class="avatar-photo" :alt="user.full_name" v-if="user.avatar_thumb_url">\n <div class="avatar-initials" v-if="!user.avatar_thumb_url">\n\t\t\t{{ abbr }}\n\t\t</div>\n\n\t\t<div class="avatar-full-name" v-if="options.showFullNameLabel">\n\t\t\t{{ user.full_name }}\n\t\t\t<span v-if="edit && datetime != \'\'">\n\t\t\t <br>\n\t\t\t <span class="user-info-span">{{datetime}}</span>\n\t\t\t</span>\n\t\t</div>\n\n\t\t<template slot="popover">\n\t\t\t<div class="user-avatar">\n\t\t\t\t<img :src="user.avatar_thumb_url" class="avatar-photo" :alt="user.full_name" v-if="user.avatar_thumb_url">\n\t\t\t\t<div class="avatar-initials" v-else>\n\t\t\t\t\t{{ abbr }}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="user-info">\n\t\t\t\t<h3>{{ user.full_name }} <small v-if="userText">| <strong style="text-transform: uppercase">{{ userText }}</strong></small></h3>\n\t\t\t\t<a v-if="user.email" v-bind:href="[\'mailto:\' + user.email]">{{ user.email }}</a>\n\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t</template>\n </v-popover>\n',
|
|
8
|
-
|
|
9
|
-
props: {
|
|
10
|
-
user: {
|
|
11
|
-
type: Object,
|
|
12
|
-
required: true
|
|
13
|
-
},
|
|
14
|
-
userText: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: function _default() {
|
|
17
|
-
return '';
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
text: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: function _default() {
|
|
23
|
-
return '';
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
options: {
|
|
27
|
-
type: Object,
|
|
28
|
-
default: function _default() {
|
|
29
|
-
return {
|
|
30
|
-
showFullNameLabel: true
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
placement: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: function _default() {
|
|
37
|
-
return 'top';
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
edit: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: function _default() {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
datetime: ''
|
|
47
|
-
},
|
|
48
|
-
computed: {
|
|
49
|
-
abbr: function abbr() {
|
|
50
|
-
return '' + this.user.first_name.slice(0, 1) + this.user.last_name.slice(0, 1);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
exports.default = UserDetailTooltip;
|
package/dist/index.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _BaseForm = require('./base-components/Form/BaseForm');
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, 'BaseForm', {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function get() {
|
|
12
|
-
return _interopRequireDefault(_BaseForm).default;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
var _BaseUpload = require('./base-components/Form/BaseUpload');
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(exports, 'BaseUpload', {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _interopRequireDefault(_BaseUpload).default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
var _BaseListing = require('./base-components/Listing/BaseListing');
|
|
26
|
-
|
|
27
|
-
Object.defineProperty(exports, 'BaseListing', {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function get() {
|
|
30
|
-
return _interopRequireDefault(_BaseListing).default;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
var _Admin = require('./admin/Admin');
|
|
35
|
-
|
|
36
|
-
Object.defineProperty(exports, 'Admin', {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function get() {
|
|
39
|
-
return _interopRequireDefault(_Admin).default;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
var _Form = require('./auth/Form');
|
|
44
|
-
|
|
45
|
-
Object.defineProperty(exports, 'Auth', {
|
|
46
|
-
enumerable: true,
|
|
47
|
-
get: function get() {
|
|
48
|
-
return _interopRequireDefault(_Form).default;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
var _Form2 = require('./translation/Form');
|
|
53
|
-
|
|
54
|
-
Object.defineProperty(exports, 'TranslationForm', {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function get() {
|
|
57
|
-
return _interopRequireDefault(_Form2).default;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
var _Listing = require('./translation/Listing');
|
|
62
|
-
|
|
63
|
-
Object.defineProperty(exports, 'TranslationListing', {
|
|
64
|
-
enumerable: true,
|
|
65
|
-
get: function get() {
|
|
66
|
-
return _interopRequireDefault(_Listing).default;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
(function ($) {
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
// My plugin default options
|
|
7
|
-
|
|
8
|
-
var defaultOptions = {
|
|
9
|
-
noEmbedEndpoint: 'https://noembed.com/embed?nowrap=on'
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
$.extend(true, $.trumbowyg, {
|
|
13
|
-
// Add some translations
|
|
14
|
-
langs: {
|
|
15
|
-
en: {
|
|
16
|
-
editNoEmbedTemplate: 'Edit embed'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
// Add our plugin to Trumbowyg registred plugins
|
|
20
|
-
plugins: {
|
|
21
|
-
editNoEmbedTemplate: {
|
|
22
|
-
init: function init(trumbowyg) {
|
|
23
|
-
// Fill current Trumbowyg instance with my plugin default options
|
|
24
|
-
trumbowyg.o.plugins.editNoEmbedTemplate = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.editNoEmbedTemplate || {});
|
|
25
|
-
|
|
26
|
-
setTimeout(function () {
|
|
27
|
-
trumbowyg.$ed.on('dblclick', '.wysiwyg-noembed', function () {
|
|
28
|
-
var $iframe = $(this).find('iframe');
|
|
29
|
-
var $editor = $iframe.closest('.trumbowyg-editor');
|
|
30
|
-
var options = {
|
|
31
|
-
url: {
|
|
32
|
-
label: 'URL',
|
|
33
|
-
value: $iframe.attr('src'),
|
|
34
|
-
required: true
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
trumbowyg.openModalInsert(trumbowyg.lang.editNoEmbedTemplate, options, function (value) {
|
|
39
|
-
$.ajax({
|
|
40
|
-
url: trumbowyg.o.plugins.editNoEmbedTemplate.noEmbedEndpoint,
|
|
41
|
-
type: 'GET',
|
|
42
|
-
data: value,
|
|
43
|
-
cache: false,
|
|
44
|
-
dataType: 'jsonp',
|
|
45
|
-
crossOrigin: true,
|
|
46
|
-
success: trumbowyg.o.plugins.editNoEmbedTemplate.success || function (data) {
|
|
47
|
-
if (data.html) {
|
|
48
|
-
$iframe.replaceWith($(data.html));
|
|
49
|
-
trumbowyg.html($editor.html());
|
|
50
|
-
setTimeout(function () {
|
|
51
|
-
trumbowyg.closeModal();
|
|
52
|
-
}, 250);
|
|
53
|
-
} else {
|
|
54
|
-
trumbowyg.addErrorOnModalField($('input[type=text]', $modal), data.error);
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
error: trumbowyg.o.plugins.editNoEmbedTemplate.error || function () {
|
|
58
|
-
trumbowyg.addErrorOnModalField($('input[type=text]', $modal), trumbowyg.lang.noembedError);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
}, 300);
|
|
64
|
-
},
|
|
65
|
-
tagHandler: function tagHandler(element, trumbowyg) {
|
|
66
|
-
return [];
|
|
67
|
-
},
|
|
68
|
-
destroy: function destroy() {}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
})(jQuery);
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
(function ($) {
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
// My plugin default options
|
|
7
|
-
|
|
8
|
-
var defaultOptions = {};
|
|
9
|
-
|
|
10
|
-
$.extend(true, $.trumbowyg, {
|
|
11
|
-
// Add some translations
|
|
12
|
-
langs: {
|
|
13
|
-
en: {
|
|
14
|
-
reupload: 'Reupload',
|
|
15
|
-
reuploadImage: 'Reupload Image',
|
|
16
|
-
description: 'Alt Text'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
// Add our plugin to Trumbowyg registred plugins
|
|
20
|
-
plugins: {
|
|
21
|
-
reupload: {
|
|
22
|
-
init: function init(trumbowyg) {
|
|
23
|
-
// Fill current Trumbowyg instance with my plugin default options
|
|
24
|
-
trumbowyg.o.plugins.reupload = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.reupload || {});
|
|
25
|
-
|
|
26
|
-
trumbowyg.o.imgDblClickHandler = function () {
|
|
27
|
-
var t = trumbowyg;
|
|
28
|
-
|
|
29
|
-
return function () {
|
|
30
|
-
var $img = $(this),
|
|
31
|
-
src = $img.attr('src'),
|
|
32
|
-
base64 = '(Base64)';
|
|
33
|
-
|
|
34
|
-
if (src.indexOf('data:image') === 0) {
|
|
35
|
-
src = base64;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var options = {
|
|
39
|
-
url: {
|
|
40
|
-
label: 'URL',
|
|
41
|
-
value: src,
|
|
42
|
-
required: true
|
|
43
|
-
},
|
|
44
|
-
reupload: {
|
|
45
|
-
label: trumbowyg.lang.reuploadImage,
|
|
46
|
-
value: src,
|
|
47
|
-
type: 'file',
|
|
48
|
-
attributes: {
|
|
49
|
-
accept: 'image/*'
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
alt: {
|
|
53
|
-
label: t.lang.description,
|
|
54
|
-
value: $img.attr('alt')
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
if (t.o.imageWidthModalEdit) {
|
|
59
|
-
options.width = {
|
|
60
|
-
value: $img.attr('width') ? $img.attr('width') : ''
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
var $modal = t.openModalInsert(t.lang.insertImage, options, function (v) {
|
|
65
|
-
$img.attr({
|
|
66
|
-
alt: v.alt
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
if (t.o.imageWidthModalEdit) {
|
|
70
|
-
if (parseInt(v.width) > 0) {
|
|
71
|
-
$img.attr({
|
|
72
|
-
width: v.width
|
|
73
|
-
});
|
|
74
|
-
} else {
|
|
75
|
-
$img.removeAttr('width');
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (v.src !== base64 && !v.reupload) {
|
|
80
|
-
$img.attr({
|
|
81
|
-
src: v.url
|
|
82
|
-
});
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (v.reupload) {
|
|
87
|
-
var prefix = trumbowyg.o.prefix;
|
|
88
|
-
var data = new FormData();
|
|
89
|
-
data.append(trumbowyg.o.plugins.upload.fileFieldName, $('.trumbowyg-modal input[type=file]').get(0).files[0]);
|
|
90
|
-
|
|
91
|
-
trumbowyg.o.plugins.upload.data.map(function (cur) {
|
|
92
|
-
data.append(cur.name, cur.value);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
$.map(v, function (curr, key) {
|
|
96
|
-
if (key !== 'file') {
|
|
97
|
-
data.append(key, curr);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
if ($('.' + prefix + 'progress', $modal).length === 0) {
|
|
102
|
-
$('.' + prefix + 'modal-title', $modal).after($('<div/>', {
|
|
103
|
-
'class': prefix + 'progress'
|
|
104
|
-
}).append($('<div/>', {
|
|
105
|
-
'class': prefix + 'progress-bar'
|
|
106
|
-
})));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
$.ajax({
|
|
110
|
-
url: trumbowyg.o.plugins.upload.serverPath,
|
|
111
|
-
headers: trumbowyg.o.plugins.upload.headers,
|
|
112
|
-
xhrFields: trumbowyg.o.plugins.upload.xhrFields,
|
|
113
|
-
type: 'POST',
|
|
114
|
-
data: data,
|
|
115
|
-
cache: false,
|
|
116
|
-
dataType: 'json',
|
|
117
|
-
processData: false,
|
|
118
|
-
contentType: false,
|
|
119
|
-
|
|
120
|
-
progressUpload: function progressUpload(e) {
|
|
121
|
-
$('.' + prefix + 'progress-bar').css('width', Math.round(e.loaded * 100 / e.total) + '%');
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
success: function success(data) {
|
|
125
|
-
trumbowyg.o.plugins.reupload.success(data, trumbowyg, $modal, v, $img);
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
error: trumbowyg.o.plugins.upload.error || function () {
|
|
129
|
-
trumbowyg.addErrorOnModalField($('input[type=file]', $modal), trumbowyg.lang.uploadError);
|
|
130
|
-
trumbowyg.$c.trigger('tbwuploaderror', [trumbowyg]);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
return false;
|
|
136
|
-
};
|
|
137
|
-
}();
|
|
138
|
-
},
|
|
139
|
-
tagHandler: function tagHandler(element, trumbowyg) {
|
|
140
|
-
return [];
|
|
141
|
-
},
|
|
142
|
-
destroy: function destroy() {}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
})(jQuery);
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
(function ($) {
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
// Adds the language variables
|
|
7
|
-
|
|
8
|
-
$.extend(true, $.trumbowyg, {
|
|
9
|
-
langs: {
|
|
10
|
-
en: {
|
|
11
|
-
template: 'Template'
|
|
12
|
-
},
|
|
13
|
-
fr: {
|
|
14
|
-
template: 'Patron'
|
|
15
|
-
},
|
|
16
|
-
nl: {
|
|
17
|
-
template: 'Sjabloon'
|
|
18
|
-
},
|
|
19
|
-
ru: {
|
|
20
|
-
template: 'Шаблон'
|
|
21
|
-
},
|
|
22
|
-
ja: {
|
|
23
|
-
template: 'テンプレート'
|
|
24
|
-
},
|
|
25
|
-
tr: {
|
|
26
|
-
template: 'Şablon'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// Adds the extra button definition
|
|
32
|
-
$.extend(true, $.trumbowyg, {
|
|
33
|
-
plugins: {
|
|
34
|
-
template: {
|
|
35
|
-
shouldInit: function shouldInit(trumbowyg) {
|
|
36
|
-
return trumbowyg.o.plugins.hasOwnProperty('templates');
|
|
37
|
-
},
|
|
38
|
-
init: function init(trumbowyg) {
|
|
39
|
-
trumbowyg.addBtnDef('template', {
|
|
40
|
-
dropdown: templateSelector(trumbowyg),
|
|
41
|
-
hasIcon: false,
|
|
42
|
-
text: trumbowyg.lang.template
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
// Creates the template-selector dropdown.
|
|
50
|
-
function templateSelector(trumbowyg) {
|
|
51
|
-
var available = trumbowyg.o.plugins.templates;
|
|
52
|
-
var templates = [];
|
|
53
|
-
|
|
54
|
-
$.each(available, function (index, template) {
|
|
55
|
-
trumbowyg.addBtnDef('template_' + index, {
|
|
56
|
-
fn: function fn() {
|
|
57
|
-
trumbowyg.execCmd('insertHTML', template.html + '<br>');
|
|
58
|
-
},
|
|
59
|
-
hasIcon: false,
|
|
60
|
-
title: template.name
|
|
61
|
-
});
|
|
62
|
-
templates.push('template_' + index);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
return templates;
|
|
66
|
-
}
|
|
67
|
-
})(jQuery);
|
package/dist/translation/Form.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _vue = require('vue');
|
|
4
|
-
|
|
5
|
-
var _vue2 = _interopRequireDefault(_vue);
|
|
6
|
-
|
|
7
|
-
var _BaseForm = require('../base-components/Form/BaseForm');
|
|
8
|
-
|
|
9
|
-
var _BaseForm2 = _interopRequireDefault(_BaseForm);
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
|
-
_vue2.default.component('translation-form', {
|
|
14
|
-
mixins: [_BaseForm2.default]
|
|
15
|
-
});
|