aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2014-09-01 12:13:55 +0000
committerplegall <plg@piwigo.org>2014-09-01 12:13:55 +0000
commit0e28516b9bf933960cd1524b8435d6a9d497f752 (patch)
tree1dec34cd8e3ffc4a16eeda6c25f41e8d35477fad
parentccea530eae8dafef8c573586562299693c4a8d39 (diff)
bug 3127: during upload, warn user if she wants to leave the page (works fine on Firefox/Chrome)
git-svn-id: http://piwigo.org/svn/trunk@29356 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/themes/default/template/photos_add_direct.tpl9
-rw-r--r--language/en_UK/admin.lang.php1
-rw-r--r--language/fr_FR/admin.lang.php3
3 files changed, 11 insertions, 2 deletions
diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl
index 971346e1e..10f861d96 100644
--- a/admin/themes/default/template/photos_add_direct.tpl
+++ b/admin/themes/default/template/photos_add_direct.tpl
@@ -103,6 +103,11 @@ jQuery(document).ready(function(){
BeforeUpload: function(up, file) {
console.log('[BeforeUpload]', file);
+ // warn user if she wants to leave page while upload is running
+ jQuery(window).bind('beforeunload', function() {
+ return "{/literal}{'Upload in progress'|translate|escape}{literal}";
+ });
+
// no more change on category/level
jQuery("select[name=level]").attr("disabled", "disabled");
@@ -165,10 +170,12 @@ jQuery(document).ready(function(){
jQuery(".batchLink").html(sprintf(batch_Label, uploadedPhotos.length));
jQuery(".afterUploadActions").show();
+
+ // user can safely leave page without warning
+ jQuery(window).unbind('beforeunload');
}
}
});
-
{/literal}
});
{/footer_script}
diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php
index 867f8777a..2b0eaff65 100644
--- a/language/en_UK/admin.lang.php
+++ b/language/en_UK/admin.lang.php
@@ -981,4 +981,5 @@ $lang['based on'] = 'based on';
$lang['file name'] = 'file name';
$lang['date & time'] = 'date & time';
$lang['width & height'] = 'width & height';
+$lang['Upload in progress'] = 'Upload in progress';
?> \ No newline at end of file
diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php
index bc267f176..eb825df59 100644
--- a/language/fr_FR/admin.lang.php
+++ b/language/fr_FR/admin.lang.php
@@ -982,4 +982,5 @@ $lang['based on'] = 'basé sur';
$lang['file name'] = 'nom de fichier';
$lang['date & time'] = 'date et heure';
$lang['width & height'] = 'largeur et hauteur';
-$lang['No and unlock sub-albums'] = 'Déverrouiller ou non les sous-albums'; \ No newline at end of file
+$lang['No and unlock sub-albums'] = 'Non, et déverrouiller les sous-albums';
+$lang['Upload in progress'] = 'Transfert en cours...'; \ No newline at end of file