@dejwcake/craftable 0.0.2 → 0.0.3
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/dist/admin/Admin.js +33 -35
- package/dist/auth/Form.js +6 -13
- package/dist/base-components/Form/BaseForm.js +53 -88
- package/dist/base-components/Form/BaseUpload.js +112 -84
- package/dist/base-components/Form/bootstrap.js +11 -15
- package/dist/base-components/Listing/BaseListing.js +438 -425
- package/dist/base-components/Listing/components/Pagination.js +90 -95
- package/dist/base-components/Listing/components/Sortable.js +34 -41
- package/dist/base-components/Listing/components/UserDetailTooltip.js +49 -50
- package/dist/index.js +23 -38
- package/dist/overrides/trumbowyg.edit-embed-template.js +63 -67
- package/dist/overrides/trumbowyg.reupload.js +123 -141
- package/dist/overrides/trumbowyg.template.js +56 -59
- package/dist/translation/Form.js +6 -13
- package/dist/translation/Listing.js +255 -266
- package/dist/ui/index.js +27 -28
- package/package.json +7 -7
|
@@ -1,283 +1,272 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _vue = require('vue');
|
|
4
|
-
|
|
5
|
-
var _vue2 = _interopRequireDefault(_vue);
|
|
6
|
-
|
|
7
|
-
var _BaseListing = require('../base-components/Listing/BaseListing');
|
|
8
|
-
|
|
9
|
-
var _BaseListing2 = _interopRequireDefault(_BaseListing);
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
"use strict";
|
|
12
2
|
|
|
3
|
+
var _vue = _interopRequireDefault(require("vue"));
|
|
4
|
+
var _BaseListing = _interopRequireDefault(require("../base-components/Listing/BaseListing"));
|
|
5
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
6
|
$(document).ready(function ($) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
7
|
+
$(document).on('click', '.close_button', function (e) {
|
|
8
|
+
$(this).closest('.show').removeClass('show');
|
|
9
|
+
});
|
|
10
|
+
$(document).on('click', '.dropdown-menu.dropdown-menu-dont-auto-close', function (e) {
|
|
11
|
+
e.stopPropagation();
|
|
12
|
+
});
|
|
21
13
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
default: function _default() {
|
|
31
|
-
return 'All groups';
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
stepCount: {
|
|
35
|
-
type: Number,
|
|
36
|
-
default: function _default() {
|
|
37
|
-
return 3;
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
locales: {}
|
|
14
|
+
_vue["default"].component('translation-listing', {
|
|
15
|
+
mixins: [_BaseListing["default"]],
|
|
16
|
+
props: {
|
|
17
|
+
label: {
|
|
18
|
+
type: String,
|
|
19
|
+
"default": function _default() {
|
|
20
|
+
return 'All groups';
|
|
21
|
+
}
|
|
41
22
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
23
|
+
stepCount: {
|
|
24
|
+
type: Number,
|
|
25
|
+
"default": function _default() {
|
|
26
|
+
return 3;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
locales: {}
|
|
30
|
+
},
|
|
31
|
+
data: function data() {
|
|
32
|
+
var exportMultiselect = {};
|
|
33
|
+
Object.values(this.locales).forEach(function (value) {
|
|
34
|
+
exportMultiselect[value] = true;
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
templateChecked: false,
|
|
38
|
+
exportMultiselect: exportMultiselect,
|
|
39
|
+
languagesToExport: this.locales,
|
|
40
|
+
importLanguage: '',
|
|
41
|
+
file: null,
|
|
42
|
+
onlyMissing: false,
|
|
43
|
+
currentStep: 1,
|
|
44
|
+
scanning: false,
|
|
45
|
+
filters: {
|
|
46
|
+
group: null
|
|
47
|
+
},
|
|
48
|
+
translationId: null,
|
|
49
|
+
translationDefault: '',
|
|
50
|
+
numberOfSuccessfullyImportedTranslations: 0,
|
|
51
|
+
numberOfSuccessfullyUpdatedTranslations: 0,
|
|
52
|
+
numberOfFoundTranslations: 0,
|
|
53
|
+
numberOfTranslationsToReview: 0,
|
|
54
|
+
translationsToImport: null,
|
|
55
|
+
translations: {},
|
|
56
|
+
importedFile: null
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
watch: {
|
|
60
|
+
exportMultiselect: {
|
|
61
|
+
handler: function handler(newVal, oldVal) {
|
|
62
|
+
var _this = this;
|
|
63
|
+
this.languagesToExport = [];
|
|
64
|
+
Object.keys(newVal).forEach(function (key) {
|
|
65
|
+
if (newVal[key]) {
|
|
66
|
+
_this.languagesToExport.push(key);
|
|
67
|
+
}
|
|
47
68
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
currentStep: 1,
|
|
56
|
-
scanning: false,
|
|
57
|
-
filters: {
|
|
58
|
-
group: null
|
|
59
|
-
},
|
|
60
|
-
translationId: null,
|
|
61
|
-
translationDefault: '',
|
|
62
|
-
numberOfSuccessfullyImportedTranslations: 0,
|
|
63
|
-
numberOfSuccessfullyUpdatedTranslations: 0,
|
|
64
|
-
numberOfFoundTranslations: 0,
|
|
65
|
-
numberOfTranslationsToReview: 0,
|
|
66
|
-
translationsToImport: null,
|
|
67
|
-
translations: {},
|
|
68
|
-
importedFile: null
|
|
69
|
-
};
|
|
69
|
+
},
|
|
70
|
+
deep: true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
computed: {
|
|
74
|
+
filteredGroup: function filteredGroup() {
|
|
75
|
+
return this.filters.group === null ? this.label : this.filters.group;
|
|
70
76
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
lastStep: function lastStep() {
|
|
78
|
+
return this.currentStep === this.stepCount;
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
rescan: function rescan(url) {
|
|
83
|
+
var _this2 = this;
|
|
84
|
+
this.scanning = true;
|
|
85
|
+
axios.post(url).then(function (response) {
|
|
86
|
+
_this2.scanning = false;
|
|
87
|
+
_this2.loadData(true);
|
|
88
|
+
}, function (error) {
|
|
89
|
+
_this2.scanning = false;
|
|
90
|
+
_this2.$notify({
|
|
91
|
+
type: 'error',
|
|
92
|
+
title: 'Error!',
|
|
93
|
+
text: 'An error has occured.'
|
|
94
|
+
});
|
|
95
|
+
});
|
|
88
96
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
lastStep: function lastStep() {
|
|
94
|
-
return this.currentStep === this.stepCount;
|
|
95
|
-
}
|
|
97
|
+
filterGroup: function filterGroup(group) {
|
|
98
|
+
this.filters.group = group;
|
|
99
|
+
this.loadData(true);
|
|
96
100
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
resetGroup: function resetGroup() {
|
|
102
|
+
this.filters.group = null;
|
|
103
|
+
this.loadData(true);
|
|
104
|
+
},
|
|
105
|
+
editTranslation: function editTranslation(item) {
|
|
106
|
+
this.$modal.show('edit-translation', item);
|
|
107
|
+
},
|
|
108
|
+
showImport: function showImport() {
|
|
109
|
+
this.$modal.show('import-translation');
|
|
110
|
+
},
|
|
111
|
+
showExport: function showExport() {
|
|
112
|
+
this.$modal.show('export-translation');
|
|
113
|
+
},
|
|
114
|
+
nextStep: function nextStep() {
|
|
115
|
+
var _this3 = this;
|
|
116
|
+
if (this.currentStep === 1) {
|
|
117
|
+
return this.$validator.validateAll().then(function (result) {
|
|
118
|
+
if (!result) {
|
|
119
|
+
_this3.$notify({
|
|
120
|
+
type: 'error',
|
|
121
|
+
title: 'Error!',
|
|
122
|
+
text: 'The form contains invalid fields.'
|
|
108
123
|
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
this.$modal.show('edit-translation', item);
|
|
120
|
-
},
|
|
121
|
-
showImport: function showImport() {
|
|
122
|
-
this.$modal.show('import-translation');
|
|
123
|
-
},
|
|
124
|
-
showExport: function showExport() {
|
|
125
|
-
this.$modal.show('export-translation');
|
|
126
|
-
},
|
|
127
|
-
nextStep: function nextStep() {
|
|
128
|
-
var _this3 = this;
|
|
129
|
-
|
|
130
|
-
if (this.currentStep === 1) {
|
|
131
|
-
return this.$validator.validateAll().then(function (result) {
|
|
132
|
-
if (!result) {
|
|
133
|
-
_this3.$notify({ type: 'error', title: 'Error!', text: 'The form contains invalid fields.' });
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
var url = '/admin/translations/import';
|
|
138
|
-
var formData = new FormData();
|
|
139
|
-
|
|
140
|
-
formData.append('fileImport', _this3.file);
|
|
141
|
-
formData.append('importLanguage', _this3.importLanguage);
|
|
142
|
-
formData.append('onlyMissing', _this3.onlyMissing);
|
|
143
|
-
|
|
144
|
-
axios.post(url, formData, {
|
|
145
|
-
headers: {
|
|
146
|
-
'Content-Type': 'multipart/form-data'
|
|
147
|
-
}
|
|
148
|
-
}).then(function (response) {
|
|
149
|
-
if (response.data.hasOwnProperty('numberOfImportedTranslations') && response.data.hasOwnProperty('numberOfUpdatedTranslations')) {
|
|
150
|
-
_this3.currentStep = 3;
|
|
151
|
-
_this3.numberOfSuccessfullyImportedTranslations = response.data.numberOfImportedTranslations;
|
|
152
|
-
_this3.numberOfSuccessfullyUpdatedTranslations = response.data.numberOfUpdatedTranslations;
|
|
153
|
-
_this3.loadData();
|
|
154
|
-
} else {
|
|
155
|
-
_this3.currentStep = 2;
|
|
156
|
-
_this3.numberOfFoundTranslations = Object.keys(response.data).length;
|
|
157
|
-
_this3.translationsToImport = response.data;
|
|
158
|
-
|
|
159
|
-
for (var i = 0; i < _this3.translationsToImport.length; i++) {
|
|
160
|
-
if (_this3.translationsToImport[i].hasOwnProperty('has_conflict')) {
|
|
161
|
-
if (_this3.translationsToImport[i].has_conflict) {
|
|
162
|
-
_this3.numberOfTranslationsToReview++;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}, function (error) {
|
|
168
|
-
if (error.response.data === "Wrong syntax in your import") _this3.$notify({ type: 'error', title: 'Error!', text: 'Wrong syntax in your import.' });else if (error.response.data === "Unsupported file type") _this3.$notify({ type: 'error', title: 'Error!', text: 'Unsupported file type.' });else _this3.$notify({ type: 'error', title: 'Error!', text: 'An error has occured.' });
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
} else if (this.currentStep === 2) {
|
|
172
|
-
return this.$validator.validateAll().then(function (result) {
|
|
173
|
-
if (!result) {
|
|
174
|
-
_this3.$notify({ type: 'error', title: 'Error!', text: 'The form contains invalid fields.' });
|
|
175
|
-
return false;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
for (var i = 0; i < _this3.translationsToImport.length; i++) {
|
|
179
|
-
if (_this3.translationsToImport[i].hasOwnProperty('checkedCurrent')) {
|
|
180
|
-
if (_this3.translationsToImport[i].checkedCurrent) {
|
|
181
|
-
_this3.translationsToImport[i][_this3.importLanguage.toLowerCase()] = _this3.translationsToImport[i].current_value;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
var url = '/admin/translations/import/conflicts';
|
|
187
|
-
var data = {
|
|
188
|
-
importLanguage: _this3.importLanguage,
|
|
189
|
-
resolvedTranslations: _this3.translationsToImport
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
axios.post(url, data).then(function (response) {
|
|
193
|
-
_this3.currentStep = 3;
|
|
194
|
-
_this3.numberOfSuccessfullyImportedTranslations = response.data.numberOfImportedTranslations;
|
|
195
|
-
_this3.numberOfSuccessfullyUpdatedTranslations = response.data.numberOfUpdatedTranslations;
|
|
196
|
-
_this3.loadData();
|
|
197
|
-
}, function (error) {
|
|
198
|
-
_this3.$notify({ type: 'error', title: 'Error!', text: 'An error has occured.' });
|
|
199
|
-
});
|
|
200
|
-
});
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
var url = '/admin/translations/import';
|
|
127
|
+
var formData = new FormData();
|
|
128
|
+
formData.append('fileImport', _this3.file);
|
|
129
|
+
formData.append('importLanguage', _this3.importLanguage);
|
|
130
|
+
formData.append('onlyMissing', _this3.onlyMissing);
|
|
131
|
+
axios.post(url, formData, {
|
|
132
|
+
headers: {
|
|
133
|
+
'Content-Type': 'multipart/form-data'
|
|
201
134
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
for (var _iterator = Object.keys(params.text)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
218
|
-
var key = _step.value;
|
|
219
|
-
|
|
220
|
-
this.translations[key] = params.text[key];
|
|
221
|
-
}
|
|
222
|
-
} catch (err) {
|
|
223
|
-
_didIteratorError = true;
|
|
224
|
-
_iteratorError = err;
|
|
225
|
-
} finally {
|
|
226
|
-
try {
|
|
227
|
-
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
228
|
-
_iterator.return();
|
|
229
|
-
}
|
|
230
|
-
} finally {
|
|
231
|
-
if (_didIteratorError) {
|
|
232
|
-
throw _iteratorError;
|
|
233
|
-
}
|
|
135
|
+
}).then(function (response) {
|
|
136
|
+
if (response.data.hasOwnProperty('numberOfImportedTranslations') && response.data.hasOwnProperty('numberOfUpdatedTranslations')) {
|
|
137
|
+
_this3.currentStep = 3;
|
|
138
|
+
_this3.numberOfSuccessfullyImportedTranslations = response.data.numberOfImportedTranslations;
|
|
139
|
+
_this3.numberOfSuccessfullyUpdatedTranslations = response.data.numberOfUpdatedTranslations;
|
|
140
|
+
_this3.loadData();
|
|
141
|
+
} else {
|
|
142
|
+
_this3.currentStep = 2;
|
|
143
|
+
_this3.numberOfFoundTranslations = Object.keys(response.data).length;
|
|
144
|
+
_this3.translationsToImport = response.data;
|
|
145
|
+
for (var i = 0; i < _this3.translationsToImport.length; i++) {
|
|
146
|
+
if (_this3.translationsToImport[i].hasOwnProperty('has_conflict')) {
|
|
147
|
+
if (_this3.translationsToImport[i].has_conflict) {
|
|
148
|
+
_this3.numberOfTranslationsToReview++;
|
|
149
|
+
}
|
|
234
150
|
}
|
|
151
|
+
}
|
|
235
152
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}, function (error) {
|
|
250
|
-
_this4.$notify({ type: 'error', title: 'Error!', text: 'An error has occured.' });
|
|
153
|
+
}, function (error) {
|
|
154
|
+
if (error.response.data === "Wrong syntax in your import") _this3.$notify({
|
|
155
|
+
type: 'error',
|
|
156
|
+
title: 'Error!',
|
|
157
|
+
text: 'Wrong syntax in your import.'
|
|
158
|
+
});else if (error.response.data === "Unsupported file type") _this3.$notify({
|
|
159
|
+
type: 'error',
|
|
160
|
+
title: 'Error!',
|
|
161
|
+
text: 'Unsupported file type.'
|
|
162
|
+
});else _this3.$notify({
|
|
163
|
+
type: 'error',
|
|
164
|
+
title: 'Error!',
|
|
165
|
+
text: 'An error has occured.'
|
|
251
166
|
});
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
} else if (this.currentStep === 2) {
|
|
170
|
+
return this.$validator.validateAll().then(function (result) {
|
|
171
|
+
if (!result) {
|
|
172
|
+
_this3.$notify({
|
|
173
|
+
type: 'error',
|
|
174
|
+
title: 'Error!',
|
|
175
|
+
text: 'The form contains invalid fields.'
|
|
176
|
+
});
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
for (var i = 0; i < _this3.translationsToImport.length; i++) {
|
|
180
|
+
if (_this3.translationsToImport[i].hasOwnProperty('checkedCurrent')) {
|
|
181
|
+
if (_this3.translationsToImport[i].checkedCurrent) {
|
|
182
|
+
_this3.translationsToImport[i][_this3.importLanguage.toLowerCase()] = _this3.translationsToImport[i].current_value;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
var url = '/admin/translations/import/conflicts';
|
|
187
|
+
var data = {
|
|
188
|
+
importLanguage: _this3.importLanguage,
|
|
189
|
+
resolvedTranslations: _this3.translationsToImport
|
|
190
|
+
};
|
|
191
|
+
axios.post(url, data).then(function (response) {
|
|
192
|
+
_this3.currentStep = 3;
|
|
193
|
+
_this3.numberOfSuccessfullyImportedTranslations = response.data.numberOfImportedTranslations;
|
|
194
|
+
_this3.numberOfSuccessfullyUpdatedTranslations = response.data.numberOfUpdatedTranslations;
|
|
195
|
+
_this3.loadData();
|
|
196
|
+
}, function (error) {
|
|
197
|
+
_this3.$notify({
|
|
198
|
+
type: 'error',
|
|
199
|
+
title: 'Error!',
|
|
200
|
+
text: 'An error has occured.'
|
|
269
201
|
});
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
previousStep: function previousStep() {
|
|
207
|
+
this.currentStep--;
|
|
208
|
+
},
|
|
209
|
+
beforeModalOpen: function beforeModalOpen(_ref) {
|
|
210
|
+
var params = _ref.params;
|
|
211
|
+
this.translationId = params.id;
|
|
212
|
+
this.translationDefault = params.key;
|
|
213
|
+
this.translations = {};
|
|
214
|
+
for (var _i = 0, _Object$keys = Object.keys(params.text); _i < _Object$keys.length; _i++) {
|
|
215
|
+
var key = _Object$keys[_i];
|
|
216
|
+
this.translations[key] = params.text[key];
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
onSubmit: function onSubmit() {
|
|
220
|
+
var _this4 = this;
|
|
221
|
+
var url = '/admin/translations/' + this.translationId;
|
|
222
|
+
var data = {
|
|
223
|
+
text: this.translations
|
|
224
|
+
};
|
|
225
|
+
axios.post(url, data).then(function (response) {
|
|
226
|
+
_this4.$modal.hide('edit-translation');
|
|
227
|
+
_this4.$notify({
|
|
228
|
+
type: 'success',
|
|
229
|
+
title: 'Success!',
|
|
230
|
+
text: 'Item successfully changed.'
|
|
231
|
+
});
|
|
232
|
+
_this4.loadData();
|
|
233
|
+
}, function (error) {
|
|
234
|
+
_this4.$notify({
|
|
235
|
+
type: 'error',
|
|
236
|
+
title: 'Error!',
|
|
237
|
+
text: 'An error has occured.'
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
onSubmitExport: function onSubmitExport() {
|
|
242
|
+
var _this5 = this;
|
|
243
|
+
return this.$validator.validateAll().then(function (result) {
|
|
244
|
+
if (!result) {
|
|
245
|
+
_this5.$notify({
|
|
246
|
+
type: 'error',
|
|
247
|
+
title: 'Error!',
|
|
248
|
+
text: 'The form contains invalid fields.'
|
|
249
|
+
});
|
|
250
|
+
return false;
|
|
281
251
|
}
|
|
252
|
+
var data = {
|
|
253
|
+
exportLanguages: _this5.languagesToExport
|
|
254
|
+
};
|
|
255
|
+
var url = '/admin/translations/export?' + $.param(data);
|
|
256
|
+
window.location = url;
|
|
257
|
+
_this5.$modal.hide('export-translation');
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
handleImportFileUpload: function handleImportFileUpload(e) {
|
|
261
|
+
this.file = this.$refs.file.files[0];
|
|
262
|
+
this.importedFile = e.target.files[0];
|
|
263
|
+
},
|
|
264
|
+
onCloseImportModal: function onCloseImportModal() {
|
|
265
|
+
this.currentStep = 1;
|
|
266
|
+
this.importedFile = '';
|
|
267
|
+
this.importLanguage = '';
|
|
268
|
+
this.onlyMissing = false;
|
|
269
|
+
this.translationsToImport = null;
|
|
282
270
|
}
|
|
271
|
+
}
|
|
283
272
|
});
|
package/dist/ui/index.js
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require('popper.js');
|
|
4
|
-
|
|
5
|
-
require('bootstrap');
|
|
6
|
-
|
|
7
|
-
require('@coreui/coreui');
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
3
|
+
require("popper.js");
|
|
4
|
+
require("bootstrap");
|
|
5
|
+
require("@coreui/coreui");
|
|
9
6
|
$(function () {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
// spinner buttons
|
|
8
|
+
$('.btn-spinner').on('click', function (e) {
|
|
9
|
+
if (!(e.shiftKey || e.ctrlKey || e.metaKey)) {
|
|
10
|
+
$(this).css({
|
|
11
|
+
'pointer-events': 'none'
|
|
12
|
+
});
|
|
13
|
+
$(this).find('i').removeClass().addClass('fa fa-spinner');
|
|
14
|
+
}
|
|
15
|
+
});
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
// dropdown Menu
|
|
18
|
+
$('.dropdown-toggle').on('click', function () {
|
|
19
|
+
$(this).parent().toggleClass('open');
|
|
20
|
+
});
|
|
21
|
+
$('.dropdown-item').on('click', function () {
|
|
22
|
+
$(this).closest('.open').removeClass('open');
|
|
23
|
+
});
|
|
24
|
+
$('.dropdown-menu').on('mouseleave', function () {
|
|
25
|
+
$(this).parent('.dropdown').removeClass('open');
|
|
26
|
+
});
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
// remove empty nav titles when no children there
|
|
29
|
+
$('.nav-title').filter(function () {
|
|
30
|
+
return !$(this).next().hasClass('nav-item');
|
|
31
|
+
}).hide();
|
|
33
32
|
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dejwcake/craftable",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "This is a frontend dependency for Craftable. Craftable is a Laravel-based open-source toolkit for building administration interfaces.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
-
"js": "babel src --presets babel
|
|
8
|
+
"js": "babel src --presets @babel/preset-env --out-dir dist",
|
|
9
9
|
"build": "npm run js",
|
|
10
10
|
"prepublish": "npm run build"
|
|
11
11
|
},
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"vue2-dropzone": "^2.3.5"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
+
"@babel/preset-env": "^7.26.9",
|
|
50
|
+
"@babel/cli": "^7.26.4",
|
|
49
51
|
"autoprefixer": "^9.3.1",
|
|
50
|
-
"babel-cli": "^6.26.0",
|
|
51
|
-
"babel-preset-es2015": "^6.24.1",
|
|
52
52
|
"cpx": "^1.5.0",
|
|
53
|
+
"postcss-cli": "^8.3.1",
|
|
54
|
+
"resolve-url-loader": "^3.1.0",
|
|
53
55
|
"sass": "^1.49.9",
|
|
54
56
|
"sass-loader": "^8.0.2",
|
|
55
|
-
"
|
|
56
|
-
"vue-loader": "^15.9.6",
|
|
57
|
-
"resolve-url-loader": "^3.1.0"
|
|
57
|
+
"vue-loader": "^15.9.6"
|
|
58
58
|
},
|
|
59
59
|
"files": [
|
|
60
60
|
"/dist",
|