redmine_apijs 6.9.7 → 6.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +4 -5
- data/README +0 -1
- data/assets/javascripts/apijs-redmine.js +3 -3
- data/assets/javascripts/apijs-redmine.min.js.map +1 -1
- data/assets/javascripts/apijs.min.js +2 -2
- data/assets/javascripts/apijs.min.js.map +1 -1
- data/assets/stylesheets/apijs-print.min.css +1 -1
- data/assets/stylesheets/apijs-print.min.css.map +1 -1
- data/assets/stylesheets/apijs-screen-rtl.min.css +2 -2
- data/assets/stylesheets/apijs-screen-rtl.min.css.map +1 -1
- data/assets/stylesheets/apijs-screen.min.css +2 -2
- data/assets/stylesheets/apijs-screen.min.css.map +1 -1
- data/config/locales/ja.yml +1 -1
- data/init.rb +2 -2
- data/redmine_apijs.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1045d2574c7857ca9bcb2b01484ef4be1c6d9fdd68e0f047274d5ad03e953e5
|
4
|
+
data.tar.gz: fc6a479a25b69c33bda077f01f6a2900ed14ba63c3b6e98b0358bc1485422adf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a82ee41ed1810e63a5c804aeee9f32254ce5144474fdc9fbe579eaf57d706e0228ec1695bb2bff80e50eb93d5215e70c87626e3d9e782182c20594b43415113e
|
7
|
+
data.tar.gz: ea7b4eedfec3f5564d6246652335be436fd15eabe7ce7d5c63c841c9a5d396ac2f51f634e0272f76f4639c14c13bf9c863694e861689163d7084223664721a20
|
data/LICENSE
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Version 2, June 1991
|
3
3
|
|
4
4
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
5
|
-
|
5
|
+
<https://fsf.org/>
|
6
6
|
Everyone is permitted to copy and distribute verbatim copies
|
7
7
|
of this license document, but changing it is not allowed.
|
8
8
|
|
@@ -304,8 +304,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
|
304
304
|
GNU General Public License for more details.
|
305
305
|
|
306
306
|
You should have received a copy of the GNU General Public License along
|
307
|
-
with this program; if not,
|
308
|
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
307
|
+
with this program; if not, see <https://www.gnu.org/licenses/>.
|
309
308
|
|
310
309
|
Also add information on how to contact you by electronic and paper mail.
|
311
310
|
|
@@ -329,8 +328,8 @@ necessary. Here is a sample; alter the names:
|
|
329
328
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330
329
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331
330
|
|
332
|
-
<signature of
|
333
|
-
|
331
|
+
<signature of Moe Ghoul>, 1 April 1989
|
332
|
+
Moe Ghoul, President of Vice
|
334
333
|
|
335
334
|
This General Public License does not permit incorporating your program into
|
336
335
|
proprietary programs. If your program is a subroutine library, you may
|
data/README
CHANGED
@@ -29,7 +29,6 @@ Depends
|
|
29
29
|
Notes
|
30
30
|
- For the app, read: https://www.luigifab.fr/apijs
|
31
31
|
- For the Redmine plugin, read: https://www.luigifab.fr/redmine/apijs
|
32
|
-
- For the Maho module, read: https://www.luigifab.fr/maho/apijs
|
33
32
|
- For the OpenMage module, read: https://www.luigifab.fr/openmage/apijs
|
34
33
|
- For the Dolibarr module, read install: https://www.luigifab.fr/apijs
|
35
34
|
- For the Symfony bundle, read install: https://www.luigifab.fr/apijs
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* Created D/15/12/2013
|
3
|
-
* Updated
|
3
|
+
* Updated L/28/07/2025
|
4
4
|
*
|
5
5
|
* Copyright 2008-2025 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
|
6
6
|
* https://github.com/luigifab/redmine-apijs
|
@@ -110,7 +110,7 @@ var apijsRedmine = new (function () {
|
|
110
110
|
apijs.dialog.dialogInformation(apijs.i18n.translate(252), data, 'error');
|
111
111
|
}
|
112
112
|
else {
|
113
|
-
apijs.dialog.remove('lock');
|
113
|
+
apijs.dialog.remove('lock');
|
114
114
|
self.location.reload();
|
115
115
|
}
|
116
116
|
};
|
@@ -313,7 +313,7 @@ var apijsRedmine = new (function () {
|
|
313
313
|
};
|
314
314
|
|
315
315
|
this.actionClearCache = function (args) {
|
316
|
-
apijs.dialog.remove('waiting', 'lock');
|
316
|
+
apijs.dialog.remove('waiting', 'lock');
|
317
317
|
self.location.href = args;
|
318
318
|
};
|
319
319
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["apijs-redmine.js"],"sourcesContent":["/**\n * Created D/15/12/2013\n * Updated D/03/12/2023\n *\n * Copyright 2008-2025 | Fabrice Creuzot (luigifab) <code~luigifab~fr>\n * https://github.com/luigifab/redmine-apijs\n *\n * This program is free software, you can redistribute it or modify\n * it under the terms of the GNU General Public License (GPL) as published\n * by the free software foundation, either version 2 of the license, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but without any warranty, without even the implied warranty of\n * merchantability or fitness for a particular purpose. See the\n * GNU General Public License (GPL) for more details.\n */\n\nvar apijsRedmine = new (function () {\n\n\t\"use strict\";\n\n\tthis.init = function () {\n\n\t\tvar d = apijs.i18n.data;\n\t\tif (!d.frca) d.frca = {};\n\t\t// @see https://docs.google.com/spreadsheets/d/1UUpKZ-YAAlcfvGHYwt6aUM9io390j0-fIL0vMRh1pW0/edit?usp=sharing\n\t\t// auto start\n\t\td.cs[250] = \"Smazat soubor\";\n\t\td.cs[251] = \"Opravdu chcete tento soubor smazat?[br]Pozor, tuto operaci nelze vrátit zpět.\";\n\t\td.cs[252] = \"Chyba\";\n\t\td.de[250] = \"Eine Datei löschen\";\n\t\td.de[251] = \"Sind Sie sicher, dass Sie diese Datei löschen möchten?[br]Achtung, diese Aktion ist unrückgängig.\";\n\t\td.de[252] = \"Fehler\";\n\t\td.de[253] = \"Sie verfügen nicht über die notwendigen Rechte um diese Operation durchzuführen, bitte [a §]aktualisieren Sie die Seite[/a].\";\n\t\td.de[254] = \"Es tut uns leid, diese Datei existiert nicht mehr, bitte [a §]aktualisieren Sie die Seite[/a].\";\n\t\td.de[255] = \"Eine Beschreibung bearbeiten\";\n\t\td.de[256] = \"Bitte geben Sie weiter unten die neue Beschreibung für diese Datei an. Um die Beschreibung zu löschen lassen Sie das Feld leer.\";\n\t\td.el[252] = \"Σφάλμα\";\n\t\td.en[250] = \"Remove file\";\n\t\td.en[251] = \"Are you sure you want to remove this file?[br]Be careful, you can't cancel this operation.\";\n\t\td.en[252] = \"Error\";\n\t\td.en[253] = \"You are not authorized to perform this operation, please [a §]refresh the page[/a].\";\n\t\td.en[254] = \"Sorry, the file no longer exists, please [a §]refresh the page[/a].\";\n\t\td.en[255] = \"Edit description\";\n\t\td.en[256] = \"Enter below the new description for the file. To remove the description, leave the field empty.\";\n\t\td.en[257] = \"Rename file\";\n\t\td.en[258] = \"Enter below the new name for the file.\";\n\t\td.en[259] = \"Clear cache\";\n\t\td.en[260] = \"Are you sure you want to clear the cache?[br]Be careful, you can't cancel this operation.\";\n\t\td.es[250] = \"Borrar un archivo\";\n\t\td.es[251] = \"¿Está usted seguro(a) de que desea eliminar este archivo?[br]Atención, pues no podrá cancelar esta operación.\";\n\t\td.es[253] = \"No está autorizado-a para llevar a cabo esta operación, por favor [a §]actualice la página[/a].\";\n\t\td.es[254] = \"Disculpe, pero el archivo ya no existe, por favor [a §]actualice la página[/a].\";\n\t\td.es[255] = \"Editar una descripción\";\n\t\td.es[256] = \"Introduzca a continuación la nueva descripción para el archivo. Para eliminar la descripción, deje el campo en blanco.\";\n\t\td.es[259] = \"Vaciar la caché\";\n\t\td.es[260] = \"¿Está usted seguro(a) de querer vaciar la caché?[br]Cuidado, esta operación no puede ser cancelada.\";\n\t\td.fr[250] = \"Supprimer le fichier\";\n\t\td.fr[251] = \"Êtes-vous sûr(e) de vouloir supprimer ce fichier ?[br]Attention, cette opération n'est pas annulable.\";\n\t\td.fr[252] = \"Erreur\";\n\t\td.fr[253] = \"Vous n'êtes pas autorisé(e) à effectuer cette opération, veuillez [a §]actualiser la page[/a].\";\n\t\td.fr[254] = \"Désolé, le fichier n'existe plus, veuillez [a §]actualiser la page[/a].\";\n\t\td.fr[255] = \"Modifier la description\";\n\t\td.fr[256] = \"Saisissez ci-dessous la nouvelle description pour ce fichier. Pour supprimer la description, laissez le champ vide.\";\n\t\td.fr[257] = \"Renommer le fichier\";\n\t\td.fr[258] = \"Saisissez ci-dessous le nouveau nom pour ce fichier.\";\n\t\td.fr[259] = \"Vider le cache\";\n\t\td.fr[260] = \"Êtes-vous certain(e) de vouloir vider le cache ?[br]Attention, cette opération n'est pas annulable.\";\n\t\td.hu[252] = \"Hiba\";\n\t\td.it[250] = \"Cancella i file\";\n\t\td.it[251] = \"Sei sicura di voler eliminare il file?[br]Attenzione, questa operazione non può essere annullata.\";\n\t\td.it[252] = \"Errore\";\n\t\td.it[253] = \"Non siete autorizzati a eseguire questa operazione, vi preghiamo di [a §]ricaricare la pagina[/a].\";\n\t\td.it[254] = \"Spiacenti, il file non esiste più, vi preghiamo di [a §]ricaricare la pagina[/a].\";\n\t\td.it[255] = \"Modificare una descrizione\";\n\t\td.it[256] = \"Inserire qui sotto la nuova descrizione del file. Per cancellare la descrizione, lasciate lo spazio vuoto.\";\n\t\td.ja[250] = \"ファイルを削除\";\n\t\td.ja[252] = \"エラー\";\n\t\td.nl[252] = \"Fout\";\n\t\td.pl[250] = \"Usuń plik\";\n\t\td.pl[251] = \"Jesteś pewny, że chcesz usunąć ten plik?[br]Uwaga! Nie ma odwrotu od tej operacji.\";\n\t\td.pl[252] = \"Błąd\";\n\t\td.pt[250] = \"Suprimir um ficheiro\";\n\t\td.pt[251] = \"Tem certeza de que quer suprimir este ficheiro?[br]Cuidado, não pode cancelar esta operação.\";\n\t\td.pt[252] = \"Erro\";\n\t\td.pt[253] = \"Não é autorizado(a) para efetuar esta operação, por favor [a §]atualize a página[/a].\";\n\t\td.pt[254] = \"Lamento, o ficheiro já não existe, por favor [a §]atualize a página[/a].\";\n\t\td.pt[255] = \"Modificar uma descrição\";\n\t\td.pt[256] = \"Digite abaixo a nova descrição para este ficheiro. Para suprimir a descrição, deixe o campo vazio.\";\n\t\td.ro[252] = \"Eroare\";\n\t\td.ru[250] = \"Удалить файл\";\n\t\td.ru[251] = \"Вы уверены, что хотите удалить этот файл?[br]Осторожно, вы не сможете отменить эту операцию.\";\n\t\td.ru[252] = \"Ошибка\";\n\t\td.ru[253] = \"Вы не авторизованы для выполнения этой операции, пожалуйста [a §]обновите страницу[/a].\";\n\t\td.ru[254] = \"Извините, но файл не существует, пожалуйста [a §]обновите страницу[/a].\";\n\t\td.ru[255] = \"Редактировать описание\";\n\t\td.ru[256] = \"Ниже введите новое описание файла. Оставьте поле пустым, чтобы удалить описание.\";\n\t\td.sk[252] = \"Chyba\";\n\t\td.tr[252] = \"Hata\";\n\t\td.tr[259] = \"Önbelleği temizle\";\n\t\td.uk[252] = \"Помилка\";\n\t\td.zh[252] = \"错误信息\";\n\t\t// auto end\n\t};\n\n\tthis.error = function (data) {\n\n\t\tif ((typeof data == 'string') && (data.indexOf('<!DOCTYPE') < 0)) {\n\t\t\tapijs.dialog.dialogInformation(apijs.i18n.translate(252), data, 'error');\n\t\t}\n\t\telse {\n\t\t\tapijs.dialog.remove('lock'); // obligatoire sinon demande de confirmation de quitter la page\n\t\t\tself.location.reload();\n\t\t}\n\t};\n\n\tthis.editAttachment = function (elem, id, action, token) {\n\n\t\tvar desc, text, title = apijs.i18n.translate(255);\n\n\t\tdesc = elem.parentNode.parentNode.querySelector('.description').textContent.trim();\n\t\ttext = '[p][label for=\"apijsinput\"]' + apijs.i18n.translate(256) + '[/label][/p]' +\n\t\t\t\t'[input type=\"text\" name=\"description\" value=\"' + desc + '\" spellcheck=\"true\" id=\"apijsinput\"]';\n\n\t\tapijs.dialog.dialogFormOptions(title, text, action, apijsRedmine.actionEditAttachment, [id, action, token], 'editattach');\n\t\tapijs.dialog.t1.querySelector('input').select();\n\t};\n\n\tthis.actionEditAttachment = function (action, args) {\n\n\t\t// vérification de la nouvelle description\n\t\tif (typeof action == 'boolean') {\n\t\t\treturn true;\n\t\t}\n\t\t// sauvegarde de la nouvelle description\n\t\telse if (typeof action == 'string') {\n\n\t\t\t// args = [id, action, token]\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', args[1] + '?id=' + args[0] + '&isAjax=true', true);\n\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\txhr.setRequestHeader('X-CSRF-Token', args[2]);\n\n\t\t\txhr.onreadystatechange = function () {\n\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\tif ([0, 200].has(xhr.status)) {\n\t\t\t\t\t\tif (xhr.responseText.indexOf('attachmentId') === 0) {\n\n\t\t\t\t\t\t\t// extrait l'id et la description du fichier enregistré\n\t\t\t\t\t\t\tvar elem, id, text;\n\t\t\t\t\t\t\tid = xhr.responseText.slice(0, xhr.responseText.indexOf(':'));\n\t\t\t\t\t\t\ttext = xhr.responseText.slice(xhr.responseText.indexOf(':') + 1);\n\n\t\t\t\t\t\t\t// description\n\t\t\t\t\t\t\telem = document.getElementById(id);\n\t\t\t\t\t\t\telem.querySelector('.description').textContent = text;\n\n\t\t\t\t\t\t\t// input type hidden\n\t\t\t\t\t\t\telem = elem.querySelector('input');\n\t\t\t\t\t\t\tif (elem)\n\t\t\t\t\t\t\t\telem.value = elem.value.slice(0, elem.value.lastIndexOf('|') + 1) + text;\n\n\t\t\t\t\t\t\tapijs.dialog.actionClose();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tapijsRedmine.error(xhr.responseText);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tapijsRedmine.error(xhr.status);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send('desc=' + encodeURIComponent(document.getElementById('apijsinput').value));\n\t\t}\n\t};\n\n\tthis.renameAttachment = function (elem, id, action, token) {\n\n\t\tvar name, text, title = apijs.i18n.translate(257);\n\n\t\tname = elem.parentNode.parentNode.querySelector('.filename').textContent.trim();\n\t\ttext = '[p][label for=\"apijsinput\"]' + apijs.i18n.translate(258) + '[/label][/p]' +\n\t\t\t\t'[input type=\"text\" name=\"name\" value=\"' + name + '\" spellcheck=\"false\" id=\"apijsinput\"]';\n\n\t\tapijs.dialog.dialogFormOptions(title, text, action, apijsRedmine.actionRenameAttachment, [id, action, token], 'editattach');\n\t};\n\n\tthis.actionRenameAttachment = function (action, args) {\n\n\t\t// vérification du nouveau nom\n\t\tif (typeof action == 'boolean') {\n\t\t\treturn true;\n\t\t}\n\t\t// sauvegarde du nouveau nom\n\t\telse if (typeof action == 'string') {\n\n\t\t\t// args = [id, action, token]\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', args[1] + '?id=' + args[0] + '&isAjax=true', true);\n\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\txhr.setRequestHeader('X-CSRF-Token', args[2]);\n\n\t\t\txhr.onreadystatechange = function () {\n\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\tif ([0, 200].has(xhr.status)) {\n\t\t\t\t\t\tif (xhr.responseText.indexOf('attachmentId') === 0) {\n\n\t\t\t\t\t\t\t// extrait l'id et le nom du fichier enregistré\n\t\t\t\t\t\t\tvar elem, id, name, subelem, text;\n\t\t\t\t\t\t\tid = xhr.responseText.slice(0, xhr.responseText.indexOf(':'));\n\t\t\t\t\t\t\tname = xhr.responseText.slice(xhr.responseText.indexOf(':') + 1);\n\n\t\t\t\t\t\t\t// nom\n\t\t\t\t\t\t\telem = document.getElementById(id);\n\t\t\t\t\t\t\telem.querySelector('.filename').textContent = name;\n\n\t\t\t\t\t\t\t// URLs sur a/href et input/value et button.download/onclick et button.show/onclick\n\t\t\t\t\t\t\t// pas de maj de src et srcset sur img pour éviter un appel réseau inutile\n\t\t\t\t\t\t\tsubelem = elem.querySelector('input');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('value');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('value', name + text.substring(text.indexOf('|')));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubelem = elem.querySelector('a');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('href');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('href', text.substring(0, text.lastIndexOf('/') + 1) + name);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubelem = elem.querySelector('button.download');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('onclick');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('onclick', text.substring(0, text.lastIndexOf('/') + 1) + name + \"';\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubelem = elem.querySelector('button.show');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('onclick');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('onclick', text.substring(0, text.lastIndexOf('/') + 1) + name + \"';\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tapijs.dialog.actionClose();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tapijsRedmine.error(xhr.responseText);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tapijsRedmine.error(xhr.status);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send('name=' + encodeURIComponent(document.getElementById('apijsinput').value));\n\t\t}\n\t};\n\n\tthis.removeAttachment = function (elem, id, action, token) {\n\t\tapijs.dialog.dialogConfirmation(apijs.i18n.translate(250), apijs.i18n.translate(251), apijsRedmine.actionRemoveAttachment, [id, action, token]);\n\t};\n\n\tthis.actionRemoveAttachment = function (args) {\n\n\t\t// args = [id, action, token]\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open('POST', args[1] + '?id=' + args[0] + '&isAjax=true', true);\n\t\txhr.setRequestHeader('X-CSRF-Token', args[2]);\n\n\t\txhr.onreadystatechange = function () {\n\n\t\t\tif (xhr.readyState === 4) {\n\t\t\t\tif ([0, 200].has(xhr.status)) {\n\t\t\t\t\tif (xhr.responseText.indexOf('attachmentId') === 0) {\n\n\t\t\t\t\t\t// supprime le fichier de la page grâce à son id\n\t\t\t\t\t\tvar attachment = document.getElementById(xhr.responseText), elems = attachment.parentNode, idx = 0;\n\t\t\t\t\t\tattachment.remove();\n\n\t\t\t\t\t\t// supprime la liste des fichiers\n\t\t\t\t\t\tif (elems.querySelectorAll('dl, li').length < 1) {\n\t\t\t\t\t\t\telems.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// ou réattribue les ids du diaporama (pas de réinitialisation, on remet juste les ids en place)\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\telems.querySelectorAll('a[id][type]').forEach(function (elem) {\n\t\t\t\t\t\t\t\telem.setAttribute('id', elem.getAttribute('id').slice(0, elem.getAttribute('id').lastIndexOf('.') + 1) + idx++);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tapijs.dialog.actionClose();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tapijsRedmine.error(xhr.responseText);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tapijsRedmine.error(xhr.status);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\txhr.send();\n\t};\n\n\tthis.clearCache = function (action) {\n\t\tapijs.dialog.dialogConfirmation(apijs.i18n.translate(259), apijs.i18n.translate(260), apijsRedmine.actionClearCache, action);\n\t};\n\n\tthis.actionClearCache = function (args) {\n\t\tapijs.dialog.remove('waiting', 'lock'); // obligatoire sinon demande de confirmation de quitter la page\n\t\tself.location.href = args;\n\t};\n\n})();\n\nif (typeof self.addEventListener == 'function')\n\tself.addEventListener('apijsload', apijsRedmine.init.bind(apijsRedmine));"],"names":["apijsRedmine","this","init","d","apijs","i18n","data","frca","cs","de","el","en","es","fr","hu","it","ja","nl","pl","pt","ro","ru","sk","tr","uk","zh","error","indexOf","dialog","dialogInformation","translate","remove","self","location","reload","editAttachment","elem","id","action","token","title","desc","parentNode","querySelector","textContent","trim","text","dialogFormOptions","actionEditAttachment","t1","select","args","xhr","XMLHttpRequest","open","setRequestHeader","onreadystatechange","readyState","has","status","responseText","slice","document","getElementById","value","lastIndexOf","actionClose","send","encodeURIComponent","renameAttachment","name","actionRenameAttachment","subelem","getAttribute","setAttribute","substring","removeAttachment","dialogConfirmation","actionRemoveAttachment","attachment","elems","idx","querySelectorAll","length","forEach","clearCache","actionClearCache","href","addEventListener","bind"],"mappings":";;;;;GAkBA;IAAIA,aAAe,IAAI,WAItBC,KAAKC,KAAO,WAEX,IAAIC,EAAIC,MAAMC,KAAKC,KACdH,EAAEI,OAAMJ,EAAEI,KAAO,IAGtBJ,EAAEK,GAAG,KAAO,gBACZL,EAAEK,GAAG,KAAO,gFACZL,EAAEK,GAAG,KAAO,QACZL,EAAEM,GAAG,KAAO,qBACZN,EAAEM,GAAG,KAAO,oGACZN,EAAEM,GAAG,KAAO,SACZN,EAAEM,GAAG,KAAO,+HACZN,EAAEM,GAAG,KAAO,iGACZN,EAAEM,GAAG,KAAO,+BACZN,EAAEM,GAAG,KAAO,kIACZN,EAAEO,GAAG,KAAO,SACZP,EAAEQ,GAAG,KAAO,cACZR,EAAEQ,GAAG,KAAO,6FACZR,EAAEQ,GAAG,KAAO,QACZR,EAAEQ,GAAG,KAAO,sFACZR,EAAEQ,GAA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AAC,EAAIgB,CAAG,EAAE,CAC/G,CAAC,EAGF7E,MAAMwB,OAAOsC,YAAY,GAGzBlE,aAAa0B,MAAM0B,EAAIQ,YAAY,EAIpC5D,aAAa0B,MAAM0B,EAAIO,MAAM,EAGhC,EAEAP,EAAIe,KAAK,CACV,EAEAlE,KAAKoF,WAAa,SAAU/C,GAC3BlC,MAAMwB,OAAOiD,mBAAmBzE,MAAMC,KAAKyB,UAAU,GAAG,EAAG1B,MAAMC,KAAKyB,UAAU,GAAG,EAAG9B,aAAasF,iBAAkBhD,CAAM,CAC5H,EAEArC,KAAKqF,iBAAmB,SAAUnC,GACjC/C,MAAMwB,OAAOG,OAAO,UAAW,MAAM,EACrCC,KAAKC,SAASsD,KAAOpC,CACtB,CAEA,EAEmC,YAAhC,OAAOnB,KAAKwD,kBACfxD,KAAKwD,iBAAiB,YAAaxF,aAAaE,KAAKuF,KAAKzF,YAAY,CAAC"}
|
1
|
+
{"version":3,"sources":["apijs-redmine.js"],"sourcesContent":["/**\n * Created D/15/12/2013\n * Updated L/28/07/2025\n *\n * Copyright 2008-2025 | Fabrice Creuzot (luigifab) <code~luigifab~fr>\n * https://github.com/luigifab/redmine-apijs\n *\n * This program is free software, you can redistribute it or modify\n * it under the terms of the GNU General Public License (GPL) as published\n * by the free software foundation, either version 2 of the license, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but without any warranty, without even the implied warranty of\n * merchantability or fitness for a particular purpose. See the\n * GNU General Public License (GPL) for more details.\n */\n\nvar apijsRedmine = new (function () {\n\n\t\"use strict\";\n\n\tthis.init = function () {\n\n\t\tvar d = apijs.i18n.data;\n\t\tif (!d.frca) d.frca = {};\n\t\t// @see https://docs.google.com/spreadsheets/d/1UUpKZ-YAAlcfvGHYwt6aUM9io390j0-fIL0vMRh1pW0/edit?usp=sharing\n\t\t// auto start\n\t\td.cs[250] = \"Smazat soubor\";\n\t\td.cs[251] = \"Opravdu chcete tento soubor smazat?[br]Pozor, tuto operaci nelze vrátit zpět.\";\n\t\td.cs[252] = \"Chyba\";\n\t\td.de[250] = \"Eine Datei löschen\";\n\t\td.de[251] = \"Sind Sie sicher, dass Sie diese Datei löschen möchten?[br]Achtung, diese Aktion ist unrückgängig.\";\n\t\td.de[252] = \"Fehler\";\n\t\td.de[253] = \"Sie verfügen nicht über die notwendigen Rechte um diese Operation durchzuführen, bitte [a §]aktualisieren Sie die Seite[/a].\";\n\t\td.de[254] = \"Es tut uns leid, diese Datei existiert nicht mehr, bitte [a §]aktualisieren Sie die Seite[/a].\";\n\t\td.de[255] = \"Eine Beschreibung bearbeiten\";\n\t\td.de[256] = \"Bitte geben Sie weiter unten die neue Beschreibung für diese Datei an. Um die Beschreibung zu löschen lassen Sie das Feld leer.\";\n\t\td.el[252] = \"Σφάλμα\";\n\t\td.en[250] = \"Remove file\";\n\t\td.en[251] = \"Are you sure you want to remove this file?[br]Be careful, you can't cancel this operation.\";\n\t\td.en[252] = \"Error\";\n\t\td.en[253] = \"You are not authorized to perform this operation, please [a §]refresh the page[/a].\";\n\t\td.en[254] = \"Sorry, the file no longer exists, please [a §]refresh the page[/a].\";\n\t\td.en[255] = \"Edit description\";\n\t\td.en[256] = \"Enter below the new description for the file. To remove the description, leave the field empty.\";\n\t\td.en[257] = \"Rename file\";\n\t\td.en[258] = \"Enter below the new name for the file.\";\n\t\td.en[259] = \"Clear cache\";\n\t\td.en[260] = \"Are you sure you want to clear the cache?[br]Be careful, you can't cancel this operation.\";\n\t\td.es[250] = \"Borrar un archivo\";\n\t\td.es[251] = \"¿Está usted seguro(a) de que desea eliminar este archivo?[br]Atención, pues no podrá cancelar esta operación.\";\n\t\td.es[253] = \"No está autorizado-a para llevar a cabo esta operación, por favor [a §]actualice la página[/a].\";\n\t\td.es[254] = \"Disculpe, pero el archivo ya no existe, por favor [a §]actualice la página[/a].\";\n\t\td.es[255] = \"Editar una descripción\";\n\t\td.es[256] = \"Introduzca a continuación la nueva descripción para el archivo. Para eliminar la descripción, deje el campo en blanco.\";\n\t\td.es[259] = \"Vaciar la caché\";\n\t\td.es[260] = \"¿Está usted seguro(a) de querer vaciar la caché?[br]Cuidado, esta operación no puede ser cancelada.\";\n\t\td.fr[250] = \"Supprimer le fichier\";\n\t\td.fr[251] = \"Êtes-vous sûr(e) de vouloir supprimer ce fichier ?[br]Attention, cette opération n'est pas annulable.\";\n\t\td.fr[252] = \"Erreur\";\n\t\td.fr[253] = \"Vous n'êtes pas autorisé(e) à effectuer cette opération, veuillez [a §]actualiser la page[/a].\";\n\t\td.fr[254] = \"Désolé, le fichier n'existe plus, veuillez [a §]actualiser la page[/a].\";\n\t\td.fr[255] = \"Modifier la description\";\n\t\td.fr[256] = \"Saisissez ci-dessous la nouvelle description pour ce fichier. Pour supprimer la description, laissez le champ vide.\";\n\t\td.fr[257] = \"Renommer le fichier\";\n\t\td.fr[258] = \"Saisissez ci-dessous le nouveau nom pour ce fichier.\";\n\t\td.fr[259] = \"Vider le cache\";\n\t\td.fr[260] = \"Êtes-vous certain(e) de vouloir vider le cache ?[br]Attention, cette opération n'est pas annulable.\";\n\t\td.hu[252] = \"Hiba\";\n\t\td.it[250] = \"Cancella i file\";\n\t\td.it[251] = \"Sei sicura di voler eliminare il file?[br]Attenzione, questa operazione non può essere annullata.\";\n\t\td.it[252] = \"Errore\";\n\t\td.it[253] = \"Non siete autorizzati a eseguire questa operazione, vi preghiamo di [a §]ricaricare la pagina[/a].\";\n\t\td.it[254] = \"Spiacenti, il file non esiste più, vi preghiamo di [a §]ricaricare la pagina[/a].\";\n\t\td.it[255] = \"Modificare una descrizione\";\n\t\td.it[256] = \"Inserire qui sotto la nuova descrizione del file. Per cancellare la descrizione, lasciate lo spazio vuoto.\";\n\t\td.ja[250] = \"ファイルを削除\";\n\t\td.ja[252] = \"エラー\";\n\t\td.nl[252] = \"Fout\";\n\t\td.pl[250] = \"Usuń plik\";\n\t\td.pl[251] = \"Jesteś pewny, że chcesz usunąć ten plik?[br]Uwaga! Nie ma odwrotu od tej operacji.\";\n\t\td.pl[252] = \"Błąd\";\n\t\td.pt[250] = \"Suprimir um ficheiro\";\n\t\td.pt[251] = \"Tem certeza de que quer suprimir este ficheiro?[br]Cuidado, não pode cancelar esta operação.\";\n\t\td.pt[252] = \"Erro\";\n\t\td.pt[253] = \"Não é autorizado(a) para efetuar esta operação, por favor [a §]atualize a página[/a].\";\n\t\td.pt[254] = \"Lamento, o ficheiro já não existe, por favor [a §]atualize a página[/a].\";\n\t\td.pt[255] = \"Modificar uma descrição\";\n\t\td.pt[256] = \"Digite abaixo a nova descrição para este ficheiro. Para suprimir a descrição, deixe o campo vazio.\";\n\t\td.ro[252] = \"Eroare\";\n\t\td.ru[250] = \"Удалить файл\";\n\t\td.ru[251] = \"Вы уверены, что хотите удалить этот файл?[br]Осторожно, вы не сможете отменить эту операцию.\";\n\t\td.ru[252] = \"Ошибка\";\n\t\td.ru[253] = \"Вы не авторизованы для выполнения этой операции, пожалуйста [a §]обновите страницу[/a].\";\n\t\td.ru[254] = \"Извините, но файл не существует, пожалуйста [a §]обновите страницу[/a].\";\n\t\td.ru[255] = \"Редактировать описание\";\n\t\td.ru[256] = \"Ниже введите новое описание файла. Оставьте поле пустым, чтобы удалить описание.\";\n\t\td.sk[252] = \"Chyba\";\n\t\td.tr[252] = \"Hata\";\n\t\td.tr[259] = \"Önbelleği temizle\";\n\t\td.uk[252] = \"Помилка\";\n\t\td.zh[252] = \"错误信息\";\n\t\t// auto end\n\t};\n\n\tthis.error = function (data) {\n\n\t\tif ((typeof data == 'string') && (data.indexOf('<!DOCTYPE') < 0)) {\n\t\t\tapijs.dialog.dialogInformation(apijs.i18n.translate(252), data, 'error');\n\t\t}\n\t\telse {\n\t\t\tapijs.dialog.remove('lock');\n\t\t\tself.location.reload();\n\t\t}\n\t};\n\n\tthis.editAttachment = function (elem, id, action, token) {\n\n\t\tvar desc, text, title = apijs.i18n.translate(255);\n\n\t\tdesc = elem.parentNode.parentNode.querySelector('.description').textContent.trim();\n\t\ttext = '[p][label for=\"apijsinput\"]' + apijs.i18n.translate(256) + '[/label][/p]' +\n\t\t\t\t'[input type=\"text\" name=\"description\" value=\"' + desc + '\" spellcheck=\"true\" id=\"apijsinput\"]';\n\n\t\tapijs.dialog.dialogFormOptions(title, text, action, apijsRedmine.actionEditAttachment, [id, action, token], 'editattach');\n\t\tapijs.dialog.t1.querySelector('input').select();\n\t};\n\n\tthis.actionEditAttachment = function (action, args) {\n\n\t\t// vérification de la nouvelle description\n\t\tif (typeof action == 'boolean') {\n\t\t\treturn true;\n\t\t}\n\t\t// sauvegarde de la nouvelle description\n\t\telse if (typeof action == 'string') {\n\n\t\t\t// args = [id, action, token]\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', args[1] + '?id=' + args[0] + '&isAjax=true', true);\n\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\txhr.setRequestHeader('X-CSRF-Token', args[2]);\n\n\t\t\txhr.onreadystatechange = function () {\n\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\tif ([0, 200].has(xhr.status)) {\n\t\t\t\t\t\tif (xhr.responseText.indexOf('attachmentId') === 0) {\n\n\t\t\t\t\t\t\t// extrait l'id et la description du fichier enregistré\n\t\t\t\t\t\t\tvar elem, id, text;\n\t\t\t\t\t\t\tid = xhr.responseText.slice(0, xhr.responseText.indexOf(':'));\n\t\t\t\t\t\t\ttext = xhr.responseText.slice(xhr.responseText.indexOf(':') + 1);\n\n\t\t\t\t\t\t\t// description\n\t\t\t\t\t\t\telem = document.getElementById(id);\n\t\t\t\t\t\t\telem.querySelector('.description').textContent = text;\n\n\t\t\t\t\t\t\t// input type hidden\n\t\t\t\t\t\t\telem = elem.querySelector('input');\n\t\t\t\t\t\t\tif (elem)\n\t\t\t\t\t\t\t\telem.value = elem.value.slice(0, elem.value.lastIndexOf('|') + 1) + text;\n\n\t\t\t\t\t\t\tapijs.dialog.actionClose();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tapijsRedmine.error(xhr.responseText);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tapijsRedmine.error(xhr.status);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send('desc=' + encodeURIComponent(document.getElementById('apijsinput').value));\n\t\t}\n\t};\n\n\tthis.renameAttachment = function (elem, id, action, token) {\n\n\t\tvar name, text, title = apijs.i18n.translate(257);\n\n\t\tname = elem.parentNode.parentNode.querySelector('.filename').textContent.trim();\n\t\ttext = '[p][label for=\"apijsinput\"]' + apijs.i18n.translate(258) + '[/label][/p]' +\n\t\t\t\t'[input type=\"text\" name=\"name\" value=\"' + name + '\" spellcheck=\"false\" id=\"apijsinput\"]';\n\n\t\tapijs.dialog.dialogFormOptions(title, text, action, apijsRedmine.actionRenameAttachment, [id, action, token], 'editattach');\n\t};\n\n\tthis.actionRenameAttachment = function (action, args) {\n\n\t\t// vérification du nouveau nom\n\t\tif (typeof action == 'boolean') {\n\t\t\treturn true;\n\t\t}\n\t\t// sauvegarde du nouveau nom\n\t\telse if (typeof action == 'string') {\n\n\t\t\t// args = [id, action, token]\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', args[1] + '?id=' + args[0] + '&isAjax=true', true);\n\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\txhr.setRequestHeader('X-CSRF-Token', args[2]);\n\n\t\t\txhr.onreadystatechange = function () {\n\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\tif ([0, 200].has(xhr.status)) {\n\t\t\t\t\t\tif (xhr.responseText.indexOf('attachmentId') === 0) {\n\n\t\t\t\t\t\t\t// extrait l'id et le nom du fichier enregistré\n\t\t\t\t\t\t\tvar elem, id, name, subelem, text;\n\t\t\t\t\t\t\tid = xhr.responseText.slice(0, xhr.responseText.indexOf(':'));\n\t\t\t\t\t\t\tname = xhr.responseText.slice(xhr.responseText.indexOf(':') + 1);\n\n\t\t\t\t\t\t\t// nom\n\t\t\t\t\t\t\telem = document.getElementById(id);\n\t\t\t\t\t\t\telem.querySelector('.filename').textContent = name;\n\n\t\t\t\t\t\t\t// URLs sur a/href et input/value et button.download/onclick et button.show/onclick\n\t\t\t\t\t\t\t// pas de maj de src et srcset sur img pour éviter un appel réseau inutile\n\t\t\t\t\t\t\tsubelem = elem.querySelector('input');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('value');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('value', name + text.substring(text.indexOf('|')));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubelem = elem.querySelector('a');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('href');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('href', text.substring(0, text.lastIndexOf('/') + 1) + name);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubelem = elem.querySelector('button.download');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('onclick');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('onclick', text.substring(0, text.lastIndexOf('/') + 1) + name + \"';\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubelem = elem.querySelector('button.show');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('onclick');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('onclick', text.substring(0, text.lastIndexOf('/') + 1) + name + \"';\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tapijs.dialog.actionClose();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tapijsRedmine.error(xhr.responseText);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tapijsRedmine.error(xhr.status);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send('name=' + encodeURIComponent(document.getElementById('apijsinput').value));\n\t\t}\n\t};\n\n\tthis.removeAttachment = function (elem, id, action, token) {\n\t\tapijs.dialog.dialogConfirmation(apijs.i18n.translate(250), apijs.i18n.translate(251), apijsRedmine.actionRemoveAttachment, [id, action, token]);\n\t};\n\n\tthis.actionRemoveAttachment = function (args) {\n\n\t\t// args = [id, action, token]\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open('POST', args[1] + '?id=' + args[0] + '&isAjax=true', true);\n\t\txhr.setRequestHeader('X-CSRF-Token', args[2]);\n\n\t\txhr.onreadystatechange = function () {\n\n\t\t\tif (xhr.readyState === 4) {\n\t\t\t\tif ([0, 200].has(xhr.status)) {\n\t\t\t\t\tif (xhr.responseText.indexOf('attachmentId') === 0) {\n\n\t\t\t\t\t\t// supprime le fichier de la page grâce à son id\n\t\t\t\t\t\tvar attachment = document.getElementById(xhr.responseText), elems = attachment.parentNode, idx = 0;\n\t\t\t\t\t\tattachment.remove();\n\n\t\t\t\t\t\t// supprime la liste des fichiers\n\t\t\t\t\t\tif (elems.querySelectorAll('dl, li').length < 1) {\n\t\t\t\t\t\t\telems.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// ou réattribue les ids du diaporama (pas de réinitialisation, on remet juste les ids en place)\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\telems.querySelectorAll('a[id][type]').forEach(function (elem) {\n\t\t\t\t\t\t\t\telem.setAttribute('id', elem.getAttribute('id').slice(0, elem.getAttribute('id').lastIndexOf('.') + 1) + idx++);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tapijs.dialog.actionClose();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tapijsRedmine.error(xhr.responseText);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tapijsRedmine.error(xhr.status);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\txhr.send();\n\t};\n\n\tthis.clearCache = function (action) {\n\t\tapijs.dialog.dialogConfirmation(apijs.i18n.translate(259), apijs.i18n.translate(260), apijsRedmine.actionClearCache, action);\n\t};\n\n\tthis.actionClearCache = function (args) {\n\t\tapijs.dialog.remove('waiting', 'lock');\n\t\tself.location.href = args;\n\t};\n\n})();\n\nif (typeof self.addEventListener == 'function')\n\tself.addEventListener('apijsload', apijsRedmine.init.bind(apijsRedmine));"],"names":["apijsRedmine","this","init","d","apijs","i18n","data","frca","cs","de","el","en","es","fr","hu","it","ja","nl","pl","pt","ro","ru","sk","tr","uk","zh","error","indexOf","dialog","dialogInformation","translate","remove","self","location","reload","editAttachment","elem","id","action","token","title","desc","parentNode","querySelector","textContent","trim","text","dialogFormOptions","actionEditAttachment","t1","select","args","xhr","XMLHttpRequest","open","setRequestHeader","onreadystatechange","readyState","has","status","responseText","slice","document","getElementById","value","lastIndexOf","actionClose","send","encodeURIComponent","renameAttachment","name","actionRenameAttachment","subelem","getAttribute","setAttribute","substring","removeAttachment","dialogConfirmation","actionRemoveAttachment","attachment","elems","idx","querySelectorAll","length","forEach","clearCache","actionClearCache","href","addEventListener","bind"],"mappings":";;;;;GAkBA;IAAIA,aAAe,IAAI,WAItBC,KAAKC,KAAO,WAEX,IAAIC,EAAIC,MAAMC,KAAKC,KACdH,EAAEI,OAAMJ,EAAEI,KAAO,IAGtBJ,EAAEK,GAAG,KAAO,gBACZL,EAAEK,GAAG,KAAO,gFACZL,EAAEK,GAAG,KAAO,QACZL,EAAEM,GAAG,KAAO,qBACZN,EAAEM,GAAG,KAAO,oGACZN,EAAEM,GAAG,KAAO,SACZN,EAAEM,GAAG,KAAO,+HACZN,EAAEM,GAAG,KAAO,iGACZN,EAAEM,GAAG,KAAO,+BACZN,EAAEM,GAAG,KAAO,kIACZN,EAAEO,GAAG,KAAO,SACZP,EAAEQ,GAAG,KAAO,cACZR,EAAEQ,GAAG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aAAa,IAAI,EAAEZ,MAAM,EAAGzB,EAAKqC,aAAa,IAAI,EAAER,YAAY,GAAG,EAAI,CAAC,EAAIgB,CAAG,EAAE,CAC/G,CAAC,EAGF7E,MAAMwB,OAAOsC,YAAY,GAGzBlE,aAAa0B,MAAM0B,EAAIQ,YAAY,EAIpC5D,aAAa0B,MAAM0B,EAAIO,MAAM,EAGhC,EAEAP,EAAIe,KAAK,CACV,EAEAlE,KAAKoF,WAAa,SAAU/C,GAC3BlC,MAAMwB,OAAOiD,mBAAmBzE,MAAMC,KAAKyB,UAAU,GAAG,EAAG1B,MAAMC,KAAKyB,UAAU,GAAG,EAAG9B,aAAasF,iBAAkBhD,CAAM,CAC5H,EAEArC,KAAKqF,iBAAmB,SAAUnC,GACjC/C,MAAMwB,OAAOG,OAAO,UAAW,MAAM,EACrCC,KAAKC,SAASsD,KAAOpC,CACtB,CAEA,EAEmC,YAAhC,OAAOnB,KAAKwD,kBACfxD,KAAKwD,iBAAiB,YAAaxF,aAAaE,KAAKuF,KAAKzF,YAAY,CAAC"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/*!
|
2
2
|
* Copyright 2008-2025 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
|
3
|
-
* https://github.com/luigifab/apijs - 6.9.
|
3
|
+
* https://github.com/luigifab/apijs - 6.9.8
|
4
4
|
* This program is free software, you can redistribute it or modify
|
5
5
|
* it under the terms of the GNU General Public License (GPL).
|
6
6
|
*/
|
7
|
-
Array.prototype.has||(Array.prototype.has=function(t,e){if(t instanceof Array){for(e in t)if(t.hasOwnProperty(e)&&this.has(t[e]))return!0}else for(e in this)if(this.hasOwnProperty(e)&&this[e]===t)return!0;return!1}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(t,e,i){for(e=e||window,i=0;i<this.length;i++)t.call(e,this[i],i,this)});var apijs=new function(){this.core={},this.version=697,this.config={lang:"auto",debug:!1,dialog:{closeOnClick:!1,restrictNavigation:!0,player:!0},slideshow:{ids:"slideshow",anchor:!0},upload:{tokenName:"X-CSRF-Token",tokenValue:null}},this.start=function(){var t;if(console.info("APIJS "+this.version.toString().split("").join(".")+" - hello - 1 MB/Mo = 1024 kB/ko"),document.getElementById("oldBrowser"))throw new Error("APIJS canceled, #oldBrowser detected!");(t=document.querySelector('link[href*="apijs/fontello.woff2"]'))&&t.getAttribute("href").indexOf("?a3ab5acff3")<0&&console.error("APIJS warning invalid cachekey for link:fontello.woff2?x, it must be ?a3ab5acff3"),(t=document.querySelector('script[src*="apijs.min.js?v="]'))&&t.getAttribute("src").indexOf("?v="+this.version)<0&&console.error("APIJS warning invalid cachekey for script:apijs.min.js?x, it must be ?v="+this.version),this.i18n=new this.core.i18n,this.dialog=new this.core.dialog,this.upload=new this.core.upload,this.slideshow=new this.core.slideshow,self.dispatchEvent(new CustomEvent("apijsbeforeload")),this.i18n.init(),this.slideshow.init(),document.querySelectorAll("video.apijsplayer[data-src]").forEach(function(t){apijs.startPlayer(t,t.getAttribute("data-src"))}),self.addEventListener("popstate",this.slideshow.onPopState),self.addEventListener("hashchange",this.slideshow.onPopState),this.config.debug&&(console.info("APIJS available languages: "+Object.keys(this.i18n.data).join(" ")),console.info("APIJS language loaded: "+this.config.lang),console.info("APIJS successfully started")),self.dispatchEvent(new CustomEvent("apijsload"))},this.formatNumber=function(e,t){var i,s="number"==typeof t?t:!1===t?0:2;try{i=new Intl.NumberFormat(this.config.lang,{minimumFractionDigits:s,maximumFractionDigits:s}).format(e)}catch(t){i=e.toFixed(s)}return"number"==typeof t?i:i.replace(/[.,]00$/,"")},this.startPlayer=function(t,e){return!0===this.config.dialog.player?(t.videoPlayer=new this.core.player(t,e),t.parentNode.classList.add("apijsvideoplayer"),!0):"function"==typeof this.config.dialog.player&&(this.config.dialog.player(t,e),!0)},this.toArray=function(t,e){return Array.prototype.slice.call(t,0,e)},this.openTab=function(t){t.preventDefault(),0<this.href.length&&self.open(this.href)},this.log=function(t){this.config.debug&&console.info("APIJS "+t)},this.html=function(t,e){return!0===e||0===t.indexOf("#")?document.getElementById(t.replace("#","apijs")):this.dialog.t1?this.dialog.t1.querySelector(t):null},this.requestFullscreen=function(t){document.webkitFullscreenElement?document.webkitCancelFullScreen():document.mozFullScreenElement?document.mozCancelFullScreen():document.fullscreenElement?document.cancelFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen&&t.mozRequestFullScreen()},this.serialize=function(t,i){var s=[];return i="string"==typeof i?i:"",Array.prototype.forEach.call(t.elements,function(t,e){if(t.name&&!t.disabled&&!["file","reset","submit","button"].has(t.type)&&0===t.name.indexOf(i))if("select-multiple"===t.type)for(e=0;e<t.options.length;e++)t.options[e].selected&&s.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.options[e].value));else["checkbox","radio"].has(t.type)&&!t.checked||s.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}),s.join("&")}};"function"==typeof self.addEventListener&&self.addEventListener("load",apijs.start.bind(apijs)),apijs.core.i18n=function(){this.data={cs:{103:"Zrušit",104:"Potvrzení",105:"Zavřít",106:"Předchozí",107:"Následující",108:"Vybrat soubor",132:"video stopa",133:"zvuková stopa",134:"titulky",135:"vypnuto",142:"předchozí/následující",143:"přehrát/pozastavit",144:"zpět/vpřed",145:"snížit/zvýšit hlasitost",146:"ztlumit",148:"ukončit",149:"Konec",150:"Esc"},de:{103:"Abbrechen",104:"Bestätigen",105:"Schließen",106:"Vorheriges",107:"Nächstes",108:"Datei wählen",109:"Dateien wählen",124:"Verarbeitung läuft...",132:"videospur",133:"audiospur",134:"untertitel",135:"aus",142:"vorheriges/nächstes",143:"wiedergabe/pause",144:"rückwärts/vorwärts",145:"leiser/lauter",146:"ton aus",147:"vollbild",148:"beenden",149:"Ende",150:"Esc",161:"Alle Dateien wurden akzeptiert.",162:"Akzeptiertes Dateiformat: §.",163:"Akzeptiertes Dateiformate: § und §.",164:"Maximale Größe: § MB.",167:"Unerlaubtes Format",168:"Format zu gross",169:"Leere Datei",181:"§% - § kB/s - Noch § Minuten",182:"§% - § kB/s - Noch § Minute",183:"§% - § kB/s - Noch § Sekunden",185:"§% - bis § kB/s in § Minuten",186:"§% - bis § kB/s in § Minute",187:"§% - bis § kB/s in § Sekunden",188:"§% - bis § kB/s",191:"Abbrechen",192:"Sind Sie sicher? [span]Ja[/span] - Nein",193:"Es ist ein unerwarteter Fehler aufgetreten... Bitte versuchen Sie es noch einmal.",194:"Es ist ein Fehler beim Senden.",195:"Es ist ein Fehler bei der Verarbeitung.",196:"Wir laden Sie ein es erneut zu [a §]versuchen[/a]."},el:{102:"Εντάξει",103:"Ακύρωση",105:"Κλείσιμο",106:"Προηγούμενο",107:"Επόμενο",108:"Επιλέξτε ένα αρχείο",131:"βίντεο",132:"κομμάτι βίντεο",133:"κομμάτι ήχου",134:"υπότιτλοι",135:"απενεργοποίηση",142:"προηγούμενο/επόμενο",143:"αναπαραγωγή/παύση",144:"προς τα πίσω/εμπρός",145:"μείωση/αύξηση έντασης ήχου",146:"σίγαση",147:"πλήρης οθόνη",148:"έξοδος",149:"Τέλος",150:"Esc"},en:{102:"Ok",103:"Cancel",104:"Confirm",105:"Close",106:"Previous",107:"Next",108:"Choose a file",109:"Choose one or multiple files",124:"Operation in progress...",125:"Upload in progress...",126:"Processing file in progress...",127:"Drag and drop your files here",131:"video",132:"video track",133:"audio track",134:"subtitles",135:"off",141:"first/last",142:"previous/next",143:"play/pause",144:"backward/forward",145:"decrease/increase the volume",146:"mute",147:"full screen",148:"quit",149:"End",150:"Escape",161:"All files are accepted.",162:"Accepted file format: §.",163:"Accepted file formats: § and §.",164:"Maximum size: § MB.",165:"Maximum size by file: § MB.|Total maximum size: § MB.",166:"§ MB",167:"Format not allowed",168:"Size too large",169:"File empty",181:"§% - § kB/s - § minutes left",182:"§% - § kB/s - § minute left",183:"§% - § kB/s - § seconds left",184:"§% - § kB/s",185:"§% - at § kB/s in § minutes",186:"§% - at § kB/s in § minute",187:"§% - at § kB/s in § seconds",188:"§% - at § kB/s",191:"Interrupt",192:"Are you sure? [span]Yes[/span] - No",193:"It seems that an unlikely mistake just happened... Please try again.",194:"An error occurred while sending.",195:"An error occurred while processing.",196:"We invite you to [a §]try again[/a]."},es:{102:"Aceptar",103:"Cancelar",104:"Confirmar",105:"Cerrar",106:"Anterior",107:"Siguiente",108:"Elegir un fichero",109:"Elegir uno o varios ficheros",124:"Operación en curso...",125:"Envío en progreso...",126:"Tratamiento en curso...",131:"vídeo",132:"pista de vídeo",133:"pista de audio",134:"subtítulos",135:"desactivar",142:"anterior/siguiente",143:"reproducir/pausa",144:"retroceder/avanzar",145:"bajar/subir volumen",146:"silenciar",147:"pantalla completa",148:"salir",149:"Fin",150:"Esc",161:"Se aceptan todos los archivos.",162:"Formato de archivo aceptado: §.",163:"Formatos de archivos aceptados: § y §.",164:"Tamaño máximo: § MB.",165:"Tamaño máximo por fichero: § Mo.|Tamaño máximo total: § Mo.",167:"Formato no autorizado",168:"Tamaño demasiado importante",169:"Fichero vacío",181:"§% - § kB/s - § minutos restantes",182:"§% - § kB/s - § minuto restantes",183:"§% - § kB/s - § segundos restantes",185:"§% - a § kB/s en § minutos",186:"§% - a § kB/s en § minuto",187:"§% - a § kB/s en § segundos",188:"§% - a § kB/s",191:"Interrumpir",192:"¿Está seguro(a)? [span]Sí[/span] - No",193:"Parece que un error improbable acabo de ocurrir... Por favor, inténtelo de nuevo.",194:"Se produjo un error durante el envío.",195:"Se produjo un error durante el procesamiento.",196:"Le invitamos a [a §]intentar de nuevo[/a]."},fr:{103:"Annuler",104:"Valider",105:"Fermer",106:"Précédent",107:"Suivant",108:"Choisir un fichier",109:"Choisir un ou plusieurs fichiers",124:"Opération en cours...",125:"Envoi en cours...",126:"Traitement en cours...",127:"Faites glisser et déposez vos fichiers ici",131:"vidéo",132:"piste vidéo",133:"piste audio",134:"sous-titres",141:"premier/dernier",142:"précédent/suivant",143:"lecture/pause",144:"reculer/avancer",145:"réduire/augmenter le volume",146:"couper le son",147:"plein écran",148:"quitter",149:"Fin",150:"Échap",161:"Tous les fichiers sont acceptés.",162:"Format de fichier accepté : §.",163:"Formats de fichier acceptés : § et §.",164:"Taille maximale : § Mo.",165:"Taille maximale par fichier : § Mo.|Taille maximale total : § Mo.",166:"§ Mo",167:"Format non autorisé",168:"Taille trop importante",169:"Fichier vide",181:"§% - § ko/s - § minutes restantes",182:"§% - § ko/s - § minute restante",183:"§% - § ko/s - § secondes restantes",184:"§% - § ko/s",185:"§% - à § ko/s en § minutes",186:"§% - à § ko/s en § minute",187:"§% - à § ko/s en § secondes",188:"§% - à § ko/s",191:"Interrompre",192:"Êtes-vous sûr(e) ? [span]Oui[/span] - Non",193:"Il semblerait qu'une erreur improbable vient de se produire... Veuillez réessayer.",194:"Une erreur est survenue lors de l'envoi.",195:"Une erreur est survenue lors du traitement.",196:"Nous vous invitons à [a §]réessayer[/a]."},hu:{103:"Mégsem",104:"Megerősít",105:"Bezár",106:"Előző",107:"Következő",108:"Válasszon fájlt",131:"videó",132:"videosáv",133:"hangsáv",134:"feliratok",135:"ki",142:"előző/következő",143:"lejátszás/szünet",144:"vissza/előre",145:"hangerő csökkentés/növelése",146:"némítás",147:"teljes képernyő",148:"kilépés",149:"Befejezés",150:"Esc"},it:{103:"Annulla",104:"Conferma",105:"Chiudi",106:"Precedente",107:"Successivo",108:"Scegli un file",109:"Scegli uno o più file",124:"Operazione in corso...",125:"Invio in corso...",126:"Trattamento in corso...",132:"traccia video",133:"traccia audio",134:"sottotitoli",135:"inattivo",142:"precedente/successivo",143:"riproduci/pausa",144:"indietro/avanti",145:"riduci/aumenta volume",146:"silenzio",147:"schermo intero",148:"esci",149:"Fine",150:"Esc",161:"Tutti i file sono accettati.",162:"Formato del file accettato: §.",163:"Formati accettati: § et §.",164:"Dimensione massima: § MB.",167:"Formato non autorizzato",168:"Dimensione troppo importante",169:"File vuoto",181:"§% - § kB/s - § minuti rimanenti",182:"§% - § kB/s - § minuto rimanente",183:"§% - § kB/s - § secondi rimanenti",185:"§% - a § kB/s in § minuti",186:"§% - a § kB/s in § minuto",187:"§% - a § kB/s in § secondi",188:"§% - a § kB/s",191:"Interrompere",192:"Sei sicuro? [span]Si[/span] - No",193:"Sembra che un errore inaspettato si sia verificato... Riprova.",194:"Un errore si è verificato durante l'invio.",195:"Un errore si è verificato durante il trattamento.",196:"Vi invitiamo a [a §]riprovare[/a]."},ja:{103:"キャンセル",104:"承認",105:"閉じる",106:"前へ",107:"次へ",108:"ファイルを選択する",131:"ビデオ",132:"ビデオトラック",133:"オーディオトラック",134:"字幕",135:"オフ",142:"前へ/次へ",143:"再生/一時停止",144:"戻る/進む",146:"ミュート",147:"全画面表示",148:"終了",149:"終了",150:"Esc",166:"§ Mo",184:"§% - § Ko/s",192:"よろしいですか?[span]はい[/span] - いいえ"},nl:{103:"Annuleren",104:"Bevestigen",105:"Sluiten",106:"Vorige",107:"Volgende",108:"Kies een bestand",132:"videospoor",133:"audiospoor",134:"ondertitels",135:"uit",142:"vorige/volgende",143:"afspelen/pauzeren",144:"achteruit/vooruit",145:"volume omlaag/omhoog",146:"dempen",147:"schermvullend",148:"afsluiten",150:"Esc"},pl:{103:"Anuluj",104:"Potwierdź",105:"Zamknij",106:"Poprzedni",107:"Następny",108:"Wybierz plik",131:"obraz",132:"ścieżka obrazu",133:"ścieżka dźwiękowa",134:"napisy",135:"wyłączone",142:"poprzedni/następny",143:"odtwarzaj/wstrzymaj",144:"wstecz/przodu",145:"ciszej/głośniej",146:"wycisz",147:"pełny ekran",148:"zakończ",150:"Esc"},pt:{103:"Cancelar",104:"Confirmar",105:"Fechar",106:"Anterior",107:"Seguinte",108:"Escolha um ficheiro",124:"Operação em processo...",125:"Envio em processo...",126:"Tratamento em processo...",131:"vídeo",132:"faixa de vídeo",133:"faixa de áudio",134:"legendas",135:"não",142:"anterior/seguinte",143:"reprodução/pausa",144:"recuar/avançar",145:"diminuir/aumentar volume",146:"sem som",147:"ecrã completo",148:"sair",149:"Fim",150:"Esc",161:"Todos os ficheiros foram aceites.",162:"Formato do ficheiro aceite: §.",163:"Formatos de ficheiro aceites: § e §.",164:"Tamanho máximo: § MB.",181:"§% - § kB/s - § minutos restantes",182:"§% - § kB/s - § minuto restantes",183:"§% - § kB/s - § segundos restantes",185:"§% - § kB/s em § minutos",186:"§% - § kB/s em § minuto",187:"§% - § kB/s em § segundos",188:"§% - § kB/s",192:"Tem a certeza? [span]Sim[/span] - Não",193:"Parece ter acontecido um erro imprevisto. Por favor, tente novamente.",194:"Ocorreu um erro ao enviar.",195:"Ocorreu um erro ao processar.",196:"Convidamo-lo a [a §]tentar novamente[/a]."},ptbr:{107:"Próximo",108:"Escolher um arquivo",124:"Operação em andamento...",125:"Envio em andamento...",126:"Tratamento em andamento...",132:"trilha de vídeo",133:"trilha de áudio",135:"desligado",142:"anterior/próximo",143:"reproduzir/pausar",144:"retroceder/avançar",146:"sem áudio",147:"tela inteira",148:"fechar",149:"Final"},ro:{103:"Anuleaza",104:"Confirmare",105:"Inchide",106:"Anteriorul",107:"Urmatorul",108:"Alege un fișier",132:"pistă video",133:"pistă audio",134:"subtitluri",135:"oprit",142:"anteriorul/urmatorul",143:"redare/pauză",144:"înapoi/înaintează",145:"scade/crește volumul",146:"mut",147:"pe tot ecranul",148:"ieșire",149:"Sfârșit",150:"Esc"},ru:{102:"Ок",103:"Отмена",104:"Подтвердить",105:"Закрыть",106:"Предыдущий",107:"Следующий",108:"Выберите файл",124:"Операция в процессе...",131:"видео",132:"видеодорожка",133:"аудиодорожка",134:"субтитры",135:"выключено",142:"предыдущий/следующий",143:"воспроизведение/пауза",144:"назад/вперед",145:"понизить/повысить громкость",146:"выключить звук",147:"полноэкранный режим",148:"выйти",150:"Esc",161:"Все файлы приняты.",162:"Формат файла: §.",163:"Форматы файлов: § и §.",164:"Максимальный размер: § Мб.",166:"§ Мб",181:"§% - § Кб/s - осталось § минут",182:"§% - § Кб/s - осталось § минут",183:"§% - § Кб/s - осталось § секунд",184:"§% - § Кб/s",185:"§% - § Кб/s за § минут",186:"§% - § Кб/s за § минут",187:"§% - § Кб/s за § секунд",188:"§% - § Кб/s",192:"Вы уверены? [span]Да[/span] - нет",193:"Кажется произошла не предусмотренная ошибка... Попробуйте еще раз.",194:"Возникла ошибка при отправке файла.",195:"Возникла ошибка при обработке файла."},sk:{103:"Zrušiť",104:"Potvrdiť",105:"Zavrieť",106:"Dozadu",107:"Ďalej",108:"Zvoľte si súbor",133:"zvuková stopa",134:"titulky",135:"vypnuté",142:"dozadu/ďalej",143:"prehrať/pozastaviť",144:"dozadu/dopredu",145:"znizit/zvysit hlasitost",146:"stlmiť",148:"koniec",150:"Esc"},tr:{102:"Tamam",103:"İptal",104:"Onayla",105:"Kapat",106:"Önceki",107:"Sonraki",108:"Bir dosya seçin",131:"görüntü",132:"görüntü kaydı",133:"ses kaydı",134:"altyazılar",135:"kapalı",142:"önceki/sonraki",143:"duraklatma/oynatma",144:"geri/i̇leri",145:"ses kısar/açar",146:"sesi kapatma",147:"tam ekran",148:"çıkış",149:"Son",150:"Esc",192:"Emin misiniz ? [span]Evet[/span] - Hayır"},uk:{102:"Гаразд",103:"Відмінити",104:"Підтвердити",105:"Закрити",106:"Попередній",107:"Наступний",108:"Вибрати файл",131:"відео",132:"відеодоріжка",133:"звукова доріжка",134:"субтитри",135:"вимкнено",142:"попередній/наступний",143:"відтворити/призупинити",144:"назад/вперед",145:"зменшити/збільшити гучність",146:"вимкнути звук",148:"вийти",149:"Кінець",150:"Esc",166:"§ МБ",184:"§% - § кБ/s"},zh:{102:"确定",103:"取消",104:"确认",105:"关闭",106:"上一个",107:"下一个",108:"选择文件",131:"视频",132:"视频轨道",133:"音频轨道",134:"字幕",135:"关",142:"上一个/下一个",143:"播放/暂停",144:"快退/快进",145:"音量减/增",146:"静音",147:"全屏",148:"退出",150:"Esc",192:"您确定吗?[span]是[/span] - 否"}},this.init=function(){var t=apijs.config.lang,e=document.querySelector("html");-1<t.indexOf("auto")&&"string"==typeof(t=e.getAttribute("xml:lang")||e.getAttribute("lang"))&&(t=(t=t.replace(/[-_]/g,"").toLowerCase()).slice(0,4),this.data.hasOwnProperty(t)||(t=t.slice(0,2)),this.data.hasOwnProperty(t))&&(apijs.config.lang=t),this.data.hasOwnProperty(t)||(apijs.config.lang="en")},this.translate=function(t){var e=apijs.config.lang,i=1,s="";if("string"!=typeof this.data[e][t])if(3<e.length&&"string"==typeof this.data[e.slice(0,2)][t])e=e.slice(0,2);else{if("en"===e||"string"!=typeof this.data.en[t])return t;e="en"}return 1<arguments.length?(this.data[e][t].split("§").forEach(function(t){s+=i<this.length?t+this[i++]:t},arguments),s):this.data[e][t]},this.translateNode=function(){return document.createTextNode(this.translate.apply(this,arguments))},this.changeLang=function(t){if("string"==typeof t){if(-1<t.indexOf("auto"))return apijs.config.lang="auto",this.init(),!0;if(t=t.replace(/[-_]/g,""),this.data.hasOwnProperty(t))return apijs.config.lang=t,!0}return!1}},apijs.core.select=function(){this.init=function(){}},apijs.core.player=function(a,t){this.video=a,this.stalled=!1,this.subload=!1,this.autoRun=function(n,t){var o;return n.removeAttribute("src"),n.removeAttribute("data-src"),n.removeAttribute("controls"),n.classList.add("apijsplayer"),n.onloadedmetadata=function(t){this.stalled=!1,this.onTimeupdate(t),this.onProgress(t),this.onVideotrack(),this.onAudiotrack()}.bind(this),n.onstalled=function(t){this.stalled=!0,this.onWaiting(t)}.bind(this),n.onplaying=this.onPlay.bind(this),n.onpause=this.onPlay.bind(this),n.onended=this.onPlay.bind(this),n.onprogress=this.onProgress.bind(this),n.ontimeupdate=this.onTimeupdate.bind(this),n.onseeking=this.onTimeupdate.bind(this),n.onseeked=this.onWaiting.bind(this),n.onwaiting=this.onWaiting.bind(this),n.onloadstart=this.onWaiting.bind(this),n.oncanplay=this.onWaiting.bind(this),n.onclick=this.actionPlay.bind(this),n.onvolumechange=this.actionVolume.bind(this),n.ondurationchange=apijs.dialog.onMediaLoad,n.onerror=apijs.dialog.onMediaLoad,n.parentNode.appendChild(this.htmlSvgPlayer()),t.indexOf("m3u")<0?n.appendChild(this.htmlSource(t)):((o=new XMLHttpRequest).open("GET",t,!0),o.onreadystatechange=function(){if(4===o.readyState)if(self.dispatchEvent(new CustomEvent("apijsajaxresponse",{detail:{from:"apijsplayer.init",xhr:o}})),!n||0<n.childNodes.length)o.abort();else if([0,200].has(o.status)){for(var t,e=0,i=0,s=0,a=o.responseText.trim().split("\n");"string"==typeof(t=a.shift());)0===t.indexOf("#APIJS#attr")?(e=t.split("|"),n.setAttribute(e[1],e[2])):0===t.indexOf("#APIJS#track|subtitles")?(e=t.split("|"),this.html(".tracks.texttrack select").appendChild(this.htmlOption(s++,e[3]+" - "+e[2])),n.appendChild(this.htmlTrack(e))):0===t.indexOf("#EXTINF")?e=t.replace(/#EXTINF:\d+,/,""):5<t.length&&"#"!==t[0]&&(this.html(".tracks.video select").appendChild(this.htmlOption(i++,"string"==typeof e?e:i)),n.appendChild(this.htmlSource(t)));this.updateSelect("video",i),"object"==typeof n.textTracks&&this.updateSelect("texttrack",n.textTracks.length||s)}else apijs.dialog.onMediaLoad({type:"error"})}.bind(this),o.send()),this},this.updateSelect=function(t,e){var i="texttrack"===t?1:0;i<e?(this.html(".tracks."+t).removeAttribute("style"),this.html(".tracks."+t+" em").textContent="("+e+")",this.html(".tracks."+t+" select").setAttribute("size",e<10?e+i:10)):(this.html(".tracks."+t).setAttribute("style","display:none;"),this.html(".tracks."+t+" select").innerHTML="")},this.html=function(t){return this.video.parentNode.querySelector(t)},this.onVideotrack=function(){var t,e=this.video.videoTracks,i=this.html(".tracks.videotrack select"),s=apijs.config.lang,a=-1;if("object"==typeof e){if(1<e.length){for(t=0;t<e.length;t++)e[t].language&&0==e[t].language.toLowerCase().replace(/[-_]/g,"").indexOf(s)&&(a=a<0?t:a),i.appendChild(this.htmlOption(t,e[t]));this.updateSelect("videotrack",e.length)}i.selectedIndex=Math.max(0,a),0<=a&&this.actionVideotrack(a)}},this.onAudiotrack=function(){var t,e=this.video.audioTracks,i=this.html(".tracks.audiotrack select"),s=apijs.config.lang,a=-1;if("object"==typeof e){if(1<e.length){for(t=0;t<e.length;t++)e[t].language&&0==e[t].language.toLowerCase().replace(/[-_]/g,"").indexOf(s)&&(a=a<0?t:a),i.appendChild(this.htmlOption(t,e[t]));this.updateSelect("audiotrack",e.length)}i.selectedIndex=Math.max(0,a),0<=a&&this.actionAudiotrack(a)}},this.onTimeupdate=function(t){var e,i,s,a=this.video.currentTime,n=this.video.duration,o="--:--";isNaN(a)||n===1/0||isNaN(n)||(o=(0<(e=Math.floor(a/3600))?e+":":"")+(i=(i=Math.floor(a%3600/60))<10?"0"+i:i)+":"+(s=(s=Math.floor(a%60))<10?"0"+s:s),o+=" / "+(0<(e=Math.floor(n/3600))?e+":":"")+(i=(i=Math.floor(n%3600/60))<10?"0"+i:i)+":"+(s=(s=Math.floor(n%60))<10?"0"+s:s),this.html("svg.bar rect").style.width=a/n*100+"%"),this.html("span.time").textContent=o,this.stalled&&!this.subload&&(this.stalled=!1,this.onWaiting(t))},this.onProgress=function(){var t,e,i=this.video,s=this.html("svg.bar"),a=i.buffered.length;if(0<a&&i.duration!==1/0&&!isNaN(i.duration))for(s.querySelectorAll(".buffer").forEach(function(t){t.remove()});0<a--;)(e=document.createElement("rect")).setAttribute("class","buffer"),99.8<(t=(i.buffered.end(a)-i.buffered.start(a))/i.duration*100)?e.setAttribute("style","left:0%; width:100%;"):e.setAttribute("style","left:"+i.buffered.start(a)/i.duration*100+"%; width:"+t+"%;"),s.appendChild(e)},this.onPlay=function(){[1,2].has(this.video.networkState)&&(this.video.paused?(this.html("span.play").textContent="",(apijs.dialog.t1?apijs.dialog:this.video.parentNode.classList).remove("playing")):(this.html("span.play").textContent="",(apijs.dialog.t1?apijs.dialog:this.video.parentNode.classList).add("playing")))},this.onWaiting=function(t){apijs.log("player:video:onWaiting:"+t.type+" stalled:"+this.stalled+"/subload:"+this.subload),apijs.dialog[["loadstart","waiting","seeking","stalled"].has(t.type)?"add":"remove"]("loading")},this.actionPlay=function(){var t=this.video;if(apijs.dialog.swipe)return!1;[1,2].has(t.networkState)&&(t.ended||t.paused?t.play():t.pause())},this.actionVolume=function(t){var e=this.video,i=this.html("svg.vol"),s=i.offsetWidth,a=0;if([1,2].has(e.networkState)){if("object"==typeof t&&!isNaN(t.clientX)){for(;a+=i.offsetLeft,i=i.offsetParent;);a=100*(t.clientX-a)/s/100,e.volume=a=a<.2?0:.92<a?1:a,e.muted=!1}this.html("svg.vol rect").style.width=e.muted?0:100*e.volume+"%"}},this.actionPosition=function(t){var e=this.video,i=this.html("svg.bar"),s=i.offsetWidth,a=0;if([1,2].has(e.networkState)&&e.duration!==1/0&&!isNaN(e.duration)&&"object"==typeof t){for(;a+=i.offsetLeft,i=i.offsetParent;);a=e.duration*(t.clientX-a)*100/s/100,e.currentTime=a=a<=1?0:a}},this.actionVideotrack=function(t){var e,i=this.video.videoTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].enabled=e==s;--a.currentTime}"object"==typeof t&&t.target.blur()},this.actionAudiotrack=function(t){var e,i=this.video.audioTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].enabled=e==s;--a.currentTime}"object"==typeof t&&t.target.blur()},this.actionTexttrack=function(t){var e,i=this.video.textTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].mode=e==s?"showing":"hidden";this.subload=!0}"object"==typeof t&&t.target.blur()},this.actionVideo=function(t){this.html("svg.bar rect").style.width="0",this.html("svg.bar").querySelectorAll(".buffer").forEach(function(t){t.remove()}),this.html("span.play").textContent="",this.updateSelect("videotrack",0),this.updateSelect("audiotrack",0),this.video.src=this.video.querySelectorAll("source")["object"==typeof t?t.target.value:t].src,"object"==typeof t&&t.target.blur()},this.actionFullscreen=function(){var t=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;this.video.parentNode.classList[t?"add":"remove"]("fullscreen")},this.htmlSvgPlayer=function(){var t,e,i,s=document.createElement("div");return s.setAttribute("class","apijsplayer noplaying"),(i=document.createElement("span")).setAttribute("class","btn play fnt"),i.appendChild(document.createTextNode("")),i.onclick=this.actionPlay.bind(this),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","svg bar"),(e=document.createElement("svg")).setAttribute("class","bar"),e.onclick=this.actionPosition.bind(this),t=document.createElement("rect"),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","time"),i.appendChild(document.createTextNode("--:--")),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","svg vol"),(e=document.createElement("svg")).setAttribute("class","vol"),e.onclick=this.actionVolume.bind(this),t=document.createElement("rect"),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks audiotrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(133)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionAudiotrack.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks videotrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(132)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionVideotrack.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks video"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(131)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionVideo.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks texttrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(134)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionTexttrack.bind(this),(t=document.createElement("option")).appendChild(apijs.i18n.translateNode(135)),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","btn full fnt"),i.appendChild(document.createTextNode("")),i.onclick=function(){apijs.dialog.t1?apijs.requestFullscreen(apijs.dialog.t1):(document.webkitFullscreenEnabled?document.addEventListener("webkitfullscreenchange",this.actionFullscreen.bind(this)):document.fullscreenEnabled?document.addEventListener("fullscreenchange",this.actionFullscreen.bind(this)):document.mozFullScreenEnabled&&document.addEventListener("mozfullscreenchange",this.actionFullscreen.bind(this)),apijs.requestFullscreen(this.video.parentNode))}.bind(this),s.appendChild(i),s},this.htmlTrack=function(t){var e=document.createElement("track");return e.setAttribute("kind",t[1]),e.setAttribute("label",t[2]),e.setAttribute("srclang",t[3]),e.setAttribute("src",t[4]),e.onload=function(t){apijs.log("player:track:onload "+t.target.src.slice(t.target.src.lastIndexOf("/")+1)),"showing"===t.target.track.mode&&(this.onWaiting(t),this.subload=!1)}.bind(this),e.onerror=function(t){apijs.log("player:track:onerror "+t.target.src.slice(t.target.src.lastIndexOf("/")+1)),"showing"===t.target.track.mode&&(this.onWaiting(t),this.subload=!1)}.bind(this),e},this.htmlSource=function(t){var e=document.createElement("source");return e.setAttribute("src",t),e.onerror=apijs.dialog.onMediaLoad,e},this.htmlOption=function(t,e){"object"==typeof e&&(e=""===e.label?e.language.toLowerCase():e.language.toLowerCase()+" - "+e.label);var i=document.createElement("option");return i.setAttribute("value",t),i.appendChild(document.createTextNode(e)),i},this.autoRun(a,t)},apijs.core.dialog=function(){this.klass=[],this.height=0,this.scroll=0,this.callback=null,this.args=null,this.xhr=null,this.ft=/information|confirmation|options|upload|progress|waiting|photo|video|iframe|ajax|start|ready|end|reduce|mobile|tiny|fullscreen/g,this.ti="a,area,button,input,textarea,select,object,iframe",this.ns="http://www.w3.org/2000/svg",this.swipe=!1,this.media=null,this.t0=null,this.t1=null,this.t2=null,this.t3=null,this.a=null,this.b=null,this.c=null,this.dialogInformation=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("information",i).htmlParent().htmlContent(t,e).htmlBtnOk().show("button.confirm"):(console.error("apijs.dialog.dialogInformation invalid arguments",arguments),!1)},this.dialogConfirmation=function(t,e,i,s,a){return"string"==typeof t&&"string"==typeof e&&"function"==typeof i?(this.callback=i,this.args=s,this.init("confirmation",a).htmlParent().htmlContent(t,e).htmlBtnConfirm("button","apijs.dialog.actionConfirm();").show("button.confirm")):(console.error("apijs.dialog.dialogConfirmation invalid arguments",arguments),!1)},this.dialogFormOptions=function(t,e,i,s,a,n){return"string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"function"==typeof s?(this.callback=s,this.args=a,this.init("options",n).htmlParent(i,"apijs.dialog.actionConfirm();").htmlContent(t,e).htmlBtnConfirm("submit").show(!0)):(console.error("apijs.dialog.dialogFormOptions invalid arguments",arguments),!1)},this.dialogFormUpload=function(t,e,i,s,a,n){return"string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("upload",n).htmlParent(i,"apijs.upload.actionConfirm();","apijs.upload.actionDrag(event);").htmlContent(t,e).htmlUpload(s,"boolean"==typeof a&&a,"apijs.upload.actionChoose(this);").htmlBtnConfirm("submit").show("button.browse"):(console.error("apijs.dialog.dialogFormUpload invalid arguments",arguments),!1)},this.dialogProgress=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("progress",i).htmlParent().htmlContent(t,e).htmlSvgProgress().show():(console.error("apijs.dialog.dialogProgress invalid arguments",arguments),!1)},this.dialogWaiting=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("waiting",i).htmlParent().htmlContent(t,e).htmlSvgLoader(!1).show():(console.error("apijs.dialog.dialogWaiting invalid arguments",arguments),!1)},this.dialogPhoto=function(t,e,i,s,a){var n="string"==typeof a;return a=n?"notransition slideshow loading "+a:"notransition loading","string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("photo",a).htmlParent().htmlMedia(t,e,i,s).htmlHelp(n,!1).htmlBtnClose().htmlBtnNavigation().htmlSvgLoader().show():(console.error("apijs.dialog.dialogPhoto invalid arguments",arguments),!1)},this.dialogVideo=function(t,e,i,s,a){var n="string"==typeof a;return a=n?"notransition slideshow loading "+a:"notransition loading","string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("video",a).htmlParent().htmlMedia(t,e,i,s).htmlHelp(n,t.indexOf("iframe")<0).htmlBtnClose().htmlBtnNavigation().htmlSvgLoader().show():(console.error("apijs.dialog.dialogVideo invalid arguments",arguments),!1)},this.dialogIframe=function(t,e,i){return"string"==typeof t&&"boolean"==typeof e?this.init("iframe","string"==typeof i?i+" loading":"loading",!e).htmlParent().htmlIframe(t).htmlBtnClose(e).htmlSvgLoader(!1).show():(console.error("apijs.dialog.dialogIframe invalid arguments",arguments),!1)},this.dialogAjax=function(t,e,i,s,a){return"string"==typeof t&&"boolean"==typeof e&&"function"==typeof i?(this.callback=i,this.args=s,this.init("ajax","string"==typeof a?a+" loading":"loading",!e).htmlParent().htmlBtnClose(e).htmlSvgLoader(!1).show(),this.xhr=new XMLHttpRequest,this.xhr.open("GET",t,!0),this.xhr.onreadystatechange=function(){4===this.xhr.readyState&&"function"==typeof this.callback&&(this.callback(this.xhr,this.args),this.remove("loading"))}.bind(this),this.xhr.send(),this):(console.error("apijs.dialog.dialogAjax invalid arguments",arguments),!1)},this.update=function(){return this.has("start","ready","end")&&(this.t1&&this.t1.setAttribute("class",this.klass.join(" ")),this.t2)&&this.t2.setAttribute("class",this.klass.join(" ")),this},this.add=function(){return Array.prototype.forEach.call(arguments,function(t){"string"!=typeof t&&console.error("apijs.dialog.add argument is not a string",t),this.klass.indexOf(t)<0&&this.klass.push(t)},this),this.update()},this.remove=function(){return Array.prototype.forEach.call(arguments,function(t){"string"!=typeof t&&console.error("apijs.dialog.remove argument is not a string",t),-1<this.klass.indexOf(t)&&this.klass.splice(this.klass.indexOf(t),1)},this),this.update()},this.toggle=function(t,e){return"string"==typeof t&&"string"==typeof e||console.error("apijs.dialog.toggle argument is not a string",t,e),this.has(t)&&this.remove(t),this.has(e)||this.add(e),this.update()},this.has=function(){return this.klass.has(apijs.toArray(arguments))},this.actionClose=function(t){apijs.config.slideshow.anchor&&"function"==typeof history.pushState&&new RegExp("#("+apijs.config.slideshow.ids+"[-\\.]\\d+[-\\.]\\d+)").test(self.location.href)&&history.pushState({},"",self.location.href.slice(0,self.location.href.indexOf("#"))),"object"==typeof t?"apijsDialog"!==t.target.getAttribute("id")||apijs.dialog.has("photo","video","progress","waiting","lock")||apijs.dialog.clear(!0):this.t1&&this.clear(!0)},this.onCloseBrowser=function(t){if(apijs.dialog.has("progress","waiting","lock"))return t.preventDefault(),t.stopPropagation(),t.m=apijs.i18n.translate(124),t.returnValue=t.m,t.m},this.onResizeBrowser=function(){var t=document.querySelector("body").clientWidth;apijs.dialog[t<=(apijs.dialog.has("photo","video")?900:460)?"add":"remove"]("mobile"),apijs.dialog[t<=300?"add":"remove"]("tiny")},this.onScrollBrowser=function(t){var e=apijs.dialog,i=t.target,s=!1;if(e.has("slideshow")&&!e.has("playing")&&!["OPTION","SELECT"].has(i.nodeName)&&["DOMMouseScroll","mousewheel","swipeleft","swiperight","swipeup","swipedown","swiped-left","swiped-right","swiped-up","swiped-down"].has(t.type))i=(new Date).getTime()/1e3,(e.scroll<1||i>e.scroll+1)&&(e.scroll=i,s=0<t.detail||t.wheelDelta<0,apijs.slideshow[["swipeleft","swipeup","swiped-left","swiped-up"].has(t.type)||s?"actionNext":"actionPrev"]());else{if("OPTION"===i.nodeName)i=i.parentNode;else if(!["TEXTAREA","SELECT"].has(i.nodeName))for(;!0!==s&&"HTML"!==i.nodeName;)i.classList.contains("scrollable")?s=!0:i=i.parentNode;if(i.scrollHeight>i.offsetHeight&&"HTML"!==i.nodeName&&((s=0<t.detail||t.wheelDelta<0)&&i.scrollTop<i.scrollHeight-i.offsetHeight-1||!s&&0<i.scrollTop))return}t.preventDefault(),t.stopPropagation()},this.onScrollIframe=function(t){for(var e,i=t.target;i.parentNode;)i=i.parentNode;((e=0<t.detail||t.wheelDelta<0)&&i.defaultView.innerHeight+i.defaultView.scrollY>=i.body.offsetHeight-1||!e&&i.defaultView.scrollY<=0)&&(t.preventDefault(),t.stopPropagation())},this.onKey=function(t){var e,i=apijs.dialog,s=i.media;i.has("progress","waiting","lock")?(t.ctrlKey&&[81,87,82,115,116].has(t.keyCode)||t.altKey&&115===t.keyCode||[27,116].has(t.keyCode))&&t.preventDefault():i.has("photo","video")&&122===t.keyCode?(t.preventDefault(),apijs.requestFullscreen(i.t1)):i.has("slideshow")?27===t.keyCode?(t.preventDefault(),i.actionClose()):35===t.keyCode?(t.preventDefault(),apijs.slideshow.actionLast()):36===t.keyCode?(t.preventDefault(),apijs.slideshow.actionFirst()):37===t.keyCode?(t.preventDefault(),apijs.slideshow.actionPrev()):39===t.keyCode&&(t.preventDefault(),apijs.slideshow.actionNext()):27===t.keyCode&&(t.preventDefault(),i.actionClose()),i.has("video")&&!i.has("videoiframe")&&([32,80].has(t.keyCode)?(t.preventDefault(),[1,2].has(s.networkState)&&(s.ended||s.paused?s.play():s.pause())):[38,33].has(t.keyCode)?(t.preventDefault(),e=38===t.keyCode?10:60,[1,2].has(s.networkState)&&s.duration!==1/0&&!isNaN(s.duration)&&(s.currentTime>e?s.currentTime-=e:s.currentTime=0)):[40,34].has(t.keyCode)?(t.preventDefault(),[1,2].has(s.networkState)&&s.duration!==1/0&&!isNaN(s.duration)&&(e=40===t.keyCode?10:60,s.currentTime<s.duration-e)&&(s.currentTime+=e)):107===t.keyCode?(t.preventDefault(),[1,2].has(s.networkState)&&(s.muted&&(s.muted=!1),s.volume<.8?s.volume+=.2:s.volume=1)):109===t.keyCode?(t.preventDefault(),[1,2].has(s.networkState)&&(s.muted&&(s.muted=!1),.21<s.volume?s.volume-=.2:s.volume=0)):77===t.keyCode&&(t.preventDefault(),[1,2].has(s.networkState))&&(s.muted=!s.muted)),![32,33,34,35,36,38,40].has(t.keyCode)||t.target&&(["INPUT","TEXTAREA","OPTION","SELECT"].has(t.target.nodeName)||t.target.classList.contains("scrollable"))||(t.preventDefault(),t.stopPropagation())},this.onFullscreen=function(t){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;t&&apijs.log("dialog:onFullscreen:"+(e?"in":"out")),apijs.dialog[e?"add":"remove"]("fullscreen")},this.onIframeLoad=function(t){t.removeAttribute("class"),apijs.dialog.remove("loading"),t.contentWindow.document.addEventListener("keydown",window.parent.apijs.dialog.onKey),t.contentWindow.addEventListener("DOMMouseScroll",window.parent.apijs.dialog.onScrollIframe,{passive:!1}),t.contentWindow.addEventListener("mousewheel",window.parent.apijs.dialog.onScrollIframe,{passive:!1}),t.contentWindow.addEventListener("touchmove",window.parent.apijs.dialog.onScrollIframe,{passive:!1})},this.onMediaLoad=function(t){var e,i=apijs.dialog,s=i.media;t&&t.target&&(e=t.target.currentSrc||t.target.src,apijs.log("dialog:onMediaLoad:"+t.type+" "+(e?e.slice(e.lastIndexOf("/")+1):""))),s&&["load","durationchange"].has(t.type)?(i.remove("loading","error"),s.style.visibility="visible",s.hasAttribute("src")||"IMG"!==s.nodeName||s.setAttribute("src",s.imageLoader.src)):s&&"error"===t.type&&(i.toggle("loading","error"),s.removeAttribute("style"),e=apijs.html(".tracks.video select"))&&t&&t.target&&0<(i=e.querySelectorAll("option")).length&&0<e.value.length&&(i[e.value].setAttribute("disabled","disabled"),e.selectedIndex+=1,"VIDEO"===t.target.nodeName)&&""!==e.value&&s.videoPlayer.actionVideo(e)},this.onSlideshowSwipe=function(t){apijs.dialog.swipe=!0,self.setTimeout(function(){apijs.dialog.swipe=!1},150),["swiperight","swipedown","swiped-right","swiped-down"].has(t.type)?apijs.slideshow.actionPrev():apijs.slideshow.actionNext()},this.actionConfirm=function(){return this.has("options")&&!0!==this.callback(!1,this.args)||(this.add("lock","loading"),this.htmlSvgLoader(!1),apijs.html("div.btns").style.visibility="hidden",apijs.html("div.bbcode").style.visibility="hidden",self.setTimeout(function(){this.t2&&"FORM"===this.t2.nodeName?this.callback(this.t2.getAttribute("action"),this.args):this.t2&&this.callback(this.args)}.bind(this),12)),!1},this.init=function(t,e,i){return i=!0===i,"string"==typeof e?e=0<(e=e.replace(this.ft,"").trim()).length?i?e+" lock":e:i?"lock":null:i&&(e="lock"),this.t0&&this.clear(!1),this.klass.push("start"),this.klass.push(t),self.matchMedia("prefers-reduced-motion:reduce").matches&&this.klass.push("reduce"),"string"==typeof e&&(this.klass=this.klass.concat(e.split(" "))),this.t0=document.createDocumentFragment(),document.addEventListener("keydown",this.onKey),self.addEventListener("beforeunload",this.onCloseBrowser),self.addEventListener("DOMMouseScroll",this.onScrollBrowser,{passive:!1}),self.addEventListener("mousewheel",this.onScrollBrowser,{passive:!1}),self.addEventListener("touchmove",this.onScrollBrowser,{passive:!1}),self.addEventListener("resize",this.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.setAttribute("tabindex","-1")}),this},this.show=function(t){this.onResizeBrowser(),this.onFullscreen(),0<this.height&&!this.has("photo","video")&&(this.t2.style.minHeight=this.height+"px");var e=apijs.html("#Dialog");return e?(this.toggle("start","ready"),this.t1=e,apijs.toArray(this.t0.firstChild.childNodes).forEach(function(t){this.t1.appendChild(t)},this),this.t1.setAttribute("class",this.t2.getAttribute("class"))):this.has("notransition")?(this.toggle("start","ready"),document.querySelector("body").appendChild(this.t0)):(document.querySelector("body").appendChild(this.t0),self.setTimeout(function(){apijs.dialog.toggle("start","ready")},12)),apijs.config.dialog.closeOnClick&&!this.has("progress","waiting","lock")&&document.addEventListener("click",this.actionClose),this.has("photo","video")?document.webkitFullscreenEnabled?document.addEventListener("webkitfullscreenchange",this.onFullscreen):document.fullscreenEnabled?document.addEventListener("fullscreenchange",this.onFullscreen):document.mozFullScreenEnabled&&document.addEventListener("mozfullscreenchange",this.onFullscreen):this.has("upload")&&window.addEventListener("paste",apijs.upload.actionDrag),!0===t?self.setTimeout(function(){apijs.html("input:not([readonly]),textarea:not([readonly]),select:not([disabled])").focus()},12):"string"==typeof t&&apijs.html(t).focus(),!0},this.clear=function(t){if(t&&this.xhr&&(this.callback=null,this.xhr.abort()),this.hammer&&(this.hammer.off("swiperight swipedown swipeleft swipeup",apijs.dialog.onSlideshowSwipe).destroy(),delete this.hammer),document.removeEventListener("keydown",this.onKey),self.removeEventListener("beforeunload",this.onCloseBrowser),self.removeEventListener("DOMMouseScroll",this.onScrollBrowser,{passive:!1}),self.removeEventListener("mousewheel",this.onScrollBrowser,{passive:!1}),self.removeEventListener("touchmove",this.onScrollBrowser,{passive:!1}),self.removeEventListener("resize",this.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.removeAttribute("tabindex")}),apijs.config.dialog.closeOnClick&&document.removeEventListener("click",this.actionClose),this.has("photo","video")?(this.has("video")&&!this.has("videoiframe")&&this.t2.querySelectorAll("video, source, track").forEach(function(t){for(var e in t)0===e.indexOf("on")&&(t[e]=null);t.removeAttribute("src")}),this.media.videoPlayer=null,this.media.imageLoader=null,document.webkitFullscreenEnabled?document.removeEventListener("webkitfullscreenchange",this.onFullscreen):document.fullscreenEnabled?document.removeEventListener("fullscreenchange",this.onFullscreen):document.mozFullScreenEnabled&&document.removeEventListener("mozfullscreenchange",this.onFullscreen)):(this.has("upload")&&window.removeEventListener("paste",apijs.upload.actionDrag),this.height=parseFloat(self.getComputedStyle(this.t2).height)),t)this.toggle("ready","end"),this.t1.remove();else for(;this.t1.firstChild;)this.t1.firstChild.remove();return this.klass=[],t&&(this.height=0,this.scroll=0,this.callback=null,this.args=null,this.xhr=null),this.media=null,this.t0=null,this.t1=null,this.t2=null,this.t3=null,this.a=null,this.b=null,!(this.c=null)},this.htmlParent=function(t,e,i){return this.t1=document.createElement("div"),this.t1.setAttribute("id","apijsDialog"),"string"==typeof i?(this.t1.setAttribute("ondragenter",i),this.t1.setAttribute("ondragleave",i),this.t1.setAttribute("ondragover",i),this.t1.setAttribute("ondrop",i),this.t1.setAttribute("onpaste",i),this.a=document.createElement("p"),this.a.setAttribute("class","drag"),this.a.appendChild(apijs.i18n.translateNode(127)),this.t1.appendChild(this.a)):this.t1.setAttribute("ondragstart","return false;"),"string"==typeof t?(this.t2=document.createElement("form"),this.t2.setAttribute("action",t),this.t2.setAttribute("method","post"),this.t2.setAttribute("enctype","multipart/form-data"),this.t2.setAttribute("onsubmit","return "+e)):this.t2=document.createElement("div"),this.t2.setAttribute("id","apijsBox"),this.t1.appendChild(this.t2),this.t0.appendChild(this.t1),this},this.htmlContent=function(t,e){return 0<t.length&&(this.a=document.createElement("h1"),this.a.innerHTML=t.replace(/</g,"<").replace(/>/g,">").replace(/\[/g,"<").replace(/]/g,">"),this.t2.appendChild(this.a)),0<e.length&&(this.a=document.createElement("div"),this.a.setAttribute("class","bbcode"),"["!==e[0]&&(e="[p]"+e+"[/p]"),this.a.innerHTML=e.replace(/</g,"<").replace(/>/g,">").replace(/\[/g,"<").replace(/]/g,">"),this.a.querySelectorAll("a.popup").forEach(function(t){t.addEventListener("click",apijs.openTab)}),this.t2.appendChild(this.a)),this},this.htmlBtnOk=function(){return this.a=document.createElement("div"),this.a.setAttribute("class","btns"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","confirm"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(102)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnConfirm=function(t,e){return this.a=document.createElement("div"),this.a.setAttribute("class","btns"),this.b=document.createElement("button"),this.b.setAttribute("type",t),this.b.setAttribute("class","confirm"),"submit"!==t&&this.b.setAttribute("onclick",e),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(104)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","cancel"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(103)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnNavigation=function(){return this.a=document.createElement("div"),this.a.setAttribute("class","navigation noplaying"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("disabled","disabled"),this.b.setAttribute("class","prev"),this.b.setAttribute("id","apijsPrev"),this.b.setAttribute("onclick","apijs.slideshow.actionPrev();"),this.c=document.createElement("span"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("disabled","disabled"),this.b.setAttribute("class","next"),this.b.setAttribute("id","apijsNext"),this.b.setAttribute("onclick","apijs.slideshow.actionNext();"),this.c=document.createElement("span"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),"function"==typeof Hammer&&(this.hammer=new Hammer(this.t2),this.hammer.get("swipe").set({direction:Hammer.DIRECTION_ALL}),this.hammer.on("swiperight swipedown swipeleft swipeup",apijs.dialog.onSlideshowSwipe)),this},this.htmlBtnClose=function(t){return!1!==t&&(this.a=document.createElement("div"),this.a.setAttribute("class","close nofullplaying"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","close"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(105)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a)),this},this.htmlUpload=function(t,e,i){return this.a=document.createElement("div"),this.a.setAttribute("class","btns upload"),this.t3=document.createElement("input"),this.t3.setAttribute("type","file"),this.t3.setAttribute("name",e?t+"[]":t),this.t3.setAttribute("id","apijsFile"),e&&this.t3.setAttribute("multiple","multiple"),this.t3.setAttribute("onchange",i),this.a.appendChild(this.t3),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","browse"),this.b.setAttribute("onclick","this.previousSibling.click();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(e?109:108)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("div"),this.b.setAttribute("class","filenames scrollable"),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlSvgProgress=function(){return this.a=document.createElement("span"),this.a.setAttribute("class","info"),this.t2.appendChild(this.a),this.a=document.createElement("svg"),this.a.setAttribute("id","apijsProgress"),this.b=document.createElement("rect"),this.b.setAttribute("class","auto"),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlSvgLoader=function(t){return this.a=document.createElementNS(this.ns,"svg"),this.a.setAttribute("class","loader"),this.b=document.createElementNS(this.ns,"path"),!1!==t&&this.b.setAttribute("style","opacity:0;"),this.b.setAttribute("d","M75.4 126.63a11.43 11.43 0 0 1-2.1-22.65 40.9 40.9 0 0 0 30.5-30.6 11.4 11.4 0 1 1 22.27 4.87h.02a63.77 63.77 0 0 1-47.8 48.05v-.02a11.38 11.38 0 0 1-2.93.37z"),this.c=document.createElementNS(this.ns,"animateTransform"),this.c.setAttribute("attributeName","transform"),this.c.setAttribute("type","rotate"),this.c.setAttribute("from","0 64 64"),this.c.setAttribute("to","360 64 64"),this.c.setAttribute("dur","5s"),this.c.setAttribute("repeatCount","indefinite"),this.b.appendChild(this.c),this.c=document.createElementNS(this.ns,"animate"),this.c.setAttribute("attributeName","opacity"),this.c.setAttribute("to","1"),this.c.setAttribute("dur","0.01s"),this.c.setAttribute("begin","1s"),this.c.setAttribute("fill","freeze"),!1!==t&&this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlMedia=function(t,e,i,s){var a;return this.a=document.createElement("dl"),this.a.setAttribute("class","media"),this.b=document.createElement("dt"),this.has("photo")?(this.media=document.createElement("img"),this.media.setAttribute("alt",s.replace('"',""))):0<t.indexOf("iframe")?(this.media=document.createElement("iframe"),this.media.setAttribute("type","text/html"),this.media.setAttribute("scrolling","no"),this.media.setAttribute("src",t)):(this.media=document.createElement("video"),this.media.setAttribute("controls","controls"),this.media.setAttribute("preload","metadata")),this.media.setAttribute("id","apijsMedia"),this.b.appendChild(this.media),this.a.appendChild(this.b),this.b=document.createElement("dd"),this.b.setAttribute("class","nofullplaying"),"false"===e&&"false"===i||(a=t.slice(t.lastIndexOf("/")+1),this.c=document.createElement("span"),"false"!==e&&"auto"!==e&&"false"!==i?this.c.appendChild(document.createTextNode(e+" ("+i+") ")):"false"!==e&&"auto"!==e?this.c.appendChild(document.createTextNode(e+" ")):"auto"===e&&"false"!==i?this.c.appendChild(document.createTextNode(a+" ("+i+") ")):"auto"===e?this.c.appendChild(document.createTextNode(a+" ")):"false"!==i&&this.c.appendChild(document.createTextNode("("+i+") ")),this.b.appendChild(this.c)),this.b.appendChild(document.createTextNode(s)),this.a.appendChild(this.b),this.t2.appendChild(this.a),this.has("photo")?(this.media.imageLoader=new Image,this.media.imageLoader.src=t,this.media.imageLoader.onload=this.onMediaLoad,this.media.imageLoader.onerror=this.onMediaLoad):0<t.indexOf("iframe")?(this.media.onload=function(t){this.onIframeLoad(this.media),this.onMediaLoad(t)}.bind(this),this.add("videoiframe")):apijs.startPlayer(this.media,t)?this.add("apijsvideoplayer"):(this.c=document.createElement("source"),this.c.setAttribute("src",t),this.c.onerror=this.onMediaLoad,this.media.appendChild(this.c),this.media.ondurationchange=this.onMediaLoad,this.media.onerror=this.onMediaLoad,this.add("videosource")),this},this.htmlHelp=function(t,e){if(!("ontouchstart"in window&&navigator.userAgent.match(/mobi/i))){var i,s,a=[t?["start",149,141]:[],t?["left","right",142]:[],e?["topk","bottom",144]:[],e?["minus","plus",145]:[],e?["M",146]:[],e?["P",143]:[],["F11",147],[150,148]];for(this.a=document.createElement("ul"),this.a.setAttribute("class","kbd nofullscreen");i=a.shift();)if(0<i.length){for(this.b=document.createElement("li");s=i.shift();)0<i.length?(this.c=document.createElement("kbd"),["M","P","F11"].has(s)?this.c.appendChild(document.createTextNode(s)):"string"==typeof s?this.c.setAttribute("class",s):this.c.appendChild(apijs.i18n.translateNode(s)),this.b.appendChild(this.c)):this.b.appendChild(apijs.i18n.translateNode(s));this.a.appendChild(this.b)}this.t2.appendChild(this.a)}return this},this.htmlIframe=function(t){return this.a=document.createElement("iframe"),this.a.setAttribute("src",t),this.a.setAttribute("class","loading"),this.a.setAttribute("onload","apijs.dialog.onIframeLoad(this);"),this.t2.appendChild(this.a),this}},apijs.core.slideshow=function(){this.current=null,this.init=function(){for(var t,e,i,s=apijs.config.slideshow.ids,a=0;e=apijs.html(s+"."+a,!0);a++){for(i=e.classList.contains("hoverload"),t=0;e=apijs.html(s+"."+a+"."+t,!0);t++)e.addEventListener("click",this.show),i&&e.addEventListener("mouseover",this.show);(e=apijs.html(s+"."+a+".99999",!0))&&e.addEventListener("click",this.show)}this.onPopState()},this.onPopState=function(){var t;new RegExp("#("+apijs.config.slideshow.ids+"[-\\.]\\d+[-\\.]\\d+)").test(self.location.href)?(t=RegExp.$1.replace(/-/g,"."),apijs.html(t,!0)&&!apijs.dialog.has("slideshow")&&apijs.slideshow.show(t,!1)):apijs.slideshow.current&&apijs.dialog.actionClose()},this.show=function(t,e){var i,s,a,n=!1,o={};if("string"==typeof t)i=apijs.html(t,n=!0),o.id=t;else{for(t.preventDefault(),i=t.target;"A"!==i.nodeName;)i=i.parentNode;if("mouseover"===t.type&&i.classList.contains("current"))return!1;o.id=i.getAttribute("id")}return o.prefix=apijs.config.slideshow.ids+"."+o.id.split(".")[1],o.number=parseInt(o.id.split(".")[2],10),o.gallery=apijs.html(o.prefix+".99999",!0),99999!==o.number&&(t=apijs.html(o.prefix,!0).querySelectorAll("a[id][type]"),a=apijs.html(o.prefix,!0).querySelectorAll("dl"),(o.gallery||t.length!==a.length?(t.forEach(function(t){t.classList.remove("current")}),i):(a.forEach(function(t){t.classList.remove("current")}),i.parentNode.parentNode)).setAttribute("class","current")),o.gallery?(99999===o.number&&(n=!0,i=o.gallery.hasAttribute("class")?o.gallery.getAttribute("class"):o.prefix+".0",i=apijs.html(i,!0),o.number=parseInt(i.getAttribute("id").split(".")[2],10),o.id=o.id.replace("99999",o.number)),o.config=i.querySelector("input").getAttribute("value").split("|"),0<(t=o.config.shift()).indexOf(";")&&(s=(t=t.split(";"))[1].trim(),t=t[0].trim()),o.gallery.setAttribute("href",i.getAttribute("href")),o.gallery.querySelector("img").setAttribute("src",t),o.gallery.querySelector("img").setAttribute("srcset",s||""),o.gallery.querySelector("img").setAttribute("alt",i.querySelector("img").getAttribute("alt")),o.gallery.setAttribute("class",o.id)):(n=!0,o.config=i.querySelector("input").getAttribute("value").split("|")),o.url=i.getAttribute("href"),o.type=i.getAttribute("type").substring(0,5).replace("image","dialogPhoto").replace("video","dialogVideo").replace("audio","dialogVideo"),o.type=0===o.type.indexOf("dialog")?o.type:"dialogPhoto",o.styles=apijs.html(o.prefix,!0),o.styles=o.styles.hasAttribute("class")?o.styles.getAttribute("class").replace(/gallery|album/g,"").trim():"",n&&(apijs.dialog[o.type](o.url,o.config[0],o.config[1],o.config[2],o.styles),a=apijs.html(o.prefix,!0).querySelectorAll("a[id][type]").length-(o.gallery?2:1),apijs.slideshow.current={number:o.number,first:o.prefix+".0",prev:0<o.number?o.prefix+"."+(o.number-1):null,next:o.number<a?o.prefix+"."+(o.number+1):null,last:o.prefix+"."+a,total:a},apijs.slideshow.current.prev&&apijs.html("#Prev").removeAttribute("disabled"),apijs.slideshow.current.next&&apijs.html("#Next").removeAttribute("disabled"),apijs.config.slideshow.anchor)&&"function"==typeof history.pushState&&("boolean"!=typeof e||e)&&(t=0<(t=self.location.href).indexOf("#")?t.slice(0,t.indexOf("#")):t,t+="#"+(o.prefix+"."+(99999===o.number?0:o.number)).replace(/\./g,"-"),history.pushState({},"",t)),n},this.actionFirst=function(){return!!(this.current&&0<this.current.number&&this.current.number<=this.current.total)&&this.show(this.current.first)},this.actionPrev=function(){return!!(this.current&&this.current.prev&&0<this.current.number)&&this.show(this.current.prev)},this.actionNext=function(){return!!(this.current&&this.current.next&&this.current.number<this.current.total)&&this.show(this.current.next)},this.actionLast=function(){return!!(this.current&&0<=this.current.number&&this.current.number<this.current.total)&&this.show(this.current.last)}},apijs.core.upload=function(){this.title=null,this.action=null,this.input=null,this.onemax=0,this.allmax=0,this.exts=null,this.callback=null,this.args=null,this.icon=null,this.start=0,this.end=0,this.sendFile=function(t,e,i,s,a,n,o,r){t=this.sendFiles(t,e,i,s,0,a,n,o,r);return t||console.error("apijs.upload.sendFile invalid arguments",arguments),t},this.sendFiles=function(t,e,i,s,a,n,o,r,l){return!0!==t&&(this.title=t,this.action=e,this.input=i,this.onemax=s,this.allmax=a,this.exts="string"==typeof n?n.split(","):["*"],this.callback=o,this.args=r,this.icon=l),"string"==typeof this.title&&"string"==typeof this.action&&"string"==typeof this.input&&"number"==typeof this.onemax&&"number"==typeof this.allmax&&"function"==typeof this.callback?(t=0<this.allmax,e="*"===this.exts.join()?apijs.i18n.translate(161):1===this.exts.length?apijs.i18n.translate(162,this.exts.join()):apijs.i18n.translate(163,this.exts.slice(0,-1).join(", "),this.exts.slice(-1)),e+="[br]"+apijs.i18n.translate(t?165:164,apijs.formatNumber(this.onemax),t?apijs.formatNumber(this.allmax):"").replace("|","[br]"),apijs.dialog.dialogFormUpload(this.title,e,this.action,this.input,t,this.icon)):(("number"!=typeof this.allmax||0<this.allmax)&&console.error("apijs.upload.sendFiles invalid arguments",arguments),!1)},this.actionDrag=function(t){var e=apijs.dialog.t3,i=!0;if("dragenter"===t.type)apijs.dialog.add("drag");else if("dragleave"===t.type)apijs.dialog.remove("drag");else if(t.dataTransfer&&t.dataTransfer.files&&0<t.dataTransfer.files.length){try{e.files=t.dataTransfer.files,apijs.upload.actionChoose(e)}catch(t){console.error(t),apijs.html(".drag").remove()}apijs.dialog.remove("drag")}else if(t.clipboardData&&t.clipboardData.files&&0<t.clipboardData.files.length)try{e.files=t.clipboardData.files,apijs.upload.actionChoose(e,!0)}catch(t){console.error(t),apijs.html(".drag").remove()}else t.clipboardData&&(i=!1);i&&(t.stopPropagation(),t.preventDefault())},this.actionChoose=function(t,s){var a=[],n=0,e=apijs.html("button.confirm");!this.exts||(apijs.toArray(t.files,0<this.allmax?999:1).forEach(function(t,e){var i=t.size/1048576,i=apijs.formatNumber(i<.01?.01:i);i=(s||0<this.allmax?'<td class="nb">'+(s?(new Date).toTimeString().substring(0,8):e+1)+"</td>":"")+'<td class="name">'+t.name+'</td><td class="size">'+apijs.i18n.translate(166,i)+"</td>","*"===this.exts.join()||this.exts.has(t.name.slice(t.name.lastIndexOf(".")+1).toLowerCase())?t.size>1048576*this.onemax?i+='<td class="err">'+apijs.i18n.translate(168)+"</td>":t.size<=0?i+='<td class="err">'+apijs.i18n.translate(169)+"</td>":i+="<td></td>":i+='<td class="err">'+apijs.i18n.translate(167)+"</td>",a.push("<tr>"+i+"</tr>"),n+=t.size/1048576},this),0<this.allmax&&n>=this.allmax&&a.push('<tr class="tt"><td></td><td></td><td class="size">'+apijs.i18n.translate(166,apijs.formatNumber(n))+'</td><td class="err">'+apijs.i18n.translate(168)+"</td></tr>"),apijs.html("div.filenames").innerHTML="<table>"+a.join("")+"</table>",apijs.html("div.filenames .err"))?e.setAttribute("disabled","disabled"):(e.removeAttribute("disabled"),e.focus())},this.actionConfirm=function(){var t,e;return 0<apijs.dialog.t3.files.length?(t=new FormData(apijs.dialog.t2),(e=new XMLHttpRequest).open("POST",this.action+(0<this.action.indexOf("?")?"&isAjax=true":"?isAjax=true"),!0),"string"==typeof apijs.config.upload.tokenValue&&(e.setRequestHeader(apijs.config.upload.tokenName,apijs.config.upload.tokenValue),t.append(apijs.config.upload.tokenName,apijs.config.upload.tokenValue)),e.onreadystatechange=function(t){4===e.readyState&&(t=e.responseText.trim(),[0,200].has(e.status)?(self.dispatchEvent(new CustomEvent("apijsajaxresponse",{detail:{from:"apijs.upload.send",xhr:e}})),apijs.log("upload:onreadystatechange status:200 message:"+t),0===t.indexOf("success-")?(this.updateTitle(),this.callback(t.slice(8),this.args)):this.onError(195,t)):(apijs.log("upload:onreadystatechange status:"+e.status+" message: "+t),this.onError(194,e.status)))}.bind(this),e.upload.onloadstart=this.onStart.bind(this),e.upload.onprogress=this.onProgress.bind(this),e.upload.onload=this.onProgress.bind(this),e.upload.onerror=this.onError.bind(this),e.send(t)):apijs.html("button.browse").focus(),!1},this.onStart=function(){this.start=this.end=Math.round((new Date).getTime()/1e3),apijs.dialog.dialogProgress(this.title,apijs.i18n.translate(125),this.icon)},this.onError=function(t,e){this.updateTitle(),"number"==typeof t?e="[p]"+apijs.i18n.translate(t)+"[/p] "+e:"string"!=typeof e&&(e="[p]"+apijs.i18n.translate(193)+"[/p]"),e+="[p]"+apijs.i18n.translate(196,'href="apijs://restart" onclick="apijs.upload.sendFile(true); return false;"')+"[/p]",apijs.dialog.dialogInformation(this.title,e,"string"==typeof this.icon?"upload error "+this.icon:"upload error")},this.onProgress=function(t){var e,i,s,a,n,o,r=Math.round((new Date).getTime()/1e3);t.lengthComputable&&"progress"===t.type&&r>=this.end+2?(this.end=r,0<(e=Math.floor(100*t.loaded/t.total))&&e<100&&(this.updateTitle(e),n=100*(r=r-this.start)/e+10,24<r&&(a=Math.round(n-r),a=10*Math.ceil(a/10),o=Math.ceil(a/60),s=Math.round(t.loaded/r/1024),r<40||n<90?(i=184,a=null):1<o?(i=181,a=o):50<a?(i=182,a=1):i=183),this.updateProgress(e,i,s,a))):"load"===t.type&&(a=Math.round((new Date).getTime()/1e3)-this.start,o=Math.ceil(a/60),0<(s=Math.round(t.loaded/a/1024))&&s!==1/0?1<o?(i=185,a=o):50<a?(i=186,a=1):20<a?i=187:(i=188,a=null):a=s=null,this.updateTitle(100),this.updateProgress(100,i,s,a))},this.updateProgress=function(t,e,i,s){var a,n,o=apijs.html("rect"),r=apijs.html("span.info");99<t?(a="100%",o.setAttribute("class","end"),o.style.width="",(n=apijs.html("p")).setAttribute("data-old",n.textContent),n.setAttribute("data-new",apijs.i18n.translate(126)),n.setAttribute("class","anim"),n.textContent=""):(o.style.width=a=t+"%",o.hasAttribute("class")&&o.removeAttribute("class")),"number"==typeof e&&"number"==typeof i&&"number"==typeof s?a=apijs.i18n.translate(e,t,apijs.formatNumber(i,!1),s):"number"==typeof e&&"number"==typeof i&&(a=apijs.i18n.translate(e,t,apijs.formatNumber(i,!1))),r.textContent=a},this.updateTitle=function(t){"number"==typeof t?document.title=/^\d{1,3}% - /.test(document.title)?t+"% - "+document.title.slice(document.title.indexOf(" - ")+3):t+"% - "+document.title:/^\d{1,3}% - /.test(document.title)&&(document.title=document.title.slice(document.title.indexOf(" - ")+3))}};
|
7
|
+
Array.prototype.has||(Array.prototype.has=function(t,e){if(t instanceof Array){for(e in t)if(t.hasOwnProperty(e)&&this.has(t[e]))return!0}else for(e in this)if(this.hasOwnProperty(e)&&this[e]===t)return!0;return!1}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(t,e,i){for(e=e||window,i=0;i<this.length;i++)t.call(e,this[i],i,this)});var apijs=new function(){this.core={},this.version=698,this.config={lang:"auto",debug:!1,dialog:{closeOnClick:!1,restrictNavigation:!0,player:!0},slideshow:{ids:"slideshow",anchor:!0},upload:{tokenName:"X-CSRF-Token",tokenValue:null}},this.start=function(){var t;if(console.info("APIJS "+this.version.toString().split("").join(".")+" - hello - 1 MB/Mo = 1024 kB/ko"),document.getElementById("oldBrowser"))throw new Error("APIJS canceled, #oldBrowser detected!");(t=document.querySelector('link[href*="apijs/fontello.woff2"]'))&&t.getAttribute("href").indexOf("?a3ab5acff3")<0&&console.error("APIJS warning invalid cachekey for link:fontello.woff2?x, it must be ?a3ab5acff3"),(t=document.querySelector('script[src*="apijs.min.js?v="]'))&&t.getAttribute("src").indexOf("?v="+this.version)<0&&console.error("APIJS warning invalid cachekey for script:apijs.min.js?x, it must be ?v="+this.version),this.i18n=new this.core.i18n,this.dialog=new this.core.dialog,this.upload=new this.core.upload,this.slideshow=new this.core.slideshow,self.dispatchEvent(new CustomEvent("apijsbeforeload")),this.i18n.init(),this.slideshow.init(),document.querySelectorAll("video.apijsplayer[data-src]").forEach(function(t){apijs.startPlayer(t,t.getAttribute("data-src"))}),self.addEventListener("popstate",this.slideshow.onPopState),self.addEventListener("hashchange",this.slideshow.onPopState),this.config.debug&&(console.info("APIJS available languages: "+Object.keys(this.i18n.data).join(" ")),console.info("APIJS language loaded: "+this.config.lang),console.info("APIJS successfully started")),self.dispatchEvent(new CustomEvent("apijsload"))},this.formatNumber=function(e,t){var i,s="number"==typeof t?t:!1===t?0:2;try{i=new Intl.NumberFormat(this.config.lang,{minimumFractionDigits:s,maximumFractionDigits:s}).format(e)}catch(t){i=e.toFixed(s)}return"number"==typeof t?i:i.replace(/[.,]00$/,"")},this.startPlayer=function(t,e){return!0===this.config.dialog.player?(t.videoPlayer=new this.core.player(t,e),t.parentNode.classList.add("apijsvideoplayer"),!0):"function"==typeof this.config.dialog.player&&(this.config.dialog.player(t,e),!0)},this.toArray=function(t,e){return Array.prototype.slice.call(t,0,e)},this.openTab=function(t){t.preventDefault(),0<this.href.length&&self.open(this.href)},this.log=function(t){this.config.debug&&console.info("APIJS "+t)},this.html=function(t,e){return!0===e||0===t.indexOf("#")?document.getElementById(t.replace("#","apijs")):this.dialog.t1?this.dialog.t1.querySelector(t):null},this.requestFullscreen=function(t){document.webkitFullscreenElement?document.webkitCancelFullScreen():document.mozFullScreenElement?document.mozCancelFullScreen():document.fullscreenElement?document.cancelFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen&&t.mozRequestFullScreen()},this.serialize=function(t,i){var s=[];return i="string"==typeof i?i:"",Array.prototype.forEach.call(t.elements,function(t,e){if(t.name&&!t.disabled&&!["file","reset","submit","button"].has(t.type)&&0===t.name.indexOf(i))if("select-multiple"===t.type)for(e=0;e<t.options.length;e++)t.options[e].selected&&s.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.options[e].value));else["checkbox","radio"].has(t.type)&&!t.checked||s.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}),s.join("&")}};"function"==typeof self.addEventListener&&self.addEventListener("load",apijs.start.bind(apijs)),apijs.core.i18n=function(){this.data={cs:{103:"Zrušit",104:"Potvrzení",105:"Zavřít",106:"Předchozí",107:"Následující",108:"Vybrat soubor",132:"video stopa",133:"zvuková stopa",134:"titulky",135:"vypnuto",142:"předchozí/následující",143:"přehrát/pozastavit",144:"zpět/vpřed",145:"snížit/zvýšit hlasitost",146:"ztlumit",148:"ukončit",149:"Konec",150:"Esc"},de:{103:"Abbrechen",104:"Bestätigen",105:"Schließen",106:"Vorheriges",107:"Nächstes",108:"Datei wählen",109:"Dateien wählen",124:"Verarbeitung läuft...",132:"videospur",133:"audiospur",134:"untertitel",135:"aus",142:"vorheriges/nächstes",143:"wiedergabe/pause",144:"rückwärts/vorwärts",145:"leiser/lauter",146:"ton aus",147:"vollbild",148:"beenden",149:"Ende",150:"Esc",161:"Alle Dateien wurden akzeptiert.",162:"Akzeptiertes Dateiformat: §.",163:"Akzeptiertes Dateiformate: § und §.",164:"Maximale Größe: § MB.",167:"Unerlaubtes Format",168:"Format zu gross",169:"Leere Datei",181:"§% - § kB/s - Noch § Minuten",182:"§% - § kB/s - Noch § Minute",183:"§% - § kB/s - Noch § Sekunden",185:"§% - bis § kB/s in § Minuten",186:"§% - bis § kB/s in § Minute",187:"§% - bis § kB/s in § Sekunden",188:"§% - bis § kB/s",191:"Abbrechen",192:"Sind Sie sicher? [span]Ja[/span] - Nein",193:"Es ist ein unerwarteter Fehler aufgetreten... Bitte versuchen Sie es noch einmal.",194:"Es ist ein Fehler beim Senden.",195:"Es ist ein Fehler bei der Verarbeitung.",196:"Wir laden Sie ein es erneut zu [a §]versuchen[/a]."},el:{102:"Εντάξει",103:"Ακύρωση",105:"Κλείσιμο",106:"Προηγούμενο",107:"Επόμενο",108:"Επιλέξτε ένα αρχείο",131:"βίντεο",132:"κομμάτι βίντεο",133:"κομμάτι ήχου",134:"υπότιτλοι",135:"απενεργοποίηση",142:"προηγούμενο/επόμενο",143:"αναπαραγωγή/παύση",144:"προς τα πίσω/εμπρός",145:"μείωση/αύξηση έντασης ήχου",146:"σίγαση",147:"πλήρης οθόνη",148:"έξοδος",149:"Τέλος",150:"Esc"},en:{102:"Ok",103:"Cancel",104:"Confirm",105:"Close",106:"Previous",107:"Next",108:"Choose a file",109:"Choose one or multiple files",124:"Operation in progress...",125:"Upload in progress...",126:"Processing file in progress...",127:"Drag and drop your files here",131:"video",132:"video track",133:"audio track",134:"subtitles",135:"off",141:"first/last",142:"previous/next",143:"play/pause",144:"backward/forward",145:"decrease/increase the volume",146:"mute",147:"full screen",148:"quit",149:"End",150:"Escape",161:"All files are accepted.",162:"Accepted file format: §.",163:"Accepted file formats: § and §.",164:"Maximum size: § MB.",165:"Maximum size by file: § MB.|Total maximum size: § MB.",166:"§ MB",167:"Format not allowed",168:"Size too large",169:"File empty",181:"§% - § kB/s - § minutes left",182:"§% - § kB/s - § minute left",183:"§% - § kB/s - § seconds left",184:"§% - § kB/s",185:"§% - at § kB/s in § minutes",186:"§% - at § kB/s in § minute",187:"§% - at § kB/s in § seconds",188:"§% - at § kB/s",191:"Interrupt",192:"Are you sure? [span]Yes[/span] - No",193:"It seems that an unlikely mistake just happened... Please try again.",194:"An error occurred while sending.",195:"An error occurred while processing.",196:"We invite you to [a §]try again[/a]."},es:{102:"Aceptar",103:"Cancelar",104:"Confirmar",105:"Cerrar",106:"Anterior",107:"Siguiente",108:"Elegir un fichero",109:"Elegir uno o varios ficheros",124:"Operación en curso...",125:"Envío en progreso...",126:"Tratamiento en curso...",131:"vídeo",132:"pista de vídeo",133:"pista de audio",134:"subtítulos",135:"desactivar",142:"anterior/siguiente",143:"reproducir/pausa",144:"retroceder/avanzar",145:"bajar/subir volumen",146:"silenciar",147:"pantalla completa",148:"salir",149:"Fin",150:"Esc",161:"Se aceptan todos los archivos.",162:"Formato de archivo aceptado: §.",163:"Formatos de archivos aceptados: § y §.",164:"Tamaño máximo: § MB.",165:"Tamaño máximo por fichero: § Mo.|Tamaño máximo total: § Mo.",167:"Formato no autorizado",168:"Tamaño demasiado importante",169:"Fichero vacío",181:"§% - § kB/s - § minutos restantes",182:"§% - § kB/s - § minuto restantes",183:"§% - § kB/s - § segundos restantes",185:"§% - a § kB/s en § minutos",186:"§% - a § kB/s en § minuto",187:"§% - a § kB/s en § segundos",188:"§% - a § kB/s",191:"Interrumpir",192:"¿Está seguro(a)? [span]Sí[/span] - No",193:"Parece que un error improbable acabo de ocurrir... Por favor, inténtelo de nuevo.",194:"Se produjo un error durante el envío.",195:"Se produjo un error durante el procesamiento.",196:"Le invitamos a [a §]intentar de nuevo[/a]."},fr:{103:"Annuler",104:"Valider",105:"Fermer",106:"Précédent",107:"Suivant",108:"Choisir un fichier",109:"Choisir un ou plusieurs fichiers",124:"Opération en cours...",125:"Envoi en cours...",126:"Traitement en cours...",127:"Faites glisser et déposez vos fichiers ici",131:"vidéo",132:"piste vidéo",133:"piste audio",134:"sous-titres",141:"premier/dernier",142:"précédent/suivant",143:"lecture/pause",144:"reculer/avancer",145:"réduire/augmenter le volume",146:"couper le son",147:"plein écran",148:"quitter",149:"Fin",150:"Échap",161:"Tous les fichiers sont acceptés.",162:"Format de fichier accepté : §.",163:"Formats de fichier acceptés : § et §.",164:"Taille maximale : § Mo.",165:"Taille maximale par fichier : § Mo.|Taille maximale total : § Mo.",166:"§ Mo",167:"Format non autorisé",168:"Taille trop importante",169:"Fichier vide",181:"§% - § ko/s - § minutes restantes",182:"§% - § ko/s - § minute restante",183:"§% - § ko/s - § secondes restantes",184:"§% - § ko/s",185:"§% - à § ko/s en § minutes",186:"§% - à § ko/s en § minute",187:"§% - à § ko/s en § secondes",188:"§% - à § ko/s",191:"Interrompre",192:"Êtes-vous sûr(e) ? [span]Oui[/span] - Non",193:"Il semblerait qu'une erreur improbable vient de se produire... Veuillez réessayer.",194:"Une erreur est survenue lors de l'envoi.",195:"Une erreur est survenue lors du traitement.",196:"Nous vous invitons à [a §]réessayer[/a]."},hu:{103:"Mégsem",104:"Megerősít",105:"Bezár",106:"Előző",107:"Következő",108:"Válasszon fájlt",131:"videó",132:"videosáv",133:"hangsáv",134:"feliratok",135:"ki",142:"előző/következő",143:"lejátszás/szünet",144:"vissza/előre",145:"hangerő csökkentés/növelése",146:"némítás",147:"teljes képernyő",148:"kilépés",149:"Befejezés",150:"Esc"},it:{103:"Annulla",104:"Conferma",105:"Chiudi",106:"Precedente",107:"Successivo",108:"Scegli un file",109:"Scegli uno o più file",124:"Operazione in corso...",125:"Invio in corso...",126:"Trattamento in corso...",132:"traccia video",133:"traccia audio",134:"sottotitoli",135:"inattivo",142:"precedente/successivo",143:"riproduci/pausa",144:"indietro/avanti",145:"riduci/aumenta volume",146:"silenzio",147:"schermo intero",148:"esci",149:"Fine",150:"Esc",161:"Tutti i file sono accettati.",162:"Formato del file accettato: §.",163:"Formati accettati: § et §.",164:"Dimensione massima: § MB.",167:"Formato non autorizzato",168:"Dimensione troppo importante",169:"File vuoto",181:"§% - § kB/s - § minuti rimanenti",182:"§% - § kB/s - § minuto rimanente",183:"§% - § kB/s - § secondi rimanenti",185:"§% - a § kB/s in § minuti",186:"§% - a § kB/s in § minuto",187:"§% - a § kB/s in § secondi",188:"§% - a § kB/s",191:"Interrompere",192:"Sei sicuro? [span]Si[/span] - No",193:"Sembra che un errore inaspettato si sia verificato... Riprova.",194:"Un errore si è verificato durante l'invio.",195:"Un errore si è verificato durante il trattamento.",196:"Vi invitiamo a [a §]riprovare[/a]."},ja:{103:"キャンセル",104:"承認",105:"閉じる",106:"前へ",107:"次へ",108:"ファイルを選択する",131:"ビデオ",132:"ビデオトラック",133:"オーディオトラック",134:"字幕",135:"オフ",142:"前へ/次へ",143:"再生/一時停止",144:"戻る/進む",146:"ミュート",147:"全画面表示",148:"終了",149:"終了",150:"Esc",166:"§ Mo",184:"§% - § Ko/s",192:"よろしいですか?[span]はい[/span] - いいえ"},nl:{103:"Annuleren",104:"Bevestigen",105:"Sluiten",106:"Vorige",107:"Volgende",108:"Kies een bestand",132:"videospoor",133:"audiospoor",134:"ondertitels",135:"uit",142:"vorige/volgende",143:"afspelen/pauzeren",144:"achteruit/vooruit",145:"volume omlaag/omhoog",146:"dempen",147:"schermvullend",148:"afsluiten",150:"Esc"},pl:{103:"Anuluj",104:"Potwierdź",105:"Zamknij",106:"Poprzedni",107:"Następny",108:"Wybierz plik",131:"obraz",132:"ścieżka obrazu",133:"ścieżka dźwiękowa",134:"napisy",135:"wyłączone",142:"poprzedni/następny",143:"odtwarzaj/wstrzymaj",144:"wstecz/przodu",145:"ciszej/głośniej",146:"wycisz",147:"pełny ekran",148:"zakończ",150:"Esc"},pt:{103:"Cancelar",104:"Confirmar",105:"Fechar",106:"Anterior",107:"Seguinte",108:"Escolha um ficheiro",124:"Operação em processo...",125:"Envio em processo...",126:"Tratamento em processo...",131:"vídeo",132:"faixa de vídeo",133:"faixa de áudio",134:"legendas",135:"não",142:"anterior/seguinte",143:"reprodução/pausa",144:"recuar/avançar",145:"diminuir/aumentar volume",146:"sem som",147:"ecrã completo",148:"sair",149:"Fim",150:"Esc",161:"Todos os ficheiros foram aceites.",162:"Formato do ficheiro aceite: §.",163:"Formatos de ficheiro aceites: § e §.",164:"Tamanho máximo: § MB.",181:"§% - § kB/s - § minutos restantes",182:"§% - § kB/s - § minuto restantes",183:"§% - § kB/s - § segundos restantes",185:"§% - § kB/s em § minutos",186:"§% - § kB/s em § minuto",187:"§% - § kB/s em § segundos",188:"§% - § kB/s",192:"Tem a certeza? [span]Sim[/span] - Não",193:"Parece ter acontecido um erro imprevisto. Por favor, tente novamente.",194:"Ocorreu um erro ao enviar.",195:"Ocorreu um erro ao processar.",196:"Convidamo-lo a [a §]tentar novamente[/a]."},ptbr:{107:"Próximo",108:"Escolher um arquivo",124:"Operação em andamento...",125:"Envio em andamento...",126:"Tratamento em andamento...",132:"trilha de vídeo",133:"trilha de áudio",135:"desligado",142:"anterior/próximo",143:"reproduzir/pausar",144:"retroceder/avançar",146:"sem áudio",147:"tela inteira",148:"fechar",149:"Final"},ro:{103:"Anuleaza",104:"Confirmare",105:"Inchide",106:"Anteriorul",107:"Urmatorul",108:"Alege un fișier",132:"pistă video",133:"pistă audio",134:"subtitluri",135:"oprit",142:"anteriorul/urmatorul",143:"redare/pauză",144:"înapoi/înaintează",145:"scade/crește volumul",146:"mut",147:"pe tot ecranul",148:"ieșire",149:"Sfârșit",150:"Esc"},ru:{102:"Ок",103:"Отмена",104:"Подтвердить",105:"Закрыть",106:"Предыдущий",107:"Следующий",108:"Выберите файл",124:"Операция в процессе...",131:"видео",132:"видеодорожка",133:"аудиодорожка",134:"субтитры",135:"выключено",142:"предыдущий/следующий",143:"воспроизведение/пауза",144:"назад/вперед",145:"понизить/повысить громкость",146:"выключить звук",147:"полноэкранный режим",148:"выйти",150:"Esc",161:"Все файлы приняты.",162:"Формат файла: §.",163:"Форматы файлов: § и §.",164:"Максимальный размер: § Мб.",166:"§ Мб",181:"§% - § Кб/s - осталось § минут",182:"§% - § Кб/s - осталось § минут",183:"§% - § Кб/s - осталось § секунд",184:"§% - § Кб/s",185:"§% - § Кб/s за § минут",186:"§% - § Кб/s за § минут",187:"§% - § Кб/s за § секунд",188:"§% - § Кб/s",192:"Вы уверены? [span]Да[/span] - нет",193:"Кажется произошла не предусмотренная ошибка... Попробуйте еще раз.",194:"Возникла ошибка при отправке файла.",195:"Возникла ошибка при обработке файла."},sk:{103:"Zrušiť",104:"Potvrdiť",105:"Zavrieť",106:"Dozadu",107:"Ďalej",108:"Zvoľte si súbor",133:"zvuková stopa",134:"titulky",135:"vypnuté",142:"dozadu/ďalej",143:"prehrať/pozastaviť",144:"dozadu/dopredu",145:"znizit/zvysit hlasitost",146:"stlmiť",148:"koniec",150:"Esc"},tr:{102:"Tamam",103:"İptal",104:"Onayla",105:"Kapat",106:"Önceki",107:"Sonraki",108:"Bir dosya seçin",131:"görüntü",132:"görüntü kaydı",133:"ses kaydı",134:"altyazılar",135:"kapalı",142:"önceki/sonraki",143:"duraklatma/oynatma",144:"geri/i̇leri",145:"ses kısar/açar",146:"sesi kapatma",147:"tam ekran",148:"çıkış",149:"Son",150:"Esc",192:"Emin misiniz ? [span]Evet[/span] - Hayır"},uk:{102:"Гаразд",103:"Відмінити",104:"Підтвердити",105:"Закрити",106:"Попередній",107:"Наступний",108:"Вибрати файл",131:"відео",132:"відеодоріжка",133:"звукова доріжка",134:"субтитри",135:"вимкнено",142:"попередній/наступний",143:"відтворити/призупинити",144:"назад/вперед",145:"зменшити/збільшити гучність",146:"вимкнути звук",148:"вийти",149:"Кінець",150:"Esc",166:"§ МБ",184:"§% - § кБ/s"},zh:{102:"确定",103:"取消",104:"确认",105:"关闭",106:"上一个",107:"下一个",108:"选择文件",131:"视频",132:"视频轨道",133:"音频轨道",134:"字幕",135:"关",142:"上一个/下一个",143:"播放/暂停",144:"快退/快进",145:"音量减/增",146:"静音",147:"全屏",148:"退出",150:"Esc",192:"您确定吗?[span]是[/span] - 否"}},this.init=function(){var t=apijs.config.lang,e=document.querySelector("html");-1<t.indexOf("auto")&&"string"==typeof(t=e.getAttribute("xml:lang")||e.getAttribute("lang"))&&(t=(t=t.replace(/[-_]/g,"").toLowerCase()).slice(0,4),this.data.hasOwnProperty(t)||(t=t.slice(0,2)),this.data.hasOwnProperty(t))&&(apijs.config.lang=t),this.data.hasOwnProperty(t)||(apijs.config.lang="en")},this.translate=function(t){var e=apijs.config.lang,i=1,s="";if("string"!=typeof this.data[e][t])if(3<e.length&&"string"==typeof this.data[e.slice(0,2)][t])e=e.slice(0,2);else{if("en"===e||"string"!=typeof this.data.en[t])return t;e="en"}return 1<arguments.length?(this.data[e][t].split("§").forEach(function(t){s+=i<this.length?t+this[i++]:t},arguments),s):this.data[e][t]},this.translateNode=function(){return document.createTextNode(this.translate.apply(this,arguments))},this.changeLang=function(t){if("string"==typeof t){if(-1<t.indexOf("auto"))return apijs.config.lang="auto",this.init(),!0;if(t=t.replace(/[-_]/g,""),this.data.hasOwnProperty(t))return apijs.config.lang=t,!0}return!1}},apijs.core.select=function(){this.init=function(){}},apijs.core.player=function(a,t){this.video=a,this.stalled=!1,this.subload=!1,this.autoRun=function(n,t){var o;return n.removeAttribute("src"),n.removeAttribute("data-src"),n.removeAttribute("controls"),n.classList.add("apijsplayer"),n.onloadedmetadata=function(t){this.stalled=!1,this.onTimeupdate(t),this.onProgress(t),this.onVideotrack(),this.onAudiotrack()}.bind(this),n.onstalled=function(t){this.stalled=!0,this.onWaiting(t)}.bind(this),n.onplaying=this.onPlay.bind(this),n.onpause=this.onPlay.bind(this),n.onended=this.onPlay.bind(this),n.onprogress=this.onProgress.bind(this),n.ontimeupdate=this.onTimeupdate.bind(this),n.onseeking=this.onTimeupdate.bind(this),n.onseeked=this.onWaiting.bind(this),n.onwaiting=this.onWaiting.bind(this),n.onloadstart=this.onWaiting.bind(this),n.oncanplay=this.onWaiting.bind(this),n.onclick=this.actionPlay.bind(this),n.onvolumechange=this.actionVolume.bind(this),n.ondurationchange=apijs.dialog.onMediaLoad,n.onerror=apijs.dialog.onMediaLoad,n.parentNode.appendChild(this.htmlSvgPlayer()),t.indexOf("m3u")<0?n.appendChild(this.htmlSource(t)):((o=new XMLHttpRequest).open("GET",t,!0),o.onreadystatechange=function(){if(4===o.readyState)if(self.dispatchEvent(new CustomEvent("apijsajaxresponse",{detail:{from:"apijsplayer.init",xhr:o}})),!n||0<n.childNodes.length)o.abort();else if([0,200].has(o.status)){for(var t,e=0,i=0,s=0,a=o.responseText.trim().split("\n");"string"==typeof(t=a.shift());)0===t.indexOf("#APIJS#attr")?(e=t.split("|"),n.setAttribute(e[1],e[2])):0===t.indexOf("#APIJS#track|subtitles")?(e=t.split("|"),this.html(".tracks.texttrack select").appendChild(this.htmlOption(s++,e[3]+" - "+e[2])),n.appendChild(this.htmlTrack(e))):0===t.indexOf("#EXTINF")?e=t.replace(/#EXTINF:\d+,/,""):5<t.length&&"#"!==t[0]&&(this.html(".tracks.video select").appendChild(this.htmlOption(i++,"string"==typeof e?e:i)),n.appendChild(this.htmlSource(t)));this.updateSelect("video",i),"object"==typeof n.textTracks&&this.updateSelect("texttrack",n.textTracks.length||s)}else apijs.dialog.onMediaLoad({type:"error"})}.bind(this),o.send()),this},this.updateSelect=function(t,e){var i="texttrack"===t?1:0;i<e?(this.html(".tracks."+t).removeAttribute("style"),this.html(".tracks."+t+" em").textContent="("+e+")",this.html(".tracks."+t+" select").setAttribute("size",e<10?e+i:10)):(this.html(".tracks."+t).setAttribute("style","display:none;"),this.html(".tracks."+t+" select").innerHTML="")},this.html=function(t){return this.video.parentNode.querySelector(t)},this.onVideotrack=function(){var t,e=this.video.videoTracks,i=this.html(".tracks.videotrack select"),s=apijs.config.lang,a=-1;if("object"==typeof e){if(1<e.length){for(t=0;t<e.length;t++)e[t].language&&0==e[t].language.toLowerCase().replace(/[-_]/g,"").indexOf(s)&&(a=a<0?t:a),i.appendChild(this.htmlOption(t,e[t]));this.updateSelect("videotrack",e.length)}i.selectedIndex=Math.max(0,a),0<=a&&this.actionVideotrack(a)}},this.onAudiotrack=function(){var t,e=this.video.audioTracks,i=this.html(".tracks.audiotrack select"),s=apijs.config.lang,a=-1;if("object"==typeof e){if(1<e.length){for(t=0;t<e.length;t++)e[t].language&&0==e[t].language.toLowerCase().replace(/[-_]/g,"").indexOf(s)&&(a=a<0?t:a),i.appendChild(this.htmlOption(t,e[t]));this.updateSelect("audiotrack",e.length)}i.selectedIndex=Math.max(0,a),0<=a&&this.actionAudiotrack(a)}},this.onTimeupdate=function(t){var e,i,s,a=this.video.currentTime,n=this.video.duration,o="--:--";isNaN(a)||n===1/0||isNaN(n)||(o=(0<(e=Math.floor(a/3600))?e+":":"")+(i=(i=Math.floor(a%3600/60))<10?"0"+i:i)+":"+(s=(s=Math.floor(a%60))<10?"0"+s:s),o+=" / "+(0<(e=Math.floor(n/3600))?e+":":"")+(i=(i=Math.floor(n%3600/60))<10?"0"+i:i)+":"+(s=(s=Math.floor(n%60))<10?"0"+s:s),this.html("svg.bar rect").style.width=a/n*100+"%"),this.html("span.time").textContent=o,this.stalled&&!this.subload&&(this.stalled=!1,this.onWaiting(t))},this.onProgress=function(){var t,e,i=this.video,s=this.html("svg.bar"),a=i.buffered.length;if(0<a&&i.duration!==1/0&&!isNaN(i.duration))for(s.querySelectorAll(".buffer").forEach(function(t){t.remove()});0<a--;)(e=document.createElement("rect")).setAttribute("class","buffer"),99.8<(t=(i.buffered.end(a)-i.buffered.start(a))/i.duration*100)?e.setAttribute("style","left:0%; width:100%;"):e.setAttribute("style","left:"+i.buffered.start(a)/i.duration*100+"%; width:"+t+"%;"),s.appendChild(e)},this.onPlay=function(){[1,2].has(this.video.networkState)&&(this.video.paused?(this.html("span.play").textContent="",(apijs.dialog.t1?apijs.dialog:this.video.parentNode.classList).remove("playing")):(this.html("span.play").textContent="",(apijs.dialog.t1?apijs.dialog:this.video.parentNode.classList).add("playing")))},this.onWaiting=function(t){apijs.log("player:video:onWaiting:"+t.type+" stalled:"+this.stalled+"/subload:"+this.subload),apijs.dialog[["loadstart","waiting","seeking","stalled"].has(t.type)?"add":"remove"]("loading")},this.actionPlay=function(){var t=this.video;if(apijs.dialog.swipe)return!1;[1,2].has(t.networkState)&&(t.ended||t.paused?t.play():t.pause())},this.actionVolume=function(t){var e=this.video,i=this.html("svg.vol"),s=i.offsetWidth,a=0;if([1,2].has(e.networkState)){if("object"==typeof t&&!isNaN(t.clientX)){for(;a+=i.offsetLeft,i=i.offsetParent;);a=100*(t.clientX-a)/s/100,e.volume=a=a<.2?0:.92<a?1:a,e.muted=!1}this.html("svg.vol rect").style.width=e.muted?0:100*e.volume+"%"}},this.actionPosition=function(t){var e=this.video,i=this.html("svg.bar"),s=i.offsetWidth,a=0;if([1,2].has(e.networkState)&&e.duration!==1/0&&!isNaN(e.duration)&&"object"==typeof t){for(;a+=i.offsetLeft,i=i.offsetParent;);a=e.duration*(t.clientX-a)*100/s/100,e.currentTime=a=a<=1?0:a}},this.actionVideotrack=function(t){var e,i=this.video.videoTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].enabled=e==s;--a.currentTime}"object"==typeof t&&t.target.blur()},this.actionAudiotrack=function(t){var e,i=this.video.audioTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].enabled=e==s;--a.currentTime}"object"==typeof t&&t.target.blur()},this.actionTexttrack=function(t){var e,i=this.video.textTracks,s="object"==typeof t?t.target.value:t;if([1,2].has(this.video.networkState)){for(e=0;e<i.length;e++)i[e].mode=e==s?"showing":"hidden";this.subload=!0}"object"==typeof t&&t.target.blur()},this.actionVideo=function(t){this.html("svg.bar rect").style.width="0",this.html("svg.bar").querySelectorAll(".buffer").forEach(function(t){t.remove()}),this.html("span.play").textContent="",this.updateSelect("videotrack",0),this.updateSelect("audiotrack",0),this.video.src=this.video.querySelectorAll("source")["object"==typeof t?t.target.value:t].src,"object"==typeof t&&t.target.blur()},this.actionFullscreen=function(){var t=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;this.video.parentNode.classList[t?"add":"remove"]("fullscreen")},this.htmlSvgPlayer=function(){var t,e,i,s=document.createElement("div");return s.setAttribute("class","apijsplayer noplaying"),(i=document.createElement("span")).setAttribute("class","btn play fnt"),i.appendChild(document.createTextNode("")),i.onclick=this.actionPlay.bind(this),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","svg bar"),(e=document.createElement("svg")).setAttribute("class","bar"),e.onclick=this.actionPosition.bind(this),t=document.createElement("rect"),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","time"),i.appendChild(document.createTextNode("--:--")),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","svg vol"),(e=document.createElement("svg")).setAttribute("class","vol"),e.onclick=this.actionVolume.bind(this),t=document.createElement("rect"),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks audiotrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(133)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionAudiotrack.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks videotrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(132)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionVideotrack.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks video"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(131)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionVideo.bind(this),i.appendChild(e),s.appendChild(i),(i=document.createElement("label")).setAttribute("class","tracks texttrack"),i.setAttribute("style","display:none;"),i.appendChild(apijs.i18n.translateNode(134)),e=document.createElement("em"),i.appendChild(e),(e=document.createElement("select")).setAttribute("lang","mul"),e.onchange=this.actionTexttrack.bind(this),(t=document.createElement("option")).appendChild(apijs.i18n.translateNode(135)),e.appendChild(t),i.appendChild(e),s.appendChild(i),(i=document.createElement("span")).setAttribute("class","btn full fnt"),i.appendChild(document.createTextNode("")),i.onclick=function(){apijs.dialog.t1?apijs.requestFullscreen(apijs.dialog.t1):(document.webkitFullscreenEnabled?document.addEventListener("webkitfullscreenchange",this.actionFullscreen.bind(this)):document.fullscreenEnabled?document.addEventListener("fullscreenchange",this.actionFullscreen.bind(this)):document.mozFullScreenEnabled&&document.addEventListener("mozfullscreenchange",this.actionFullscreen.bind(this)),apijs.requestFullscreen(this.video.parentNode))}.bind(this),s.appendChild(i),s},this.htmlTrack=function(t){var e=document.createElement("track");return e.setAttribute("kind",t[1]),e.setAttribute("label",t[2]),e.setAttribute("srclang",t[3]),e.setAttribute("src",t[4]),e.onload=function(t){apijs.log("player:track:onload "+t.target.src.slice(t.target.src.lastIndexOf("/")+1)),"showing"===t.target.track.mode&&(this.onWaiting(t),this.subload=!1)}.bind(this),e.onerror=function(t){apijs.log("player:track:onerror "+t.target.src.slice(t.target.src.lastIndexOf("/")+1)),"showing"===t.target.track.mode&&(this.onWaiting(t),this.subload=!1)}.bind(this),e},this.htmlSource=function(t){var e=document.createElement("source");return e.setAttribute("src",t),e.onerror=apijs.dialog.onMediaLoad,e},this.htmlOption=function(t,e){"object"==typeof e&&(e=""===e.label?e.language.toLowerCase():e.language.toLowerCase()+" - "+e.label);var i=document.createElement("option");return i.setAttribute("value",t),i.appendChild(document.createTextNode(e)),i},this.autoRun(a,t)},apijs.core.dialog=function(){this.klass=[],this.height=0,this.scroll=0,this.callback=null,this.args=null,this.xhr=null,this.ft=/information|confirmation|options|upload|progress|waiting|photo|video|iframe|ajax|start|ready|end|reduce|mobile|tiny|fullscreen/g,this.ti="a,area,button,input,textarea,select,object,iframe",this.ns="http://www.w3.org/2000/svg",this.swipe=!1,this.media=null,this.t0=null,this.t1=null,this.t2=null,this.t3=null,this.a=null,this.b=null,this.c=null,this.dialogInformation=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("information",i).htmlParent().htmlContent(t,e).htmlBtnOk().show("button.confirm"):(console.error("apijs.dialog.dialogInformation invalid arguments",arguments),!1)},this.dialogConfirmation=function(t,e,i,s,a){return"string"==typeof t&&"string"==typeof e&&"function"==typeof i?(this.callback=i,this.args=s,this.init("confirmation",a).htmlParent().htmlContent(t,e).htmlBtnConfirm("button","apijs.dialog.actionConfirm();").show("button.confirm")):(console.error("apijs.dialog.dialogConfirmation invalid arguments",arguments),!1)},this.dialogFormOptions=function(t,e,i,s,a,n){return"string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"function"==typeof s?(this.callback=s,this.args=a,this.init("options",n).htmlParent(i,"apijs.dialog.actionConfirm();").htmlContent(t,e).htmlBtnConfirm("submit").show(!0)):(console.error("apijs.dialog.dialogFormOptions invalid arguments",arguments),!1)},this.dialogFormUpload=function(t,e,i,s,a,n){return"string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("upload",n).htmlParent(i,"apijs.upload.actionConfirm();","apijs.upload.actionDrag(event);").htmlContent(t,e).htmlUpload(s,"boolean"==typeof a&&a,"apijs.upload.actionChoose(this);").htmlBtnConfirm("submit").show("button.browse"):(console.error("apijs.dialog.dialogFormUpload invalid arguments",arguments),!1)},this.dialogProgress=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("progress",i).htmlParent().htmlContent(t,e).htmlSvgProgress().show():(console.error("apijs.dialog.dialogProgress invalid arguments",arguments),!1)},this.dialogWaiting=function(t,e,i){return"string"==typeof t&&"string"==typeof e?this.init("waiting",i).htmlParent().htmlContent(t,e).htmlSvgLoader(!1).show():(console.error("apijs.dialog.dialogWaiting invalid arguments",arguments),!1)},this.dialogPhoto=function(t,e,i,s,a){var n="string"==typeof a;return a=n?"notransition slideshow loading "+a:"notransition loading","string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("photo",a).htmlParent().htmlMedia(t,e,i,s).htmlHelp(n,!1).htmlBtnClose().htmlBtnNavigation().htmlSvgLoader().show():(console.error("apijs.dialog.dialogPhoto invalid arguments",arguments),!1)},this.dialogVideo=function(t,e,i,s,a){var n="string"==typeof a;return a=n?"notransition slideshow loading "+a:"notransition loading","string"==typeof t&&"string"==typeof e&&"string"==typeof i&&"string"==typeof s?this.init("video",a).htmlParent().htmlMedia(t,e,i,s).htmlHelp(n,t.indexOf("iframe")<0).htmlBtnClose().htmlBtnNavigation().htmlSvgLoader().show():(console.error("apijs.dialog.dialogVideo invalid arguments",arguments),!1)},this.dialogIframe=function(t,e,i){return"string"==typeof t&&"boolean"==typeof e?this.init("iframe","string"==typeof i?i+" loading":"loading",!e).htmlParent().htmlIframe(t).htmlBtnClose(e).htmlSvgLoader(!1).show():(console.error("apijs.dialog.dialogIframe invalid arguments",arguments),!1)},this.dialogAjax=function(t,e,i,s,a){return"string"==typeof t&&"boolean"==typeof e&&"function"==typeof i?(this.callback=i,this.args=s,this.init("ajax","string"==typeof a?a+" loading":"loading",!e).htmlParent().htmlBtnClose(e).htmlSvgLoader(!1).show(),this.xhr=new XMLHttpRequest,this.xhr.open("GET",t,!0),this.xhr.onreadystatechange=function(){4===this.xhr.readyState&&"function"==typeof this.callback&&(this.callback(this.xhr,this.args),this.remove("loading"))}.bind(this),this.xhr.send(),this):(console.error("apijs.dialog.dialogAjax invalid arguments",arguments),!1)},this.update=function(){return this.has("start","ready","end")&&(this.t1&&this.t1.setAttribute("class",this.klass.join(" ")),this.t2)&&this.t2.setAttribute("class",this.klass.join(" ")),this},this.add=function(){return Array.prototype.forEach.call(arguments,function(t){"string"!=typeof t&&console.error("apijs.dialog.add argument is not a string",t),this.klass.indexOf(t)<0&&this.klass.push(t)},this),this.update()},this.remove=function(){return Array.prototype.forEach.call(arguments,function(t){"string"!=typeof t&&console.error("apijs.dialog.remove argument is not a string",t),-1<this.klass.indexOf(t)&&this.klass.splice(this.klass.indexOf(t),1)},this),this.update()},this.toggle=function(t,e){return"string"==typeof t&&"string"==typeof e||console.error("apijs.dialog.toggle argument is not a string",t,e),this.has(t)&&this.remove(t),this.has(e)||this.add(e),this.update()},this.has=function(){return this.klass.has(apijs.toArray(arguments))},this.actionClose=function(t){apijs.config.slideshow.anchor&&"function"==typeof history.pushState&&new RegExp("#("+apijs.config.slideshow.ids+"[-\\.]\\d+[-\\.]\\d+)").test(self.location.href)&&history.pushState({},"",self.location.href.slice(0,self.location.href.indexOf("#"))),"object"==typeof t?"apijsDialog"!==t.target.getAttribute("id")||apijs.dialog.has("photo","video","progress","waiting","lock")||apijs.dialog.clear(!0):this.t1&&this.clear(!0)},this.onCloseBrowser=function(t){if(apijs.dialog.has("progress","waiting","lock"))return t.preventDefault(),t.stopPropagation(),t.m=apijs.i18n.translate(124),t.returnValue=t.m,t.m},this.onResizeBrowser=function(){var t=document.querySelector("body").clientWidth;apijs.dialog[t<=(apijs.dialog.has("photo","video")?900:460)?"add":"remove"]("mobile"),apijs.dialog[t<=300?"add":"remove"]("tiny")},this.onScrollBrowser=function(t){var e=apijs.dialog,i=t.target,s=!1;if(e.has("slideshow")&&!e.has("playing")&&!["OPTION","SELECT"].has(i.nodeName)&&["DOMMouseScroll","mousewheel","swipeleft","swiperight","swipeup","swipedown","swiped-left","swiped-right","swiped-up","swiped-down"].has(t.type))i=(new Date).getTime()/1e3,(e.scroll<1||i>e.scroll+1)&&(e.scroll=i,s=0<t.detail||t.wheelDelta<0,apijs.slideshow[["swipeleft","swipeup","swiped-left","swiped-up"].has(t.type)||s?"actionNext":"actionPrev"]());else{if("OPTION"===i.nodeName)i=i.parentNode;else if(!["TEXTAREA","SELECT"].has(i.nodeName))for(;!0!==s&&"HTML"!==i.nodeName;)i.classList.contains("scrollable")?s=!0:i=i.parentNode;if(i.scrollHeight>i.offsetHeight&&"HTML"!==i.nodeName&&((s=0<t.detail||t.wheelDelta<0)&&i.scrollTop<i.scrollHeight-i.offsetHeight-1||!s&&0<i.scrollTop))return}t.preventDefault(),t.stopPropagation()},this.onScrollIframe=function(t){for(var e,i=t.target;i.parentNode;)i=i.parentNode;((e=0<t.detail||t.wheelDelta<0)&&i.defaultView.innerHeight+i.defaultView.scrollY>=i.body.offsetHeight-1||!e&&i.defaultView.scrollY<=0)&&(t.preventDefault(),t.stopPropagation())},this.onKey=function(t){var e,i=apijs.dialog,s=i.media;i.has("progress","waiting","lock")?(t.ctrlKey&&[81,87,82,115,116].has(t.keyCode)||t.altKey&&115===t.keyCode||[27,116].has(t.keyCode))&&t.preventDefault():i.has("photo","video")&&122===t.keyCode?(t.preventDefault(),apijs.requestFullscreen(i.t1)):i.has("slideshow")?27===t.keyCode?(t.preventDefault(),i.actionClose()):35===t.keyCode?(t.preventDefault(),apijs.slideshow.actionLast()):36===t.keyCode?(t.preventDefault(),apijs.slideshow.actionFirst()):37===t.keyCode?(t.preventDefault(),apijs.slideshow.actionPrev()):39===t.keyCode&&(t.preventDefault(),apijs.slideshow.actionNext()):27===t.keyCode&&(t.preventDefault(),i.actionClose()),i.has("video")&&!i.has("videoiframe")&&([32,80].has(t.keyCode)?(t.preventDefault(),[1,2].has(s.networkState)&&(s.ended||s.paused?s.play():s.pause())):[38,33].has(t.keyCode)?(t.preventDefault(),e=38===t.keyCode?10:60,[1,2].has(s.networkState)&&s.duration!==1/0&&!isNaN(s.duration)&&(s.currentTime>e?s.currentTime-=e:s.currentTime=0)):[40,34].has(t.keyCode)?(t.preventDefault(),[1,2].has(s.networkState)&&s.duration!==1/0&&!isNaN(s.duration)&&(e=40===t.keyCode?10:60,s.currentTime<s.duration-e)&&(s.currentTime+=e)):107===t.keyCode?(t.preventDefault(),[1,2].has(s.networkState)&&(s.muted&&(s.muted=!1),s.volume<.8?s.volume+=.2:s.volume=1)):109===t.keyCode?(t.preventDefault(),[1,2].has(s.networkState)&&(s.muted&&(s.muted=!1),.21<s.volume?s.volume-=.2:s.volume=0)):77===t.keyCode&&(t.preventDefault(),[1,2].has(s.networkState))&&(s.muted=!s.muted)),![32,33,34,35,36,38,40].has(t.keyCode)||t.target&&(["INPUT","TEXTAREA","OPTION","SELECT"].has(t.target.nodeName)||t.target.classList.contains("scrollable"))||(t.preventDefault(),t.stopPropagation())},this.onFullscreen=function(t){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;t&&apijs.log("dialog:onFullscreen:"+(e?"in":"out")),apijs.dialog[e?"add":"remove"]("fullscreen")},this.onIframeLoad=function(t){t.removeAttribute("class"),apijs.dialog.remove("loading"),t.contentWindow.document.addEventListener("keydown",window.parent.apijs.dialog.onKey),t.contentWindow.addEventListener("DOMMouseScroll",window.parent.apijs.dialog.onScrollIframe,{passive:!1}),t.contentWindow.addEventListener("mousewheel",window.parent.apijs.dialog.onScrollIframe,{passive:!1}),t.contentWindow.addEventListener("touchmove",window.parent.apijs.dialog.onScrollIframe,{passive:!1})},this.onMediaLoad=function(t){var e,i=apijs.dialog,s=i.media;t&&t.target&&(e=t.target.currentSrc||t.target.src,apijs.log("dialog:onMediaLoad:"+t.type+" "+(e?e.slice(e.lastIndexOf("/")+1):""))),s&&["load","durationchange"].has(t.type)?(i.remove("loading","error"),s.style.visibility="visible",s.hasAttribute("src")||"IMG"!==s.nodeName||s.setAttribute("src",s.imageLoader.src)):s&&"error"===t.type&&(i.toggle("loading","error"),s.removeAttribute("style"),e=apijs.html(".tracks.video select"))&&t&&t.target&&0<(i=e.querySelectorAll("option")).length&&0<e.value.length&&(i[e.value].setAttribute("disabled","disabled"),e.selectedIndex+=1,"VIDEO"===t.target.nodeName)&&""!==e.value&&s.videoPlayer.actionVideo(e)},this.onSlideshowSwipe=function(t){apijs.dialog.swipe=!0,self.setTimeout(function(){apijs.dialog.swipe=!1},150),["swiperight","swipedown","swiped-right","swiped-down"].has(t.type)?apijs.slideshow.actionPrev():apijs.slideshow.actionNext()},this.actionConfirm=function(){return this.has("options")&&!0!==this.callback(!1,this.args)||(this.add("lock","loading"),this.htmlSvgLoader(!1),apijs.html("div.btns").style.visibility="hidden",apijs.html("div.bbcode").style.visibility="hidden",self.setTimeout(function(){this.t2&&"FORM"===this.t2.nodeName?this.callback(this.t2.getAttribute("action"),this.args):this.t2&&this.callback(this.args)}.bind(this),12)),!1},this.init=function(t,e,i){return i=!0===i,"string"==typeof e?e=0<(e=e.replace(this.ft,"").trim()).length?i?e+" lock":e:i?"lock":null:i&&(e="lock"),this.t0&&this.clear(!1),this.klass.push("start"),this.klass.push(t),self.matchMedia("prefers-reduced-motion:reduce").matches&&this.klass.push("reduce"),"string"==typeof e&&(this.klass=this.klass.concat(e.split(" "))),this.t0=document.createDocumentFragment(),document.addEventListener("keydown",this.onKey),self.addEventListener("beforeunload",this.onCloseBrowser),self.addEventListener("DOMMouseScroll",this.onScrollBrowser,{passive:!1}),self.addEventListener("mousewheel",this.onScrollBrowser,{passive:!1}),self.addEventListener("touchmove",this.onScrollBrowser,{passive:!1}),self.addEventListener("resize",this.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.setAttribute("tabindex","-1")}),this},this.show=function(t){this.onResizeBrowser(),this.onFullscreen(),0<this.height&&!this.has("photo","video")&&(this.t2.style.minHeight=this.height+"px");var e=apijs.html("#Dialog");return e?(this.toggle("start","ready"),this.t1=e,apijs.toArray(this.t0.firstChild.childNodes).forEach(function(t){this.t1.appendChild(t)},this),this.t1.setAttribute("class",this.t2.getAttribute("class"))):this.has("notransition")?(this.toggle("start","ready"),document.querySelector("body").appendChild(this.t0)):(document.querySelector("body").appendChild(this.t0),self.setTimeout(function(){apijs.dialog.toggle("start","ready")},12)),apijs.config.dialog.closeOnClick&&!this.has("progress","waiting","lock")&&document.addEventListener("click",this.actionClose),this.has("photo","video")?document.webkitFullscreenEnabled?document.addEventListener("webkitfullscreenchange",this.onFullscreen):document.fullscreenEnabled?document.addEventListener("fullscreenchange",this.onFullscreen):document.mozFullScreenEnabled&&document.addEventListener("mozfullscreenchange",this.onFullscreen):this.has("upload")&&window.addEventListener("paste",apijs.upload.actionDrag),!0===t?self.setTimeout(function(){apijs.html("input:not([readonly]),textarea:not([readonly]),select:not([disabled])").focus()},12):"string"==typeof t&&apijs.html(t).focus(),!0},this.clear=function(t){if(t&&this.xhr&&(this.callback=null,this.xhr.abort()),this.hammer&&(this.hammer.off("swiperight swipedown swipeleft swipeup",apijs.dialog.onSlideshowSwipe).destroy(),delete this.hammer),document.removeEventListener("keydown",this.onKey),self.removeEventListener("beforeunload",this.onCloseBrowser),self.removeEventListener("DOMMouseScroll",this.onScrollBrowser,{passive:!1}),self.removeEventListener("mousewheel",this.onScrollBrowser,{passive:!1}),self.removeEventListener("touchmove",this.onScrollBrowser,{passive:!1}),self.removeEventListener("resize",this.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.removeAttribute("tabindex")}),apijs.config.dialog.closeOnClick&&document.removeEventListener("click",this.actionClose),this.has("photo","video")?(this.has("video")&&!this.has("videoiframe")&&this.t2.querySelectorAll("video, source, track").forEach(function(t){for(var e in t)0===e.indexOf("on")&&(t[e]=null);t.removeAttribute("src")}),this.media.videoPlayer=null,this.media.imageLoader=null,document.webkitFullscreenEnabled?document.removeEventListener("webkitfullscreenchange",this.onFullscreen):document.fullscreenEnabled?document.removeEventListener("fullscreenchange",this.onFullscreen):document.mozFullScreenEnabled&&document.removeEventListener("mozfullscreenchange",this.onFullscreen)):(this.has("upload")&&window.removeEventListener("paste",apijs.upload.actionDrag),this.height=parseFloat(self.getComputedStyle(this.t2).height)),t)this.toggle("ready","end"),this.t1.remove();else for(;this.t1.firstChild;)this.t1.firstChild.remove();return this.klass=[],t&&(this.height=0,this.scroll=0,this.callback=null,this.args=null,this.xhr=null),this.media=null,this.t0=null,this.t1=null,this.t2=null,this.t3=null,this.a=null,this.b=null,!(this.c=null)},this.htmlParent=function(t,e,i){return this.t1=document.createElement("div"),this.t1.setAttribute("id","apijsDialog"),"string"==typeof i?(this.t1.setAttribute("ondragenter",i),this.t1.setAttribute("ondragleave",i),this.t1.setAttribute("ondragover",i),this.t1.setAttribute("ondrop",i),this.t1.setAttribute("onpaste",i),this.a=document.createElement("p"),this.a.setAttribute("class","drag"),this.a.appendChild(apijs.i18n.translateNode(127)),this.t1.appendChild(this.a)):this.t1.setAttribute("ondragstart","return false;"),"string"==typeof t?(this.t2=document.createElement("form"),this.t2.setAttribute("action",t),this.t2.setAttribute("method","post"),this.t2.setAttribute("enctype","multipart/form-data"),this.t2.setAttribute("onsubmit","return "+e)):this.t2=document.createElement("div"),this.t2.setAttribute("id","apijsBox"),this.t1.appendChild(this.t2),this.t0.appendChild(this.t1),this},this.htmlContent=function(t,e){return 0<t.length&&(this.a=document.createElement("h1"),this.a.innerHTML=t.replace(/</g,"<").replace(/>/g,">").replace(/\[/g,"<").replace(/]/g,">"),this.t2.appendChild(this.a)),0<e.length&&(this.a=document.createElement("div"),this.a.setAttribute("class","bbcode"),"["!==e[0]&&(e="[p]"+e+"[/p]"),this.a.innerHTML=e.replace(/</g,"<").replace(/>/g,">").replace(/\[/g,"<").replace(/]/g,">"),this.a.querySelectorAll("a.popup").forEach(function(t){t.addEventListener("click",apijs.openTab)}),this.t2.appendChild(this.a)),this},this.htmlBtnOk=function(){return this.a=document.createElement("div"),this.a.setAttribute("class","btns"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","confirm"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(102)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnConfirm=function(t,e){return this.a=document.createElement("div"),this.a.setAttribute("class","btns"),this.b=document.createElement("button"),this.b.setAttribute("type",t),this.b.setAttribute("class","confirm"),"submit"!==t&&this.b.setAttribute("onclick",e),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(104)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","cancel"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(103)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlBtnNavigation=function(){return this.a=document.createElement("div"),this.a.setAttribute("class","navigation noplaying"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("disabled","disabled"),this.b.setAttribute("class","prev"),this.b.setAttribute("id","apijsPrev"),this.b.setAttribute("onclick","apijs.slideshow.actionPrev();"),this.c=document.createElement("span"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("disabled","disabled"),this.b.setAttribute("class","next"),this.b.setAttribute("id","apijsNext"),this.b.setAttribute("onclick","apijs.slideshow.actionNext();"),this.c=document.createElement("span"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),"function"==typeof Hammer&&(this.hammer=new Hammer(this.t2),this.hammer.get("swipe").set({direction:Hammer.DIRECTION_ALL}),this.hammer.on("swiperight swipedown swipeleft swipeup",apijs.dialog.onSlideshowSwipe)),this},this.htmlBtnClose=function(t){return!1!==t&&(this.a=document.createElement("div"),this.a.setAttribute("class","close nofullplaying"),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","close"),this.b.setAttribute("onclick","apijs.dialog.actionClose();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(105)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a)),this},this.htmlUpload=function(t,e,i){return this.a=document.createElement("div"),this.a.setAttribute("class","btns upload"),this.t3=document.createElement("input"),this.t3.setAttribute("type","file"),this.t3.setAttribute("name",e?t+"[]":t),this.t3.setAttribute("id","apijsFile"),e&&this.t3.setAttribute("multiple","multiple"),this.t3.setAttribute("onchange",i),this.a.appendChild(this.t3),this.b=document.createElement("button"),this.b.setAttribute("type","button"),this.b.setAttribute("class","browse"),this.b.setAttribute("onclick","this.previousSibling.click();"),this.c=document.createElement("span"),this.c.appendChild(apijs.i18n.translateNode(e?109:108)),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("div"),this.b.setAttribute("class","filenames scrollable"),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlSvgProgress=function(){return this.a=document.createElement("span"),this.a.setAttribute("class","info"),this.t2.appendChild(this.a),this.a=document.createElement("svg"),this.a.setAttribute("id","apijsProgress"),this.b=document.createElement("rect"),this.b.setAttribute("class","auto"),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlSvgLoader=function(t){return this.a=document.createElementNS(this.ns,"svg"),this.a.setAttribute("class","loader"),this.b=document.createElementNS(this.ns,"path"),!1!==t&&this.b.setAttribute("style","opacity:0;"),this.b.setAttribute("d","M75.4 126.63a11.43 11.43 0 0 1-2.1-22.65 40.9 40.9 0 0 0 30.5-30.6 11.4 11.4 0 1 1 22.27 4.87h.02a63.77 63.77 0 0 1-47.8 48.05v-.02a11.38 11.38 0 0 1-2.93.37z"),this.c=document.createElementNS(this.ns,"animateTransform"),this.c.setAttribute("attributeName","transform"),this.c.setAttribute("type","rotate"),this.c.setAttribute("from","0 64 64"),this.c.setAttribute("to","360 64 64"),this.c.setAttribute("dur","5s"),this.c.setAttribute("repeatCount","indefinite"),this.b.appendChild(this.c),this.c=document.createElementNS(this.ns,"animate"),this.c.setAttribute("attributeName","opacity"),this.c.setAttribute("to","1"),this.c.setAttribute("dur","0.01s"),this.c.setAttribute("begin","1s"),this.c.setAttribute("fill","freeze"),!1!==t&&this.b.appendChild(this.c),this.a.appendChild(this.b),this.t2.appendChild(this.a),this},this.htmlMedia=function(t,e,i,s){var a;return this.a=document.createElement("dl"),this.a.setAttribute("class","media"),this.b=document.createElement("dt"),this.has("photo")?(this.media=document.createElement("img"),this.media.setAttribute("alt",s.replace('"',""))):0<t.indexOf("iframe")?(this.media=document.createElement("iframe"),this.media.setAttribute("type","text/html"),this.media.setAttribute("scrolling","no"),this.media.setAttribute("src",t)):(this.media=document.createElement("video"),this.media.setAttribute("controls","controls"),this.media.setAttribute("preload","metadata")),this.media.setAttribute("id","apijsMedia"),this.b.appendChild(this.media),this.a.appendChild(this.b),this.b=document.createElement("dd"),this.b.setAttribute("class","nofullplaying"),"false"===e&&"false"===i||(a=t.slice(t.lastIndexOf("/")+1),this.c=document.createElement("span"),"false"!==e&&"auto"!==e&&"false"!==i?this.c.appendChild(document.createTextNode(e+" ("+i+") ")):"false"!==e&&"auto"!==e?this.c.appendChild(document.createTextNode(e+" ")):"auto"===e&&"false"!==i?this.c.appendChild(document.createTextNode(a+" ("+i+") ")):"auto"===e?this.c.appendChild(document.createTextNode(a+" ")):"false"!==i&&this.c.appendChild(document.createTextNode("("+i+") ")),this.b.appendChild(this.c)),this.b.appendChild(document.createTextNode(s)),this.a.appendChild(this.b),this.t2.appendChild(this.a),this.has("photo")?(this.media.imageLoader=new Image,this.media.imageLoader.src=t,this.media.imageLoader.onload=this.onMediaLoad,this.media.imageLoader.onerror=this.onMediaLoad):0<t.indexOf("iframe")?(this.media.onload=function(t){this.onIframeLoad(this.media),this.onMediaLoad(t)}.bind(this),this.add("videoiframe")):apijs.startPlayer(this.media,t)?this.add("apijsvideoplayer"):(this.c=document.createElement("source"),this.c.setAttribute("src",t),this.c.onerror=this.onMediaLoad,this.media.appendChild(this.c),this.media.ondurationchange=this.onMediaLoad,this.media.onerror=this.onMediaLoad,this.add("videosource")),this},this.htmlHelp=function(t,e){if(!("ontouchstart"in window&&navigator.userAgent.match(/mobi/i))){var i,s,a=[t?["start",149,141]:[],t?["left","right",142]:[],e?["topk","bottom",144]:[],e?["minus","plus",145]:[],e?["M",146]:[],e?["P",143]:[],["F11",147],[150,148]];for(this.a=document.createElement("ul"),this.a.setAttribute("class","kbd nofullscreen");i=a.shift();)if(0<i.length){for(this.b=document.createElement("li");s=i.shift();)0<i.length?(this.c=document.createElement("kbd"),["M","P","F11"].has(s)?this.c.appendChild(document.createTextNode(s)):"string"==typeof s?this.c.setAttribute("class",s):this.c.appendChild(apijs.i18n.translateNode(s)),this.b.appendChild(this.c)):this.b.appendChild(apijs.i18n.translateNode(s));this.a.appendChild(this.b)}this.t2.appendChild(this.a)}return this},this.htmlIframe=function(t){return this.a=document.createElement("iframe"),this.a.setAttribute("src",t),this.a.setAttribute("class","loading"),this.a.setAttribute("onload","apijs.dialog.onIframeLoad(this);"),this.t2.appendChild(this.a),this}},apijs.core.slideshow=function(){this.current=null,this.init=function(){for(var t,e,i,s=apijs.config.slideshow.ids,a=0;e=apijs.html(s+"."+a,!0);a++){for(i=e.classList.contains("hoverload"),t=0;e=apijs.html(s+"."+a+"."+t,!0);t++)e.addEventListener("click",this.show),i&&e.addEventListener("mouseover",this.show);(e=apijs.html(s+"."+a+".99999",!0))&&e.addEventListener("click",this.show)}this.onPopState()},this.onPopState=function(){var t;new RegExp("#("+apijs.config.slideshow.ids+"[-\\.]\\d+[-\\.]\\d+)").test(self.location.href)?(t=RegExp.$1.replace(/-/g,"."),apijs.html(t,!0)&&!apijs.dialog.has("slideshow")&&apijs.slideshow.show(t,!1)):apijs.slideshow.current&&apijs.dialog.actionClose()},this.show=function(t,e){var i,s,a,n=!1,o={};if("string"==typeof t)i=apijs.html(t,n=!0),o.id=t;else{for(t.preventDefault(),i=t.target;"A"!==i.nodeName;)i=i.parentNode;if("mouseover"===t.type&&i.classList.contains("current"))return!1;o.id=i.getAttribute("id")}return o.prefix=apijs.config.slideshow.ids+"."+o.id.split(".")[1],o.number=parseInt(o.id.split(".")[2],10),o.gallery=apijs.html(o.prefix+".99999",!0),99999!==o.number&&(t=apijs.html(o.prefix,!0).querySelectorAll("a[id][type]"),a=apijs.html(o.prefix,!0).querySelectorAll("dl"),(o.gallery||t.length!==a.length?(t.forEach(function(t){t.classList.remove("current")}),i):(a.forEach(function(t){t.classList.remove("current")}),i.parentNode.parentNode)).setAttribute("class","current")),o.gallery?(99999===o.number&&(n=!0,i=o.gallery.hasAttribute("class")?o.gallery.getAttribute("class"):o.prefix+".0",i=apijs.html(i,!0),o.number=parseInt(i.getAttribute("id").split(".")[2],10),o.id=o.id.replace("99999",o.number)),o.config=i.querySelector("input").getAttribute("value").split("|"),0<(t=o.config.shift()).indexOf(";")&&(s=(t=t.split(";"))[1].trim(),t=t[0].trim()),o.gallery.setAttribute("href",i.getAttribute("href")),o.gallery.querySelector("img").setAttribute("src",t),o.gallery.querySelector("img").setAttribute("srcset",s||""),o.gallery.querySelector("img").setAttribute("alt",i.querySelector("img").getAttribute("alt")),o.gallery.setAttribute("class",o.id)):(n=!0,o.config=i.querySelector("input").getAttribute("value").split("|")),o.url=i.getAttribute("href"),o.type=i.getAttribute("type").substring(0,5).replace("image","dialogPhoto").replace("video","dialogVideo").replace("audio","dialogVideo"),o.type=0===o.type.indexOf("dialog")?o.type:"dialogPhoto",o.styles=apijs.html(o.prefix,!0),o.styles=o.styles.hasAttribute("class")?o.styles.getAttribute("class").replace(/gallery|album/g,"").trim():"",n&&(apijs.dialog[o.type](o.url,o.config[0],o.config[1],o.config[2],o.styles),a=apijs.html(o.prefix,!0).querySelectorAll("a[id][type]").length-(o.gallery?2:1),apijs.slideshow.current={number:o.number,first:o.prefix+".0",prev:0<o.number?o.prefix+"."+(o.number-1):null,next:o.number<a?o.prefix+"."+(o.number+1):null,last:o.prefix+"."+a,total:a},apijs.slideshow.current.prev&&apijs.html("#Prev").removeAttribute("disabled"),apijs.slideshow.current.next&&apijs.html("#Next").removeAttribute("disabled"),apijs.config.slideshow.anchor)&&"function"==typeof history.pushState&&("boolean"!=typeof e||e)&&(t=0<(t=self.location.href).indexOf("#")?t.slice(0,t.indexOf("#")):t,t+="#"+(o.prefix+"."+(99999===o.number?0:o.number)).replace(/\./g,"-"),history.pushState({},"",t)),n},this.actionFirst=function(){return!!(this.current&&0<this.current.number&&this.current.number<=this.current.total)&&this.show(this.current.first)},this.actionPrev=function(){return!!(this.current&&this.current.prev&&0<this.current.number)&&this.show(this.current.prev)},this.actionNext=function(){return!!(this.current&&this.current.next&&this.current.number<this.current.total)&&this.show(this.current.next)},this.actionLast=function(){return!!(this.current&&0<=this.current.number&&this.current.number<this.current.total)&&this.show(this.current.last)}},apijs.core.upload=function(){this.title=null,this.action=null,this.input=null,this.onemax=0,this.allmax=0,this.exts=null,this.callback=null,this.args=null,this.icon=null,this.start=0,this.end=0,this.sendFile=function(t,e,i,s,a,n,o,r){t=this.sendFiles(t,e,i,s,0,a,n,o,r);return t||console.error("apijs.upload.sendFile invalid arguments",arguments),t},this.sendFiles=function(t,e,i,s,a,n,o,r,l){return!0!==t&&(this.title=t,this.action=e,this.input=i,this.onemax=s,this.allmax=a,this.exts="string"==typeof n?n.split(","):["*"],this.callback=o,this.args=r,this.icon=l),"string"==typeof this.title&&"string"==typeof this.action&&"string"==typeof this.input&&"number"==typeof this.onemax&&"number"==typeof this.allmax&&"function"==typeof this.callback?(t=0<this.allmax,e="*"===this.exts.join()?apijs.i18n.translate(161):1===this.exts.length?apijs.i18n.translate(162,this.exts.join()):apijs.i18n.translate(163,this.exts.slice(0,-1).join(", "),this.exts.slice(-1)),e+="[br]"+apijs.i18n.translate(t?165:164,apijs.formatNumber(this.onemax),t?apijs.formatNumber(this.allmax):"").replace("|","[br]"),apijs.dialog.dialogFormUpload(this.title,e,this.action,this.input,t,this.icon)):(("number"!=typeof this.allmax||0<this.allmax)&&console.error("apijs.upload.sendFiles invalid arguments",arguments),!1)},this.actionDrag=function(t){var e=apijs.dialog.t3,i=!0;if("dragenter"===t.type)apijs.dialog.add("drag");else if("dragleave"===t.type)apijs.dialog.remove("drag");else if(t.dataTransfer&&t.dataTransfer.files&&0<t.dataTransfer.files.length){try{e.files=t.dataTransfer.files,apijs.upload.actionChoose(e)}catch(t){console.error(t),apijs.html(".drag").remove()}apijs.dialog.remove("drag")}else if(t.clipboardData&&t.clipboardData.files&&0<t.clipboardData.files.length)try{e.files=t.clipboardData.files,apijs.upload.actionChoose(e,!0)}catch(t){console.error(t),apijs.html(".drag").remove()}else t.clipboardData&&(i=!1);i&&(t.stopPropagation(),t.preventDefault())},this.actionChoose=function(t,s){var a=[],n=0,e=apijs.html("button.confirm");!this.exts||(apijs.toArray(t.files,0<this.allmax?999:1).forEach(function(t,e){var i=t.size/1048576,i=apijs.formatNumber(i<.01?.01:i);i=(s||0<this.allmax?'<td class="nb">'+(s?(new Date).toTimeString().substring(0,8):e+1)+"</td>":"")+'<td class="name">'+t.name+'</td><td class="size">'+apijs.i18n.translate(166,i)+"</td>","*"===this.exts.join()||this.exts.has(t.name.slice(t.name.lastIndexOf(".")+1).toLowerCase())?t.size>1048576*this.onemax?i+='<td class="err">'+apijs.i18n.translate(168)+"</td>":t.size<=0?i+='<td class="err">'+apijs.i18n.translate(169)+"</td>":i+="<td></td>":i+='<td class="err">'+apijs.i18n.translate(167)+"</td>",a.push("<tr>"+i+"</tr>"),n+=t.size/1048576},this),0<this.allmax&&n>=this.allmax&&a.push('<tr class="tt"><td></td><td></td><td class="size">'+apijs.i18n.translate(166,apijs.formatNumber(n))+'</td><td class="err">'+apijs.i18n.translate(168)+"</td></tr>"),apijs.html("div.filenames").innerHTML="<table>"+a.join("")+"</table>",apijs.html("div.filenames .err"))?e.setAttribute("disabled","disabled"):(e.removeAttribute("disabled"),e.focus())},this.actionConfirm=function(){var t,e;return 0<apijs.dialog.t3.files.length?(t=new FormData(apijs.dialog.t2),(e=new XMLHttpRequest).open("POST",this.action+(0<this.action.indexOf("?")?"&isAjax=true":"?isAjax=true"),!0),"string"==typeof apijs.config.upload.tokenValue&&(e.setRequestHeader(apijs.config.upload.tokenName,apijs.config.upload.tokenValue),t.append(apijs.config.upload.tokenName,apijs.config.upload.tokenValue)),e.onreadystatechange=function(t){4===e.readyState&&(t=e.responseText.trim(),[0,200].has(e.status)?(self.dispatchEvent(new CustomEvent("apijsajaxresponse",{detail:{from:"apijs.upload.send",xhr:e}})),apijs.log("upload:onreadystatechange status:200 message:"+t),0===t.indexOf("success-")?(this.updateTitle(),this.callback(t.slice(8),this.args)):this.onError(195,t)):(apijs.log("upload:onreadystatechange status:"+e.status+" message: "+t),this.onError(194,e.status)))}.bind(this),e.upload.onloadstart=this.onStart.bind(this),e.upload.onprogress=this.onProgress.bind(this),e.upload.onload=this.onProgress.bind(this),e.upload.onerror=this.onError.bind(this),e.send(t)):apijs.html("button.browse").focus(),!1},this.onStart=function(){this.start=this.end=Math.round((new Date).getTime()/1e3),apijs.dialog.dialogProgress(this.title,apijs.i18n.translate(125),this.icon)},this.onError=function(t,e){this.updateTitle(),"number"==typeof t?e="[p]"+apijs.i18n.translate(t)+"[/p] "+e:"string"!=typeof e&&(e="[p]"+apijs.i18n.translate(193)+"[/p]"),e+="[p]"+apijs.i18n.translate(196,'href="apijs://restart" onclick="apijs.upload.sendFile(true); return false;"')+"[/p]",apijs.dialog.dialogInformation(this.title,e,"string"==typeof this.icon?"upload error "+this.icon:"upload error")},this.onProgress=function(t){var e,i,s,a,n,o,r=Math.round((new Date).getTime()/1e3);t.lengthComputable&&"progress"===t.type&&r>=this.end+2?(this.end=r,0<(e=Math.floor(100*t.loaded/t.total))&&e<100&&(this.updateTitle(e),n=100*(r=r-this.start)/e+10,24<r&&(a=Math.round(n-r),a=10*Math.ceil(a/10),o=Math.ceil(a/60),s=Math.round(t.loaded/r/1024),r<40||n<90?(i=184,a=null):1<o?(i=181,a=o):50<a?(i=182,a=1):i=183),this.updateProgress(e,i,s,a))):"load"===t.type&&(a=Math.round((new Date).getTime()/1e3)-this.start,o=Math.ceil(a/60),0<(s=Math.round(t.loaded/a/1024))&&s!==1/0?1<o?(i=185,a=o):50<a?(i=186,a=1):20<a?i=187:(i=188,a=null):a=s=null,this.updateTitle(100),this.updateProgress(100,i,s,a))},this.updateProgress=function(t,e,i,s){var a,n,o=apijs.html("rect"),r=apijs.html("span.info");99<t?(a="100%",o.setAttribute("class","end"),o.style.width="",(n=apijs.html("p")).setAttribute("data-old",n.textContent),n.setAttribute("data-new",apijs.i18n.translate(126)),n.setAttribute("class","anim"),n.textContent=""):(o.style.width=a=t+"%",o.hasAttribute("class")&&o.removeAttribute("class")),"number"==typeof e&&"number"==typeof i&&"number"==typeof s?a=apijs.i18n.translate(e,t,apijs.formatNumber(i,!1),s):"number"==typeof e&&"number"==typeof i&&(a=apijs.i18n.translate(e,t,apijs.formatNumber(i,!1))),r.textContent=a},this.updateTitle=function(t){"number"==typeof t?document.title=/^\d{1,3}% - /.test(document.title)?t+"% - "+document.title.slice(document.title.indexOf(" - ")+3):t+"% - "+document.title:/^\d{1,3}% - /.test(document.title)&&(document.title=document.title.slice(document.title.indexOf(" - ")+3))}};
|
8
8
|
//# sourceMappingURL=apijs.min.js.map
|