diff --git a/assets/javascripts/plupload/i18n/de.js b/assets/javascripts/plupload/i18n/de.js
index 96429d31..4c4de07a 100644
--- a/assets/javascripts/plupload/i18n/de.js
+++ b/assets/javascripts/plupload/i18n/de.js
@@ -1,25 +1,24 @@
// German
plupload.addI18n({
- 'Select files' : 'Wählen Sie die Dateien:',
- 'Add files to the upload queue and click the start button.' : 'Dateien hinzufügen und danach auf \'Starten des Uploads\' klicken und die Datei hochzuladen.',
- 'Filename' : 'Dateiname',
- 'Status' : 'Status',
- 'Size' : 'Größe',
- 'Add files' : 'Hinzufügen von Dateien',
- 'Stop current upload' : 'Stop aktuellen Upload',
- 'Start uploading queue' : 'Starte Upload',
- 'Uploaded %d/%d files': '%d/%d Dateien sind Hochgeladen',
- 'N/A' : 'Nicht verfügbar',
- 'Drag files here.' : 'Ziehen Sie die Dateien hier hin',
- 'File extension error.': 'Dateiendungs Fehler.',
- 'File size error.': 'Dateigrößen Fehler.',
- 'Init error.': 'Initialisierungs Fehler.',
- 'HTTP Error.': 'HTTP Fehler.',
- 'Security error.': 'Sicherheits Fehler.',
- 'Generic error.': 'Generic Fehler.',
- 'IO error.': 'Ein/Ausgabe Fehler.',
- 'Stop Upload': 'Stoppen des Uploads.',
- 'Add Files': 'Dateien hinzufügen',
- 'Start Upload': 'Starten des Uploads.',
- '%d files queued': '%d Dateien in der Warteschlange.'
+ 'Select files' : 'Dateien hochladen',
+ 'Add files to the upload queue and click the start button.' : 'Dateien hinzufügen und auf \'Hochladen\' klicken.',
+ 'Filename' : 'Dateiname',
+ 'Status' : 'Status',
+ 'Size' : 'Größe',
+ 'Add files' : 'Dateien', // hinzufügen',
+ 'Stop current upload' : 'Aktuelles Hochladen stoppen',
+ 'Start uploading queue' : 'Hochladen starten',
+ 'Uploaded %d/%d files': '%d/%d Dateien sind hochgeladen',
+ 'N/A' : 'Nicht verfügbar',
+ 'Drag files here.' : 'Ziehen Sie die Dateien hier hin',
+ 'File extension error.': 'Fehler bei Dateiendung',
+ 'File size error.': 'Fehler bei Dateigröße',
+ 'Init error.': 'Initialisierungsfehler',
+ 'HTTP Error.': 'HTTP-Fehler',
+ 'Security error.': 'Sicherheitsfehler',
+ 'Generic error.': 'Typischer Fehler',
+ 'IO error.': 'Ein/Ausgabe-Fehler',
+ 'Stop Upload': 'Hochladen stoppen',
+ 'Start upload': 'Hochladen',
+ '%d files queued': '%d Dateien in der Warteschlange'
});
\ No newline at end of file
diff --git a/assets/javascripts/plupload/i18n/fr.js b/assets/javascripts/plupload/i18n/fr.js
index c534ec4e..53dbe289 100644
--- a/assets/javascripts/plupload/i18n/fr.js
+++ b/assets/javascripts/plupload/i18n/fr.js
@@ -1,4 +1,4 @@
-// .po file like language pack
+// French
plupload.addI18n({
'Select files' : 'Sélectionnez les fichiers',
'Add files to the upload queue and click the start button.' : 'Ajoutez des fichiers à la file et appuyez sur le bouton démarrer.',
diff --git a/assets/javascripts/plupload/i18n/hr.js b/assets/javascripts/plupload/i18n/hr.js
new file mode 100644
index 00000000..084be51c
--- /dev/null
+++ b/assets/javascripts/plupload/i18n/hr.js
@@ -0,0 +1,25 @@
+// Croatian
+plupload.addI18n({
+ 'Select files': 'Izaberite datoteke:',
+ 'Add files to the upload queue and click the start button.': 'Dodajte datoteke u listu i kliknite Upload.',
+ 'Filename': 'Ime datoteke',
+ 'Status': 'Status',
+ 'Size': 'Veličina',
+ 'Add files': 'Dodajte datoteke',
+ 'Stop current upload': 'Zaustavi trenutan upload',
+ 'Start uploading queue': 'Pokreni Upload',
+ 'Uploaded %d/%d files': 'Uploadano %d/%d datoteka',
+ 'N/A': 'N/A',
+ 'Drag files here.': 'Dovucite datoteke ovdje',
+ 'File extension error.': 'Greška ekstenzije datoteke.',
+ 'File size error.': 'Greška veličine datoteke.',
+ 'Init error.': 'Greška inicijalizacije.',
+ 'HTTP Error.': 'HTTP greška.',
+ 'Security error.': 'Sigurnosna greška.',
+ 'Generic error.': 'Generička greška.',
+ 'IO error.': 'I/O greška.',
+ 'Stop Upload': 'Zaustavi upload.',
+ 'Add Files': 'Dodaj datoteke',
+ 'Start Upload': 'Pokreni upload.',
+ '%d files queued': '%d datoteka na čekanju.'
+});
\ No newline at end of file
diff --git a/assets/javascripts/plupload/i18n/hu.js b/assets/javascripts/plupload/i18n/hu.js
new file mode 100644
index 00000000..87070bae
--- /dev/null
+++ b/assets/javascripts/plupload/i18n/hu.js
@@ -0,0 +1,33 @@
+// Hungarian
+plupload.addI18n({
+ 'Select files' : 'Fájlok kiválasztása',
+ 'Add files to the upload queue and click the start button.' : 'Válaszd ki a fájlokat, majd kattints az Indítás gombra.',
+ 'Filename' : 'Fájlnév',
+ 'Status' : 'Állapot',
+ 'Size' : 'Méret',
+ 'Add files' : 'Hozzáadás',
+ 'Stop current upload' : 'Jelenlegi feltöltés megszakítása',
+ 'Start uploading queue' : 'Várakozási sor feltöltésének indítása',
+ 'Uploaded %d/%d files': 'Feltöltött fájlok: %d/%d',
+ 'N/A': 'Nem elérhető',
+ 'Drag files here.' : 'Húzd ide a fájlokat.',
+ 'Stop upload': 'Feltöltés megszakítása',
+ 'Start upload': 'Indítás',
+ '%d files queued': '%d fájl sorbaállítva',
+ 'File: %s': 'Fájl: %s',
+ 'Close': 'Bezárás',
+ 'Using runtime: ': 'Használt runtime: ',
+ 'File: %f, size: %s, max file size: %m': 'Fájl: %f, méret: %s, maximális fájlméret: %m',
+ 'Upload element accepts only %d file(s) at a time. Extra files were stripped.': 'A feltöltés egyszerre csak %d fájlt fogad el, a többi fájl nem lesz feltöltve.',
+ 'Upload URL might be wrong or doesn\'t exist': 'A megadott URL hibás vagy nem létezik',
+ 'Error: File too large: ': 'Hiba: A fájl túl nagy: ',
+ 'Error: Invalid file extension: ': 'Hiba: Érvénytelen fájlkiterjesztés: ',
+ 'File extension error.': 'Hibás fájlkiterjesztés.',
+ 'File size error.': 'Hibás fájlméret.',
+ 'File count error.': 'A fájlok számával kapcsolatos hiba.',
+ 'Init error.': 'Init hiba.',
+ 'HTTP Error.': 'HTTP hiba.',
+ 'Security error.': 'Biztonsági hiba.',
+ 'Generic error.': 'Általános hiba.',
+ 'IO error.': 'I/O hiba.'
+});
diff --git a/assets/javascripts/plupload/i18n/it.js b/assets/javascripts/plupload/i18n/it.js
index 7946578a..891e4fb0 100644
--- a/assets/javascripts/plupload/i18n/it.js
+++ b/assets/javascripts/plupload/i18n/it.js
@@ -1,21 +1,24 @@
-// .po file like language pack
-plupload.addI18n({
- 'Select files' : 'Seleziona i files',
- 'Add files to the upload queue and click the start button.' : 'Aggiungi i file alla coda di caricamento e clicca il pulsante di avvio.',
- 'Filename' : 'Nome file',
- 'Status' : 'Stato',
- 'Size' : 'Dimensione',
- 'Add files' : 'Aggiungi file',
- 'Stop current upload' : 'Interrompi il caricamento',
- 'Start uploading queue' : 'Avvia il caricamento',
- 'Uploaded %d/%d files': 'Caricati %d/%d file',
- 'N/A' : 'N/D',
- 'Drag files here.' : 'Trascina i file qui.',
- 'File extension error.': 'Errore estensione file.',
- 'File size error.': 'Errore dimensione file.',
- 'Init error.': 'Errore inizializzazione.',
- 'HTTP Error.': 'Errore HTTP.',
- 'Security error.': 'Errore sicurezza.',
- 'Generic error.': 'Errore generico.',
- 'IO error.': 'Errore IO.'
+// Italian
+plupload.addI18n({
+ 'Select files' : 'Seleziona i files',
+ 'Add files to the upload queue and click the start button.' : 'Aggiungi i file alla coda di caricamento e clicca il pulsante di avvio.',
+ 'Filename' : 'Nome file',
+ 'Status' : 'Stato',
+ 'Size' : 'Dimensione',
+ 'Add Files' : 'Aggiungi file',
+ 'Stop current upload' : 'Interrompi il caricamento',
+ 'Start uploading queue' : 'Avvia il caricamento',
+ 'Uploaded %d/%d files': 'Caricati %d/%d file',
+ 'N/A' : 'N/D',
+ 'Drag files here.' : 'Trascina i file qui.',
+ 'File extension error.': 'Errore estensione file.',
+ 'File size error.': 'Errore dimensione file.',
+ 'Init error.': 'Errore inizializzazione.',
+ 'HTTP Error.': 'Errore HTTP.',
+ 'Security error.': 'Errore sicurezza.',
+ 'Generic error.': 'Errore generico.',
+ 'IO error.': 'Errore IO.',
+ 'Stop Upload': 'Ferma Upload',
+ 'Start Upload': 'Inizia Upload',
+ '%d files queued': '%d file in lista'
});
\ No newline at end of file
diff --git a/assets/javascripts/plupload/i18n/ro.js b/assets/javascripts/plupload/i18n/ro.js
new file mode 100644
index 00000000..fd198f0a
--- /dev/null
+++ b/assets/javascripts/plupload/i18n/ro.js
@@ -0,0 +1,24 @@
+// Romanian
+plupload.addI18n({
+ 'Select files' : 'Selectare fişiere',
+ 'Add files to the upload queue and click the start button.' : 'Adaugă fişiere în lista apoi apasă butonul \'Începe încărcare\'.',
+ 'Filename' : 'Nume fişier',
+ 'Status' : 'Stare',
+ 'Size' : 'Mărime',
+ 'Add files' : 'Adăugare fişiere',
+ 'Stop current upload' : 'Întrerupe încărcarea curentă',
+ 'Start uploading queue' : 'Începe incărcarea',
+ 'Uploaded %d/%d files': 'Fişiere încărcate %d/%d',
+ 'N/A' : 'N/A',
+ 'Drag files here.' : 'Trage aici fişierele',
+ 'File extension error.': 'Extensie fişier eronată',
+ 'File size error.': 'Eroare dimensiune fişier',
+ 'Init error.': 'Eroare iniţializare',
+ 'HTTP Error.': 'Eroare HTTP',
+ 'Security error.': 'Eroare securitate',
+ 'Generic error.': 'Eroare generică',
+ 'IO error.': 'Eroare Intrare/Ieşire',
+ 'Stop Upload': 'Oprire încărcare',
+ 'Start upload': 'Începe încărcare',
+ '%d files queued': '%d fişiere listate'
+});
\ No newline at end of file
diff --git a/assets/javascripts/plupload/i18n/sr.js b/assets/javascripts/plupload/i18n/sr.js
new file mode 100644
index 00000000..59dc0a97
--- /dev/null
+++ b/assets/javascripts/plupload/i18n/sr.js
@@ -0,0 +1,14 @@
+// Serbian
+plupload.addI18n({
+ 'Select files' : 'Izaberite fajlove',
+ 'Add files to the upload queue and click the start button.' : 'Dodajte fajlove u listu i kliknite na dugme Start.',
+ 'Filename' : 'Naziv fajla',
+ 'Status' : 'Status',
+ 'Size' : 'Veličina',
+ 'Add Files' : 'Dodaj fajlove',
+ 'Stop current upload' : 'Zaustavi upload',
+ 'Start uploading queue' : 'Počni upload',
+ 'Drag files here.' : 'Prevucite fajlove ovde.',
+ 'Start Upload': 'Počni upload',
+ 'Uploaded %d/%d files': 'Snimljeno %d/%d fajlova'
+});
\ No newline at end of file
diff --git a/assets/javascripts/plupload/jquery.ui.plupload/jquery.ui.plupload.js b/assets/javascripts/plupload/jquery.ui.plupload/jquery.ui.plupload.js
index 680ffec8..5ed1a499 100644
--- a/assets/javascripts/plupload/jquery.ui.plupload/jquery.ui.plupload.js
+++ b/assets/javascripts/plupload/jquery.ui.plupload/jquery.ui.plupload.js
@@ -159,20 +159,6 @@ $.widget("ui.plupload", {
});
}
- // all buttons are optional, so they can be disabled and hidden
- if (!this.options.buttons.browse) {
- this.browse_button.button('disable').hide();
- $('#' + id + self.runtime + '_container').hide();
- }
-
- if (!this.options.buttons.start) {
- this.start_button.button('disable').hide();
- }
-
- if (!this.options.buttons.stop) {
- this.stop_button.button('disable').hide();
- }
-
// progressbar
this.progressbar = $('.plupload_progress_container', this.container);
@@ -186,15 +172,35 @@ $.widget("ui.plupload", {
id: id + '_count',
name: id + '_count'
});
-
+
// initialize uploader instance
uploader = this.uploader = uploaders[id] = new plupload.Uploader($.extend({
container: id ,
browse_button: id + '_browse'
}, this.options));
+ // do not show UI if no runtime can be initialized
+ uploader.bind('Error', function(up, err) {
+ if (err.code === plupload.INIT_ERROR) {
+ self.destroy();
+ }
+ });
- uploader.bind('Init', function(up, res) {
+ uploader.bind('Init', function(up, res) {
+ // all buttons are optional, so they can be disabled and hidden
+ if (!self.options.buttons.browse) {
+ self.browse_button.button('disable').hide();
+ up.disableBrowse(true);
+ }
+
+ if (!self.options.buttons.start) {
+ self.start_button.button('disable').hide();
+ }
+
+ if (!self.options.buttons.stop) {
+ self.stop_button.button('disable').hide();
+ }
+
if (!self.options.unique_names && self.options.rename) {
self._enableRenaming();
}
@@ -213,7 +219,7 @@ $.widget("ui.plupload", {
});
self.stop_button.click(function(e) {
- uploader.stop();
+ self.stop();
e.preventDefault();
});
});
@@ -244,7 +250,10 @@ $.widget("ui.plupload", {
self._trigger('selected', null, { up: up, files: files } );
if (self.options.autostart) {
- self.start();
+ // set a little delay to make sure that QueueChanged triggered by the core has time to complete
+ setTimeout(function() {
+ self.start();
+ }, 10);
}
});
@@ -272,7 +281,12 @@ $.widget("ui.plupload", {
uploader.bind('UploadProgress', function(up, file) {
// Set file specific progress
- $('#' + file.id + ' .plupload_file_status', self.element).html(file.percent + '%');
+ $('#' + file.id)
+ .find('.plupload_file_status')
+ .html(file.percent + '%')
+ .end()
+ .find('.plupload_file_size')
+ .html(plupload.formatSize(file.size));
self._handleFileStatus(file);
self._updateTotalProgress();
@@ -354,10 +368,10 @@ $.widget("ui.plupload", {
if (!value.browse) {
self.browse_button.button('disable').hide();
- $('#' + self.id + self.runtime + '_container').hide();
+ up.disableBrowse(true);
} else {
self.browse_button.button('enable').show();
- $('#' + self.id + self.runtime + '_container').show();
+ up.disableBrowse(false);
}
if (!value.start) {
@@ -419,9 +433,9 @@ $.widget("ui.plupload", {
_handleState: function() {
- var self = this, uploader = this.uploader;
+ var self = this, up = this.uploader;
- if (uploader.state === plupload.STARTED) {
+ if (up.state === plupload.STARTED) {
$(self.start_button).button('disable');
@@ -431,7 +445,7 @@ $.widget("ui.plupload", {
.removeClass('plupload_hidden');
$('.plupload_upload_status', self.element).text(
- _('Uploaded %d/%d files').replace('%d/%d', uploader.total.uploaded+'/'+uploader.files.length)
+ _('Uploaded %d/%d files').replace('%d/%d', up.total.uploaded+'/'+up.files.length)
);
$('.plupload_header_content', self.element).addClass('plupload_header_content_bw');
@@ -456,6 +470,11 @@ $.widget("ui.plupload", {
_handleFileStatus: function(file) {
var actionClass, iconClass;
+
+ // since this method might be called asynchronously, file row might not yet be rendered
+ if (!$('#' + file.id).length) {
+ return;
+ }
switch (file.status) {
case plupload.DONE:
@@ -498,20 +517,24 @@ $.widget("ui.plupload", {
_updateTotalProgress: function() {
- var uploader = this.uploader;
+ var up = this.uploader;
- this.progressbar.progressbar('value', uploader.total.percent);
+ this.progressbar.progressbar('value', up.total.percent);
- $('.plupload_total_status', this.element).html(uploader.total.percent + '%');
-
- $('.plupload_upload_status', this.element).text(
- _('Uploaded %d/%d files').replace('%d/%d', uploader.total.uploaded+'/'+uploader.files.length)
- );
+ this.element
+ .find('.plupload_total_status')
+ .html(up.total.percent + '%')
+ .end()
+ .find('.plupload_total_file_size')
+ .html(plupload.formatSize(up.total.size))
+ .end()
+ .find('.plupload_upload_status')
+ .text(_('Uploaded %d/%d files').replace('%d/%d', up.total.uploaded+'/'+up.files.length));
},
_updateFileList: function() {
- var self = this, uploader = this.uploader, filelist = this.filelist,
+ var self = this, up = this.uploader, filelist = this.filelist,
count = 0,
id, prefix = this.id + '_',
fields;
@@ -523,7 +546,7 @@ $.widget("ui.plupload", {
filelist.empty();
- $.each(uploader.files, function(i, file) {
+ $.each(up.files, function(i, file) {
fields = '';
id = prefix + count;
@@ -552,25 +575,22 @@ $.widget("ui.plupload", {
$('#' + file.id + '.plupload_delete .ui-icon, #' + file.id + '.plupload_done .ui-icon')
.click(function(e) {
$('#' + file.id).remove();
- uploader.removeFile(file);
+ up.removeFile(file);
e.preventDefault();
});
self._trigger('updatelist', null, filelist);
});
-
- $('.plupload_total_file_size', self.element).html(plupload.formatSize(uploader.total.size));
-
- if (uploader.total.queued === 0) {
+ if (up.total.queued === 0) {
$('.ui-button-text', self.browse_button).text(_('Add Files'));
} else {
- $('.ui-button-text', self.browse_button).text(_('%d files queued').replace('%d', uploader.total.queued));
+ $('.ui-button-text', self.browse_button).text(_('%d files queued').replace('%d', up.total.queued));
}
- if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {
+ if (up.files.length === (up.total.uploaded + up.total.failed)) {
self.start_button.button('disable');
} else {
self.start_button.button('enable');
@@ -582,7 +602,7 @@ $.widget("ui.plupload", {
self._updateTotalProgress();
- if (!uploader.files.length && uploader.features.dragdrop && uploader.settings.dragdrop) {
+ if (!up.files.length && up.features.dragdrop && up.settings.dragdrop) {
// Re-add drag message if there are no files
$('#' + id + '_filelist').append('
| ' + _("Drag files here.") + ' |
');
} else {
@@ -597,7 +617,7 @@ $.widget("ui.plupload", {
_enableRenaming: function() {
var self = this;
- $('.plupload_file_name span', this.filelist).live('click', function(e) {
+ $('.plupload_delete .plupload_file_name span', this.filelist).live('click', function(e) {
var targetSpan = $(e.target), file, parts, name, ext = "";
// Get file name and split out name and extension
diff --git a/assets/javascripts/plupload/plupload.flash.js b/assets/javascripts/plupload/plupload.flash.js
index a5d08b10..9af96127 100644
--- a/assets/javascripts/plupload/plupload.flash.js
+++ b/assets/javascripts/plupload/plupload.flash.js
@@ -133,7 +133,7 @@
html = '