Skip to content

Commit 633d792

Browse files
author
Leonix
committed
photos/plugins/publicgallery: v.1.1.1
* Added support for WebP images.
1 parent a77359b commit 633d792

File tree

9 files changed

+35
-115
lines changed

9 files changed

+35
-115
lines changed

wa-apps/photos/plugins/publicgallery/js/jquery.fileupload-ui.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
minFileSize: 1,
3636
// The regular expression for allowed file types, matches
3737
// against either file type or file name:
38-
acceptFileTypes: /\.(gif|png|jpg|jpeg)$/i,
38+
acceptFileTypes: /\.(gif|png|jpg|jpeg|webp)$/i,
3939
// The regular expression to define for which files a preview
4040
// image is shown, matched against the file type:
41-
previewFileTypes: /^image\/(gif|jpeg|png)$/,
41+
previewFileTypes: /^image\/(gif|jpeg|png|webp)$/,
4242
// The maximum file size for preview images:
4343
previewMaxFileSize: 5000000, // 5MB
4444
// The maximum width of the preview images:
@@ -363,7 +363,7 @@
363363
// only browsers with support for the File API report the type:
364364
if (!(this.options.acceptFileTypes.test(file.type) ||
365365
this.options.acceptFileTypes.test(file.name))) {
366-
return $_('Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only.');
366+
return $_('Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only.');
367367
}
368368
if (this.options.maxFileSize &&
369369
file.size > this.options.maxFileSize) {

wa-apps/photos/plugins/publicgallery/lib/actions/photosPublicgalleryPluginVote.controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class photosPublicgalleryPluginVoteController extends waJsonController
55
public function execute()
66
{
77
if (!$this->getUser()->getId()) {
8-
$this->errors[] = sprintf_wp("Please %ssign in%s to be able to vote for photos", '<a href="'.wa()->getRouteUrl('/login', null, true).'">', '</a>');
8+
$this->errors[] = sprintf_wp("Please %ssign in%s to be able to vote for photos.", '<a href="'.wa()->getRouteUrl('/login', null, true).'">', '</a>');
99
return;
1010
}
1111

@@ -81,4 +81,4 @@ public function filterAllowedPhotoIds($photo_id)
8181
return $photo_id;
8282
}
8383
}
84-
}
84+
}

wa-apps/photos/plugins/publicgallery/lib/config/plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'name' => /*_wp*/('Public Gallery'),
55
'description' => /*_wp*/('Enables the ability to upload and vote for photos in the app frontend'),
66
'img' => 'img/publicgallery.png',
7-
'version' => '1.1.0',
7+
'version' => '1.1.1',
88
'vendor' => 'webasyst',
99
'rights' => false,
1010
'frontend' => true,

wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function frontendAssets() {
8787
$strings = array();
8888
foreach(array(
8989
'Empty result', //_w('Empty result')
90-
'Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only.', //_w('Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only.')
90+
'Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only.', //_w('Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only.')
9191
'Upload complete! <a href="#">Reload page</a> to view your photos.', //_w('Upload complete! <a href="#">Reload page</a> to view your photos.')
9292
) as $s) {
9393
$strings[$s] = _w($s);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deny from all

wa-apps/photos/plugins/publicgallery/locale/en_US/LC_MESSAGES/photos_publicgallery.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ msgid "Upload complete! <a href=\"#\">Reload page</a> to view your photos."
7575
msgstr ""
7676

7777
#: /wa-apps/photos/plugins/publicgallery/js/jquery.fileupload-ui.js:366
78-
msgid "Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only."
78+
msgid "Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only."
7979
msgstr ""
8080

8181
#: /wa-apps/photos/plugins/publicgallery/lib/actions/backend/photosPublicgalleryPluginBackendModeration.controller.php:12
Binary file not shown.

wa-apps/photos/plugins/publicgallery/locale/ru_RU/LC_MESSAGES/photos_publicgallery.po

Lines changed: 25 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -8,235 +8,154 @@ msgstr ""
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
11-
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n"
12-
"%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
11+
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
1312
"X-Poedit-SourceCharset: utf-8\n"
1413
"X-Poedit-Basepath: .\n"
15-
"X-Generator: Poedit 1.6.10\n"
14+
"X-Generator: Poedit 2.0.6\n"
1615
"Language: ru_RU\n"
1716
"X-Poedit-SearchPath-0: .\n"
1817
"X-Poedit-SearchPath-1: .\n"
1918

20-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/backend/BackendRatesDistribution.html:30
2119
msgid "User votes"
2220
msgstr "Оценки пользователей"
2321

24-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/backend/BackendRatesDistribution.html:46
2522
msgid "Close"
2623
msgstr "Закрыть"
2724

28-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendImageUpload.html:9
2925
msgid "Stop upload"
3026
msgstr "Прервать"
3127

32-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendImageUpload.html:15
3328
msgid "Files uploaded with errors"
3429
msgstr "Произошла ошибка во время загрузки файлов"
3530

36-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendImageUpload.html:50
37-
msgid ""
38-
"Failed to upload. Most probably, there were not enough memory to create "
39-
"thumbnails."
40-
msgstr ""
41-
"Ошибки при загрузке. Вероятно, недостаточно памяти для формирования эскизов "
42-
"изображений."
31+
msgid "Failed to upload. Most probably, there were not enough memory to create thumbnails."
32+
msgstr "Ошибки при загрузке. Вероятно, недостаточно памяти для формирования эскизов изображений."
4333

44-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:235
4534
msgid "My uploads"
4635
msgstr "Мои фотографии"
4736

48-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendMyphotos.html:44
49-
msgid ""
50-
"To upload a photo, either <a href=\"#\">sign up</a> or authorize using one "
51-
"of services listed below"
52-
msgstr ""
53-
"Для загрузки фотографий <a href=\"#\">зарегистрируйтесь</a> или "
54-
"авторизуйтесь с помощью одного из сервисов, перечисленных ниже."
37+
msgid "To upload a photo, either <a href=\"#\">sign up</a> or authorize using one of services listed below"
38+
msgstr "Для загрузки фотографий <a href=\"#\">зарегистрируйтесь</a> или авторизуйтесь с помощью одного из сервисов, перечисленных ниже."
5539

56-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendMyphotos.html:57
5740
msgid "Upload images"
5841
msgstr "Выберите фотографии для загрузки"
5942

60-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendMyphotos.html:58
6143
msgid "or drag them here to start upload"
6244
msgstr "или перетащите фотографии сюда"
6345

64-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:65
6546
msgid "Photo has been declined by the administrator"
6647
msgstr "Фотография была отклонена администратором"
6748

68-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:251
6949
msgid "Pending moderation"
7050
msgstr "На модерации"
7151

72-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendPhotos.html:41
7352
msgid "Show more photos"
7453
msgstr "Показать еще"
7554

76-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendPhotos.html:47
7755
msgid "Loading"
7856
msgstr "Загрузка"
7957

80-
#: /wa-apps/photos/plugins/publicgallery/js/jquery.fileupload-ui.js:111
8158
msgid "Empty result"
8259
msgstr "Пустой ответ"
8360

84-
#: /wa-apps/photos/plugins/publicgallery/js/jquery.fileupload-ui.js:135
8561
msgid "Upload complete! <a href=\"#\">Reload page</a> to view your photos."
86-
msgstr ""
87-
"Загрузка завершена! <a href=\"#\">Перезагрузите страницу</a>, чтобы увидеть "
88-
"фотографии."
62+
msgstr "Загрузка завершена! <a href=\"#\">Перезагрузите страницу</a>, чтобы увидеть фотографии."
8963

90-
#: /wa-apps/photos/plugins/publicgallery/js/jquery.fileupload-ui.js:366
91-
msgid "Files with extensions *.gif, *.jpg, *.jpeg, *.png are allowed only."
92-
msgstr "Допускаются только файлы с расширениями .gif, .jpg, .jpeg, .png"
64+
msgid "Files with extensions *.gif, *.jpg, *.jpeg, *.png, *.webp are allowed only."
65+
msgstr "Допускаются только файлы с расширениями *.gif, *.jpg, *.jpeg, *.png, *.webp"
9366

94-
#: /wa-apps/photos/plugins/publicgallery/lib/actions/backend/photosPublicgalleryPluginBackendModeration.controller.php:12
9567
msgid "Unknown photo"
9668
msgstr "Неизвестный формат фотографии"
9769

98-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:21
9970
msgid "Minimal photo size (px)"
10071
msgstr "Минимально допустимый размер фотографии (в пикселях)"
10172

102-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:22
103-
msgid ""
104-
"Limits the minimum width and height for photos uploaded in the frontend (in "
105-
"pixels)"
106-
msgstr ""
107-
"Устанавливает ограничение на минимальную ширину и высоту фотографий, которые "
108-
"принимаются к загрузке во фронтенде приложения"
73+
msgid "Limits the minimum width and height for photos uploaded in the frontend (in pixels)"
74+
msgstr "Устанавливает ограничение на минимальную ширину и высоту фотографий, которые принимаются к загрузке во фронтенде приложения"
10975

110-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:27
11176
msgid "Maximum photo size (px)"
11277
msgstr "Максимально допустимый размер фотографии (в пикселях)"
11378

114-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:28
115-
msgid ""
116-
"Limits the maximum width and height for photos uploaded in the frontend (in "
117-
"pixels)"
118-
msgstr ""
119-
"Устанавливает ограничение на максимальную ширину и высоту фотографий, "
120-
"которые принимаются к загрузке во фронтенде приложения"
79+
msgid "Limits the maximum width and height for photos uploaded in the frontend (in pixels)"
80+
msgstr "Устанавливает ограничение на максимальную ширину и высоту фотографий, которые принимаются к загрузке во фронтенде приложения"
12181

122-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:5
12382
msgid "Assign tags on upload"
12483
msgstr "Назначить теги"
12584

126-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:6
127-
msgid ""
128-
"Automatically assign listed tags for all photos uploaded in the frontend"
129-
msgstr ""
130-
"Перечисленные теги будут автоматически назначены на все фотографии, которые "
131-
"пользователи загружают во фронтенде приложения"
85+
msgid "Automatically assign listed tags for all photos uploaded in the frontend"
86+
msgstr "Перечисленные теги будут автоматически назначены на все фотографии, которые пользователи загружают во фронтенде приложения"
13287

133-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:11
13488
msgid "Moderation"
13589
msgstr "Модерация"
13690

137-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:12
138-
msgid ""
139-
"Define if photos uploaded in the frontend needs to be moderated in the "
140-
"backend or not. In case moderation is disabled, all photos will "
141-
"automatically appear in the frontend after upload"
142-
msgstr ""
143-
"Настройка определяет должны ли фотографии, загружаемые пользователями во "
144-
"фронтенде, проходить обязательную модерацию перед публикацией. При "
145-
"выключении модерации фотографии автоматически будут попадать в общий поток."
91+
msgid "Define if photos uploaded in the frontend needs to be moderated in the backend or not. In case moderation is disabled, all photos will automatically appear in the frontend after upload"
92+
msgstr "Настройка определяет должны ли фотографии, загружаемые пользователями во фронтенде, проходить обязательную модерацию перед публикацией. При выключении модерации фотографии автоматически будут попадать в общий поток."
14693

147-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:16
14894
msgid "Yes"
14995
msgstr "Да"
15096

151-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:17
15297
msgid "No"
15398
msgstr "Нет"
15499

155-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:52
156100
msgid "Rate"
157101
msgstr "Оценка"
158102

159-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:214
160103
msgid "cancel my vote"
161104
msgstr "очистить мою оценку"
162105

163-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:253
164106
msgid "Declined"
165107
msgstr "Отклоненные"
166108

167-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:123
168109
msgid "Approve photo"
169110
msgstr "Опубликовать"
170111

171-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:197
172112
msgid "Decline"
173113
msgstr "Отклонить"
174114

175-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:196
176115
msgid "Approve"
177116
msgstr "Опубликовать"
178117

179-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:60
180118
msgid "Rate this photo:"
181119
msgstr "Оцените фотографию:"
182120

183-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:226
184121
msgid "My vote: "
185122
msgstr "Моя оценка:"
186123

187-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendMyphotos.html:45
188-
msgid ""
189-
"To upload a photo, either <a href=\"%s\">sign up</a> or authorize using one "
190-
"of the services listed below."
191-
msgstr ""
192-
"Для загрузки фотографий <a href=\"%s\">зарегистрируйтесь</a> или "
193-
"авторизуйтесь с помощью одного из сервисов, перечисленных ниже."
124+
msgid "To upload a photo, either <a href=\"%s\">sign up</a> or authorize using one of the services listed below."
125+
msgstr "Для загрузки фотографий <a href=\"%s\">зарегистрируйтесь</a> или авторизуйтесь с помощью одного из сервисов, перечисленных ниже."
194126

195-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendMyphotos.html:54
196-
msgid ""
197-
"To upload a photo, either <a href=\"%s\">create an account</a> or <a href="
198-
"\"%s\">sign in</a> as a registered user."
199-
msgstr ""
200-
"Для загрузки фотографий <a href=\"%s\">зарегистрируйтесь</a> или <a href=\"%s"
201-
"\">авторизуйтесь</a>."
127+
msgid "To upload a photo, either <a href=\"%s\">create an account</a> or <a href=\"%s\">sign in</a> as a registered user."
128+
msgstr "Для загрузки фотографий <a href=\"%s\">зарегистрируйтесь</a> или <a href=\"%s\">авторизуйтесь</a>."
202129

203-
#: /wa-apps/photos/plugins/publicgallery/lib/actions/photosPublicgalleryPluginVote.controller.php:8
204130
msgid "Please sign in to be able to vote for photos"
205131
msgstr "Авторизуйтесь, чтобы проголосовать за фотографию"
206132

207-
#: /wa-apps/photos/plugins/publicgallery/lib/actions/photosPublicgalleryPluginVote.controller.php:14
208133
msgid "You may not vote for your own photos"
209134
msgstr "Вы не можете голосовать за свои фотографии"
210135

211-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:21
212136
msgid "Self photo voting"
213137
msgstr "Голосование за свои фото"
214138

215-
#: /wa-apps/photos/plugins/publicgallery/lib/config/settings.php:22
216139
msgid "Author can vote for self uploaded photos"
217140
msgstr "Автор фотографий может оставлять голоса за свои фотографии"
218141

219-
#: /wa-apps/photos/plugins/publicgallery/lib/config/plugin.php:4
220142
msgid "Public Gallery"
221143
msgstr "Фотогалерея"
222144

223-
#: /wa-apps/photos/plugins/publicgallery/lib/config/plugin.php:5
224145
msgid "Enables the ability to upload and vote for photos in the app frontend"
225-
msgstr ""
226-
"Включает возможность загрузки фотографий в фронтенде и коллективного "
227-
"голосования за фотографии"
146+
msgstr "Включает возможность загрузки фотографий в фронтенде и коллективного голосования за фотографии"
228147

229-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:40
230148
msgid "%d vote"
231149
msgid_plural "%d votes"
232150
msgstr[0] "%d оценка"
233151
msgstr[1] "%d оценки"
234152
msgstr[2] "%d оценок"
235153

236-
#: /wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendImageUpload.html:18
237154
msgid "Photos have been successfully uploaded"
238155
msgstr "Фотографии успешно загружены"
239156

240-
#: /wa-apps/photos/plugins/publicgallery/lib/photosPublicgallery.plugin.php:230
241157
msgid "My vote:"
242158
msgstr "Моя оценка:"
159+
160+
msgid "Please %ssign in%s to be able to vote for photos."
161+
msgstr "Пожалуйста, %sвойдите%s, чтобы голосовать за фотографии."

wa-apps/photos/plugins/publicgallery/templates/actions/frontend/FrontendImageUpload.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
$(function() {
8080
var fileupload = $('#fileupload');
8181
fileupload.fileupload({
82-
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
82+
acceptFileTypes: /(\.|\/)(gif|jpe?g|png|webp)$/i,
8383
});
8484
});
8585
</script>

0 commit comments

Comments
 (0)