redmine_apijs 6.4.0 → 6.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2f0e0e66ed30a6a4f5627a81a61c66b5304fa6110c29a650a2f66c278ba0d6a
4
- data.tar.gz: 7e83933fb79ab34635a11a5ee4acece551ab2d2e78e301bf071f902158c0c4c5
3
+ metadata.gz: 39609d468cb518bfca13bbab58594dd6012c01e80f51a7fe21698a0d3f94200a
4
+ data.tar.gz: 75ea34049316807eaa322c2797dc7a2896c2dbddd2b3cee1a0573f1b19df92c4
5
5
  SHA512:
6
- metadata.gz: 52297b53f8bf05dc0cf18c925d5c6b0a1093a4d82e79b7a313fb0376a55c89d19bac072a0a914995f21316a0a005c97eeed5929bacbe499ee4ea2d8f3b7b8312
7
- data.tar.gz: 0704cee3e63c573ed2d15393b0ec0d2b9890e2f9ec97a8909d97d4edc9ce27a02fc423c0eb911e682af7b93da75ccadd7ca205c9b7f86fbfa1153cbce38700ed
6
+ metadata.gz: 5f54ed02b615f5646e8d92bbe4b80399d79e70208de82a69decf5b47629dff6ad8bbf86575fea68a39f031956123640b15bad0cee2a51c8a656d20b8571bf720
7
+ data.tar.gz: c89d818945069757127bcac480861a486fdb66c06ea22f5bb5671d0f73d13ad2c2f34571f9e994f76a53ae571a4571cdf8e52bb578b44766026c9b984e7df6fb
data/README CHANGED
@@ -13,7 +13,7 @@ Copyright : 2008-2020 Fabrice Creuzot (luigifab) <code~luigifab~fr>
13
13
 
14
14
 
15
15
  IF YOU FOUND A MISTAKE OR A BUG, PLEASE, CONTACT ME (IN FRENCH OR IN ENGLISH) AT code~luigifab~fr
16
- CSS AND JS FILES ARE MINIFIED WITH clean-css (github.com/jakubpawlowicz/clean-css) AND uglify-js (github.com/mishoo/UglifyJS2).
16
+ CSS AND JS FILES ARE MINIFIED WITH clean-css (github.com/jakubpawlowicz/clean-css) AND uglify-js (github.com/mishoo/UglifyJS).
17
17
  ALL FILES (INCLUDING DOCUMENTATION AND TRANSLATIONS) ARE LICENSED UNDER THE TERMS OF THE GNU GPL 2+ LICENSE.
18
18
  THAT BEING SAID SOME FILES COME FROM OTHER PROJECTS AND ARE UNDER OTHER LICENSES (SEE AT THE END OF THIS FILE).
19
19
 
@@ -26,7 +26,7 @@ Depends
26
26
  - python-scour
27
27
  - libimage-exiftool-perl (optional)
28
28
  - ffmpegthumbnailer (optional)
29
- - also used: command -v, python3 or python or python2, nproc, du -hs, cut -f1
29
+ - also used: command -v, python3, nproc, du -hs, cut -f1
30
30
  Notes
31
31
  - For the app, read: https://www.luigifab.fr/apijs
32
32
  - For the Redmine plugin, read: https://www.luigifab.fr/redmine/apijs
@@ -1,6 +1,6 @@
1
1
  <%
2
2
  # Created J/12/12/2013
3
- # Updated J/20/08/2020
3
+ # Updated S/07/11/2020
4
4
  #
5
5
  # Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
6
6
  # https://www.luigifab.fr/redmine/apijs
@@ -53,35 +53,6 @@ if File.directory?(File.join(APIJS_ROOT, 'show'))
53
53
  size_show = number_to_human_size(size * 1024 * 1024) if size_show =~ /M/i
54
54
  size_show = number_to_human_size(size * 1024) if size_show =~ /K/i
55
55
  end
56
-
57
-
58
- if Redmine::Platform.mswin?
59
- cmd = 'python.exe'
60
- else
61
- cmd = `command -v python3 || command -v python || command -v python2`.to_s.strip!
62
- end
63
-
64
- if cmd.length == 0
65
- pyt = 'not found'
66
- pil = pyt
67
- sco = pyt
68
- else
69
- pyt = `#{cmd} --version 2>&1`.gsub('Python ', '').strip!
70
-
71
- pil = `#{cmd} -c "from PIL import Image; print(Image.__version__)" 2>&1`.strip!
72
- if pil.include? "o module named"
73
- pil = 'not available'
74
- elsif pil.include? "__version__"
75
- pil = 'available'
76
- end
77
-
78
- sco = `#{cmd} -c "import scour; print(scour.__version__)" 2>&1`.strip!
79
- if sco.include? "o module named"
80
- sco = 'not available'
81
- elsif sco.include? "__version__"
82
- sco = 'available'
83
- end
84
- end
85
56
  %>
86
57
 
87
58
  <p style="margin:0.5em 1em; padding:0.5em;">
@@ -243,9 +214,11 @@ end
243
214
  <legend><%= raw l(:apijs_config_programs) %></legend>
244
215
  <p dir="ltr">
245
216
  <label>python / python-pil / python-scour</label>
246
- <span class="cmd"><%= pyt %> / <%= pil %> (<a href="https://pillow.readthedocs.io/en/latest/">docs</a>) / <%= sco %> (svg, <a href="https://github.com/scour-project/scour/wiki/Documentation">docs</a>)</span>
247
- <em class="info">python .../redmine_apijs/lib/image.py .../xyz.jpg .../xyz.jpg 200 150 90 2&gt;&amp;1</em>
248
- <em class="info">python .../redmine_apijs/lib/video.py .../xyz.ogv .../xyz.jpg 200 150 90 2&gt;&amp;1</em>
217
+ <span class="cmd"><%= raw Attachment.new.getProgramVersions(
218
+ '(jpg jpeg gif png..., <a href="https://pillow.readthedocs.io/en/latest/">docs</a>)',
219
+ '(svg, <a href="https://github.com/scour-project/scour/wiki/Documentation">docs</a>)') %></span>
220
+ <em class="info">python3 .../redmine_apijs/lib/image.py .../xyz.jpg .../xyz.jpg 200 150 90 2&gt;&amp;1</em>
221
+ <em class="info">python3 .../redmine_apijs/lib/video.py .../xyz.ogv .../xyz.jpg 200 150 90 2&gt;&amp;1</em>
249
222
  </p>
250
223
  <p dir="ltr">
251
224
  <label>libimage-exiftool-perl</label>
@@ -4,4 +4,4 @@
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
- var apijsRedmine=new function(){"use strict";this.start=function(){var e=apijs.i18n.data;e.frca||(e.frca={}),e.cs[252]="Chyba",e.de[250]="Eine Datei löschen",e.de[251]="Sind Sie sicher, dass Sie diese Datei löschen möchten?[br]Achtung, diese Aktion ist unrückgängig.",e.de[252]="Fehler",e.de[253]="Sie verfügen nicht über die notwendigen Rechte um diese Operation durchzuführen, bitte [a §]aktualisieren Sie die Seite[/a].",e.de[254]="Es tut uns leid, diese Datei existiert nicht mehr, bitte [a §]aktualisieren Sie die Seite[/a].",e.de[255]="Eine Beschreibung bearbeiten",e.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.",e.en[250]="Remove file",e.en[251]="Are you sure you want to remove this file?[br]Be careful, you can't cancel this operation.",e.en[252]="Error",e.en[253]="You are not authorized to perform this operation, please [a §]refresh the page[/a].",e.en[254]="Sorry, the file no longer exists, please [a §]refresh the page[/a].",e.en[255]="Edit description",e.en[256]="Enter below the new description for the file. To remove the description, leave the field empty.",e.en[257]="Rename file",e.en[258]="Enter below the new name for the file.",e.es[250]="Borrar un archivo",e.es[251]="¿Está usted seguro(a) de que desea eliminar este archivo?[br]Atención, pues no podrá cancelar esta operación.",e.es[253]="No está autorizado-a para llevar a cabo esta operación, por favor [a §]actualice la página[/a].",e.es[254]="Disculpe, pero el archivo ya no existe, por favor [a §]actualice la página[/a].",e.es[255]="Editar una descripción",e.es[256]="Introduzca a continuación la nueva descripción para el archivo. Para eliminar la descripción, deje el campo en blanco.",e.fr[250]="Supprimer le fichier",e.fr[251]="Êtes-vous sûr(e) de vouloir supprimer ce fichier ?[br]Attention, cette opération n'est pas annulable.",e.fr[252]="Erreur",e.fr[253]="Vous n'êtes pas autorisé(e) à effectuer cette opération, veuillez [a §]actualiser la page[/a].",e.fr[254]="Désolé, le fichier n'existe plus, veuillez [a §]actualiser la page[/a].",e.fr[255]="Modifier la description",e.fr[256]="Saisissez ci-dessous la nouvelle description pour ce fichier. Pour supprimer la description, laissez le champ vide.",e.fr[257]="Renommer le fichier",e.fr[258]="Saisissez ci-dessous le nouveau nom pour ce fichier.",e.it[250]="Eliminare un file",e.it[251]="Sicuri di voler eliminare il file?[br]Attenzione, questa operazione non può essere annullata.",e.it[252]="Errore",e.it[253]="Non siete autorizzati a eseguire questa operazione, vi preghiamo di [a §]ricaricare la pagina[/a].",e.it[254]="Spiacenti, il file non esiste più, vi preghiamo di [a §]ricaricare la pagina[/a].",e.it[255]="Modificare una descrizione",e.it[256]="Inserire qui sotto la nuova descrizione del file. Per cancellare la descrizione, lasciate lo spazio vuoto.",e.ja[250]="ファイルを削除",e.ja[252]="エラー",e.nl[252]="Fout",e.pl[252]="Błąd",e.pt[250]="Suprimir um ficheiro",e.pt[251]="Tem certeza de que quer suprimir este ficheiro?[br]Cuidado, não pode cancelar esta operação.",e.pt[252]="Erro",e.pt[253]="Não é autorizado(a) para efetuar esta operação, por favor [a §]atualize a página[/a].",e.pt[254]="Lamento, o ficheiro já não existe, por favor [a §]atualize a página[/a].",e.pt[255]="Modificar uma descrição",e.pt[256]="Digite abaixo a nova descrição para este ficheiro. Para suprimir a descrição, deixe o campo vazio.",e.ru[250]="Удалить файл",e.ru[251]="Вы уверены, что хотите удалить этот файл?[br]Осторожно, вы не сможете отменить эту операцию.",e.ru[252]="Ошибка",e.ru[253]="Вы не авторизованы для выполнения этой операции, пожалуйста [a §]обновите страницу[/a].",e.ru[254]="Извините, но файл не существует, пожалуйста [a §]обновите страницу[/a].",e.ru[255]="Редактировать описание",e.ru[256]="Ниже введите новое описание файла. Оставьте поле пустым, чтобы удалить описание.",e.sk[252]="Chyba",e.tr[252]="Hata",e.zh[252]="错误信息"},this.error=function(e){"string"==typeof e&&e.indexOf("<!DOCTYPE")<0?apijs.dialog.dialogInformation(apijs.i18n.translate(252),e,"error"):(apijs.dialog.remove("lock"),self.location.reload())},this.editAttachment=function(e,t,i,a){var r=apijs.i18n.translate(255),e=e.parentNode.parentNode.querySelector(".description").textContent.trim(),e='[p][label for="apijsinput"]'+apijs.i18n.translate(256)+'[/label][/p][input type="text" name="description" value="'+e+'" spellcheck="true" id="apijsinput"]';apijs.dialog.dialogFormOptions(r,e,i,apijsRedmine.actionEditAttachment,[t,i,a],"editattach"),apijs.dialog.t1.querySelector("input").select()},this.actionEditAttachment=function(e,t){if("boolean"==typeof e)return!0;var i;"string"==typeof e&&((i=new XMLHttpRequest).open("POST",t[1]+"?id="+t[0]+"&isAjax=true",!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.setRequestHeader("X-CSRF-Token",t[2]),i.onreadystatechange=function(){var e,t;4===i.readyState&&([0,200].has(i.status)?0===i.responseText.indexOf("attachmentId")?(t=i.responseText.slice(0,i.responseText.indexOf(":")),e=i.responseText.slice(i.responseText.indexOf(":")+1),(t=document.getElementById(t)).querySelector(".description").textContent=e,(t=t.querySelector("input"))&&(t.value=t.value.slice(0,t.value.lastIndexOf("|")+1)+e),apijs.dialog.actionClose()):apijsRedmine.error(i.responseText):apijsRedmine.error(i.status))},i.send("desc="+encodeURIComponent(document.getElementById("apijsinput").value)))},this.renameAttachment=function(e,t,i,a){var r=apijs.i18n.translate(257),e=e.parentNode.parentNode.querySelector(".filename").textContent.trim(),e='[p][label for="apijsinput"]'+apijs.i18n.translate(258)+'[/label][/p][input type="text" name="name" value="'+e+'" spellcheck="false" id="apijsinput"]';apijs.dialog.dialogFormOptions(r,e,i,apijsRedmine.actionRenameAttachment,[t,i,a],"editattach")},this.actionRenameAttachment=function(e,t){if("boolean"==typeof e)return!0;var r;"string"==typeof e&&((r=new XMLHttpRequest).open("POST",t[1]+"?id="+t[0]+"&isAjax=true",!0),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.setRequestHeader("X-CSRF-Token",t[2]),r.onreadystatechange=function(){var e,t,i,a;4===r.readyState&&([0,200].has(r.status)?0===r.responseText.indexOf("attachmentId")?(t=r.responseText.slice(0,r.responseText.indexOf(":")),i=r.responseText.slice(r.responseText.indexOf(":")+1),(a=document.getElementById(t)).querySelector(".filename").textContent=i,(t=a.querySelector("input"))&&(e=t.getAttribute("value"),t.setAttribute("value",i+e.substr(e.indexOf("|")))),(t=a.querySelector("a"))&&(e=t.getAttribute("href"),t.setAttribute("href",e.substr(0,e.lastIndexOf("/")+1)+i)),(t=a.querySelector("button.download"))&&(e=t.getAttribute("onclick"),t.setAttribute("onclick",e.substr(0,e.lastIndexOf("/")+1)+i+"';")),(t=a.querySelector("button.show"))&&(e=t.getAttribute("onclick"),t.setAttribute("onclick",e.substr(0,e.lastIndexOf("/")+1)+i+"';")),apijs.dialog.actionClose()):apijsRedmine.error(r.responseText):apijsRedmine.error(r.status))},r.send("name="+encodeURIComponent(document.getElementById("apijsinput").value)))},this.removeAttachment=function(e,t,i,a){apijs.dialog.dialogConfirmation(apijs.i18n.translate(250),apijs.i18n.translate(251),apijsRedmine.actionRemoveAttachment,[t,i,a])},this.actionRemoveAttachment=function(e){var a=new XMLHttpRequest;a.open("POST",e[1]+"?id="+e[0]+"&isAjax=true",!0),a.setRequestHeader("X-CSRF-Token",e[2]),a.onreadystatechange=function(){var e,t,i;4===a.readyState&&([0,200].has(a.status)?0===a.responseText.indexOf("attachmentId")?(t=(e=document.getElementById(a.responseText)).parentNode,i=0,t.removeChild(e),t.querySelectorAll("dl, li").length<1?t.parentNode.removeChild(t):t.querySelectorAll("a[id][type]").forEach(function(e){e.setAttribute("id",e.getAttribute("id").slice(0,e.getAttribute("id").lastIndexOf(".")+1)+i++)}),apijs.dialog.actionClose()):apijsRedmine.error(a.responseText):apijsRedmine.error(a.status))},a.send()}};"function"==typeof self.addEventListener&&self.addEventListener("apijsload",apijsRedmine.start.bind(apijsRedmine));
7
+ var apijsRedmine=new function(){"use strict";this.start=function(){var e=apijs.i18n.data;e.frca||(e.frca={}),e.cs[250]="Smazat soubor",e.cs[251]="Opravdu chcete tento soubor smazat?[br]Pozor, tuto operaci nelze vrátit zpět.",e.cs[252]="Chyba",e.de[250]="Eine Datei löschen",e.de[251]="Sind Sie sicher, dass Sie diese Datei löschen möchten?[br]Achtung, diese Aktion ist unrückgängig.",e.de[252]="Fehler",e.de[253]="Sie verfügen nicht über die notwendigen Rechte um diese Operation durchzuführen, bitte [a §]aktualisieren Sie die Seite[/a].",e.de[254]="Es tut uns leid, diese Datei existiert nicht mehr, bitte [a §]aktualisieren Sie die Seite[/a].",e.de[255]="Eine Beschreibung bearbeiten",e.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.",e.en[250]="Remove file",e.en[251]="Are you sure you want to remove this file?[br]Be careful, you can't cancel this operation.",e.en[252]="Error",e.en[253]="You are not authorized to perform this operation, please [a §]refresh the page[/a].",e.en[254]="Sorry, the file no longer exists, please [a §]refresh the page[/a].",e.en[255]="Edit description",e.en[256]="Enter below the new description for the file. To remove the description, leave the field empty.",e.en[257]="Rename file",e.en[258]="Enter below the new name for the file.",e.es[250]="Borrar un archivo",e.es[251]="¿Está usted seguro(a) de que desea eliminar este archivo?[br]Atención, pues no podrá cancelar esta operación.",e.es[253]="No está autorizado-a para llevar a cabo esta operación, por favor [a §]actualice la página[/a].",e.es[254]="Disculpe, pero el archivo ya no existe, por favor [a §]actualice la página[/a].",e.es[255]="Editar una descripción",e.es[256]="Introduzca a continuación la nueva descripción para el archivo. Para eliminar la descripción, deje el campo en blanco.",e.fr[250]="Supprimer le fichier",e.fr[251]="Êtes-vous sûr(e) de vouloir supprimer ce fichier ?[br]Attention, cette opération n'est pas annulable.",e.fr[252]="Erreur",e.fr[253]="Vous n'êtes pas autorisé(e) à effectuer cette opération, veuillez [a §]actualiser la page[/a].",e.fr[254]="Désolé, le fichier n'existe plus, veuillez [a §]actualiser la page[/a].",e.fr[255]="Modifier la description",e.fr[256]="Saisissez ci-dessous la nouvelle description pour ce fichier. Pour supprimer la description, laissez le champ vide.",e.fr[257]="Renommer le fichier",e.fr[258]="Saisissez ci-dessous le nouveau nom pour ce fichier.",e.it[250]="Cancella i file",e.it[251]="Sei sicura di voler eliminare il file?[br]Attenzione, questa operazione non può essere annullata.",e.it[252]="Errore",e.it[253]="Non siete autorizzati a eseguire questa operazione, vi preghiamo di [a §]ricaricare la pagina[/a].",e.it[254]="Spiacenti, il file non esiste più, vi preghiamo di [a §]ricaricare la pagina[/a].",e.it[255]="Modificare una descrizione",e.it[256]="Inserire qui sotto la nuova descrizione del file. Per cancellare la descrizione, lasciate lo spazio vuoto.",e.ja[250]="ファイルを削除",e.ja[252]="エラー",e.nl[252]="Fout",e.pl[250]="Usuń plik",e.pl[251]="Jesteś pewny, że chcesz usunąć ten plik?[br]Uwaga! Nie ma odwrotu od tej operacji.",e.pl[252]="Błąd",e.pt[250]="Suprimir um ficheiro",e.pt[251]="Tem certeza de que quer suprimir este ficheiro?[br]Cuidado, não pode cancelar esta operação.",e.pt[252]="Erro",e.pt[253]="Não é autorizado(a) para efetuar esta operação, por favor [a §]atualize a página[/a].",e.pt[254]="Lamento, o ficheiro já não existe, por favor [a §]atualize a página[/a].",e.pt[255]="Modificar uma descrição",e.pt[256]="Digite abaixo a nova descrição para este ficheiro. Para suprimir a descrição, deixe o campo vazio.",e.ru[250]="Удалить файл",e.ru[251]="Вы уверены, что хотите удалить этот файл?[br]Осторожно, вы не сможете отменить эту операцию.",e.ru[252]="Ошибка",e.ru[253]="Вы не авторизованы для выполнения этой операции, пожалуйста [a §]обновите страницу[/a].",e.ru[254]="Извините, но файл не существует, пожалуйста [a §]обновите страницу[/a].",e.ru[255]="Редактировать описание",e.ru[256]="Ниже введите новое описание файла. Оставьте поле пустым, чтобы удалить описание.",e.sk[252]="Chyba",e.tr[252]="Hata",e.zh[252]="错误信息"},this.error=function(e){"string"==typeof e&&e.indexOf("<!DOCTYPE")<0?apijs.dialog.dialogInformation(apijs.i18n.translate(252),e,"error"):(apijs.dialog.remove("lock"),self.location.reload())},this.editAttachment=function(e,t,i,a){var r=apijs.i18n.translate(255),e=e.parentNode.parentNode.querySelector(".description").textContent.trim(),e='[p][label for="apijsinput"]'+apijs.i18n.translate(256)+'[/label][/p][input type="text" name="description" value="'+e+'" spellcheck="true" id="apijsinput"]';apijs.dialog.dialogFormOptions(r,e,i,apijsRedmine.actionEditAttachment,[t,i,a],"editattach"),apijs.dialog.t1.querySelector("input").select()},this.actionEditAttachment=function(e,t){if("boolean"==typeof e)return!0;var i;"string"==typeof e&&((i=new XMLHttpRequest).open("POST",t[1]+"?id="+t[0]+"&isAjax=true",!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.setRequestHeader("X-CSRF-Token",t[2]),i.onreadystatechange=function(){var e,t;4===i.readyState&&([0,200].has(i.status)?0===i.responseText.indexOf("attachmentId")?(t=i.responseText.slice(0,i.responseText.indexOf(":")),e=i.responseText.slice(i.responseText.indexOf(":")+1),(t=document.getElementById(t)).querySelector(".description").textContent=e,(t=t.querySelector("input"))&&(t.value=t.value.slice(0,t.value.lastIndexOf("|")+1)+e),apijs.dialog.actionClose()):apijsRedmine.error(i.responseText):apijsRedmine.error(i.status))},i.send("desc="+encodeURIComponent(document.getElementById("apijsinput").value)))},this.renameAttachment=function(e,t,i,a){var r=apijs.i18n.translate(257),e=e.parentNode.parentNode.querySelector(".filename").textContent.trim(),e='[p][label for="apijsinput"]'+apijs.i18n.translate(258)+'[/label][/p][input type="text" name="name" value="'+e+'" spellcheck="false" id="apijsinput"]';apijs.dialog.dialogFormOptions(r,e,i,apijsRedmine.actionRenameAttachment,[t,i,a],"editattach")},this.actionRenameAttachment=function(e,t){if("boolean"==typeof e)return!0;var r;"string"==typeof e&&((r=new XMLHttpRequest).open("POST",t[1]+"?id="+t[0]+"&isAjax=true",!0),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.setRequestHeader("X-CSRF-Token",t[2]),r.onreadystatechange=function(){var e,t,i,a;4===r.readyState&&([0,200].has(r.status)?0===r.responseText.indexOf("attachmentId")?(t=r.responseText.slice(0,r.responseText.indexOf(":")),i=r.responseText.slice(r.responseText.indexOf(":")+1),(a=document.getElementById(t)).querySelector(".filename").textContent=i,(t=a.querySelector("input"))&&(e=t.getAttribute("value"),t.setAttribute("value",i+e.substr(e.indexOf("|")))),(t=a.querySelector("a"))&&(e=t.getAttribute("href"),t.setAttribute("href",e.substr(0,e.lastIndexOf("/")+1)+i)),(t=a.querySelector("button.download"))&&(e=t.getAttribute("onclick"),t.setAttribute("onclick",e.substr(0,e.lastIndexOf("/")+1)+i+"';")),(t=a.querySelector("button.show"))&&(e=t.getAttribute("onclick"),t.setAttribute("onclick",e.substr(0,e.lastIndexOf("/")+1)+i+"';")),apijs.dialog.actionClose()):apijsRedmine.error(r.responseText):apijsRedmine.error(r.status))},r.send("name="+encodeURIComponent(document.getElementById("apijsinput").value)))},this.removeAttachment=function(e,t,i,a){apijs.dialog.dialogConfirmation(apijs.i18n.translate(250),apijs.i18n.translate(251),apijsRedmine.actionRemoveAttachment,[t,i,a])},this.actionRemoveAttachment=function(e){var a=new XMLHttpRequest;a.open("POST",e[1]+"?id="+e[0]+"&isAjax=true",!0),a.setRequestHeader("X-CSRF-Token",e[2]),a.onreadystatechange=function(){var e,t,i;4===a.readyState&&([0,200].has(a.status)?0===a.responseText.indexOf("attachmentId")?(t=(e=document.getElementById(a.responseText)).parentNode,i=0,t.removeChild(e),t.querySelectorAll("dl, li").length<1?t.parentNode.removeChild(t):t.querySelectorAll("a[id][type]").forEach(function(e){e.setAttribute("id",e.getAttribute("id").slice(0,e.getAttribute("id").lastIndexOf(".")+1)+i++)}),apijs.dialog.actionClose()):apijsRedmine.error(a.responseText):apijsRedmine.error(a.status))},a.send()}};"function"==typeof self.addEventListener&&self.addEventListener("apijsload",apijsRedmine.start.bind(apijsRedmine));
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
3
- * https://www.luigifab.fr/apijs - 6.4.0
3
+ * https://www.luigifab.fr/apijs - 6.5.0
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(){"use strict";this.core={},this.version=640,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.player=null,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(),self.addEventListener("popstate",apijs.slideshow.onPopState),self.addEventListener("hashchange",apijs.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.toArray=function(t){return Array.prototype.slice.call(t,0)},this.log=function(t){this.config.debug&&console.info("APIJS "+t)},this.openTab=function(t){t.preventDefault(),0<this.href.length&&self.open(this.href)},this.html=function(t){return 0===t.indexOf("#")||0===t.indexOf(this.config.slideshow.ids)?document.getElementById(t.replace("#","apijs")):this.dialog.t1?this.dialog.t1.querySelector(t):null},this.serialize=function(t,i){var s=[];return i="string"==typeof i?i:"",Array.prototype.forEach.call(t.elements,function(t){if(t.name&&!t.disabled&&!["file","reset","submit","button"].has(t.type)&&0===t.name.indexOf(i))if("select-multiple"===t.type)for(var 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(){"use strict";this.data={cs:{103:"Zrušit",104:"Potvrzení",105:"Zavřít",106:"Předchozí",107:"Další",142:"předchozí/další"},de:{103:"Abbrechen",104:"Bestätigen",105:"Schließen",106:"Zurück",107:"Weiter",108:"Datei wählen",109:"Dateien wählen",124:"Verarbeitung läuft...",141:"anfang/ende",142:"zurück/weiter",143:"wiedergabe/pause",144:"rückwärts/vorwärts",145:"leiser/lauter",146:"stumm",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]."},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...",131:"video",132:"video track",133:"audio track",134:"subtitles",135:"off",141:"start/end",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...",132:"pista video",133:"pista audio",134:"subtítulos",141:"inicio/fin",142:"anterior/siguiente",143:"reproducir/pausa",144:"retroceder/avanzar",145:"bajar/subir el 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...",131:"vidéo",132:"piste vidéo",133:"piste audio",134:"sous-titres",141:"début/fin",142:"précédent/suivant",143:"lecture/pause",144:"reculer/avancer",145:"baisser/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]."},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...",141:"inizio/fine",142:"precedente/successivo",143:"riproduci/pausa",144:"indietro/avanti",145:"abbassare/aumentare il volume",146:"muto",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:"次へ",142:"前へ/次へ",166:"§ Mo",184:"§% - § Ko/s",192:"よろしいですか?[span]はい[/span] - いいえ"},nl:{103:"Annuleren",104:"Bevestigen",105:"Sluiten",106:"Vorige",107:"Volgende",142:"vorige/volgende"},pl:{103:"Anuluj",104:"Potwierdź",105:"Zamknij",106:"Poprzedni",107:"Następne",142:"poprzedni/następne"},pt:{103:"Cancelar",104:"Confirmar",105:"Fechar",106:"Anterior",107:"Seguinte",108:"Escolher um ficheiro",109:"Escolher um ou vários ficheiros",124:"Operação em processo...",125:"Envio em processo...",126:"Tratamento em processo...",131:"vídeo",141:"início/fim",142:"anterior/seguinte",143:"reprodução/pausa",144:"recuar/avançar",145:"subir/baixar o volume",146:"silenciar",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",124:"Operação em andamento...",125:"Envio em andamento...",126:"Tratamento em andamento...",142:"anterior/próximo"},ru:{102:"Ок",103:"Отмена",104:"Подтвердить",105:"Закрыть",106:"Предыдущий",107:"Следующий",108:"Выберите файл",124:"Операция в процессе...",141:"начало/конец",142:"предыдущий/следующий",143:"воспроизведение/пауза",144:"назад/вперед",145:"понизить/повысить громкость",146:"отключить звук",147:"на весь экран",148:"выйти",161:"Все файлы приняты.",162:"Формат файла: §.",163:"Форматы файлов: § и §.",164:"Максимальный размер: § MB.",181:"§% - § kB/s - осталось § минут",182:"§% - § kB/s - осталось § минут",183:"§% - § kB/s - осталось § секунд",185:"§% - § kB/s за § минут",186:"§% - § kB/s за § минут",187:"§% - § kB/s за § секунд",188:"§% - § kB/s",192:"Вы уверены? [span]Да[/span] - нет",193:"Кажется произошла не предусмотренная ошибка... Попробуйте еще раз.",194:"Возникла ошибка при отправке файла.",195:"Возникла ошибка при обработке файла."},sk:{103:"Zrušiť",105:"Zavrieť",106:"Predchádzajúci",107:"Ďalší",142:"predchádzajúci/ďalší"},tr:{103:"İptal",104:"Onayla",105:"Kapat",106:"Önceki",107:"Sonraki",142:"önceki/sonraki",192:"Emin misiniz ? [span]Evet[/span] - Hayır"},zh:{103:"取消",104:"确认",105:"关闭",106:"前页",107:"下一步",142:"前页/下一步",192:"您确定吗?[span]是[/span] - 否"}},this.init=function(){var t,e=apijs.config.lang,i=document.querySelector("html");-1<e.indexOf("auto")&&(i.getAttribute("xml:lang")?t=i.getAttribute("xml:lang").slice(0,2):i.getAttribute("lang")&&(t=i.getAttribute("lang").slice(0,2)),"string"==typeof t&&this.data.hasOwnProperty(t)&&(apijs.config.lang=t)),this.data.hasOwnProperty(apijs.config.lang)||(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(this.data.hasOwnProperty(t))return apijs.config.lang=t,!0;if(-1<t.indexOf("auto"))return apijs.config.lang=t,this.init(),!0}return!1}},apijs.core.select=function(){"use strict";this.init=function(){}},apijs.core.player=function(){"use strict";this.root=null,this.video=null,this.stalled=!1,this.subload=!1,this.init=function(t,e,i){var s,a;if(this.root=t,(this.video=e).removeAttribute("controls"),e.onloadedmetadata=function(t){if(this.stalled=!1,this.onTimeupdate(t),this.onProgress(t),"object"==typeof this.video.videoTracks){if(1<(a=this.video.videoTracks).length){for(s=0;s<a.length;s++)this.createOption("videotrack",s,""===a[s].label?a[s].language:a[s].language+" - "+a[s].label);this.updateSelect("videotrack",a.length,0)}this.html(".tracks.videotrack select").selectedIndex=0}if("object"==typeof this.video.audioTracks){if(1<(a=this.video.audioTracks).length){for(s=0;s<a.length;s++)this.createOption("audiotrack",s,""===a[s].label?a[s].language:a[s].language+" - "+a[s].label);this.updateSelect("audiotrack",a.length,0)}this.html(".tracks.audiotrack select").selectedIndex=0}}.bind(this),e.onstalled=function(t){this.stalled=!0,this.onWaiting(t)}.bind(this),e.onplaying=apijs.player.onPlay.bind(this),e.onpause=apijs.player.onPlay.bind(this),e.onended=apijs.player.onEnded.bind(this),e.onprogress=apijs.player.onProgress.bind(this),e.ontimeupdate=apijs.player.onTimeupdate.bind(this),e.onseeking=apijs.player.onTimeupdate.bind(this),e.onseeked=apijs.player.onWaiting.bind(this),e.onwaiting=apijs.player.onWaiting.bind(this),e.onloadstart=apijs.player.onWaiting.bind(this),e.oncanplay=apijs.player.onWaiting.bind(this),e.onvolumechange=apijs.player.actionVolume.bind(this),i.indexOf("m3u")<0)return this.createTags([i]);var n=new XMLHttpRequest;return n.open("GET",i,!0),n.onreadystatechange=function(){4===n.readyState&&(self.dispatchEvent(new CustomEvent("apijsajaxresponse",{detail:{from:"apijs.player.init",xhr:n}})),[0,200].has(n.status)?apijs.player.createTags(n.responseText.trim().split("\n")):apijs.dialog.onMediaLoad({type:"error"}))},n.send(),this},this.createTags=function(t){var e,i,s;if(!(0<this.video.childNodes.length)){for(this.vv=0,this.tt=0;"string"==typeof(e=t.shift());)0===e.indexOf("#APIJS#attr")?(i=e.split("|"),this.video.setAttribute(i[1],i[2])):0===e.indexOf("#APIJS#track|subtitles")?(i=e.split("|"),this.createOption("text",this.tt++,i[3]+" - "+i[2]),(s=document.createElement("track")).setAttribute("kind",i[1]),s.setAttribute("label",i[2]),s.setAttribute("srclang",i[3]),s.setAttribute("src",i[4]),s.onload=function(t){"showing"===t.target.track.mode&&(apijs.log("player:track:onload"),this.onWaiting(t),this.subload=!1)}.bind(this),s.onerror=function(t){"showing"===t.target.track.mode&&(apijs.log("player:track:onerror"),this.onWaiting(t),this.subload=!1)}.bind(this),this.video.appendChild(s)):0===e.indexOf("#EXTINF")?i=e.replace(/#EXTINF:[0-9]+,/,""):5<e.length&&"#"!==e[0]&&(this.createOption("video",this.vv++,"string"==typeof i?i:this.vv),(s=document.createElement("source")).setAttribute("src",e),s.onerror=apijs.dialog.onMediaLoad,this.video.appendChild(s));return this.updateSelect("video",this.vv,0),"object"==typeof this.video.textTracks&&this.updateSelect("text",this.tt,1,!0),this}},this.createOption=function(t,e,i){var s=document.createElement("option");s.setAttribute("value",e),s.appendChild(document.createTextNode(i)),this.html(".tracks."+t+" select").appendChild(s)},this.updateSelect=function(t,e,i,s){(!0===s?0:1)<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.root.querySelector(t)},this.onTimeupdate=function(t){var e,i,s,a,n="00:00",o=this.video.currentTime;0<o&&(e=Math.floor(o/3600),i=Math.floor(o%3600/60),(s=Math.floor(o%60))<10&&(s="0"+s),i<10&&(i="0"+i),n=(e=0<e?e+":":"")+i+":"+s),(a=this.video.duration)===1/0||isNaN(a)||(e=Math.floor(a/3600),i=Math.floor(a%3600/60),(s=Math.floor(a%60))<10&&(s="0"+s),i<10&&(i="0"+i),n+=" / "+(e=0<e?e+":":"")+i+":"+s,this.html("svg.bar rect").style.width=o/a*100+"%"),this.html("span.time").textContent=n,this.stalled&&!this.subload&&(this.stalled=!1,this.onWaiting(t))},this.onProgress=function(){var t,e,i=this.html("svg.bar"),s=this.video,a=s.buffered.length;if(0<a&&s.duration!==1/0&&!isNaN(s.duration))for(i.querySelectorAll(".buffer").forEach(function(t){t.parentNode.removeChild(t)});0<a--;)(t=document.createElement("rect")).setAttribute("class","buffer"),99.8<(e=(s.buffered.end(a)-s.buffered.start(a))/s.duration*100)?t.setAttribute("style","left:0%; width:100%;"):t.setAttribute("style","left:"+s.buffered.start(a)/s.duration*100+"%; width:"+e+"%;"),i.appendChild(t)},this.onPlay=function(){this.video.paused?(this.html("span.play").textContent="",apijs.dialog.remove("playing")):(this.html("span.play").textContent="",apijs.dialog.add("playing"))},this.onEnded=function(){this.html("span.play").textContent="⟲"},this.onWaiting=function(t){apijs.log("player:onWaiting:"+t.type+" stalled:"+this.stalled+"/subload:"+this.subload),apijs.dialog[["loadstart","waiting","seeking","stalled"].has(t.type)?"add":"remove"]("loading")},this.actionVolume=function(t){var e=this.html("svg.vol"),i=e.offsetWidth,s=0,a=this.video;if(3!==a.networkState){if("object"==typeof t&&!isNaN(t.clientX)){for(;s+=e.offsetLeft,e=e.offsetParent;);s=(s=100*(t.clientX-s)/i/100)<=.1?0:.92<s?1:s,a.volume=s,a.muted=!1}this.html("svg.vol rect").style.width=a.muted?0:100*a.volume+"%"}},this.actionPosition=function(t){var e=this.html("svg.bar"),i=e.offsetWidth,s=0,a=this.video;if(3!==a.networkState&&"object"==typeof t&&a.duration!==1/0&&!isNaN(a.duration)){for(;s+=e.offsetLeft,e=e.offsetParent;);s=(s=a.duration*(t.clientX-s)*100/i/100)<=1?0:s,a.currentTime=s}},this.actionVideo=function(t){this.html("svg.bar rect").style.width="0",this.html("svg.bar").querySelectorAll(".buffer").forEach(function(t){t.parentNode.removeChild(t)}),this.html("span.play").textContent="",this.updateSelect("videotrack",0,0),this.updateSelect("audiotrack",0,0),this.video.src=this.video.querySelectorAll("source")[t.value].src,t.blur()},this.actionVideotrack=function(t){for(var e=this.video.videoTracks,i=0;i<e.length;i++)e[i].enabled=i==t.value;t.blur()},this.actionAudiotrack=function(t){for(var e=this.video.audioTracks,i=0;i<e.length;i++)e[i].enabled=i==t.value;t.blur()},this.actionText=function(t){for(var e=this.video.textTracks,i=0;i<e.length;i++)e[i].mode=i==t.value?"showing":"hidden";t.blur(),this.subload=!0}},apijs.core.dialog=function(){"use strict";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.media=null,this.t0=null,this.t1=null,this.t2=null,this.a=null,this.b=null,this.c=null,this.d=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",apijs.toArray(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",apijs.toArray(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",apijs.toArray(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();").htmlContent(t,e).htmlUpload(s,"boolean"==typeof a&&a).htmlBtnConfirm("submit").show("button.browse"):(console.error("apijs.dialog.dialogFormUpload invalid arguments",apijs.toArray(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",apijs.toArray(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",apijs.toArray(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",apijs.toArray(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",apijs.toArray(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",apijs.toArray(arguments)),!1)},this.dialogAjax=function(t,e,i,s,a){if("string"!=typeof t||"boolean"!=typeof e||"function"!=typeof i)return console.error("apijs.dialog.dialogAjax invalid arguments",apijs.toArray(arguments)),!1;this.callback=i,this.args=s;e=this.init("ajax","string"==typeof a?a+" loading":"loading",!e).htmlParent().htmlBtnClose(e).htmlSvgLoader(!1).show();return 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(apijs.dialog),this.xhr.send(),e},this.update=function(){return this.has("start","ready","end")&&(apijs.dialog.t1&&apijs.dialog.t1.setAttribute("class",this.klass.join(" ")),apijs.dialog.t2&&apijs.dialog.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){new RegExp("#("+apijs.config.slideshow.ids+"[-\\.]\\d+[-\\.]\\d+)").test(self.location.href)&&apijs.config.slideshow.anchor&&"function"==typeof history.pushState&&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.has("photo","video")?900:460);apijs.dialog[t?"add":"remove"]("mobile"),t=document.querySelector("body").clientWidth<=300,apijs.dialog[t?"add":"remove"]("tiny")},this.onScrollBrowser=function(t){var e=t.target,i=!1;if(apijs.dialog.has("slideshow")&&!apijs.dialog.has("playing")&&!["OPTION","SELECT"].has(e.nodeName)&&["DOMMouseScroll","mousewheel","panleft","panright"].has(t.type))e=(new Date).getTime()/1e3,(apijs.dialog.scroll<1||e>1+apijs.dialog.scroll)&&(apijs.dialog.scroll=e,i=0<t.detail||t.wheelDelta<0,apijs.slideshow["panleft"===t.type||i?"actionNext":"actionPrev"]());else{if("OPTION"===e.nodeName)e=e.parentNode;else if(!["TEXTAREA","SELECT"].has(e.nodeName))for(;!0!==i&&"HTML"!==e.nodeName;)e.classList.contains("scrollable")?i=!0:e=e.parentNode;if("HTML"!==e.nodeName&&((i=0<t.detail||t.wheelDelta<0)&&e.scrollTop<e.scrollHeight-e.offsetHeight||!i&&0<e.scrollTop))return}apijs.dialog.stopScroll(t)},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.pageYOffset>i.body.offsetHeight||!e&&i.defaultView.pageYOffset<=0)&&apijs.dialog.stopScroll(t)},this.onKey=function(t){var e=apijs.dialog,i=e.media,s=e.t1;isNaN(t)||(t={keyCode:t,ctrlKey:!1,altKey:!1,preventDefault:function(){}}),e.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():e.has("photo","video")&&122===t.keyCode?(t.preventDefault(),document.webkitFullscreenElement?document.webkitCancelFullScreen():document.mozFullScreenElement?document.mozCancelFullScreen():document.fullscreenElement?document.cancelFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen&&s.mozRequestFullScreen()):e.has("slideshow")?27===t.keyCode?(t.preventDefault(),e.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(),e.actionClose()),e.has("video")&&(32===t.keyCode||80===t.keyCode?(t.preventDefault(),3!==i.networkState&&(i.ended||i.paused?i.play():i.pause())):38===t.keyCode||33===t.keyCode?(t.preventDefault(),3!==i.networkState&&i.duration!==1/0&&i.currentTime<i.duration-10&&(i.currentTime+=10)):40===t.keyCode||34===t.keyCode?(t.preventDefault(),3!==i.networkState&&i.duration!==1/0&&(10<i.currentTime?i.currentTime-=10:i.currentTime=0)):107===t.keyCode?(t.preventDefault(),3!==i.networkState&&(i.muted&&(i.muted=!1),i.volume<.8?i.volume+=.2:i.volume=1)):109===t.keyCode?(t.preventDefault(),3!==i.networkState&&(i.muted&&(i.muted=!1),.21<i.volume?i.volume-=.2:i.volume=0)):77===t.keyCode&&(t.preventDefault(),3!==i.networkState&&(i.muted=!i.muted))),[32,33,34,35,36,38,40].has(t.keyCode)&&(t.target&&["INPUT","TEXTAREA","OPTION","SELECT"].has(t.target.nodeName)||e.stopScroll(t))},this.stopScroll=function(t){t.preventDefault(),"function"==typeof t.stopPropagation&&t.stopPropagation()},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.onIframeLoad=function(t){t.removeAttribute("class"),apijs.dialog.remove("loading"),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,s=apijs.dialog,a=s.media;t&&t.target&&(e=t.target.currentSrc||t.target.src,apijs.log("dialog:onMediaLoad:"+t.type+" "+(e?e.slice(e.lastIndexOf("/")+1):""))),a&&["load","durationchange"].has(t.type)?(s.remove("loading","error"),a.style.visibility="visible",a.hasAttribute("src")||"IMG"!==a.nodeName||a.setAttribute("src",a.imageLoader.src)):a&&"error"===t.type&&(s.toggle("loading","error"),a.removeAttribute("style"),(a=apijs.html(".tracks.video select"))&&t&&t.target&&0<(i=a.querySelectorAll("option")).length&&0<a.value.length&&(i[a.value].setAttribute("disabled","disabled"),a.selectedIndex+=1,"VIDEO"===t.target.nodeName&&""!==a.value&&apijs.player.actionVideo(a)))},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.init=function(t,e,i){return"string"==typeof e?e=0<(e=e.replace(this.ft,"").trim()).length?!0===i?e+" lock":e:!0===i?"lock":null:!0===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",apijs.dialog.onKey),self.addEventListener("beforeunload",apijs.dialog.onCloseBrowser),self.addEventListener("DOMMouseScroll",apijs.dialog.onScrollBrowser,{passive:!1}),self.addEventListener("mousewheel",apijs.dialog.onScrollBrowser,{passive:!1}),self.addEventListener("touchmove",apijs.dialog.onScrollBrowser,{passive:!1}),self.addEventListener("resize",apijs.dialog.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.setAttribute("tabindex","-1")}),this},this.show=function(t){return this.onResizeBrowser(),this.onFullscreen(),0<this.height&&!this.has("photo","video")&&(this.t2.style.minHeight=this.height+"px"),apijs.html("#Dialog")?(this.toggle("start","ready"),this.t1=apijs.html("#Dialog"),this.t1.appendChild(this.t0.firstChild.firstChild),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",apijs.dialog.actionClose),this.has("photo","video")&&(document.webkitFullscreenEnabled?document.addEventListener("webkitfullscreenchange",apijs.dialog.onFullscreen):document.fullscreenEnabled?document.addEventListener("fullscreenchange",apijs.dialog.onFullscreen):document.mozFullScreenEnabled&&document.addEventListener("mozfullscreenchange",apijs.dialog.onFullscreen)),!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){return t&&this.xhr&&(this.callback=null,this.xhr.abort()),document.removeEventListener("keydown",apijs.dialog.onKey),self.removeEventListener("beforeunload",apijs.dialog.onCloseBrowser),self.removeEventListener("DOMMouseScroll",apijs.dialog.onScrollBrowser,{passive:!1}),self.removeEventListener("mousewheel",apijs.dialog.onScrollBrowser,{passive:!1}),self.removeEventListener("touchmove",apijs.dialog.onScrollBrowser,{passive:!1}),self.removeEventListener("resize",apijs.dialog.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.removeAttribute("tabindex")}),apijs.config.dialog.closeOnClick&&document.removeEventListener("click",apijs.dialog.actionClose),this.has("photo","video")&&(document.webkitFullscreenEnabled?document.removeEventListener("webkitfullscreenchange",apijs.dialog.onFullscreen):document.fullscreenEnabled?document.removeEventListener("fullscreenchange",apijs.dialog.onFullscreen):document.mozFullScreenEnabled&&document.removeEventListener("mozfullscreenchange",apijs.dialog.onFullscreen)),this.has("video")&&(this.media.ondurationchange=null,this.media.onerror=null),this.has("photo","video")||(this.height=parseFloat(self.getComputedStyle(this.t2).height)),t?(this.toggle("ready","end"),document.querySelector("body").removeChild(this.t1)):this.t1.removeChild(this.t2),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.a=null,this.b=null,this.c=null,!(this.d=null)},this.htmlParent=function(t,e){return this.t1=document.createElement("div"),this.t1.setAttribute("id","apijsDialog"),"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,"&lt;").replace(/>/g,"&gt;").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,"&lt;").replace(/>/g,"&gt;").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),this},this.htmlBtnClose=function(t){return!1===t||(this.a=document.createElement("div"),this.a.setAttribute("class","close noplaying"),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){return this.a=document.createElement("div"),this.a.setAttribute("class","btns upload"),this.b=document.createElement("input"),this.b.setAttribute("type","file"),this.b.setAttribute("name",t),this.b.setAttribute("id","apijsFile"),e&&this.b.setAttribute("multiple","multiple"),this.b.setAttribute("onchange","apijs.upload.actionChoose(this);"),this.a.appendChild(this.b),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"),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.htmlSvgPlayer=function(t){return this.a=document.createElement("span"),this.a.setAttribute("class","player noplaying"),this.b=document.createElement("span"),this.b.setAttribute("class","btn play fnt"),this.b.setAttribute("onclick","apijs.dialog.onKey(80);"),this.b.appendChild(document.createTextNode("")),this.a.appendChild(this.b),this.b=document.createElement("span"),this.b.setAttribute("class","svg bar"),this.c=document.createElement("svg"),this.c.setAttribute("class","bar"),this.c.setAttribute("onclick","apijs.player.actionPosition(event);"),this.d=document.createElement("rect"),this.c.appendChild(this.d),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("span"),this.b.setAttribute("class","time"),this.b.appendChild(document.createTextNode("00:00 / 00:00")),this.a.appendChild(this.b),this.b=document.createElement("span"),this.b.setAttribute("class","svg vol nomobile"),this.c=document.createElement("svg"),this.c.setAttribute("class","vol"),this.c.setAttribute("onclick","apijs.player.actionVolume(event);"),this.d=document.createElement("rect"),this.c.appendChild(this.d),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("label"),this.b.setAttribute("class","tracks audiotrack"),this.b.setAttribute("style","display:none;"),this.b.appendChild(apijs.i18n.translateNode(133)),this.c=document.createElement("em"),this.c.setAttribute("class","nomobile"),this.b.appendChild(this.c),this.c=document.createElement("select"),this.c.setAttribute("lang","mul"),this.c.setAttribute("onchange","apijs.player.actionAudiotrack(this);"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("label"),this.b.setAttribute("class","tracks videotrack"),this.b.setAttribute("style","display:none;"),this.b.appendChild(apijs.i18n.translateNode(132)),this.c=document.createElement("em"),this.c.setAttribute("class","nomobile"),this.b.appendChild(this.c),this.c=document.createElement("select"),this.c.setAttribute("lang","mul"),this.c.setAttribute("onchange","apijs.player.actionVideotrack(this);"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("label"),this.b.setAttribute("class","tracks video"),this.b.setAttribute("style","display:none;"),this.b.appendChild(apijs.i18n.translateNode(131)),this.c=document.createElement("em"),this.c.setAttribute("class","nomobile"),this.b.appendChild(this.c),this.c=document.createElement("select"),this.c.setAttribute("lang","mul"),this.c.setAttribute("onchange","apijs.player.actionVideo(this);"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("label"),this.b.setAttribute("class","tracks text"),this.b.setAttribute("style","display:none;"),this.b.appendChild(apijs.i18n.translateNode(134)),this.c=document.createElement("em"),this.c.setAttribute("class","nomobile"),this.b.appendChild(this.c),this.c=document.createElement("select"),this.c.setAttribute("lang","mul"),this.c.setAttribute("onchange","apijs.player.actionText(this);"),this.d=document.createElement("option"),this.d.appendChild(apijs.i18n.translateNode(135)),this.c.appendChild(this.d),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("span"),this.b.setAttribute("class","btn full fnt nomobile"),this.b.setAttribute("onclick","apijs.dialog.onKey(122);"),this.b.appendChild(document.createTextNode("")),this.a.appendChild(this.b),t.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("onclick","apijs.dialog.onKey(80);")),this.media.setAttribute("id","apijsMedia"),this.b.appendChild(this.media),this.a.appendChild(this.b),this.b=document.createElement("dd"),this.b.setAttribute("class","nomobile noplaying"),"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=apijs.dialog.onMediaLoad,this.media.imageLoader.onerror=apijs.dialog.onMediaLoad):0<t.indexOf("iframe")?this.media.onload=apijs.dialog.onMediaLoad:!0===apijs.config.dialog.player?(this.media.setAttribute("class","player"),this.htmlSvgPlayer(this.media.parentNode),apijs.player=new apijs.core.player,apijs.player.init(this.media.parentNode,this.media,t),this.media.ondurationchange=apijs.dialog.onMediaLoad,this.media.onerror=apijs.dialog.onMediaLoad):"function"==typeof apijs.config.dialog.player?apijs.config.dialog.player(this.media,t):(this.c=document.createElement("source"),this.c.setAttribute("src",t),this.c.onerror=apijs.dialog.onMediaLoad,this.media.appendChild(this.c),this.media.ondurationchange=apijs.dialog.onMediaLoad,this.media.onerror=apijs.dialog.onMediaLoad),this},this.htmlHelp=function(t,e){var i,s,a=[t?["start",149,141]:[],t?["left","right",142]:[],e?["bottom","topk",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 nomobile 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)}return this.t2.appendChild(this.a),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(){"use strict";this.current=null,this.init=function(){for(var t,e,i,s=apijs.config.slideshow.ids,a=0;e=apijs.html(s+"."+a);a++){for(i=e.classList.contains("hoverload"),t=0;e=apijs.html(s+"."+a+"."+t);t++)e.addEventListener("click",apijs.slideshow.show),i&&e.addEventListener("mouseover",apijs.slideshow.show);(e=apijs.html(s+"."+a+".99999"))&&e.addEventListener("click",apijs.slideshow.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)&&!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)n=!0,i=apijs.html(t),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"),99999!==o.number&&(t=apijs.html(o.prefix).querySelectorAll("a[id][type]"),a=apijs.html(o.prefix).querySelectorAll("dl"),o.gallery||t.length!==a.length?(t.forEach(function(t){t.classList.remove("current")}),i.setAttribute("class","current")):(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),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<(a=o.config.shift()).indexOf(";")&&(s=(a=a.split(";"))[1].trim(),a=a[0].trim()),o.gallery.setAttribute("href",i.getAttribute("href")),o.gallery.querySelector("img").setAttribute("src",a),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").substr(0,5).replace("image","dialogPhoto").replace("video","dialogVideo"),o.type=0===o.type.indexOf("dialog")?o.type:"dialogPhoto",o.styles=apijs.html(o.prefix).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),s=apijs.html(o.prefix).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<s?o.prefix+"."+(o.number+1):null,last:o.prefix+"."+s,total:s},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)&&(e=0<(e=self.location.href).indexOf("#")?e.slice(0,e.indexOf("#")):e,e+="#"+(o.prefix+"."+(99999===o.number?0:o.number)).replace(/\./g,"-"),history.pushState({},"",e))),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(){"use strict";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.files=[],this.start=0,this.end=0,this.sendFile=function(t,e,i,s,a,n,o,r){r=this.sendFiles(t,e,i,s,0,a,n,o,r);return r||console.error("apijs.upload.sendFile invalid arguments",apijs.toArray(arguments)),r},this.sendFiles=function(t,e,i,s,a,n,o,r,l){if(this.files=[],!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)return("number"!=typeof this.allmax||0<this.allmax)&&console.error("apijs.upload.sendFiles invalid arguments",apijs.toArray(arguments)),!1;r=0<this.allmax,l="*"===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));return l+="[br]"+apijs.i18n.translate(r?165:164,apijs.formatNumber(this.onemax),r?apijs.formatNumber(this.allmax):"").replace("|","[br]"),apijs.dialog.dialogFormUpload(this.title,l,this.action,this.input,r,this.icon)},this.actionChoose=function(t){var e,i=[],s=0;this.files=[],this.exts&&(Array.prototype.forEach.call(t.files,function(t){e=t.name+' <span class="sz">'+apijs.i18n.translate(166,apijs.formatNumber(t.size/1048576))+"</span>","*"===this.exts.join()||this.exts.has(t.name.slice(t.name.lastIndexOf(".")+1).toLowerCase())?t.size>1048576*this.onemax?e+=' <span class="ee">'+apijs.i18n.translate(168)+"</span>":t.size<=0?e+=' <span class="ee">'+apijs.i18n.translate(169)+"</span>":this.files.push(t):e+=' <span class="ee">'+apijs.i18n.translate(167)+"</span>",i.push("<div>"+e+"</div>"),s+=t.size/1048576},this),0<this.allmax&&s>=this.allmax&&i.push('<div class="tt"> = <span class="sz">'+apijs.i18n.translate(166,apijs.formatNumber(s))+'</span> <span class="ee">'+apijs.i18n.translate(168)+"</span></div>"),this.files.length===t.files.length?(apijs.html("button.confirm").removeAttribute("disabled"),apijs.html("button.confirm").focus()):apijs.html("button.confirm").setAttribute("disabled","disabled"),apijs.html("div.filenames").innerHTML=i.join(" "))},this.actionConfirm=function(){var s,e;return 0<this.files.length?(s=new FormData,(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),s.append(apijs.config.upload.tokenName,apijs.config.upload.tokenValue)),this.files.forEach(function(t,e,i){s.append(1<i.length&&this.input.indexOf("[")<0?this.input+"_"+e:this.input,t)},this),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-")?(apijs.upload.updateTitle(),apijs.upload.callback(t.slice(8),apijs.upload.args)):apijs.upload.onError(195,t)):(apijs.log("upload:onreadystatechange status:"+e.status+" message: "+t),apijs.upload.onError(194,e.status)))},e.upload.onloadstart=apijs.upload.onStart.bind(this),e.upload.onprogress=apijs.upload.onProgress.bind(this),e.upload.onload=apijs.upload.onProgress.bind(this),e.upload.onerror=apijs.upload.onError.bind(this),e.send(s)):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),r=100*(n=r-this.start)/e+10,24<n&&(a=Math.round(r-n),a=10*Math.ceil(a/10),o=Math.ceil(a/60),s=Math.round(t.loaded/n/1024),n<40||r<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=apijs.html("rect"),o=apijs.html("span.info");99<t?(a="100%",n.setAttribute("class","end"),n.style.width="",apijs.html("p").textContent=apijs.i18n.translate(126)):(n.style.width=a=t+"%",n.hasAttribute("class")&&n.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))),o.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(){"use strict";this.core={},this.version=650,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.player=null,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(),self.addEventListener("popstate",apijs.slideshow.onPopState),self.addEventListener("hashchange",apijs.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.toArray=function(t){return Array.prototype.slice.call(t,0)},this.log=function(t){this.config.debug&&console.info("APIJS "+t)},this.openTab=function(t){t.preventDefault(),0<this.href.length&&self.open(this.href)},this.html=function(t){return 0===t.indexOf("#")||0===t.indexOf(this.config.slideshow.ids)?document.getElementById(t.replace("#","apijs")):this.dialog.t1?this.dialog.t1.querySelector(t):null},this.serialize=function(t,i){var s=[];return i="string"==typeof i?i:"",Array.prototype.forEach.call(t.elements,function(t){if(t.name&&!t.disabled&&!["file","reset","submit","button"].has(t.type)&&0===t.name.indexOf(i))if("select-multiple"===t.type)for(var 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(){"use strict";this.data={cs:{103:"Zrušit",104:"Potvrzení",105:"Zavřít",106:"Předchozí",107:"Další",142:"předchozí/další"},de:{103:"Abbrechen",104:"Bestätigen",105:"Schließen",106:"Zurück",107:"Weiter",108:"Datei wählen",109:"Dateien wählen",124:"Verarbeitung läuft...",141:"anfang/ende",142:"zurück/weiter",143:"wiedergabe/pause",144:"rückwärts/vorwärts",145:"leiser/lauter",146:"stumm",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]."},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...",131:"video",132:"video track",133:"audio track",134:"subtitles",135:"off",141:"start/end",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...",132:"pista video",133:"pista audio",134:"subtítulos",141:"inicio/fin",142:"anterior/siguiente",143:"reproducir/pausa",144:"retroceder/avanzar",145:"bajar/subir el 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...",131:"vidéo",132:"piste vidéo",133:"piste audio",134:"sous-titres",141:"début/fin",142:"précédent/suivant",143:"lecture/pause",144:"reculer/avancer",145:"baisser/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]."},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...",141:"inizio/fine",142:"precedente/successivo",143:"riproduci/pausa",144:"indietro/avanti",145:"abbassare/aumentare il volume",146:"muto",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:"次へ",142:"前へ/次へ",166:"§ Mo",184:"§% - § Ko/s",192:"よろしいですか?[span]はい[/span] - いいえ"},nl:{103:"Annuleren",104:"Bevestigen",105:"Sluiten",106:"Vorige",107:"Volgende",142:"vorige/volgende"},pl:{103:"Anuluj",104:"Potwierdź",105:"Zamknij",106:"Poprzedni",107:"Następne",142:"poprzedni/następne"},pt:{103:"Cancelar",104:"Confirmar",105:"Fechar",106:"Anterior",107:"Seguinte",108:"Escolher um ficheiro",109:"Escolher um ou vários ficheiros",124:"Operação em processo...",125:"Envio em processo...",126:"Tratamento em processo...",131:"vídeo",141:"início/fim",142:"anterior/seguinte",143:"reprodução/pausa",144:"recuar/avançar",145:"subir/baixar o volume",146:"silenciar",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",124:"Operação em andamento...",125:"Envio em andamento...",126:"Tratamento em andamento...",142:"anterior/próximo"},ru:{102:"Ок",103:"Отмена",104:"Подтвердить",105:"Закрыть",106:"Предыдущий",107:"Следующий",108:"Выберите файл",124:"Операция в процессе...",141:"начало/конец",142:"предыдущий/следующий",143:"воспроизведение/пауза",144:"назад/вперед",145:"понизить/повысить громкость",146:"отключить звук",147:"на весь экран",148:"выйти",161:"Все файлы приняты.",162:"Формат файла: §.",163:"Форматы файлов: § и §.",164:"Максимальный размер: § MB.",181:"§% - § kB/s - осталось § минут",182:"§% - § kB/s - осталось § минут",183:"§% - § kB/s - осталось § секунд",185:"§% - § kB/s за § минут",186:"§% - § kB/s за § минут",187:"§% - § kB/s за § секунд",188:"§% - § kB/s",192:"Вы уверены? [span]Да[/span] - нет",193:"Кажется произошла не предусмотренная ошибка... Попробуйте еще раз.",194:"Возникла ошибка при отправке файла.",195:"Возникла ошибка при обработке файла."},sk:{103:"Zrušiť",105:"Zavrieť",106:"Predchádzajúci",107:"Ďalší",142:"predchádzajúci/ďalší"},tr:{103:"İptal",104:"Onayla",105:"Kapat",106:"Önceki",107:"Sonraki",142:"önceki/sonraki",192:"Emin misiniz ? [span]Evet[/span] - Hayır"},zh:{103:"取消",104:"确认",105:"关闭",106:"前页",107:"下一步",142:"前页/下一步",192:"您确定吗?[span]是[/span] - 否"}},this.init=function(){var t,e=apijs.config.lang,i=document.querySelector("html");-1<e.indexOf("auto")&&(i.getAttribute("xml:lang")?t=i.getAttribute("xml:lang").slice(0,2):i.getAttribute("lang")&&(t=i.getAttribute("lang").slice(0,2)),"string"==typeof t&&this.data.hasOwnProperty(t)&&(apijs.config.lang=t)),this.data.hasOwnProperty(apijs.config.lang)||(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(this.data.hasOwnProperty(t))return apijs.config.lang=t,!0;if(-1<t.indexOf("auto"))return apijs.config.lang=t,this.init(),!0}return!1}},apijs.core.select=function(){"use strict";this.init=function(){document.querySelectorAll("select").forEach(function(t){t.addEventListener("focus",apijs.select.open)})},this.open=function(t){var e,i=t.target,s=document.createDocumentFragment(),a=document.createElement("div"),t=document.createElement("ul");i.querySelectorAll("option").forEach(function(t){(e=document.createElement("li")).appendChild(document.createTextNode(t.textContent)),Array.prototype.forEach.call(t.attributes,function(t){e.setAttribute(t.name,t.value)}),this.appendChild(e)},t),a.appendChild(t),s.appendChild(a),console.log(s.firstChild.innerHTML),i.parentNode.replaceChild(s.firstChild,i)}},apijs.core.player=function(){"use strict";this.root=null,this.video=null,this.stalled=!1,this.subload=!1,this.init=function(t,e,i){var s,a;if(this.root=t,(this.video=e).removeAttribute("controls"),e.onloadedmetadata=function(t){if(this.stalled=!1,this.onTimeupdate(t),this.onProgress(t),"object"==typeof this.video.videoTracks){if(1<(a=this.video.videoTracks).length){for(s=0;s<a.length;s++)this.createOption("videotrack",s,""===a[s].label?a[s].language:a[s].language+" - "+a[s].label);this.updateSelect("videotrack",a.length,0)}this.html(".tracks.videotrack select").selectedIndex=0}if("object"==typeof this.video.audioTracks){if(1<(a=this.video.audioTracks).length){for(s=0;s<a.length;s++)this.createOption("audiotrack",s,""===a[s].label?a[s].language:a[s].language+" - "+a[s].label);this.updateSelect("audiotrack",a.length,0)}this.html(".tracks.audiotrack select").selectedIndex=0}}.bind(this),e.onstalled=function(t){this.stalled=!0,this.onWaiting(t)}.bind(this),e.onplaying=apijs.player.onPlay.bind(this),e.onpause=apijs.player.onPlay.bind(this),e.onended=apijs.player.onEnded.bind(this),e.onprogress=apijs.player.onProgress.bind(this),e.ontimeupdate=apijs.player.onTimeupdate.bind(this),e.onseeking=apijs.player.onTimeupdate.bind(this),e.onseeked=apijs.player.onWaiting.bind(this),e.onwaiting=apijs.player.onWaiting.bind(this),e.onloadstart=apijs.player.onWaiting.bind(this),e.oncanplay=apijs.player.onWaiting.bind(this),e.onvolumechange=apijs.player.actionVolume.bind(this),i.indexOf("m3u")<0)return this.createTags([i]);var n=new XMLHttpRequest;return n.open("GET",i,!0),n.onreadystatechange=function(){4===n.readyState&&(self.dispatchEvent(new CustomEvent("apijsajaxresponse",{detail:{from:"apijs.player.init",xhr:n}})),[0,200].has(n.status)?apijs.player.createTags(n.responseText.trim().split("\n")):apijs.dialog.onMediaLoad({type:"error"}))},n.send(),this},this.createTags=function(t){var e,i,s;if(!(0<this.video.childNodes.length)){for(this.vv=0,this.tt=0;"string"==typeof(e=t.shift());)0===e.indexOf("#APIJS#attr")?(i=e.split("|"),this.video.setAttribute(i[1],i[2])):0===e.indexOf("#APIJS#track|subtitles")?(i=e.split("|"),this.createOption("text",this.tt++,i[3]+" - "+i[2]),(s=document.createElement("track")).setAttribute("kind",i[1]),s.setAttribute("label",i[2]),s.setAttribute("srclang",i[3]),s.setAttribute("src",i[4]),s.onload=function(t){"showing"===t.target.track.mode&&(apijs.log("player:track:onload"),this.onWaiting(t),this.subload=!1)}.bind(this),s.onerror=function(t){"showing"===t.target.track.mode&&(apijs.log("player:track:onerror"),this.onWaiting(t),this.subload=!1)}.bind(this),this.video.appendChild(s)):0===e.indexOf("#EXTINF")?i=e.replace(/#EXTINF:[0-9]+,/,""):5<e.length&&"#"!==e[0]&&(this.createOption("video",this.vv++,"string"==typeof i?i:this.vv),(s=document.createElement("source")).setAttribute("src",e),s.onerror=apijs.dialog.onMediaLoad,this.video.appendChild(s));return this.updateSelect("video",this.vv,0),"object"==typeof this.video.textTracks&&this.updateSelect("text",this.tt,1,!0),this}},this.createOption=function(t,e,i){var s=document.createElement("option");s.setAttribute("value",e),s.appendChild(document.createTextNode(i)),this.html(".tracks."+t+" select").appendChild(s)},this.updateSelect=function(t,e,i,s){(!0===s?0:1)<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.root.querySelector(t)},this.onTimeupdate=function(t){var e,i,s,a,n="00:00",o=this.video.currentTime;0<o&&(e=Math.floor(o/3600),i=Math.floor(o%3600/60),(s=Math.floor(o%60))<10&&(s="0"+s),i<10&&(i="0"+i),n=(e=0<e?e+":":"")+i+":"+s),(a=this.video.duration)===1/0||isNaN(a)||(e=Math.floor(a/3600),i=Math.floor(a%3600/60),(s=Math.floor(a%60))<10&&(s="0"+s),i<10&&(i="0"+i),n+=" / "+(e=0<e?e+":":"")+i+":"+s,this.html("svg.bar rect").style.width=o/a*100+"%"),this.html("span.time").textContent=n,this.stalled&&!this.subload&&(this.stalled=!1,this.onWaiting(t))},this.onProgress=function(){var t,e,i=this.html("svg.bar"),s=this.video,a=s.buffered.length;if(0<a&&s.duration!==1/0&&!isNaN(s.duration))for(i.querySelectorAll(".buffer").forEach(function(t){t.parentNode.removeChild(t)});0<a--;)(t=document.createElement("rect")).setAttribute("class","buffer"),99.8<(e=(s.buffered.end(a)-s.buffered.start(a))/s.duration*100)?t.setAttribute("style","left:0%; width:100%;"):t.setAttribute("style","left:"+s.buffered.start(a)/s.duration*100+"%; width:"+e+"%;"),i.appendChild(t)},this.onPlay=function(){this.video.paused?(this.html("span.play").textContent="",apijs.dialog.remove("playing")):(this.html("span.play").textContent="",apijs.dialog.add("playing"))},this.onEnded=function(){this.html("span.play").textContent="⟲"},this.onWaiting=function(t){apijs.log("player:onWaiting:"+t.type+" stalled:"+this.stalled+"/subload:"+this.subload),apijs.dialog[["loadstart","waiting","seeking","stalled"].has(t.type)?"add":"remove"]("loading")},this.actionVolume=function(t){var e=this.html("svg.vol"),i=e.offsetWidth,s=0,a=this.video;if(3!==a.networkState){if("object"==typeof t&&!isNaN(t.clientX)){for(;s+=e.offsetLeft,e=e.offsetParent;);s=(s=100*(t.clientX-s)/i/100)<=.1?0:.92<s?1:s,a.volume=s,a.muted=!1}this.html("svg.vol rect").style.width=a.muted?0:100*a.volume+"%"}},this.actionPosition=function(t){var e=this.html("svg.bar"),i=e.offsetWidth,s=0,a=this.video;if(3!==a.networkState&&"object"==typeof t&&a.duration!==1/0&&!isNaN(a.duration)){for(;s+=e.offsetLeft,e=e.offsetParent;);s=(s=a.duration*(t.clientX-s)*100/i/100)<=1?0:s,a.currentTime=s}},this.actionVideo=function(t){this.html("svg.bar rect").style.width="0",this.html("svg.bar").querySelectorAll(".buffer").forEach(function(t){t.parentNode.removeChild(t)}),this.html("span.play").textContent="",this.updateSelect("videotrack",0,0),this.updateSelect("audiotrack",0,0),this.video.src=this.video.querySelectorAll("source")[t.value].src,t.blur()},this.actionVideotrack=function(t){for(var e=this.video.videoTracks,i=0;i<e.length;i++)e[i].enabled=i==t.value;t.blur()},this.actionAudiotrack=function(t){for(var e=this.video.audioTracks,i=0;i<e.length;i++)e[i].enabled=i==t.value;t.blur()},this.actionText=function(t){for(var e=this.video.textTracks,i=0;i<e.length;i++)e[i].mode=i==t.value?"showing":"hidden";t.blur(),this.subload=!0}},apijs.core.dialog=function(){"use strict";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.media=null,this.t0=null,this.t1=null,this.t2=null,this.a=null,this.b=null,this.c=null,this.d=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",apijs.toArray(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",apijs.toArray(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",apijs.toArray(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();").htmlContent(t,e).htmlUpload(s,"boolean"==typeof a&&a).htmlBtnConfirm("submit").show("button.browse"):(console.error("apijs.dialog.dialogFormUpload invalid arguments",apijs.toArray(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",apijs.toArray(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",apijs.toArray(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",apijs.toArray(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",apijs.toArray(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",apijs.toArray(arguments)),!1)},this.dialogAjax=function(t,e,i,s,a){if("string"!=typeof t||"boolean"!=typeof e||"function"!=typeof i)return console.error("apijs.dialog.dialogAjax invalid arguments",apijs.toArray(arguments)),!1;this.callback=i,this.args=s;e=this.init("ajax","string"==typeof a?a+" loading":"loading",!e).htmlParent().htmlBtnClose(e).htmlSvgLoader(!1).show();return 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(apijs.dialog),this.xhr.send(),e},this.update=function(){return this.has("start","ready","end")&&(apijs.dialog.t1&&apijs.dialog.t1.setAttribute("class",this.klass.join(" ")),apijs.dialog.t2&&apijs.dialog.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){new RegExp("#("+apijs.config.slideshow.ids+"[-\\.]\\d+[-\\.]\\d+)").test(self.location.href)&&apijs.config.slideshow.anchor&&"function"==typeof history.pushState&&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.has("photo","video")?900:460);apijs.dialog[t?"add":"remove"]("mobile"),t=document.querySelector("body").clientWidth<=300,apijs.dialog[t?"add":"remove"]("tiny")},this.onScrollBrowser=function(t){var e=t.target,i=!1;if(apijs.dialog.has("slideshow")&&!apijs.dialog.has("playing")&&!["OPTION","SELECT"].has(e.nodeName)&&["DOMMouseScroll","mousewheel","panleft","panright"].has(t.type))e=(new Date).getTime()/1e3,(apijs.dialog.scroll<1||e>1+apijs.dialog.scroll)&&(apijs.dialog.scroll=e,i=0<t.detail||t.wheelDelta<0,apijs.slideshow["panleft"===t.type||i?"actionNext":"actionPrev"]());else{if("OPTION"===e.nodeName)e=e.parentNode;else if(!["TEXTAREA","SELECT"].has(e.nodeName))for(;!0!==i&&"HTML"!==e.nodeName;)e.classList.contains("scrollable")?i=!0:e=e.parentNode;if("HTML"!==e.nodeName&&((i=0<t.detail||t.wheelDelta<0)&&e.scrollTop<e.scrollHeight-e.offsetHeight||!i&&0<e.scrollTop))return}apijs.dialog.stopScroll(t)},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.pageYOffset>i.body.offsetHeight||!e&&i.defaultView.pageYOffset<=0)&&apijs.dialog.stopScroll(t)},this.onKey=function(t){var e=apijs.dialog,i=e.media,s=e.t1;isNaN(t)||(t={keyCode:t,ctrlKey:!1,altKey:!1,preventDefault:function(){}}),e.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():e.has("photo","video")&&122===t.keyCode?(t.preventDefault(),document.webkitFullscreenElement?document.webkitCancelFullScreen():document.mozFullScreenElement?document.mozCancelFullScreen():document.fullscreenElement?document.cancelFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen&&s.mozRequestFullScreen()):e.has("slideshow")?27===t.keyCode?(t.preventDefault(),e.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(),e.actionClose()),e.has("video")&&(32===t.keyCode||80===t.keyCode?(t.preventDefault(),3!==i.networkState&&(i.ended||i.paused?i.play():i.pause())):38===t.keyCode||33===t.keyCode?(t.preventDefault(),3!==i.networkState&&i.duration!==1/0&&i.currentTime<i.duration-10&&(i.currentTime+=10)):40===t.keyCode||34===t.keyCode?(t.preventDefault(),3!==i.networkState&&i.duration!==1/0&&(10<i.currentTime?i.currentTime-=10:i.currentTime=0)):107===t.keyCode?(t.preventDefault(),3!==i.networkState&&(i.muted&&(i.muted=!1),i.volume<.8?i.volume+=.2:i.volume=1)):109===t.keyCode?(t.preventDefault(),3!==i.networkState&&(i.muted&&(i.muted=!1),.21<i.volume?i.volume-=.2:i.volume=0)):77===t.keyCode&&(t.preventDefault(),3!==i.networkState&&(i.muted=!i.muted))),[32,33,34,35,36,38,40].has(t.keyCode)&&(t.target&&["INPUT","TEXTAREA","OPTION","SELECT"].has(t.target.nodeName)||e.stopScroll(t))},this.stopScroll=function(t){t.preventDefault(),"function"==typeof t.stopPropagation&&t.stopPropagation()},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.onIframeLoad=function(t){t.removeAttribute("class"),apijs.dialog.remove("loading"),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,s=apijs.dialog,a=s.media;t&&t.target&&(e=t.target.currentSrc||t.target.src,apijs.log("dialog:onMediaLoad:"+t.type+" "+(e?e.slice(e.lastIndexOf("/")+1):""))),a&&["load","durationchange"].has(t.type)?(s.remove("loading","error"),a.style.visibility="visible",a.hasAttribute("src")||"IMG"!==a.nodeName||a.setAttribute("src",a.imageLoader.src)):a&&"error"===t.type&&(s.toggle("loading","error"),a.removeAttribute("style"),(a=apijs.html(".tracks.video select"))&&t&&t.target&&0<(i=a.querySelectorAll("option")).length&&0<a.value.length&&(i[a.value].setAttribute("disabled","disabled"),a.selectedIndex+=1,"VIDEO"===t.target.nodeName&&""!==a.value&&apijs.player.actionVideo(a)))},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.init=function(t,e,i){return"string"==typeof e?e=0<(e=e.replace(this.ft,"").trim()).length?!0===i?e+" lock":e:!0===i?"lock":null:!0===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",apijs.dialog.onKey),self.addEventListener("beforeunload",apijs.dialog.onCloseBrowser),self.addEventListener("DOMMouseScroll",apijs.dialog.onScrollBrowser,{passive:!1}),self.addEventListener("mousewheel",apijs.dialog.onScrollBrowser,{passive:!1}),self.addEventListener("touchmove",apijs.dialog.onScrollBrowser,{passive:!1}),self.addEventListener("resize",apijs.dialog.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.setAttribute("tabindex","-1")}),this},this.show=function(t){return this.onResizeBrowser(),this.onFullscreen(),0<this.height&&!this.has("photo","video")&&(this.t2.style.minHeight=this.height+"px"),apijs.html("#Dialog")?(this.toggle("start","ready"),this.t1=apijs.html("#Dialog"),this.t1.appendChild(this.t0.firstChild.firstChild),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",apijs.dialog.actionClose),this.has("photo","video")&&(document.webkitFullscreenEnabled?document.addEventListener("webkitfullscreenchange",apijs.dialog.onFullscreen):document.fullscreenEnabled?document.addEventListener("fullscreenchange",apijs.dialog.onFullscreen):document.mozFullScreenEnabled&&document.addEventListener("mozfullscreenchange",apijs.dialog.onFullscreen)),!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){return t&&this.xhr&&(this.callback=null,this.xhr.abort()),document.removeEventListener("keydown",apijs.dialog.onKey),self.removeEventListener("beforeunload",apijs.dialog.onCloseBrowser),self.removeEventListener("DOMMouseScroll",apijs.dialog.onScrollBrowser,{passive:!1}),self.removeEventListener("mousewheel",apijs.dialog.onScrollBrowser,{passive:!1}),self.removeEventListener("touchmove",apijs.dialog.onScrollBrowser,{passive:!1}),self.removeEventListener("resize",apijs.dialog.onResizeBrowser),apijs.config.dialog.restrictNavigation&&document.querySelectorAll(this.ti).forEach(function(t){t.removeAttribute("tabindex")}),apijs.config.dialog.closeOnClick&&document.removeEventListener("click",apijs.dialog.actionClose),this.has("photo","video")&&(document.webkitFullscreenEnabled?document.removeEventListener("webkitfullscreenchange",apijs.dialog.onFullscreen):document.fullscreenEnabled?document.removeEventListener("fullscreenchange",apijs.dialog.onFullscreen):document.mozFullScreenEnabled&&document.removeEventListener("mozfullscreenchange",apijs.dialog.onFullscreen)),this.has("video")&&(this.media.ondurationchange=null,this.media.onerror=null),this.has("photo","video")||(this.height=parseFloat(self.getComputedStyle(this.t2).height)),t?(this.toggle("ready","end"),document.querySelector("body").removeChild(this.t1)):this.t1.removeChild(this.t2),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.a=null,this.b=null,this.c=null,!(this.d=null)},this.htmlParent=function(t,e){return this.t1=document.createElement("div"),this.t1.setAttribute("id","apijsDialog"),"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,"&lt;").replace(/>/g,"&gt;").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,"&lt;").replace(/>/g,"&gt;").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),this},this.htmlBtnClose=function(t){return!1===t||(this.a=document.createElement("div"),this.a.setAttribute("class","close noplaying"),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){return this.a=document.createElement("div"),this.a.setAttribute("class","btns upload"),this.b=document.createElement("input"),this.b.setAttribute("type","file"),this.b.setAttribute("name",t),this.b.setAttribute("id","apijsFile"),e&&this.b.setAttribute("multiple","multiple"),this.b.setAttribute("onchange","apijs.upload.actionChoose(this);"),this.a.appendChild(this.b),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"),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.htmlSvgPlayer=function(t){return this.a=document.createElement("span"),this.a.setAttribute("class","player noplaying"),this.b=document.createElement("span"),this.b.setAttribute("class","btn play fnt"),this.b.setAttribute("onclick","apijs.dialog.onKey(80);"),this.b.appendChild(document.createTextNode("")),this.a.appendChild(this.b),this.b=document.createElement("span"),this.b.setAttribute("class","svg bar"),this.c=document.createElement("svg"),this.c.setAttribute("class","bar"),this.c.setAttribute("onclick","apijs.player.actionPosition(event);"),this.d=document.createElement("rect"),this.c.appendChild(this.d),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("span"),this.b.setAttribute("class","time"),this.b.appendChild(document.createTextNode("00:00 / 00:00")),this.a.appendChild(this.b),this.b=document.createElement("span"),this.b.setAttribute("class","svg vol nomobile"),this.c=document.createElement("svg"),this.c.setAttribute("class","vol"),this.c.setAttribute("onclick","apijs.player.actionVolume(event);"),this.d=document.createElement("rect"),this.c.appendChild(this.d),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("label"),this.b.setAttribute("class","tracks audiotrack"),this.b.setAttribute("style","display:none;"),this.b.appendChild(apijs.i18n.translateNode(133)),this.c=document.createElement("em"),this.c.setAttribute("class","nomobile"),this.b.appendChild(this.c),this.c=document.createElement("select"),this.c.setAttribute("lang","mul"),this.c.setAttribute("onchange","apijs.player.actionAudiotrack(this);"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("label"),this.b.setAttribute("class","tracks videotrack"),this.b.setAttribute("style","display:none;"),this.b.appendChild(apijs.i18n.translateNode(132)),this.c=document.createElement("em"),this.c.setAttribute("class","nomobile"),this.b.appendChild(this.c),this.c=document.createElement("select"),this.c.setAttribute("lang","mul"),this.c.setAttribute("onchange","apijs.player.actionVideotrack(this);"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("label"),this.b.setAttribute("class","tracks video"),this.b.setAttribute("style","display:none;"),this.b.appendChild(apijs.i18n.translateNode(131)),this.c=document.createElement("em"),this.c.setAttribute("class","nomobile"),this.b.appendChild(this.c),this.c=document.createElement("select"),this.c.setAttribute("lang","mul"),this.c.setAttribute("onchange","apijs.player.actionVideo(this);"),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("label"),this.b.setAttribute("class","tracks text"),this.b.setAttribute("style","display:none;"),this.b.appendChild(apijs.i18n.translateNode(134)),this.c=document.createElement("em"),this.c.setAttribute("class","nomobile"),this.b.appendChild(this.c),this.c=document.createElement("select"),this.c.setAttribute("lang","mul"),this.c.setAttribute("onchange","apijs.player.actionText(this);"),this.d=document.createElement("option"),this.d.appendChild(apijs.i18n.translateNode(135)),this.c.appendChild(this.d),this.b.appendChild(this.c),this.a.appendChild(this.b),this.b=document.createElement("span"),this.b.setAttribute("class","btn full fnt nomobile"),this.b.setAttribute("onclick","apijs.dialog.onKey(122);"),this.b.appendChild(document.createTextNode("")),this.a.appendChild(this.b),t.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("onclick","apijs.dialog.onKey(80);")),this.media.setAttribute("id","apijsMedia"),this.b.appendChild(this.media),this.a.appendChild(this.b),this.b=document.createElement("dd"),this.b.setAttribute("class","nomobile noplaying"),"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=apijs.dialog.onMediaLoad,this.media.imageLoader.onerror=apijs.dialog.onMediaLoad):0<t.indexOf("iframe")?this.media.onload=apijs.dialog.onMediaLoad:!0===apijs.config.dialog.player?(this.media.setAttribute("class","player"),this.htmlSvgPlayer(this.media.parentNode),apijs.player=new apijs.core.player,apijs.player.init(this.media.parentNode,this.media,t),this.media.ondurationchange=apijs.dialog.onMediaLoad,this.media.onerror=apijs.dialog.onMediaLoad):"function"==typeof apijs.config.dialog.player?apijs.config.dialog.player(this.media,t):(this.c=document.createElement("source"),this.c.setAttribute("src",t),this.c.onerror=apijs.dialog.onMediaLoad,this.media.appendChild(this.c),this.media.ondurationchange=apijs.dialog.onMediaLoad,this.media.onerror=apijs.dialog.onMediaLoad),this},this.htmlHelp=function(t,e){var i,s,a=[t?["start",149,141]:[],t?["left","right",142]:[],e?["bottom","topk",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 nomobile 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)}return this.t2.appendChild(this.a),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(){"use strict";this.current=null,this.init=function(){for(var t,e,i,s=apijs.config.slideshow.ids,a=0;e=apijs.html(s+"."+a);a++){for(i=e.classList.contains("hoverload"),t=0;e=apijs.html(s+"."+a+"."+t);t++)e.addEventListener("click",apijs.slideshow.show),i&&e.addEventListener("mouseover",apijs.slideshow.show);(e=apijs.html(s+"."+a+".99999"))&&e.addEventListener("click",apijs.slideshow.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)&&!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)n=!0,i=apijs.html(t),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"),99999!==o.number&&(t=apijs.html(o.prefix).querySelectorAll("a[id][type]"),a=apijs.html(o.prefix).querySelectorAll("dl"),o.gallery||t.length!==a.length?(t.forEach(function(t){t.classList.remove("current")}),i.setAttribute("class","current")):(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),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<(a=o.config.shift()).indexOf(";")&&(s=(a=a.split(";"))[1].trim(),a=a[0].trim()),o.gallery.setAttribute("href",i.getAttribute("href")),o.gallery.querySelector("img").setAttribute("src",a),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").substr(0,5).replace("image","dialogPhoto").replace("video","dialogVideo"),o.type=0===o.type.indexOf("dialog")?o.type:"dialogPhoto",o.styles=apijs.html(o.prefix).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),s=apijs.html(o.prefix).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<s?o.prefix+"."+(o.number+1):null,last:o.prefix+"."+s,total:s},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)&&(e=0<(e=self.location.href).indexOf("#")?e.slice(0,e.indexOf("#")):e,e+="#"+(o.prefix+"."+(99999===o.number?0:o.number)).replace(/\./g,"-"),history.pushState({},"",e))),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(){"use strict";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.files=[],this.start=0,this.end=0,this.sendFile=function(t,e,i,s,a,n,o,r){r=this.sendFiles(t,e,i,s,0,a,n,o,r);return r||console.error("apijs.upload.sendFile invalid arguments",apijs.toArray(arguments)),r},this.sendFiles=function(t,e,i,s,a,n,o,r,l){if(this.files=[],!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)return("number"!=typeof this.allmax||0<this.allmax)&&console.error("apijs.upload.sendFiles invalid arguments",apijs.toArray(arguments)),!1;r=0<this.allmax,l="*"===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));return l+="[br]"+apijs.i18n.translate(r?165:164,apijs.formatNumber(this.onemax),r?apijs.formatNumber(this.allmax):"").replace("|","[br]"),apijs.dialog.dialogFormUpload(this.title,l,this.action,this.input,r,this.icon)},this.actionChoose=function(t){var e,i=[],s=0;this.files=[],this.exts&&(Array.prototype.forEach.call(t.files,function(t){e=t.name+' <span class="sz">'+apijs.i18n.translate(166,apijs.formatNumber(t.size/1048576))+"</span>","*"===this.exts.join()||this.exts.has(t.name.slice(t.name.lastIndexOf(".")+1).toLowerCase())?t.size>1048576*this.onemax?e+=' <span class="ee">'+apijs.i18n.translate(168)+"</span>":t.size<=0?e+=' <span class="ee">'+apijs.i18n.translate(169)+"</span>":this.files.push(t):e+=' <span class="ee">'+apijs.i18n.translate(167)+"</span>",i.push("<div>"+e+"</div>"),s+=t.size/1048576},this),0<this.allmax&&s>=this.allmax&&i.push('<div class="tt"> = <span class="sz">'+apijs.i18n.translate(166,apijs.formatNumber(s))+'</span> <span class="ee">'+apijs.i18n.translate(168)+"</span></div>"),this.files.length===t.files.length?(apijs.html("button.confirm").removeAttribute("disabled"),apijs.html("button.confirm").focus()):apijs.html("button.confirm").setAttribute("disabled","disabled"),apijs.html("div.filenames").innerHTML=i.join(" "))},this.actionConfirm=function(){var s,e,t;return 0<this.files.length?(s=new FormData,(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),s.append(apijs.config.upload.tokenName,apijs.config.upload.tokenValue)),3<(t=apijs.serialize(apijs.dialog.t2)).length&&t.split("&").forEach(function(t){t=t.split("="),s.append(t[0],t[1])}),this.files.forEach(function(t,e,i){s.append(1<i.length&&this.input.indexOf("[")<0?this.input+"_"+e:this.input,t)},this),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-")?(apijs.upload.updateTitle(),apijs.upload.callback(t.slice(8),apijs.upload.args)):apijs.upload.onError(195,t)):(apijs.log("upload:onreadystatechange status:"+e.status+" message: "+t),apijs.upload.onError(194,e.status)))},e.upload.onloadstart=apijs.upload.onStart.bind(this),e.upload.onprogress=apijs.upload.onProgress.bind(this),e.upload.onload=apijs.upload.onProgress.bind(this),e.upload.onerror=apijs.upload.onError.bind(this),e.send(s)):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),r=100*(n=r-this.start)/e+10,24<n&&(a=Math.round(r-n),a=10*Math.ceil(a/10),o=Math.ceil(a/60),s=Math.round(t.loaded/n/1024),n<40||r<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=apijs.html("rect"),o=apijs.html("span.info");99<t?(a="100%",n.setAttribute("class","end"),n.style.width="",apijs.html("p").textContent=apijs.i18n.translate(126)):(n.style.width=a=t+"%",n.hasAttribute("class")&&n.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))),o.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))}};
@@ -26,6 +26,8 @@ var apijsRedmine = new (function () {
26
26
  if (!d.frca) d.frca = {};
27
27
  // https://docs.google.com/spreadsheets/d/1UUpKZ-YAAlcfvGHYwt6aUM9io390j0-fIL0vMRh1pW0/edit?usp=sharing
28
28
  // auto start
29
+ d.cs[250] = "Smazat soubor";
30
+ d.cs[251] = "Opravdu chcete tento soubor smazat?[br]Pozor, tuto operaci nelze vrátit zpět.";
29
31
  d.cs[252] = "Chyba";
30
32
  d.de[250] = "Eine Datei löschen";
31
33
  d.de[251] = "Sind Sie sicher, dass Sie diese Datei löschen möchten?[br]Achtung, diese Aktion ist unrückgängig.";
@@ -58,8 +60,8 @@ var apijsRedmine = new (function () {
58
60
  d.fr[256] = "Saisissez ci-dessous la nouvelle description pour ce fichier. Pour supprimer la description, laissez le champ vide.";
59
61
  d.fr[257] = "Renommer le fichier";
60
62
  d.fr[258] = "Saisissez ci-dessous le nouveau nom pour ce fichier.";
61
- d.it[250] = "Eliminare un file";
62
- d.it[251] = "Sicuri di voler eliminare il file?[br]Attenzione, questa operazione non può essere annullata.";
63
+ d.it[250] = "Cancella i file";
64
+ d.it[251] = "Sei sicura di voler eliminare il file?[br]Attenzione, questa operazione non può essere annullata.";
63
65
  d.it[252] = "Errore";
64
66
  d.it[253] = "Non siete autorizzati a eseguire questa operazione, vi preghiamo di [a §]ricaricare la pagina[/a].";
65
67
  d.it[254] = "Spiacenti, il file non esiste più, vi preghiamo di [a §]ricaricare la pagina[/a].";
@@ -68,6 +70,8 @@ var apijsRedmine = new (function () {
68
70
  d.ja[250] = "ファイルを削除";
69
71
  d.ja[252] = "エラー";
70
72
  d.nl[252] = "Fout";
73
+ d.pl[250] = "Usuń plik";
74
+ d.pl[251] = "Jesteś pewny, że chcesz usunąć ten plik?[br]Uwaga! Nie ma odwrotu od tej operacji.";
71
75
  d.pl[252] = "Błąd";
72
76
  d.pt[250] = "Suprimir um ficheiro";
73
77
  d.pt[251] = "Tem certeza de que quer suprimir este ficheiro?[br]Cuidado, não pode cancelar esta operação.";
@@ -1,7 +1,7 @@
1
1
  @charset "utf-8";
2
2
  /**
3
3
  * Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
4
- * https://www.luigifab.fr/apijs - 6.4.0
4
+ * https://www.luigifab.fr/apijs - 6.5.0
5
5
  * This program is free software, you can redistribute it or modify
6
6
  * it under the terms of the GNU General Public License (GPL).
7
7
  */
@@ -1,7 +1,7 @@
1
1
  @charset "utf-8";
2
2
  /**
3
3
  * Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
4
- * https://www.luigifab.fr/apijs - 6.4.0
4
+ * https://www.luigifab.fr/apijs - 6.5.0
5
5
  * This program is free software, you can redistribute it or modify
6
6
  * it under the terms of the GNU General Public License (GPL).
7
7
  */
@@ -1,7 +1,7 @@
1
1
  @charset "utf-8";
2
2
  /**
3
3
  * Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
4
- * https://www.luigifab.fr/apijs - 6.4.0
4
+ * https://www.luigifab.fr/apijs - 6.5.0
5
5
  * This program is free software, you can redistribute it or modify
6
6
  * it under the terms of the GNU General Public License (GPL).
7
7
  */
data/init.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # Created L/21/05/2012
3
- # Updated J/20/08/2020
3
+ # Updated S/10/10/2020
4
4
  #
5
5
  # Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
6
6
  # https://www.luigifab.fr/redmine/apijs
@@ -26,7 +26,7 @@ Redmine::Plugin.register :redmine_apijs do
26
26
  name 'Redmine Apijs plugin'
27
27
  author 'Fabrice Creuzot'
28
28
  description 'Integrate the apijs javascript library into Redmine.'
29
- version '6.4.0-gem'
29
+ version '6.5.0-gem'
30
30
  url 'https://www.luigifab.fr/redmine/apijs'
31
31
  author_url 'https://www.luigifab.fr/'
32
32
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # Created V/27/12/2013
3
- # Updated J/20/08/2020
3
+ # Updated S/07/11/2020
4
4
  #
5
5
  # Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
6
6
  # https://www.luigifab.fr/redmine/apijs
@@ -23,12 +23,9 @@ module ApijsAttachment
23
23
  unloadable
24
24
  if Rails::VERSION::MAJOR >= 3
25
25
  include Rails.application.routes.url_helpers
26
- else
27
- include ActionController::UrlWriter
28
- end
29
- if Rails::VERSION::MAJOR >= 4
30
26
  before_create :update_date
31
27
  else
28
+ include ActionController::UrlWriter
32
29
  before_save :update_date
33
30
  end
34
31
  after_destroy :delete_cache
@@ -154,14 +151,37 @@ module ApijsAttachment
154
151
  end
155
152
 
156
153
  # commande python
157
- def getCmd(source, target, width, height, fixed=false)
154
+ def getPython
158
155
 
159
156
  if Redmine::Platform.mswin?
160
- cmd = 'python.exe'
157
+ cmd = `python.exe --version`
158
+ if $? == 0
159
+ cmd = 'python.exe'
160
+ else
161
+ cmd = `python --version`
162
+ if $? == 0
163
+ cmd = 'python'
164
+ else
165
+ cmd = nil
166
+ end
167
+ end
161
168
  else
162
- cmd = `command -v python3 || command -v python || command -v python2`.to_s.strip!
169
+ cmd = `python3 --version`
170
+ if $? == 0
171
+ cmd = 'python3'
172
+ else
173
+ cmd = nil
174
+ end
163
175
  end
164
176
 
177
+ return cmd
178
+ end
179
+
180
+ def getCmd(source, target, width, height, fixed=false)
181
+
182
+ cmd = getPython
183
+ cmd = 'notfound' if not cmd or cmd.length == 0
184
+
165
185
  script = File.join(File.dirname(__FILE__), (self.isPhoto? ? 'image.py' : 'video.py'))
166
186
  return cmd + ' ' + script.to_s + ' ' + source.to_s + ' ' + target.to_s + ' ' +
167
187
  width.to_s + ' ' + height.to_s + (fixed ? ' 90 fixed' : ' 90') + ' 2>&1'
@@ -250,6 +270,36 @@ module ApijsAttachment
250
270
  logger.info 'APIJS::ApijsAttachment#update_filedir: moving file from ' + src + ' to ' + dest
251
271
  end
252
272
 
273
+ # informations
274
+ def getProgramVersions(helpPil, helpSco)
275
+
276
+ cmd = getPython
277
+
278
+ if not cmd or cmd.length == 0
279
+ pyt = 'not found'
280
+ pil = pyt
281
+ sco = pyt
282
+ else
283
+ pyt = `#{cmd} --version 2>&1`.gsub('Python ', '').strip!
284
+
285
+ pil = `#{cmd} -c "from PIL import Image; print(Image.__version__)" 2>&1`.strip!
286
+ if pil.include? "o module named"
287
+ pil = 'not available'
288
+ elsif pil.include? "__version__"
289
+ pil = 'available'
290
+ end
291
+
292
+ sco = `#{cmd} -c "import scour; print(scour.__version__)" 2>&1`.strip!
293
+ if sco.include? "o module named"
294
+ sco = 'not available'
295
+ elsif sco.include? "__version__"
296
+ sco = 'available'
297
+ end
298
+ end
299
+
300
+ return sprintf('%s / %s %s / %s %s', pyt, pil, helpPil, sco, helpSco)
301
+ end
302
+
253
303
  end
254
304
  end
255
305
 
@@ -1,7 +1,7 @@
1
- #!/usr/bin/env python
1
+ #!/usr/bin/python3
2
2
  # -*- coding: utf8 -*-
3
3
  # Created J/26/12/2013
4
- # Updated D/26/07/2020
4
+ # Updated S/07/11/2020
5
5
  #
6
6
  # Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
7
7
  # https://www.luigifab.fr/openmage/apijs
@@ -17,7 +17,6 @@
17
17
  # GNU General Public License (GPL) for more details.
18
18
 
19
19
  import os
20
- import re
21
20
  import sys
22
21
  from PIL import Image, ImageSequence
23
22
 
@@ -1,7 +1,7 @@
1
- #!/usr/bin/env python
1
+ #!/usr/bin/python3
2
2
  # -*- coding: utf8 -*-
3
3
  # Created J/26/12/2013
4
- # Updated D/27/09/2020
4
+ # Updated S/07/11/2020
5
5
  #
6
6
  # Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
7
7
  # https://www.luigifab.fr/redmine/apijs
@@ -17,7 +17,6 @@
17
17
  # GNU General Public License (GPL) for more details.
18
18
 
19
19
  import os
20
- import re
21
20
  import sys
22
21
  from PIL import Image
23
22
 
@@ -35,6 +34,7 @@ except:
35
34
  if not os.path.exists(os.path.dirname(fileout)):
36
35
  os.makedirs(os.path.dirname(fileout))
37
36
 
37
+ # Video to image
38
38
  os.system('ffmpegthumbnailer -i ' + filein + ' -o ' + fileout + ' -q 10 -s ' + str(size[0]))
39
39
  if os.path.isfile(fileout):
40
40
  filein = fileout
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'redmine_apijs'
4
- s.version = '6.4.0'
4
+ s.version = '6.5.0'
5
5
  s.summary = 'Redmine Apijs plugin'
6
6
  s.description = 'Integrate the apijs javascript library into Redmine.'
7
7
  s.homepage = 'https://github.com/luigifab/redmine-apijs'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_apijs
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.4.0
4
+ version: 6.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabrice Creuzot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-10 00:00:00.000000000 Z
11
+ date: 2020-12-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Integrate the apijs javascript library into Redmine.
14
14
  email: code@luigifab.fr
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubygems_version: 3.1.2
90
+ rubygems_version: 3.2.0.rc.2
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Redmine Apijs plugin