##// END OF EJS Templates
Ability to switch file source field in posting form
neko259 -
r1461:0a26ae7c default
parent child Browse files
Show More
1 NO CONTENT: modified file, binary diff hidden
@@ -1,535 +1,538 b''
1 1 # SOME DESCRIPTIVE TITLE.
2 2 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 3 # This file is distributed under the same license as the PACKAGE package.
4 4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 5 #
6 6 msgid ""
7 7 msgstr ""
8 8 "Project-Id-Version: PACKAGE VERSION\n"
9 9 "Report-Msgid-Bugs-To: \n"
10 10 "POT-Creation-Date: 2015-10-09 23:21+0300\n"
11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 14 "Language: ru\n"
15 15 "MIME-Version: 1.0\n"
16 16 "Content-Type: text/plain; charset=UTF-8\n"
17 17 "Content-Transfer-Encoding: 8bit\n"
18 18 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
19 19 "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
20 20
21 21 #: admin.py:22
22 22 msgid "{} posters were banned"
23 23 msgstr ""
24 24
25 25 #: authors.py:9
26 26 msgid "author"
27 27 msgstr "автор"
28 28
29 29 #: authors.py:10
30 30 msgid "developer"
31 31 msgstr "разработчик"
32 32
33 33 #: authors.py:11
34 34 msgid "javascript developer"
35 35 msgstr "разработчик javascript"
36 36
37 37 #: authors.py:12
38 38 msgid "designer"
39 39 msgstr "дизайнер"
40 40
41 41 #: forms.py:30
42 42 msgid "Type message here. Use formatting panel for more advanced usage."
43 43 msgstr ""
44 44 "Вводите сообщение сюда. Используйте панель для более сложного форматирования."
45 45
46 46 #: forms.py:31
47 47 msgid "music images i_dont_like_tags"
48 48 msgstr "музыка картинки теги_не_нужны"
49 49
50 50 #: forms.py:33
51 51 msgid "Title"
52 52 msgstr "Заголовок"
53 53
54 54 #: forms.py:34
55 55 msgid "Text"
56 56 msgstr "Текст"
57 57
58 58 #: forms.py:35
59 59 msgid "Tag"
60 60 msgstr "Метка"
61 61
62 62 #: forms.py:36 templates/boards/base.html:40 templates/search/search.html:7
63 63 msgid "Search"
64 64 msgstr "Поиск"
65 65
66 66 #: forms.py:139
67 67 msgid "File"
68 68 msgstr "Файл"
69 69
70 70 #: forms.py:142
71 71 msgid "File URL"
72 72 msgstr "URL файла"
73 73
74 74 #: forms.py:148
75 75 msgid "e-mail"
76 76 msgstr ""
77 77
78 78 #: forms.py:151
79 79 msgid "Additional threads"
80 80 msgstr "Дополнительные темы"
81 81
82 82 #: forms.py:162
83 83 #, python-format
84 84 msgid "Title must have less than %s characters"
85 85 msgstr "Заголовок должен иметь меньше %s символов"
86 86
87 87 #: forms.py:172
88 88 #, python-format
89 89 msgid "Text must have less than %s characters"
90 90 msgstr "Текст должен быть короче %s символов"
91 91
92 92 #: forms.py:192
93 93 msgid "Invalid URL"
94 94 msgstr "Неверный URL"
95 95
96 96 #: forms.py:213
97 97 msgid "Invalid additional thread list"
98 98 msgstr "Неверный список дополнительных тем"
99 99
100 100 #: forms.py:258
101 101 msgid "Either text or file must be entered."
102 102 msgstr "Текст или файл должны быть введены."
103 103
104 104 #: forms.py:317 templates/boards/all_threads.html:153
105 105 #: templates/boards/rss/post.html:10 templates/boards/tags.html:6
106 106 msgid "Tags"
107 107 msgstr "Метки"
108 108
109 109 #: forms.py:324
110 110 msgid "Inappropriate characters in tags."
111 111 msgstr "Недопустимые символы в метках."
112 112
113 113 #: forms.py:344
114 114 msgid "Need at least one section."
115 115 msgstr "Нужен хотя бы один раздел."
116 116
117 117 #: forms.py:356
118 118 msgid "Theme"
119 119 msgstr "Тема"
120 120
121 121 #: forms.py:357
122 122 msgid "Image view mode"
123 123 msgstr "Режим просмотра изображений"
124 124
125 125 #: forms.py:358
126 126 msgid "User name"
127 127 msgstr "Имя пользователя"
128 128
129 129 #: forms.py:359
130 130 msgid "Time zone"
131 131 msgstr "Часовой пояс"
132 132
133 133 #: forms.py:365
134 134 msgid "Inappropriate characters."
135 135 msgstr "Недопустимые символы."
136 136
137 137 #: templates/boards/404.html:6
138 138 msgid "Not found"
139 139 msgstr "Не найдено"
140 140
141 141 #: templates/boards/404.html:12
142 142 msgid "This page does not exist"
143 143 msgstr "Этой страницы не существует"
144 144
145 145 #: templates/boards/all_threads.html:35
146 146 msgid "Details"
147 147 msgstr "Подробности"
148 148
149 149 #: templates/boards/all_threads.html:69
150 150 msgid "Edit tag"
151 151 msgstr "Изменить метку"
152 152
153 153 #: templates/boards/all_threads.html:76
154 154 #, python-format
155 155 msgid "%(count)s active thread"
156 156 msgid_plural "%(count)s active threads"
157 157 msgstr[0] "%(count)s активная тема"
158 158 msgstr[1] "%(count)s активные темы"
159 159 msgstr[2] "%(count)s активных тем"
160 160
161 161 #: templates/boards/all_threads.html:76
162 162 #, python-format
163 163 msgid "%(count)s thread in bumplimit"
164 164 msgid_plural "%(count)s threads in bumplimit"
165 165 msgstr[0] "%(count)s тема в бамплимите"
166 166 msgstr[1] "%(count)s темы в бамплимите"
167 167 msgstr[2] "%(count)s тем в бамплимите"
168 168
169 169 #: templates/boards/all_threads.html:77
170 170 #, python-format
171 171 msgid "%(count)s archived thread"
172 172 msgid_plural "%(count)s archived thread"
173 173 msgstr[0] "%(count)s архивная тема"
174 174 msgstr[1] "%(count)s архивные темы"
175 175 msgstr[2] "%(count)s архивных тем"
176 176
177 177 #: templates/boards/all_threads.html:78 templates/boards/post.html:102
178 178 #, python-format
179 179 #| msgid "%(count)s message"
180 180 #| msgid_plural "%(count)s messages"
181 181 msgid "%(count)s message"
182 182 msgid_plural "%(count)s messages"
183 183 msgstr[0] "%(count)s сообщение"
184 184 msgstr[1] "%(count)s сообщения"
185 185 msgstr[2] "%(count)s сообщений"
186 186
187 187 #: templates/boards/all_threads.html:95 templates/boards/feed.html:30
188 188 #: templates/boards/notifications.html:17 templates/search/search.html:26
189 189 msgid "Previous page"
190 190 msgstr "Предыдущая страница"
191 191
192 192 #: templates/boards/all_threads.html:109
193 193 #, python-format
194 194 msgid "Skipped %(count)s reply. Open thread to see all replies."
195 195 msgid_plural "Skipped %(count)s replies. Open thread to see all replies."
196 196 msgstr[0] "Пропущен %(count)s ответ. Откройте тред, чтобы увидеть все ответы."
197 197 msgstr[1] ""
198 198 "Пропущено %(count)s ответа. Откройте тред, чтобы увидеть все ответы."
199 199 msgstr[2] ""
200 200 "Пропущено %(count)s ответов. Откройте тред, чтобы увидеть все ответы."
201 201
202 202 #: templates/boards/all_threads.html:127 templates/boards/feed.html:40
203 203 #: templates/boards/notifications.html:27 templates/search/search.html:37
204 204 msgid "Next page"
205 205 msgstr "Следующая страница"
206 206
207 207 #: templates/boards/all_threads.html:132
208 208 msgid "No threads exist. Create the first one!"
209 209 msgstr "Нет тем. Создайте первую!"
210 210
211 211 #: templates/boards/all_threads.html:138
212 212 msgid "Create new thread"
213 213 msgstr "Создать новую тему"
214 214
215 215 #: templates/boards/all_threads.html:143 templates/boards/preview.html:16
216 216 #: templates/boards/thread_normal.html:51
217 217 msgid "Post"
218 218 msgstr "Отправить"
219 219
220 220 #: templates/boards/all_threads.html:144 templates/boards/preview.html:6
221 221 #: templates/boards/staticpages/help.html:21
222 222 #: templates/boards/thread_normal.html:52
223 223 msgid "Preview"
224 224 msgstr "Предпросмотр"
225 225
226 226 #: templates/boards/all_threads.html:149
227 227 msgid "Tags must be delimited by spaces. Text or image is required."
228 228 msgstr ""
229 229 "Метки должны быть разделены пробелами. Текст или изображение обязательны."
230 230
231 231 #: templates/boards/all_threads.html:152 templates/boards/thread_normal.html:58
232 232 msgid "Text syntax"
233 233 msgstr "Синтаксис текста"
234 234
235 235 #: templates/boards/all_threads.html:166 templates/boards/feed.html:53
236 236 msgid "Pages:"
237 237 msgstr "Страницы: "
238 238
239 239 #: templates/boards/authors.html:6 templates/boards/authors.html.py:12
240 240 msgid "Authors"
241 241 msgstr "Авторы"
242 242
243 243 #: templates/boards/authors.html:26
244 244 msgid "Distributed under the"
245 245 msgstr "Распространяется под"
246 246
247 247 #: templates/boards/authors.html:28
248 248 msgid "license"
249 249 msgstr "лицензией"
250 250
251 251 #: templates/boards/authors.html:30
252 252 msgid "Repository"
253 253 msgstr "Репозиторий"
254 254
255 255 #: templates/boards/base.html:14 templates/boards/base.html.py:41
256 256 msgid "Feed"
257 257 msgstr "Лента"
258 258
259 259 #: templates/boards/base.html:31
260 260 msgid "All threads"
261 261 msgstr "Все темы"
262 262
263 263 #: templates/boards/base.html:37
264 264 msgid "Add tags"
265 265 msgstr "Добавить метки"
266 266
267 267 #: templates/boards/base.html:39
268 268 msgid "Tag management"
269 269 msgstr "Управление метками"
270 270
271 271 #: templates/boards/base.html:39
272 272 msgid "tags"
273 273 msgstr "метки"
274 274
275 275 #: templates/boards/base.html:40
276 276 msgid "search"
277 277 msgstr "поиск"
278 278
279 279 #: templates/boards/base.html:41 templates/boards/feed.html:11
280 280 msgid "feed"
281 281 msgstr "лента"
282 282
283 283 #: templates/boards/base.html:42 templates/boards/random.html:6
284 284 msgid "Random images"
285 285 msgstr "Случайные изображения"
286 286
287 287 #: templates/boards/base.html:42
288 288 msgid "random"
289 289 msgstr "случайные"
290 290
291 291 #: templates/boards/base.html:44
292 292 msgid "favorites"
293 293 msgstr "избранное"
294 294
295 295 #: templates/boards/base.html:48 templates/boards/base.html.py:49
296 296 #: templates/boards/notifications.html:8
297 297 msgid "Notifications"
298 298 msgstr "Уведомления"
299 299
300 300 #: templates/boards/base.html:56 templates/boards/settings.html:8
301 301 msgid "Settings"
302 302 msgstr "Настройки"
303 303
304 304 #: templates/boards/base.html:59
305 305 msgid "Loading..."
306 306 msgstr "Загрузка..."
307 307
308 308 #: templates/boards/base.html:71
309 309 msgid "Admin"
310 310 msgstr "Администрирование"
311 311
312 312 #: templates/boards/base.html:73
313 313 #, python-format
314 314 msgid "Speed: %(ppd)s posts per day"
315 315 msgstr "Скорость: %(ppd)s сообщений в день"
316 316
317 317 #: templates/boards/base.html:75
318 318 msgid "Up"
319 319 msgstr "Вверх"
320 320
321 321 #: templates/boards/feed.html:45
322 322 msgid "No posts exist. Create the first one!"
323 323 msgstr "Нет сообщений. Создайте первое!"
324 324
325 325 #: templates/boards/post.html:33
326 326 msgid "Open"
327 327 msgstr "Открыть"
328 328
329 329 #: templates/boards/post.html:35 templates/boards/post.html.py:46
330 330 msgid "Reply"
331 331 msgstr "Ответить"
332 332
333 333 #: templates/boards/post.html:41
334 334 msgid " in "
335 335 msgstr " в "
336 336
337 337 #: templates/boards/post.html:51
338 338 msgid "Edit"
339 339 msgstr "Изменить"
340 340
341 341 #: templates/boards/post.html:53
342 342 msgid "Edit thread"
343 343 msgstr "Изменить тему"
344 344
345 345 #: templates/boards/post.html:91
346 346 msgid "Replies"
347 347 msgstr "Ответы"
348 348
349 349 #: templates/boards/post.html:103
350 350 #, python-format
351 351 msgid "%(count)s image"
352 352 msgid_plural "%(count)s images"
353 353 msgstr[0] "%(count)s изображение"
354 354 msgstr[1] "%(count)s изображения"
355 355 msgstr[2] "%(count)s изображений"
356 356
357 357 #: templates/boards/rss/post.html:5
358 358 msgid "Post image"
359 359 msgstr "Изображение сообщения"
360 360
361 361 #: templates/boards/settings.html:15
362 362 msgid "You are moderator."
363 363 msgstr "Вы модератор."
364 364
365 365 #: templates/boards/settings.html:19
366 366 msgid "Hidden tags:"
367 367 msgstr "Скрытые метки:"
368 368
369 369 #: templates/boards/settings.html:25
370 370 msgid "No hidden tags."
371 371 msgstr "Нет скрытых меток."
372 372
373 373 #: templates/boards/settings.html:34
374 374 msgid "Save"
375 375 msgstr "Сохранить"
376 376
377 377 #: templates/boards/staticpages/banned.html:6
378 378 msgid "Banned"
379 379 msgstr "Заблокирован"
380 380
381 381 #: templates/boards/staticpages/banned.html:11
382 382 msgid "Your IP address has been banned. Contact the administrator"
383 383 msgstr "Ваш IP адрес был заблокирован. Свяжитесь с администратором"
384 384
385 385 #: templates/boards/staticpages/help.html:6
386 386 #: templates/boards/staticpages/help.html:10
387 387 msgid "Syntax"
388 388 msgstr "Синтаксис"
389 389
390 390 #: templates/boards/staticpages/help.html:11
391 391 msgid "Italic text"
392 392 msgstr "Курсивный текст"
393 393
394 394 #: templates/boards/staticpages/help.html:12
395 395 msgid "Bold text"
396 396 msgstr "Полужирный текст"
397 397
398 398 #: templates/boards/staticpages/help.html:13
399 399 msgid "Spoiler"
400 400 msgstr "Спойлер"
401 401
402 402 #: templates/boards/staticpages/help.html:14
403 403 msgid "Link to a post"
404 404 msgstr "Ссылка на сообщение"
405 405
406 406 #: templates/boards/staticpages/help.html:15
407 407 msgid "Strikethrough text"
408 408 msgstr "Зачеркнутый текст"
409 409
410 410 #: templates/boards/staticpages/help.html:16
411 411 msgid "Comment"
412 412 msgstr "Комментарий"
413 413
414 414 #: templates/boards/staticpages/help.html:17
415 415 #: templates/boards/staticpages/help.html:18
416 416 msgid "Quote"
417 417 msgstr "Цитата"
418 418
419 419 #: templates/boards/staticpages/help.html:21
420 420 msgid "You can try pasting the text and previewing the result here:"
421 421 msgstr "Вы можете попробовать вставить текст и проверить результат здесь:"
422 422
423 423 #: templates/boards/tags.html:17
424 424 msgid "Sections:"
425 425 msgstr "Разделы:"
426 426
427 427 #: templates/boards/tags.html:30
428 428 msgid "Other tags:"
429 429 msgstr "Другие метки:"
430 430
431 431 #: templates/boards/tags.html:43
432 432 msgid "All tags..."
433 433 msgstr "Все метки..."
434 434
435 435 #: templates/boards/thread.html:14
436 436 msgid "Normal"
437 437 msgstr "Нормальный"
438 438
439 439 #: templates/boards/thread.html:15
440 440 msgid "Gallery"
441 441 msgstr "Галерея"
442 442
443 443 #: templates/boards/thread.html:16
444 444 msgid "Tree"
445 445 msgstr "Дерево"
446 446
447 447 #: templates/boards/thread.html:35
448 448 msgid "message"
449 449 msgid_plural "messages"
450 450 msgstr[0] "сообщение"
451 451 msgstr[1] "сообщения"
452 452 msgstr[2] "сообщений"
453 453
454 454 #: templates/boards/thread.html:38
455 455 msgid "image"
456 456 msgid_plural "images"
457 457 msgstr[0] "изображение"
458 458 msgstr[1] "изображения"
459 459 msgstr[2] "изображений"
460 460
461 461 #: templates/boards/thread.html:40
462 462 msgid "Last update: "
463 463 msgstr "Последнее обновление: "
464 464
465 465 #: templates/boards/thread_gallery.html:36
466 466 msgid "No images."
467 467 msgstr "Нет изображений."
468 468
469 469 #: templates/boards/thread_normal.html:30
470 470 msgid "posts to bumplimit"
471 471 msgstr "сообщений до бамплимита"
472 472
473 473 #: templates/boards/thread_normal.html:44
474 474 msgid "Reply to thread"
475 475 msgstr "Ответить в тему"
476 476
477 477 #: templates/boards/thread_normal.html:44
478 478 msgid "to message "
479 479 msgstr "на сообщение"
480 480
481 481 #: templates/boards/thread_normal.html:59
482 482 msgid "Close form"
483 483 msgstr "Закрыть форму"
484 484
485 485 #: templates/search/search.html:17
486 486 msgid "Ok"
487 487 msgstr "Ок"
488 488
489 489 #: utils.py:120
490 490 #, python-format
491 491 msgid "File must be less than %s but is %s."
492 492 msgstr "Файл должен быть менее %s, но его размер %s."
493 493
494 494 msgid "Please wait %(delay)d second before sending message"
495 495 msgid_plural "Please wait %(delay)d seconds before sending message"
496 496 msgstr[0] "Пожалуйста подождите %(delay)d секунду перед отправкой сообщения"
497 497 msgstr[1] "Пожалуйста подождите %(delay)d секунды перед отправкой сообщения"
498 498 msgstr[2] "Пожалуйста подождите %(delay)d секунд перед отправкой сообщения"
499 499
500 500 msgid "New threads"
501 501 msgstr "Новые темы"
502 502
503 503 #, python-format
504 504 msgid "Max file size is %(size)s."
505 505 msgstr "Максимальный размер файла %(size)s."
506 506
507 507 msgid "Size of media:"
508 508 msgstr "Размер медиа:"
509 509
510 510 msgid "Statistics"
511 511 msgstr "Статистика"
512 512
513 513 msgid "Invalid PoW."
514 514 msgstr "Неверный PoW."
515 515
516 516 msgid "Stale PoW."
517 517 msgstr "PoW устарел."
518 518
519 519 msgid "Show"
520 520 msgstr "Показывать"
521 521
522 522 msgid "Hide"
523 523 msgstr "Скрывать"
524 524
525 525 msgid "Add to favorites"
526 526 msgstr "Добавить в избранное"
527 527
528 528 msgid "Remove from favorites"
529 529 msgstr "Убрать из избранного"
530 530
531 531 msgid "Monochrome"
532 532 msgstr "Монохромный"
533 533
534 534 msgid "Subsections: "
535 535 msgstr "Подразделы: "
536
537 msgid "Change file source"
538 msgstr "Изменить источник файла"
@@ -1,155 +1,156 b''
1 1 .ui-button {
2 2 display: none;
3 3 }
4 4
5 5 .ui-dialog-content {
6 6 padding: 0;
7 7 min-height: 0;
8 8 }
9 9
10 10 .mark_btn {
11 11 cursor: pointer;
12 12 }
13 13
14 14 .img-full {
15 15 position: fixed;
16 16 background-color: #CCC;
17 17 border: 1px solid #000;
18 18 cursor: pointer;
19 19 }
20 20
21 21 .strikethrough {
22 22 text-decoration: line-through;
23 23 }
24 24
25 25 .post_preview {
26 26 z-index: 300;
27 27 position:absolute;
28 28 }
29 29
30 30 .gallery_image {
31 31 display: inline-block;
32 32 }
33 33
34 34 @media print {
35 35 .post-form-w {
36 36 display: none;
37 37 }
38 38 }
39 39
40 40 input[name="image"] {
41 41 display: block;
42 42 width: 100px;
43 43 height: 100px;
44 44 cursor: pointer;
45 45 position: absolute;
46 46 opacity: 0;
47 47 z-index: 1;
48 48 }
49 49
50 50 .file_wrap {
51 51 width: 100px;
52 52 height: 100px;
53 53 border: solid 1px white;
54 54 display: inline-block;
55 55 }
56 56
57 57 form > .file_wrap {
58 58 float: left;
59 59 }
60 60
61 61 .file-thumb {
62 62 width: 100px;
63 63 height: 100px;
64 64 background-size: cover;
65 65 background-position: center;
66 66 }
67 67
68 68 .compact-form-text {
69 69 margin-left:110px;
70 70 }
71 71
72 72 textarea, input {
73 73 -moz-box-sizing: border-box;
74 74 -webkit-box-sizing: border-box;
75 75 box-sizing: border-box;
76 76 }
77 77
78 78 .compact-form-text > textarea {
79 79 height: 100px;
80 80 width: 100%;
81 81 }
82 82
83 83 .post-button-form {
84 84 display: inline;
85 85 }
86 86
87 87 .post-button-form > button, #autoupdate {
88 88 border: none;
89 89 margin: inherit;
90 90 padding: inherit;
91 91 background: none;
92 92 font-size: inherit;
93 93 cursor: pointer;
94 94 }
95 95
96 96 #form-close-button {
97 97 display: none;
98 98 }
99 99
100 100 .post-image-full {
101 101 width: 100%;
102 102 height: auto;
103 103 }
104 104
105 105 #preview-text {
106 106 display: none;
107 107 }
108 108
109 109 .random-images-table {
110 110 text-align: center;
111 111 width: 100%;
112 112 }
113 113
114 114 .random-images-table > div {
115 115 margin-left: auto;
116 116 margin-right: auto;
117 117 }
118 118
119 119 .tag-image, .tag-text-data {
120 120 display: inline-block;
121 121 }
122 122
123 123 .tag-text-data > h2 {
124 124 margin: 0;
125 125 }
126 126
127 127 .tag-image {
128 128 margin-right: 5px;
129 129 }
130 130
131 131 .reply-to-message {
132 132 display: none;
133 133 }
134 134
135 135 .tripcode {
136 136 padding: 2px;
137 137 }
138 138
139 139 #fav-panel {
140 140 display: none;
141 141 margin: 1ex;
142 142 }
143 143
144 144 .hidden_post {
145 145 opacity: 0.2;
146 146 }
147 147
148 148 .hidden_post:hover {
149 149 opacity: 1;
150 150 }
151 151
152 152 .monochrome > .image > .thumb > img {
153 153 filter: grayscale(100%);
154 154 -webkit-filter: grayscale(100%);
155 155 }
156
@@ -1,95 +1,132 b''
1 var ITEM_FILE_SOURCE = 'fileSource';
2
1 3 $('input[name=image]').wrap($('<div class="file_wrap"></div>'));
2 4
3 5 $('body').on('change', 'input[name=image]', function(event) {
4 6 var file = event.target.files[0];
5 7
6 8 if(file.type.match('image.*')) {
7 9 var fileReader = new FileReader();
8 10
9 11 fileReader.addEventListener("load", function(event) {
10 12 var wrapper = $('.file_wrap');
11 13
12 14 wrapper.find('.file-thumb').remove();
13 15 wrapper.append(
14 16 $('<div class="file-thumb" style="background-image: url('+event.target.result+')"></div>')
15 17 );
16 18 });
17 19
18 20 fileReader.readAsDataURL(file);
19 21 }
20 22 });
21 23
22 24 var form = $('#form');
23 25 $('textarea').keypress(function(event) {
24 26 if (event.which == 13 && event.ctrlKey) {
25 27 form.find('input[type=submit]').click();
26 28 }
27 29 });
28 30
29 31 $('#preview-button').click(function() {
30 32 var data = {
31 33 raw_text: $('textarea').val()
32 34 }
33 35
34 36 var diffUrl = '/api/preview/';
35 37
36 38 $.post(diffUrl,
37 39 data,
38 40 function(data) {
39 41 var previewTextBlock = $('#preview-text');
40 42 previewTextBlock.html(data);
41 43 previewTextBlock.show();
42 44 })
43 45 });
44 46
45 47 /**
46 48 * Show text in the errors row of the form.
47 49 * @param form
48 50 * @param text
49 51 */
50 52 function showAsErrors(form, text) {
51 53 form.children('.form-errors').remove();
52 54
53 55 if (text.length > 0) {
54 56 var errorList = $('<div class="form-errors">' + text + '<div>');
55 57 errorList.appendTo(form);
56 58 }
57 59 }
58 60
59 61 function addHiddenInput(form, name, value) {
60 62 form.find('input[name=' + name + ']').val(value);
61 63 }
62 64
65 function selectFileChoice() {
66 var file_input = $('#id_file');
67 var url_input = $('#id_file_url');
68
69 var file_input_row = file_input.parent().parent();
70 var url_input_row = url_input.parent().parent();
71
72 file_input_row.toggle();
73 url_input_row.toggle();
74 url_input.val('');
75 file_input.val('');
76
77 var source;
78 if (file_input_row.is(':visible')) {
79 source = 'file';
80 } else {
81 source = 'url';
82 }
83 localStorage.setItem(ITEM_FILE_SOURCE, source);
84 }
85
63 86 $(document).ready(function() {
64 87 var powDifficulty = parseInt($('body').attr('data-pow-difficulty'));
65 88 if (powDifficulty > 0) {
66 89 var worker = new Worker($('#powScript').attr('src'));
67 90 worker.onmessage = function(e) {
68 91 var form = $('#form');
69 92 addHiddenInput(form, 'timestamp', e.data.timestamp);
70 93 addHiddenInput(form, 'iteration', e.data.iteration);
71 94 addHiddenInput(form, 'guess', e.data.guess);
72 95
73 96 form.submit();
74 97 $('.post-form-w').unblock();
75 98 };
76 99
77 100 var form = $('#form');
78 101 var submitButton = form.find('input[type=submit]');
79 102 submitButton.click(function() {
80 103 showAsErrors(form, gettext('Computing PoW...'));
81 104 $('.post-form-w').block({ message: gettext('Computing PoW...') })
82 105
83 106 var msg = $('textarea').val().trim();
84 107
85 108 var data = {
86 109 msg: msg,
87 110 difficulty: parseInt($('body').attr('data-pow-difficulty')),
88 111 hasher: $('#sha256Script').attr('src')
89 112 };
90 113 worker.postMessage(data);
91 114
92 115 return false;
93 116 });
94 117 }
118
119 var source = localStorage.getItem(ITEM_FILE_SOURCE);
120 if (source == null) {
121 source = 'file';
122 }
123 if (source == 'file') {
124 $('#id_file_url').parent().parent().hide();
125 } else {
126 $('#id_file').parent().parent().hide();
127 }
128
129 $('#file-source-button').click(function() {
130 selectFileChoice();
131 });
95 132 });
@@ -1,210 +1,211 b''
1 1 {% extends "boards/base.html" %}
2 2
3 3 {% load i18n %}
4 4 {% load board %}
5 5 {% load static %}
6 6 {% load tz %}
7 7
8 8 {% block head %}
9 9 <meta name="robots" content="noindex">
10 10
11 11 {% if tag %}
12 12 <title>{{ tag.name }} - {{ site_name }}</title>
13 13 {% else %}
14 14 <title>{{ site_name }}</title>
15 15 {% endif %}
16 16
17 17 {% if prev_page_link %}
18 18 <link rel="prev" href="{{ prev_page_link }}" />
19 19 {% endif %}
20 20 {% if next_page_link %}
21 21 <link rel="next" href="{{ next_page_link }}" />
22 22 {% endif %}
23 23
24 24 {% endblock %}
25 25
26 26 {% block content %}
27 27
28 28 {% get_current_language as LANGUAGE_CODE %}
29 29 {% get_current_timezone as TIME_ZONE %}
30 30
31 31 {% for banner in banners %}
32 32 <div class="post">
33 33 <div class="title">{{ banner.title }}</div>
34 34 <div>{{ banner.get_text|safe }}</div>
35 35 <div>{% trans 'Details' %}: <a href="{{ banner.post.get_absolute_url }}">>>{{ banner.post.id }}</a></div>
36 36 </div>
37 37 {% endfor %}
38 38
39 39 {% if tag %}
40 40 <div class="tag_info" style="border-bottom: solid .5ex #{{ tag.get_color }}">
41 41 {% if random_image_post %}
42 42 <div class="tag-image">
43 43 {% with image=random_image_post.images.first %}
44 44 <a href="{{ random_image_post.get_absolute_url }}"><img
45 45 src="{{ image.image.url_200x150 }}"
46 46 width="{{ image.pre_width }}"
47 47 height="{{ image.pre_height }}"
48 48 alt="{{ random_image_post.id }}"/></a>
49 49 {% endwith %}
50 50 </div>
51 51 {% endif %}
52 52 <div class="tag-text-data">
53 53 <h2>
54 54 /{{ tag.get_view|safe }}/
55 55 {% if perms.change_tag %}
56 56 <span class="moderator_info">| <a href="{% url 'admin:boards_tag_change' tag.id %}">{% trans 'Edit tag' %}</a></span>
57 57 {% endif %}
58 58 </h2>
59 59 <p>
60 60 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
61 61 {% if is_favorite %}
62 62 <button name="method" value="unsubscribe" class="fav">★ {% trans "Remove from favorites" %}</button>
63 63 {% else %}
64 64 <button name="method" value="subscribe" class="not_fav">★ {% trans "Add to favorites" %}</button>
65 65 {% endif %}
66 66 </form>
67 67 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
68 68 {% if is_hidden %}
69 69 <button name="method" value="unhide" class="fav">{% trans "Show" %}</button>
70 70 {% else %}
71 71 <button name="method" value="hide" class="not_fav">{% trans "Hide" %}</button>
72 72 {% endif %}
73 73 </form>
74 74 <a href="{% url 'tag_gallery' tag.name %}">{% trans 'Gallery' %}</a>
75 75 </p>
76 76 {% if tag.get_description %}
77 77 <p>{{ tag.get_description|safe }}</p>
78 78 {% endif %}
79 79 <p>
80 80 {% with active_count=tag.get_active_thread_count bumplimit_count=tag.get_bumplimit_thread_count archived_count=tag.get_archived_thread_count %}
81 81 {% if active_count %}
82 82 {% blocktrans count count=active_count %}{{ count }} active thread{% plural %}active threads{% endblocktrans %},
83 83 {% endif %}
84 84 {% if bumplimit_count %}
85 85 {% blocktrans count count=bumplimit_count %}{{ count }} thread in bumplimit{% plural %} threads in bumplimit{% endblocktrans %},
86 86 {% endif %}
87 87 {% if archived_count %}
88 88 {% blocktrans count count=archived_count %}{{ count }} archived thread{% plural %}archived threads{% endblocktrans %},
89 89 {% endif %}
90 90 {% endwith %}
91 91 {% blocktrans count count=tag.get_post_count %}{{ count }} message{% plural %}messages{% endblocktrans %}.
92 92 </p>
93 93 {% if tag.get_all_parents %}
94 94 <p>
95 95 {% for parent in tag.get_all_parents %}
96 96 {{ parent.get_view|safe }} &gt;
97 97 {% endfor %}
98 98 {{ tag.get_view|safe }}
99 99 </p>
100 100 {% endif %}
101 101 {% if tag.get_children.all %}
102 102 <p>
103 103 {% trans "Subsections: " %}
104 104 {% for child in tag.get_children.all %}
105 105 {{ child.get_view|safe }}{% if not forloop.last%}, {% endif %}
106 106 {% endfor %}
107 107 </p>
108 108 {% endif %}
109 109 </div>
110 110 </div>
111 111 {% endif %}
112 112
113 113 {% if threads %}
114 114 {% if prev_page_link %}
115 115 <div class="page_link">
116 116 <a href="{{ prev_page_link }}">{% trans "Previous page" %}</a>
117 117 </div>
118 118 {% endif %}
119 119
120 120 {% for thread in threads %}
121 121 <div class="thread">
122 122 {% post_view thread.get_opening_post thread=thread truncated=True need_open_link=True %}
123 123 {% if not thread.archived %}
124 124 {% with last_replies=thread.get_last_replies %}
125 125 {% if last_replies %}
126 126 {% with skipped_replies_count=thread.get_skipped_replies_count %}
127 127 {% if skipped_replies_count %}
128 128 <div class="skipped_replies">
129 129 <a href="{% url 'thread' thread.get_opening_post_id %}">
130 130 {% blocktrans count count=skipped_replies_count %}Skipped {{ count }} reply. Open thread to see all replies.{% plural %}Skipped {{ count }} replies. Open thread to see all replies.{% endblocktrans %}
131 131 </a>
132 132 </div>
133 133 {% endif %}
134 134 {% endwith %}
135 135 <div class="last-replies">
136 136 {% for post in last_replies %}
137 137 {% post_view post truncated=True %}
138 138 {% endfor %}
139 139 </div>
140 140 {% endif %}
141 141 {% endwith %}
142 142 {% endif %}
143 143 </div>
144 144 {% endfor %}
145 145
146 146 {% if next_page_link %}
147 147 <div class="page_link">
148 148 <a href="{{ next_page_link }}">{% trans "Next page" %}</a>
149 149 </div>
150 150 {% endif %}
151 151 {% else %}
152 152 <div class="post">
153 153 {% trans 'No threads exist. Create the first one!' %}</div>
154 154 {% endif %}
155 155
156 156 <div class="post-form-w">
157 157 <script src="{% static 'js/panel.js' %}"></script>
158 158 <div class="post-form">
159 159 <div class="form-title">{% trans "Create new thread" %}</div>
160 160 <div class="swappable-form-full">
161 161 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
162 162 {{ form.as_div }}
163 163 <div class="form-submit">
164 164 <input type="submit" value="{% trans "Post" %}"/>
165 165 <button id="preview-button" onclick="return false;">{% trans 'Preview' %}</button>
166 <button id="file-source-button" onclick="return false;">{% trans 'Change file source' %}</button>
166 167 </div>
167 168 </form>
168 169 </div>
169 170 <div>
170 171 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
171 172 {% with size=max_file_size|filesizeformat %}
172 173 {% blocktrans %}Max file size is {{ size }}.{% endblocktrans %}
173 174 {% endwith %}
174 175 </div>
175 176 <div id="preview-text"></div>
176 177 <div><a href="{% url "staticpage" name="help" %}">{% trans 'Text syntax' %}</a></div>
177 178 <div><a href="{% url "tags" "required" %}">{% trans 'Tags' %}</a></div>
178 179 </div>
179 180 </div>
180 181
181 182 <script src="{% static 'js/form.js' %}"></script>
182 183 <script id="sha256Script" src="{% static 'js/3party/sha256.js' %}"></script>
183 184 <script id="powScript" src="{% static 'js/proof_of_work.js' %}"></script>
184 185 <script src="{% static 'js/3party/jquery.blockUI.js' %}"></script>
185 186 <script src="{% static 'js/thread_create.js' %}"></script>
186 187
187 188 {% endblock %}
188 189
189 190 {% block metapanel %}
190 191
191 192 <span class="metapanel">
192 193 <b><a href="{% url "authors" %}">{{ site_name }}</a> {{ version }}</b>
193 194 {% trans "Pages:" %}
194 195 [
195 196 {% with dividers=paginator.get_dividers %}
196 197 {% for page in paginator.get_divided_range %}
197 198 {% if page in dividers %}
198 199 …,
199 200 {% endif %}
200 201 <a
201 202 {% ifequal page current_page.number %}
202 203 class="current_page"
203 204 {% endifequal %}
204 205 href="{% page_url paginator page %}">{{ page }}</a>{% if not forloop.last %},{% endif %}
205 206 {% endfor %}
206 207 {% endwith %}
207 208 ]
208 209 </span>
209 210
210 211 {% endblock %}
@@ -1,79 +1,80 b''
1 1 {% extends "boards/thread.html" %}
2 2
3 3 {% load i18n %}
4 4 {% load static from staticfiles %}
5 5 {% load board %}
6 6 {% load tz %}
7 7
8 8 {% block thread_content %}
9 9 {% get_current_language as LANGUAGE_CODE %}
10 10 {% get_current_timezone as TIME_ZONE %}
11 11
12 12 <div class="tag_info">
13 13 <h2>
14 14 <form action="{% url 'thread' opening_post.id %}" method="post" class="post-button-form">
15 15 {% csrf_token %}
16 16 {% if is_favorite %}
17 17 <button name="method" value="unsubscribe" class="fav"></button>
18 18 {% else %}
19 19 <button name="method" value="subscribe" class="not_fav"></button>
20 20 {% endif %}
21 21 </form>
22 22 {{ opening_post.get_title_or_text }}
23 23 </h2>
24 24 </div>
25 25
26 26 {% if bumpable and thread.has_post_limit %}
27 27 <div class="bar-bg">
28 28 <div class="bar-value" style="width:{{ bumplimit_progress }}%" id="bumplimit_progress">
29 29 </div>
30 30 <div class="bar-text">
31 31 <span id="left_to_limit">{{ posts_left }}</span> {% trans 'posts to bumplimit' %}
32 32 </div>
33 33 </div>
34 34 {% endif %}
35 35
36 36 <div class="thread">
37 37 {% for post in thread.get_replies %}
38 38 {% post_view post reply_link=True %}
39 39 {% endfor %}
40 40 </div>
41 41
42 42 {% if not thread.is_archived %}
43 43 <div class="post-form-w">
44 44 <script src="{% static 'js/panel.js' %}"></script>
45 45 <div class="form-title">{% trans "Reply to thread" %} #{{ opening_post.id }}<span class="reply-to-message"> {% trans "to message " %} #<span id="reply-to-message-id"></span></span></div>
46 46 <div class="post-form" id="compact-form">
47 47 <div class="swappable-form-full">
48 48 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
49 49 <div class="compact-form-text"></div>
50 50 {{ form.as_div }}
51 51 <div class="form-submit">
52 52 <input type="submit" value="{% trans "Post" %}"/>
53 53 <button id="preview-button" onclick="return false;">{% trans 'Preview' %}</button>
54 <button id="file-source-button" onclick="return false;">{% trans 'Change file source' %}</button>
54 55 </div>
55 56 </form>
56 57 </div>
57 58 <div id="preview-text"></div>
58 59 <div>
59 60 {% with size=max_file_size|filesizeformat %}
60 61 {% blocktrans %}Max file size is {{ size }}.{% endblocktrans %}
61 62 {% endwith %}
62 63 </div>
63 64 <div><a href="{% url "staticpage" name="help" %}">
64 65 {% trans 'Text syntax' %}</a></div>
65 66 <div><a id="form-close-button" href="#" onClick="resetFormPosition(); return false;">{% trans 'Close form' %}</a></div>
66 67 </div>
67 68 </div>
68 69
69 70 <script src="{% static 'js/form.js' %}"></script>
70 71 <script src="{% static 'js/jquery.form.min.js' %}"></script>
71 72 <script id="sha256Script" src="{% static 'js/3party/sha256.js' %}"></script>
72 73 <script id="powScript" src="{% static 'js/proof_of_work.js' %}"></script>
73 74 <script src="{% static 'js/3party/jquery.blockUI.js' %}"></script>
74 75 <script src="{% static 'js/thread.js' %}"></script>
75 76 <script src="{% static 'js/thread_update.js' %}"></script>
76 77 {% endif %}
77 78
78 79 <script src="{% static 'js/3party/centrifuge.js' %}"></script>
79 80 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now