Skip to content

Commit a77359b

Browse files
author
Leonix
committed
Photos v.2.1.2
* Fixed viewing of photos, after selecting a tag written in non-Latin letters, in the app’s backend. * Added support for WebP images. * Minor user interface improvement.
1 parent 309457c commit a77359b

File tree

16 files changed

+35
-38
lines changed

16 files changed

+35
-38
lines changed

wa-apps/photos/js/jquery.fileupload-wa.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@
455455
// only browsers with support for the File API report the type:
456456
if (!(this.options.acceptFileTypes.test(file.type) ||
457457
this.options.acceptFileTypes.test(file.name))) {
458-
return $_('Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only.');
458+
return $_('Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only.');
459459
}
460460
if (this.options.maxFileSize &&
461461
file.size > this.options.maxFileSize) {

wa-apps/photos/js/legacy/jquery.fileupload-wa.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@
450450
// only browsers with support for the File API report the type:
451451
if (!(this.options.acceptFileTypes.test(file.type) ||
452452
this.options.acceptFileTypes.test(file.name))) {
453-
return $_('Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only.');
453+
return $_('Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only.');
454454
}
455455
if (this.options.maxFileSize &&
456456
file.size > this.options.maxFileSize) {

wa-apps/photos/js/legacy/photos.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,10 +2971,10 @@
29712971
$(".lazyloading-wrapper .lazyloading-link").hide();
29722972
$.post(
29732973
'?module=photo&action=loadList',
2974-
{ offset : offset, hash: $.photos.hash },
2974+
{ offset : offset, hash: decodeURI($.photos.hash) },
29752975
function (r) {
29762976
// if hash has changed already than ignore
2977-
if (r.data.hash != $.photos.hash) {
2977+
if (r.data.hash != decodeURI($.photos.hash)) {
29782978
return;
29792979
}
29802980
var target = $("#photo-list");

wa-apps/photos/js/photos.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3165,10 +3165,10 @@
31653165
$(".lazyloading-wrapper .lazyloading-link").hide();
31663166
$.post(
31673167
'?module=photo&action=loadList',
3168-
{ offset : offset, hash: $.photos.hash },
3168+
{ offset : offset, hash: decodeURI($.photos.hash) },
31693169
function (r) {
31703170
// if hash has changed already than ignore
3171-
if (r.data.hash != $.photos.hash) {
3171+
if (r.data.hash != decodeURI($.photos.hash)) {
31723172
return;
31733173
}
31743174
var target = $("#photo-list");

wa-apps/photos/js/sidebar.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -346,30 +346,27 @@
346346
},
347347

348348
initHandlers: function() {
349+
let dialog;
350+
349351
$("#p-upload-link").on('click', function (e) {
350352
e.preventDefault();
351-
let $dialog = $('#p-uploader')
353+
354+
if (dialog) {
355+
dialog.show();
356+
return;
357+
}
358+
359+
let $dialog = $('#p-uploader');
352360

353361
if($dialog.length) {
354-
$.waDialog({
362+
dialog = $.waDialog({
355363
$wrapper: $dialog,
356364
onOpen($_dialog, dialog_instance) {
357365
$.photos.onUploadDialog($_dialog, dialog_instance)
358366
},
359367
onClose(dialog_instance) {
360-
let $dialog = dialog_instance.$wrapper;
361-
if (dialog_instance.animate) {
362-
dialog_instance.animateDialog(false).then( function() {
363-
dialog_instance.$wrapper.hide();
364-
});
365-
} else {
366-
dialog_instance.$wrapper.hide();
367-
}
368-
369-
if (dialog_instance.lock_body_scroll) {
370-
document.querySelector('body').classList.remove('is-locked')
371-
}
372368
$.photos.dialogClearSteps.call($dialog);
369+
dialog_instance.hide();
373370
return false;
374371
}
375372
});

wa-apps/photos/lib/actions/backend/photosBackendLoc.action.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function execute()
2828
'Plugins', //_w('Plugins')
2929
'Settings', //_w('Settings')
3030
'add a tag', //_w('add a tag'),
31-
'Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only.', //_w('Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only.'),
31+
'Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only.', //_w('Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only.'),
3232
'Close', //_w('Close'),
3333
'Stop upload', //_w('Stop upload'),
3434
'Edit title...', //_w('Edit title...'),

wa-apps/photos/lib/config/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'plugins' => true,
1111
'pages' => true,
1212
'mobile' => true,
13-
'version' => '2.1.1',
13+
'version' => '2.1.2',
1414
'vendor' => 'webasyst',
1515
'my_account' => true,
1616
'sash_color' => '#af71b3',

wa-apps/photos/locale/en_US/LC_MESSAGES/photos.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ msgstr ""
465465
msgid "Upload photos (%d)"
466466
msgstr ""
467467

468-
msgid "Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only."
469-
msgstr "Only files with name extensions .gif, .jpg, .jpeg, .png are allowed."
468+
msgid "Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only."
469+
msgstr "Only files with name extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed."
470470

471471
msgid "You don't have sufficient access rights"
472472
msgstr "You don't have sufficient access rights."

wa-apps/photos/locale/ru_RU/LC_MESSAGES/photos.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@ msgstr "Применить фильтр резкости при создании
511511
msgid "Click “Save” button below to apply this change."
512512
msgstr "Щелкните по кнопке «Сохранить» внизу, чтобы применить это изменение."
513513

514-
msgid "Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only."
515-
msgstr "Допускаются только файлы с расширениями имени .gif, .jpg, .jpeg, .png"
514+
msgid "Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only."
515+
msgstr "Допускаются только файлы с расширениями имени *.gif, *.jpg, *.jpeg, *.png, *.webp"
516516

517517
msgid "You don't have sufficient access rights"
518518
msgstr "У вас недостаточно прав доступа."

wa-apps/photos/templates/actions-legacy/upload/Upload.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ <h1>
240240
});
241241
// Initialize the jQuery File Upload widget:
242242
$('#fileupload').fileupload({
243-
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
243+
acceptFileTypes: /(\.|\/)(gif|jpe?g|png|webp)$/i
244244
});
245245
});
246246
</script>

0 commit comments

Comments
 (0)