activeadmin_trumbowyg 0.1.3 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/app/assets/fonts/active_admin-trumbowyg.svg +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/da.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/de.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/fa.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/fr.min.js +3 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/lt.min.js +8 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/sq.min.js +8 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/th.min.js +9 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_tw.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js +143 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +21 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +23 -90
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +24 -2
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +1190 -876
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js +82 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js +160 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.js +82 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss +25 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css +20 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css +2 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.js +202 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +10 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.js +122 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.js +98 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/sass/trumbowyg.mathml.scss +36 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.css +29 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.min.css +2 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.js +111 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/sass/trumbowyg.mention.scss +39 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.css +32 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.min.css +2 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +12 -2
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.js +96 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +16 -3
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.js +69 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.js +82 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +236 -86
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss +42 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.css +33 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.min.css +2 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +19 -7
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +44 -20
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.js +215 -78
- data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.min.js +2 -2
- data/app/assets/javascripts/activeadmin/trumbowyg/ui/icons.svg +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/ui/sass/trumbowyg.scss +25 -12
- data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.css +23 -20
- data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.min.css +2 -2
- data/app/assets/stylesheets/activeadmin/_trumbowyg_input.sass +5 -3
- data/app/assets/stylesheets/activeadmin/trumbowyg/ui/icons.svg +1 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/ui/sass/trumbowyg.scss +25 -12
- data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.css +23 -20
- data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.min.css +2 -2
- data/lib/activeadmin/trumbowyg/version.rb +1 -1
- metadata +40 -72
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ar.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/bg.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/by.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ca.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/cs.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/da.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/de.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/el.min.js +0 -12
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es_ar.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fa.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fi.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fr.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/he.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hr.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hu.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/id.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/it.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ja.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ko.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/mn.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/my.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/nl.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/no_nb.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ph.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pl.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt_br.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ro.min.js +0 -12
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs_latin.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ru.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sk.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sv.min.js +0 -12
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/tr.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ua.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/vi.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_cn.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_tw.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +0 -121
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +0 -179
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +0 -176
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +0 -49
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +0 -43
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +0 -2
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +0 -965
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss +0 -56
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css +0 -47
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +0 -2
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +0 -83
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +0 -101
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +0 -41
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +0 -123
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +0 -154
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +0 -58
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +0 -242
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.js +0 -1688
- data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.min.js +0 -2
@@ -23,7 +23,8 @@
|
|
23
23
|
urlPropertyName: 'file', // How to get url from the json response (for instance 'url' for {url: ....})
|
24
24
|
statusPropertyName: 'success', // How to get status from the json response
|
25
25
|
success: undefined, // Success callback: function (data, trumbowyg, $modal, values) {}
|
26
|
-
error: undefined
|
26
|
+
error: undefined, // Error callback: function () {}
|
27
|
+
imageWidthModalEdit: false // Add ability to edit image width
|
27
28
|
};
|
28
29
|
|
29
30
|
function getDeep(object, propertyParts) {
|
@@ -52,6 +53,11 @@
|
|
52
53
|
file: 'File',
|
53
54
|
uploadError: 'Error'
|
54
55
|
},
|
56
|
+
da: {
|
57
|
+
upload: 'Upload',
|
58
|
+
file: 'Fil',
|
59
|
+
uploadError: 'Fejl'
|
60
|
+
},
|
55
61
|
sk: {
|
56
62
|
upload: 'Nahrať',
|
57
63
|
file: 'Súbor',
|
@@ -76,7 +82,7 @@
|
|
76
82
|
upload: '上傳',
|
77
83
|
file: '文件',
|
78
84
|
uploadError: '錯誤'
|
79
|
-
},
|
85
|
+
},
|
80
86
|
ru: {
|
81
87
|
upload: 'Загрузка',
|
82
88
|
file: 'Файл',
|
@@ -92,6 +98,11 @@
|
|
92
98
|
file: 'Arquivo',
|
93
99
|
uploadError: 'Erro'
|
94
100
|
},
|
101
|
+
tr: {
|
102
|
+
upload: 'Yükle',
|
103
|
+
file: 'Dosya',
|
104
|
+
uploadError: 'Hata'
|
105
|
+
}
|
95
106
|
},
|
96
107
|
// jshint camelcase:true
|
97
108
|
|
@@ -106,24 +117,32 @@
|
|
106
117
|
var file,
|
107
118
|
prefix = trumbowyg.o.prefix;
|
108
119
|
|
120
|
+
var fields = {
|
121
|
+
file: {
|
122
|
+
type: 'file',
|
123
|
+
required: true,
|
124
|
+
attributes: {
|
125
|
+
accept: 'image/*'
|
126
|
+
}
|
127
|
+
},
|
128
|
+
alt: {
|
129
|
+
label: 'description',
|
130
|
+
value: trumbowyg.getRangeText()
|
131
|
+
}
|
132
|
+
};
|
133
|
+
|
134
|
+
if (trumbowyg.o.plugins.upload.imageWidthModalEdit) {
|
135
|
+
fields.width = {
|
136
|
+
value: ''
|
137
|
+
};
|
138
|
+
}
|
139
|
+
|
109
140
|
var $modal = trumbowyg.openModalInsert(
|
110
141
|
// Title
|
111
142
|
trumbowyg.lang.upload,
|
112
143
|
|
113
144
|
// Fields
|
114
|
-
|
115
|
-
file: {
|
116
|
-
type: 'file',
|
117
|
-
required: true,
|
118
|
-
attributes: {
|
119
|
-
accept: 'image/*'
|
120
|
-
}
|
121
|
-
},
|
122
|
-
alt: {
|
123
|
-
label: 'description',
|
124
|
-
value: trumbowyg.getRangeText()
|
125
|
-
}
|
126
|
-
},
|
145
|
+
fields,
|
127
146
|
|
128
147
|
// Callback
|
129
148
|
function (values) {
|
@@ -133,9 +152,9 @@
|
|
133
152
|
trumbowyg.o.plugins.upload.data.map(function (cur) {
|
134
153
|
data.append(cur.name, cur.value);
|
135
154
|
});
|
136
|
-
|
137
|
-
$.map(values, function(curr, key){
|
138
|
-
if(key !== 'file') {
|
155
|
+
|
156
|
+
$.map(values, function (curr, key) {
|
157
|
+
if (key !== 'file') {
|
139
158
|
data.append(key, curr);
|
140
159
|
}
|
141
160
|
});
|
@@ -175,7 +194,13 @@
|
|
175
194
|
if (!!getDeep(data, trumbowyg.o.plugins.upload.statusPropertyName.split('.'))) {
|
176
195
|
var url = getDeep(data, trumbowyg.o.plugins.upload.urlPropertyName.split('.'));
|
177
196
|
trumbowyg.execCmd('insertImage', url);
|
178
|
-
$('img[src="' + url + '"]:not([alt])', trumbowyg.$box)
|
197
|
+
var $img = $('img[src="' + url + '"]:not([alt])', trumbowyg.$box);
|
198
|
+
$img.attr('alt', values.alt);
|
199
|
+
if (trumbowyg.o.imageWidthModalEdit && parseInt(values.width) > 0) {
|
200
|
+
$img.attr({
|
201
|
+
width: values.width
|
202
|
+
});
|
203
|
+
}
|
179
204
|
setTimeout(function () {
|
180
205
|
trumbowyg.closeModal();
|
181
206
|
}, 250);
|
@@ -219,7 +244,6 @@
|
|
219
244
|
}
|
220
245
|
});
|
221
246
|
|
222
|
-
|
223
247
|
function addXhrProgressEvent() {
|
224
248
|
if (!$.trumbowyg.addedXhrProgressEvent) { // Avoid adding progress event multiple times
|
225
249
|
var originalXhr = $.ajaxSettings.xhr;
|
@@ -1 +1 @@
|
|
1
|
-
!function(r){"use strict";function
|
1
|
+
!function(r){"use strict";function a(r,e){var o=e.shift(),l=e;if(null!==r){if(0===l.length)return r[o];if("object"==typeof r)return a(r[o],l)}return r}function e(){if(!r.trumbowyg.addedXhrProgressEvent){var a=r.ajaxSettings.xhr;r.ajaxSetup({xhr:function(){var r=a(),e=this;return r&&"object"==typeof r.upload&&void 0!==e.progressUpload&&r.upload.addEventListener("progress",function(r){e.progressUpload(r)},!1),r}}),r.trumbowyg.addedXhrProgressEvent=!0}}var o={serverPath:"",fileFieldName:"fileToUpload",data:[],headers:{},xhrFields:{},urlPropertyName:"file",statusPropertyName:"success",success:void 0,error:void 0,imageWidthModalEdit:!1};e(),r.extend(!0,r.trumbowyg,{langs:{en:{upload:"Upload",file:"File",uploadError:"Error"},da:{upload:"Upload",file:"Fil",uploadError:"Fejl"},sk:{upload:"Nahrať",file:"Súbor",uploadError:"Chyba"},fr:{upload:"Envoi",file:"Fichier",uploadError:"Erreur"},cs:{upload:"Nahrát obrázek",file:"Soubor",uploadError:"Chyba"},zh_cn:{upload:"上传",file:"文件",uploadError:"错误"},zh_tw:{upload:"上傳",file:"文件",uploadError:"錯誤"},ru:{upload:"Загрузка",file:"Файл",uploadError:"Ошибка"},ja:{upload:"アップロード",file:"ファイル",uploadError:"エラー"},pt_br:{upload:"Enviar do local",file:"Arquivo",uploadError:"Erro"},tr:{upload:"Yükle",file:"Dosya",uploadError:"Hata"}},plugins:{upload:{init:function(e){e.o.plugins.upload=r.extend(!0,{},o,e.o.plugins.upload||{});var l={fn:function(){e.saveRange();var o,l=e.o.prefix,t={file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:e.getRangeText()}};e.o.plugins.upload.imageWidthModalEdit&&(t.width={value:""});var d=e.openModalInsert(e.lang.upload,t,function(t){var i=new FormData;i.append(e.o.plugins.upload.fileFieldName,o),e.o.plugins.upload.data.map(function(r){i.append(r.name,r.value)}),r.map(t,function(r,a){"file"!==a&&i.append(a,r)}),0===r("."+l+"progress",d).length&&r("."+l+"modal-title",d).after(r("<div/>",{"class":l+"progress"}).append(r("<div/>",{"class":l+"progress-bar"}))),r.ajax({url:e.o.plugins.upload.serverPath,headers:e.o.plugins.upload.headers,xhrFields:e.o.plugins.upload.xhrFields,type:"POST",data:i,cache:!1,dataType:"json",processData:!1,contentType:!1,progressUpload:function(a){r("."+l+"progress-bar").css("width",Math.round(100*a.loaded/a.total)+"%")},success:function(o){if(e.o.plugins.upload.success)e.o.plugins.upload.success(o,e,d,t);else if(a(o,e.o.plugins.upload.statusPropertyName.split("."))){var l=a(o,e.o.plugins.upload.urlPropertyName.split("."));e.execCmd("insertImage",l);var i=r('img[src="'+l+'"]:not([alt])',e.$box);i.attr("alt",t.alt),e.o.imageWidthModalEdit&&parseInt(t.width)>0&&i.attr({width:t.width}),setTimeout(function(){e.closeModal()},250),e.$c.trigger("tbwuploadsuccess",[e,o,l])}else e.addErrorOnModalField(r("input[type=file]",d),e.lang[o.message]),e.$c.trigger("tbwuploaderror",[e,o])},error:e.o.plugins.upload.error||function(){e.addErrorOnModalField(r("input[type=file]",d),e.lang.uploadError),e.$c.trigger("tbwuploaderror",[e])}})});r("input[type=file]").on("change",function(r){try{o=r.target.files[0]}catch(a){o=r.target.value}})}};e.addBtnDef("upload",l)}}}})}(jQuery);
|