app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js in activeadmin_trumbowyg-0.1.8 vs app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js in activeadmin_trumbowyg-0.2.0
- old
+ new
@@ -56,10 +56,15 @@
da: {
upload: 'Upload',
file: 'Fil',
uploadError: 'Fejl'
},
+ de: {
+ upload: 'Hochladen',
+ file: 'Datei',
+ uploadError: 'Fehler'
+ },
sk: {
upload: 'Nahrať',
file: 'Súbor',
uploadError: 'Chyba'
},
@@ -100,11 +105,16 @@
},
tr: {
upload: 'Yükle',
file: 'Dosya',
uploadError: 'Hata'
- }
+ },
+ ko: {
+ upload: '그림 올리기',
+ file: '파일',
+ uploadError: '에러'
+ },
},
// jshint camelcase:true
plugins: {
upload: {
@@ -191,11 +201,11 @@
if (trumbowyg.o.plugins.upload.success) {
trumbowyg.o.plugins.upload.success(data, trumbowyg, $modal, values);
} else {
if (!!getDeep(data, trumbowyg.o.plugins.upload.statusPropertyName.split('.'))) {
var url = getDeep(data, trumbowyg.o.plugins.upload.urlPropertyName.split('.'));
- trumbowyg.execCmd('insertImage', url);
+ trumbowyg.execCmd('insertImage', url, false, true);
var $img = $('img[src="' + url + '"]:not([alt])', trumbowyg.$box);
$img.attr('alt', values.alt);
if (trumbowyg.o.imageWidthModalEdit && parseInt(values.width) > 0) {
$img.attr({
width: values.width
@@ -247,11 +257,12 @@
function addXhrProgressEvent() {
if (!$.trumbowyg.addedXhrProgressEvent) { // Avoid adding progress event multiple times
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
xhr: function () {
- var req = originalXhr(),
- that = this;
+ var that = this,
+ req = originalXhr();
+
if (req && typeof req.upload === 'object' && that.progressUpload !== undefined) {
req.upload.addEventListener('progress', function (e) {
that.progressUpload(e);
}, false);
}