redmine_apijs 6.6.0 → 6.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README +8 -9
  3. data/app/controllers/apijs_controller.rb +7 -7
  4. data/app/views/application/_browser.html.erb +1 -1
  5. data/app/views/attachments/_links.html.erb +1 -1
  6. data/app/views/settings/_apijs.html.erb +1 -1
  7. data/assets/javascripts/{app.js → apijs-redmine.js} +9 -6
  8. data/assets/javascripts/apijs-redmine.min.js +3 -3
  9. data/assets/javascripts/apijs-redmine.min.js.map +1 -0
  10. data/assets/javascripts/apijs.min.js +3 -3
  11. data/assets/javascripts/apijs.min.js.map +1 -1
  12. data/assets/stylesheets/apijs-print.min.css +2 -2
  13. data/assets/stylesheets/apijs-print.min.css.map +1 -1
  14. data/assets/stylesheets/apijs-redmine-rtl.min.css +2 -2
  15. data/assets/stylesheets/apijs-redmine-rtl.min.css.map +1 -0
  16. data/assets/stylesheets/{styles.css → apijs-redmine.css} +1 -1
  17. data/assets/stylesheets/apijs-redmine.min.css +2 -2
  18. data/assets/stylesheets/apijs-redmine.min.css.map +1 -0
  19. data/assets/stylesheets/apijs-screen-rtl.min.css +3 -3
  20. data/assets/stylesheets/apijs-screen-rtl.min.css.map +1 -1
  21. data/assets/stylesheets/apijs-screen.min.css +3 -3
  22. data/assets/stylesheets/apijs-screen.min.css.map +1 -1
  23. data/config/locales/el.yml +34 -0
  24. data/config/locales/hu.yml +34 -0
  25. data/config/locales/ro.yml +34 -0
  26. data/config/routes.rb +1 -1
  27. data/init.rb +4 -4
  28. data/lib/apijs_attachment.rb +1 -1
  29. data/lib/apijs_const.rb +1 -1
  30. data/lib/apijs_files.rb +1 -1
  31. data/lib/image.py +19 -13
  32. data/lib/redmine_apijs.rb +1 -1
  33. data/lib/useragentparser.rb +4 -4
  34. data/lib/video.py +1 -1
  35. data/redmine_apijs.gemspec +10 -7
  36. metadata +13 -9
  37. data/assets/javascripts/app.min.js.map +0 -1
  38. data/assets/stylesheets/styles-rtl.min.css.map +0 -1
  39. data/assets/stylesheets/styles.min.css.map +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9502319f70386b9a6d6bdc113eb0a5b2764cf149c462c6386d84bdd02e476839
4
- data.tar.gz: 67b5e238f20e0188c9b94dd5c67bd12ed805811680594b3047c518eaac7fc758
3
+ metadata.gz: 8869cf2ecfd172edfc1a2e8d90dfcb31d2e8c4344cfc4dcc3c52a777f71eb048
4
+ data.tar.gz: 483f9d38ef5bddb748488015b4eb0743277f768560e300c855bc677a322d1a74
5
5
  SHA512:
6
- metadata.gz: ff4462f86fa5c83a8aef9c8f7121291d40e4f3924693e40f166d958531ecd6700df4ecf9bda7b578232cd1b17a37ee6907e1deb5cf48c4e3a092908c18d80c49
7
- data.tar.gz: e2aa564b8f8a395591d162433148fa1fcb3382578d18f5846dc7e57e3f75c6e942bf2eccd3be1ad6c2daa45351111519bf69ff607cb993025d9d2c8cae7d945b
6
+ metadata.gz: 28b9bb14e9728db390eb6df1b786ff3036e1c36e306335d1b897e14e271c443b2dc0d6c54156428a7f7eae59d244c81d9c22502c932cfae7bae5dddf4180fb6b
7
+ data.tar.gz: a855a338e327ea3f9aa0afb23d1c3636014f8374545f4337d5539d9dbf5e6f407bb6c8ba5d41cfe0e32d5743c0d67f98e2fca85292b6f0ef9f705c8b7cb78c8a
data/README CHANGED
@@ -3,17 +3,14 @@ Tracker : https://github.com/luigifab/redmine-apijs
3
3
  Rubygems : https://rubygems.org/gems/redmine_apijs
4
4
  Plugin : Luigifab/Apijs
5
5
  License : GNU GPL 2+ (https://opensource.org/licenses/gpl-2.0)
6
- Copyright : 2008-2021 Fabrice Creuzot (luigifab) <code~luigifab~fr>
6
+ Copyright : 2008-2022 Fabrice Creuzot (luigifab) <code~luigifab~fr>
7
7
 
8
8
 
9
9
 
10
10
 
11
11
 
12
-
13
-
14
-
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/UglifyJS).
12
+ IF YOU FOUND A MISTAKE OR A BUG, PLEASE CONTACT ME (IN FRENCH OR IN ENGLISH).
13
+ CSS AND JS FILES ARE MINIFIED WITH clean-css (github.com/jakubpawlowicz/clean-css) AND uglify-js (github.com/mishoo/uglifyjs).
17
14
  ALL FILES (INCLUDING DOCUMENTATION AND TRANSLATIONS) ARE LICENSED UNDER THE TERMS OF THE GNU GPL 2+ LICENSE.
18
15
  THAT BEING SAID SOME FILES COME FROM OTHER PROJECTS AND ARE UNDER OTHER LICENSES (SEE AT THE END OF THIS FILE).
19
16
 
@@ -37,7 +34,7 @@ Translations in de-DE (deutsch/Deutschland) by:
37
34
  - Philip Junietz <info~label-park~com> 2016
38
35
  - Pamela Steinborn <st.pamela~laposte~net> 2016
39
36
  Translations in en-US (english/United-States) by:
40
- - Fabrice Creuzot (luigifab) <code~luigifab~fr> 2008-2021
37
+ - Fabrice Creuzot (luigifab) <code~luigifab~fr> 2008-2022
41
38
  - Brian Legrand <mrbibi1987~gmail~com> 2012
42
39
  - Pascale Scellier <scellier.pascale~orange~fr> 2016
43
40
  Translations in es-ES (español/España) by:
@@ -47,7 +44,7 @@ Translations in es-ES (español/España) by:
47
44
  - Hélène Vergine <vergineh~gmail~com> 2017, 2020
48
45
  - Guillaume Genetet <genetet.incorporated~gmail~com> 2018 https://fr.tipeee.com/william-broome
49
46
  Translations in fr-FR (français/France) by:
50
- - Fabrice Creuzot (luigifab) <code~luigifab~fr> 2008-2021
47
+ - Fabrice Creuzot (luigifab) <code~luigifab~fr> 2008-2022
51
48
  - Pascale Scellier <scellier.pascale~orange~fr> 2016
52
49
  Translations in it-IT (italiano/Italia) by:
53
50
  - Maria Grasso <mgrasso~outlook~fr> 2016-2017
@@ -63,11 +60,13 @@ If you like, take some of your time to improve the translations, go to https://b
63
60
 
64
61
 
65
62
  File: /lib/useragentparser.rb
66
- Source: https://github.com/donatj/PhpUserAgent + https://gist.github.com/luigifab/19a68d9aa98fa80f2961809d7cec59c0 (1.3.0-fork1)
63
+ Source: https://github.com/donatj/PhpUserAgent + https://gist.github.com/luigifab/19a68d9aa98fa80f2961809d7cec59c0 (1.5.0-fork1)
67
64
  Copyright: 2013-2021 Jesse G. Donat <donatj~gmail~com>
68
65
  Copyright: 2019-2021 Fabrice Creuzot (luigifab) <code~luigifab~fr>
69
66
  License: MIT (https://opensource.org/licenses/mit)
70
67
 
71
68
  Files: /assets/fonts/apijs/fontello.woff /assets/fonts/apijs/fontello.woff2
72
69
  Source: http://fontello.com/
70
+ Copyright: Font Awesome 2016 Dave Gandy
71
+ Copyright: Iconic 2012 P.J. Onori
73
72
  License: SIL (https://opensource.org/licenses/ofl-1.1)
@@ -1,8 +1,8 @@
1
1
  # encoding: utf-8
2
2
  # Created J/12/12/2013
3
- # Updated S/16/01/2021
3
+ # Updated V/15/10/2021
4
4
  #
5
- # Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
5
+ # Copyright 2008-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
6
6
  # https://www.luigifab.fr/redmine/apijs
7
7
  #
8
8
  # This program is free software, you can redistribute it or modify
@@ -246,11 +246,11 @@ class ApijsController < AttachmentsController
246
246
  if !request.headers['Range']
247
247
  send_file(@attachment.diskfile,
248
248
  filename: filename_for_content_disposition(@attachment.filename),
249
- type: @attachment.content_type, disposition: 'inline')
249
+ type: detect_content_type(@attachment), disposition: 'inline')
250
250
  else
251
251
  send_data(File.binread(@attachment.diskfile, file_end - file_begin + 1, file_begin),
252
252
  filename: filename_for_content_disposition(@attachment.filename),
253
- type: @attachment.content_type, disposition: 'inline', status: '206 Partial Content')
253
+ type: detect_content_type(@attachment), disposition: 'inline', status: '206 Partial Content')
254
254
  end
255
255
 
256
256
  response.close
@@ -258,18 +258,18 @@ class ApijsController < AttachmentsController
258
258
  elsif @attachment.isImage?
259
259
  if stale?(etag: @attachment.diskfile)
260
260
  send_file(@attachment.diskfile, filename: filename_for_content_disposition(@attachment.filename),
261
- type: @attachment.content_type, disposition: 'inline')
261
+ type: detect_content_type(@attachment), disposition: 'inline')
262
262
  end
263
263
  # fichier
264
264
  else
265
265
  send_file(@attachment.diskfile, filename: filename_for_content_disposition(@attachment.filename),
266
- type: @attachment.content_type, disposition: 'attachment')
266
+ type: detect_content_type(@attachment), disposition: 'attachment')
267
267
  end
268
268
  # téléchargement d'un fichier
269
269
  else
270
270
  @attachment.increment_download if @attachment.container.is_a?(Version) || @attachment.container.is_a?(Project)
271
271
  send_file(@attachment.diskfile, filename: filename_for_content_disposition(@attachment.filename),
272
- type: @attachment.content_type, disposition: 'attachment')
272
+ type: detect_content_type(@attachment), disposition: 'attachment')
273
273
  end
274
274
  end
275
275
 
@@ -2,7 +2,7 @@
2
2
  # Created S/17/08/2019
3
3
  # Updated L/25/05/2020
4
4
  #
5
- # Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
5
+ # Copyright 2008-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
6
6
  # https://www.luigifab.fr/redmine/apijs
7
7
  #
8
8
  # This program is free software, you can redistribute it or modify
@@ -2,7 +2,7 @@
2
2
  # Created L/21/05/2012
3
3
  # Updated J/20/08/2020
4
4
  #
5
- # Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
5
+ # Copyright 2008-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
6
6
  # https://www.luigifab.fr/redmine/apijs
7
7
  #
8
8
  # This program is free software, you can redistribute it or modify
@@ -2,7 +2,7 @@
2
2
  # Created J/12/12/2013
3
3
  # Updated D/17/01/2021
4
4
  #
5
- # Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
5
+ # Copyright 2008-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
6
6
  # https://www.luigifab.fr/redmine/apijs
7
7
  #
8
8
  # This program is free software, you can redistribute it or modify
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Created D/15/12/2013
3
- * Updated S/16/01/2021
3
+ * Updated D/05/09/2021
4
4
  *
5
- * Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
5
+ * Copyright 2008-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
6
6
  * https://www.luigifab.fr/redmine/apijs
7
7
  *
8
8
  * This program is free software, you can redistribute it or modify
@@ -20,7 +20,7 @@ var apijsRedmine = new (function () {
20
20
 
21
21
  "use strict";
22
22
 
23
- this.start = function () {
23
+ this.init = function () {
24
24
 
25
25
  var d = apijs.i18n.data;
26
26
  if (!d.frca) d.frca = {};
@@ -36,6 +36,7 @@ var apijsRedmine = new (function () {
36
36
  d.de[254] = "Es tut uns leid, diese Datei existiert nicht mehr, bitte [a §]aktualisieren Sie die Seite[/a].";
37
37
  d.de[255] = "Eine Beschreibung bearbeiten";
38
38
  d.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.";
39
+ d.el[252] = "Σφάλμα";
39
40
  d.en[250] = "Remove file";
40
41
  d.en[251] = "Are you sure you want to remove this file?[br]Be careful, you can't cancel this operation.";
41
42
  d.en[252] = "Error";
@@ -66,6 +67,7 @@ var apijsRedmine = new (function () {
66
67
  d.fr[258] = "Saisissez ci-dessous le nouveau nom pour ce fichier.";
67
68
  d.fr[259] = "Vider le cache";
68
69
  d.fr[260] = "Êtes-vous certain(e) de vouloir vider le cache ?[br]Attention, cette opération n'est pas annulable.";
70
+ d.hu[252] = "Hiba";
69
71
  d.it[250] = "Cancella i file";
70
72
  d.it[251] = "Sei sicura di voler eliminare il file?[br]Attenzione, questa operazione non può essere annullata.";
71
73
  d.it[252] = "Errore";
@@ -86,6 +88,7 @@ var apijsRedmine = new (function () {
86
88
  d.pt[254] = "Lamento, o ficheiro já não existe, por favor [a §]atualize a página[/a].";
87
89
  d.pt[255] = "Modificar uma descrição";
88
90
  d.pt[256] = "Digite abaixo a nova descrição para este ficheiro. Para suprimir a descrição, deixe o campo vazio.";
91
+ d.ro[252] = "Eroare";
89
92
  d.ru[250] = "Удалить файл";
90
93
  d.ru[251] = "Вы уверены, что хотите удалить этот файл?[br]Осторожно, вы не сможете отменить эту операцию.";
91
94
  d.ru[252] = "Ошибка";
@@ -276,11 +279,11 @@ var apijsRedmine = new (function () {
276
279
 
277
280
  // supprime le fichier de la page grâce à son id
278
281
  var attachment = document.getElementById(xhr.responseText), elems = attachment.parentNode, idx = 0;
279
- elems.removeChild(attachment);
282
+ attachment.remove();
280
283
 
281
284
  // supprime la liste des fichiers
282
285
  if (elems.querySelectorAll('dl, li').length < 1) {
283
- elems.parentNode.removeChild(elems);
286
+ elems.remove();
284
287
  }
285
288
  // ou réattribue les ids du diaporama (pas de réinitialisation, on remet juste les ids en place)
286
289
  else {
@@ -316,4 +319,4 @@ var apijsRedmine = new (function () {
316
319
  })();
317
320
 
318
321
  if (typeof self.addEventListener == 'function')
319
- self.addEventListener('apijsload', apijsRedmine.start.bind(apijsRedmine));
322
+ self.addEventListener('apijsload', apijsRedmine.init.bind(apijsRedmine));
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
2
+ * Copyright 2008-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
3
3
  * https://www.luigifab.fr/redmine/apijs
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[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.en[259]="Clear cache",e.en[260]="Are you sure you want to clear the cache?[br]Be careful, you can't cancel this operation.",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.es[259]="Vaciar la caché",e.es[260]="¿Está usted seguro(a) de querer vaciar la caché?[br]Cuidado, esta operación no puede ser cancelada.",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.fr[259]="Vider le cache",e.fr[260]="Êtes-vous certain(e) de vouloir vider le cache ?[br]Attention, cette opération n'est pas annulable.",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.uk[252]="Помилка",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,a,i){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,a,apijsRedmine.actionEditAttachment,[t,a,i],"editattach"),apijs.dialog.t1.querySelector("input").select()},this.actionEditAttachment=function(e,t){if("boolean"==typeof e)return!0;var a;"string"==typeof e&&((a=new XMLHttpRequest).open("POST",t[1]+"?id="+t[0]+"&isAjax=true",!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.setRequestHeader("X-CSRF-Token",t[2]),a.onreadystatechange=function(){var e,t;4===a.readyState&&([0,200].has(a.status)?0===a.responseText.indexOf("attachmentId")?(t=a.responseText.slice(0,a.responseText.indexOf(":")),e=a.responseText.slice(a.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(a.responseText):apijsRedmine.error(a.status))},a.send("desc="+encodeURIComponent(document.getElementById("apijsinput").value)))},this.renameAttachment=function(e,t,a,i){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,a,apijsRedmine.actionRenameAttachment,[t,a,i],"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,a,i;4===r.readyState&&([0,200].has(r.status)?0===r.responseText.indexOf("attachmentId")?(t=r.responseText.slice(0,r.responseText.indexOf(":")),a=r.responseText.slice(r.responseText.indexOf(":")+1),(i=document.getElementById(t)).querySelector(".filename").textContent=a,(t=i.querySelector("input"))&&(e=t.getAttribute("value"),t.setAttribute("value",a+e.substr(e.indexOf("|")))),(t=i.querySelector("a"))&&(e=t.getAttribute("href"),t.setAttribute("href",e.substr(0,e.lastIndexOf("/")+1)+a)),(t=i.querySelector("button.download"))&&(e=t.getAttribute("onclick"),t.setAttribute("onclick",e.substr(0,e.lastIndexOf("/")+1)+a+"';")),(t=i.querySelector("button.show"))&&(e=t.getAttribute("onclick"),t.setAttribute("onclick",e.substr(0,e.lastIndexOf("/")+1)+a+"';")),apijs.dialog.actionClose()):apijsRedmine.error(r.responseText):apijsRedmine.error(r.status))},r.send("name="+encodeURIComponent(document.getElementById("apijsinput").value)))},this.removeAttachment=function(e,t,a,i){apijs.dialog.dialogConfirmation(apijs.i18n.translate(250),apijs.i18n.translate(251),apijsRedmine.actionRemoveAttachment,[t,a,i])},this.actionRemoveAttachment=function(e){var i=new XMLHttpRequest;i.open("POST",e[1]+"?id="+e[0]+"&isAjax=true",!0),i.setRequestHeader("X-CSRF-Token",e[2]),i.onreadystatechange=function(){var e,t,a;4===i.readyState&&([0,200].has(i.status)?0===i.responseText.indexOf("attachmentId")?(t=(e=document.getElementById(i.responseText)).parentNode,a=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)+a++)}),apijs.dialog.actionClose()):apijsRedmine.error(i.responseText):apijsRedmine.error(i.status))},i.send()},this.clearCache=function(e){apijs.dialog.dialogConfirmation(apijs.i18n.translate(259),apijs.i18n.translate(260),apijsRedmine.actionClearCache,e)},this.actionClearCache=function(e){apijs.dialog.remove("waiting","lock"),self.location.href=e}};"function"==typeof self.addEventListener&&self.addEventListener("apijsload",apijsRedmine.start.bind(apijsRedmine));
8
- //# sourceMappingURL=app.min.js.map
7
+ var apijsRedmine=new function(){"use strict";this.init=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.el[252]="Σφάλμα",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.en[259]="Clear cache",e.en[260]="Are you sure you want to clear the cache?[br]Be careful, you can't cancel this operation.",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.es[259]="Vaciar la caché",e.es[260]="¿Está usted seguro(a) de querer vaciar la caché?[br]Cuidado, esta operación no puede ser cancelada.",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.fr[259]="Vider le cache",e.fr[260]="Êtes-vous certain(e) de vouloir vider le cache ?[br]Attention, cette opération n'est pas annulable.",e.hu[252]="Hiba",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.ro[252]="Eroare",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.uk[252]="Помилка",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,a,i){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,a,apijsRedmine.actionEditAttachment,[t,a,i],"editattach"),apijs.dialog.t1.querySelector("input").select()},this.actionEditAttachment=function(e,t){if("boolean"==typeof e)return!0;var a;"string"==typeof e&&((a=new XMLHttpRequest).open("POST",t[1]+"?id="+t[0]+"&isAjax=true",!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.setRequestHeader("X-CSRF-Token",t[2]),a.onreadystatechange=function(){var e,t;4===a.readyState&&([0,200].has(a.status)?0===a.responseText.indexOf("attachmentId")?(t=a.responseText.slice(0,a.responseText.indexOf(":")),e=a.responseText.slice(a.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(a.responseText):apijsRedmine.error(a.status))},a.send("desc="+encodeURIComponent(document.getElementById("apijsinput").value)))},this.renameAttachment=function(e,t,a,i){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,a,apijsRedmine.actionRenameAttachment,[t,a,i],"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,a,i;4===r.readyState&&([0,200].has(r.status)?0===r.responseText.indexOf("attachmentId")?(t=r.responseText.slice(0,r.responseText.indexOf(":")),a=r.responseText.slice(r.responseText.indexOf(":")+1),(i=document.getElementById(t)).querySelector(".filename").textContent=a,(t=i.querySelector("input"))&&(e=t.getAttribute("value"),t.setAttribute("value",a+e.substr(e.indexOf("|")))),(t=i.querySelector("a"))&&(e=t.getAttribute("href"),t.setAttribute("href",e.substr(0,e.lastIndexOf("/")+1)+a)),(t=i.querySelector("button.download"))&&(e=t.getAttribute("onclick"),t.setAttribute("onclick",e.substr(0,e.lastIndexOf("/")+1)+a+"';")),(t=i.querySelector("button.show"))&&(e=t.getAttribute("onclick"),t.setAttribute("onclick",e.substr(0,e.lastIndexOf("/")+1)+a+"';")),apijs.dialog.actionClose()):apijsRedmine.error(r.responseText):apijsRedmine.error(r.status))},r.send("name="+encodeURIComponent(document.getElementById("apijsinput").value)))},this.removeAttachment=function(e,t,a,i){apijs.dialog.dialogConfirmation(apijs.i18n.translate(250),apijs.i18n.translate(251),apijsRedmine.actionRemoveAttachment,[t,a,i])},this.actionRemoveAttachment=function(e){var i=new XMLHttpRequest;i.open("POST",e[1]+"?id="+e[0]+"&isAjax=true",!0),i.setRequestHeader("X-CSRF-Token",e[2]),i.onreadystatechange=function(){var e,t,a;4===i.readyState&&([0,200].has(i.status)?0===i.responseText.indexOf("attachmentId")?(t=(e=document.getElementById(i.responseText)).parentNode,a=0,e.remove(),t.querySelectorAll("dl, li").length<1?t.remove():t.querySelectorAll("a[id][type]").forEach(function(e){e.setAttribute("id",e.getAttribute("id").slice(0,e.getAttribute("id").lastIndexOf(".")+1)+a++)}),apijs.dialog.actionClose()):apijsRedmine.error(i.responseText):apijsRedmine.error(i.status))},i.send()},this.clearCache=function(e){apijs.dialog.dialogConfirmation(apijs.i18n.translate(259),apijs.i18n.translate(260),apijsRedmine.actionClearCache,e)},this.actionClearCache=function(e){apijs.dialog.remove("waiting","lock"),self.location.href=e}};"function"==typeof self.addEventListener&&self.addEventListener("apijsload",apijsRedmine.init.bind(apijsRedmine));
8
+ //# sourceMappingURL=apijs-redmine.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["apijs-redmine.js"],"sourcesContent":["/**\n * Created D/15/12/2013\n * Updated D/05/09/2021\n *\n * Copyright 2008-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>\n * https://www.luigifab.fr/redmine/apijs\n *\n * This program is free software, you can redistribute it or modify\n * it under the terms of the GNU General Public License (GPL) as published\n * by the free software foundation, either version 2 of the license, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but without any warranty, without even the implied warranty of\n * merchantability or fitness for a particular purpose. See the\n * GNU General Public License (GPL) for more details.\n */\n\nvar apijsRedmine = new (function () {\n\n\t\"use strict\";\n\n\tthis.init = function () {\n\n\t\tvar d = apijs.i18n.data;\n\t\tif (!d.frca) d.frca = {};\n\t\t// https://docs.google.com/spreadsheets/d/1UUpKZ-YAAlcfvGHYwt6aUM9io390j0-fIL0vMRh1pW0/edit?usp=sharing\n\t\t// auto start\n\t\td.cs[250] = \"Smazat soubor\";\n\t\td.cs[251] = \"Opravdu chcete tento soubor smazat?[br]Pozor, tuto operaci nelze vrátit zpět.\";\n\t\td.cs[252] = \"Chyba\";\n\t\td.de[250] = \"Eine Datei löschen\";\n\t\td.de[251] = \"Sind Sie sicher, dass Sie diese Datei löschen möchten?[br]Achtung, diese Aktion ist unrückgängig.\";\n\t\td.de[252] = \"Fehler\";\n\t\td.de[253] = \"Sie verfügen nicht über die notwendigen Rechte um diese Operation durchzuführen, bitte [a §]aktualisieren Sie die Seite[/a].\";\n\t\td.de[254] = \"Es tut uns leid, diese Datei existiert nicht mehr, bitte [a §]aktualisieren Sie die Seite[/a].\";\n\t\td.de[255] = \"Eine Beschreibung bearbeiten\";\n\t\td.de[256] = \"Bitte geben Sie weiter unten die neue Beschreibung für diese Datei an. Um die Beschreibung zu löschen lassen Sie das Feld leer.\";\n\t\td.el[252] = \"Σφάλμα\";\n\t\td.en[250] = \"Remove file\";\n\t\td.en[251] = \"Are you sure you want to remove this file?[br]Be careful, you can't cancel this operation.\";\n\t\td.en[252] = \"Error\";\n\t\td.en[253] = \"You are not authorized to perform this operation, please [a §]refresh the page[/a].\";\n\t\td.en[254] = \"Sorry, the file no longer exists, please [a §]refresh the page[/a].\";\n\t\td.en[255] = \"Edit description\";\n\t\td.en[256] = \"Enter below the new description for the file. To remove the description, leave the field empty.\";\n\t\td.en[257] = \"Rename file\";\n\t\td.en[258] = \"Enter below the new name for the file.\";\n\t\td.en[259] = \"Clear cache\";\n\t\td.en[260] = \"Are you sure you want to clear the cache?[br]Be careful, you can't cancel this operation.\";\n\t\td.es[250] = \"Borrar un archivo\";\n\t\td.es[251] = \"¿Está usted seguro(a) de que desea eliminar este archivo?[br]Atención, pues no podrá cancelar esta operación.\";\n\t\td.es[253] = \"No está autorizado-a para llevar a cabo esta operación, por favor [a §]actualice la página[/a].\";\n\t\td.es[254] = \"Disculpe, pero el archivo ya no existe, por favor [a §]actualice la página[/a].\";\n\t\td.es[255] = \"Editar una descripción\";\n\t\td.es[256] = \"Introduzca a continuación la nueva descripción para el archivo. Para eliminar la descripción, deje el campo en blanco.\";\n\t\td.es[259] = \"Vaciar la caché\";\n\t\td.es[260] = \"¿Está usted seguro(a) de querer vaciar la caché?[br]Cuidado, esta operación no puede ser cancelada.\";\n\t\td.fr[250] = \"Supprimer le fichier\";\n\t\td.fr[251] = \"Êtes-vous sûr(e) de vouloir supprimer ce fichier ?[br]Attention, cette opération n'est pas annulable.\";\n\t\td.fr[252] = \"Erreur\";\n\t\td.fr[253] = \"Vous n'êtes pas autorisé(e) à effectuer cette opération, veuillez [a §]actualiser la page[/a].\";\n\t\td.fr[254] = \"Désolé, le fichier n'existe plus, veuillez [a §]actualiser la page[/a].\";\n\t\td.fr[255] = \"Modifier la description\";\n\t\td.fr[256] = \"Saisissez ci-dessous la nouvelle description pour ce fichier. Pour supprimer la description, laissez le champ vide.\";\n\t\td.fr[257] = \"Renommer le fichier\";\n\t\td.fr[258] = \"Saisissez ci-dessous le nouveau nom pour ce fichier.\";\n\t\td.fr[259] = \"Vider le cache\";\n\t\td.fr[260] = \"Êtes-vous certain(e) de vouloir vider le cache ?[br]Attention, cette opération n'est pas annulable.\";\n\t\td.hu[252] = \"Hiba\";\n\t\td.it[250] = \"Cancella i file\";\n\t\td.it[251] = \"Sei sicura di voler eliminare il file?[br]Attenzione, questa operazione non può essere annullata.\";\n\t\td.it[252] = \"Errore\";\n\t\td.it[253] = \"Non siete autorizzati a eseguire questa operazione, vi preghiamo di [a §]ricaricare la pagina[/a].\";\n\t\td.it[254] = \"Spiacenti, il file non esiste più, vi preghiamo di [a §]ricaricare la pagina[/a].\";\n\t\td.it[255] = \"Modificare una descrizione\";\n\t\td.it[256] = \"Inserire qui sotto la nuova descrizione del file. Per cancellare la descrizione, lasciate lo spazio vuoto.\";\n\t\td.ja[250] = \"ファイルを削除\";\n\t\td.ja[252] = \"エラー\";\n\t\td.nl[252] = \"Fout\";\n\t\td.pl[250] = \"Usuń plik\";\n\t\td.pl[251] = \"Jesteś pewny, że chcesz usunąć ten plik?[br]Uwaga! Nie ma odwrotu od tej operacji.\";\n\t\td.pl[252] = \"Błąd\";\n\t\td.pt[250] = \"Suprimir um ficheiro\";\n\t\td.pt[251] = \"Tem certeza de que quer suprimir este ficheiro?[br]Cuidado, não pode cancelar esta operação.\";\n\t\td.pt[252] = \"Erro\";\n\t\td.pt[253] = \"Não é autorizado(a) para efetuar esta operação, por favor [a §]atualize a página[/a].\";\n\t\td.pt[254] = \"Lamento, o ficheiro já não existe, por favor [a §]atualize a página[/a].\";\n\t\td.pt[255] = \"Modificar uma descrição\";\n\t\td.pt[256] = \"Digite abaixo a nova descrição para este ficheiro. Para suprimir a descrição, deixe o campo vazio.\";\n\t\td.ro[252] = \"Eroare\";\n\t\td.ru[250] = \"Удалить файл\";\n\t\td.ru[251] = \"Вы уверены, что хотите удалить этот файл?[br]Осторожно, вы не сможете отменить эту операцию.\";\n\t\td.ru[252] = \"Ошибка\";\n\t\td.ru[253] = \"Вы не авторизованы для выполнения этой операции, пожалуйста [a §]обновите страницу[/a].\";\n\t\td.ru[254] = \"Извините, но файл не существует, пожалуйста [a §]обновите страницу[/a].\";\n\t\td.ru[255] = \"Редактировать описание\";\n\t\td.ru[256] = \"Ниже введите новое описание файла. Оставьте поле пустым, чтобы удалить описание.\";\n\t\td.sk[252] = \"Chyba\";\n\t\td.tr[252] = \"Hata\";\n\t\td.uk[252] = \"Помилка\";\n\t\td.zh[252] = \"错误信息\";\n\t\t// auto end\n\t};\n\n\tthis.error = function (data) {\n\n\t\tif ((typeof data == 'string') && (data.indexOf('<!DOCTYPE') < 0)) {\n\t\t\tapijs.dialog.dialogInformation(apijs.i18n.translate(252), data, 'error');\n\t\t}\n\t\telse {\n\t\t\tapijs.dialog.remove('lock'); // obligatoire sinon demande de confirmation de quitter la page\n\t\t\tself.location.reload();\n\t\t}\n\t};\n\n\tthis.editAttachment = function (elem, id, action, token) {\n\n\t\tvar desc, text, title = apijs.i18n.translate(255);\n\n\t\tdesc = elem.parentNode.parentNode.querySelector('.description').textContent.trim();\n\t\ttext = '[p][label for=\"apijsinput\"]' + apijs.i18n.translate(256) + '[/label][/p]' +\n\t\t\t\t'[input type=\"text\" name=\"description\" value=\"' + desc + '\" spellcheck=\"true\" id=\"apijsinput\"]';\n\n\t\tapijs.dialog.dialogFormOptions(title, text, action, apijsRedmine.actionEditAttachment, [id, action, token], 'editattach');\n\t\tapijs.dialog.t1.querySelector('input').select();\n\t};\n\n\tthis.actionEditAttachment = function (action, args) {\n\n\t\t// vérification de la nouvelle description\n\t\tif (typeof action == 'boolean') {\n\t\t\treturn true;\n\t\t}\n\t\t// sauvegarde de la nouvelle description\n\t\telse if (typeof action == 'string') {\n\n\t\t\t// args = [id, action, token]\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', args[1] + '?id=' + args[0] + '&isAjax=true', true);\n\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\txhr.setRequestHeader('X-CSRF-Token', args[2]);\n\n\t\t\txhr.onreadystatechange = function () {\n\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\tif ([0, 200].has(xhr.status)) {\n\t\t\t\t\t\tif (xhr.responseText.indexOf('attachmentId') === 0) {\n\n\t\t\t\t\t\t\t// extrait l'id et la description du fichier enregistré\n\t\t\t\t\t\t\tvar elem, id, text;\n\t\t\t\t\t\t\tid = xhr.responseText.slice(0, xhr.responseText.indexOf(':'));\n\t\t\t\t\t\t\ttext = xhr.responseText.slice(xhr.responseText.indexOf(':') + 1);\n\n\t\t\t\t\t\t\t// description\n\t\t\t\t\t\t\telem = document.getElementById(id);\n\t\t\t\t\t\t\telem.querySelector('.description').textContent = text;\n\n\t\t\t\t\t\t\t// input type hidden\n\t\t\t\t\t\t\telem = elem.querySelector('input');\n\t\t\t\t\t\t\tif (elem)\n\t\t\t\t\t\t\t\telem.value = elem.value.slice(0, elem.value.lastIndexOf('|') + 1) + text;\n\n\t\t\t\t\t\t\tapijs.dialog.actionClose();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tapijsRedmine.error(xhr.responseText);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tapijsRedmine.error(xhr.status);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send('desc=' + encodeURIComponent(document.getElementById('apijsinput').value));\n\t\t}\n\t};\n\n\tthis.renameAttachment = function (elem, id, action, token) {\n\n\t\tvar name, text, title = apijs.i18n.translate(257);\n\n\t\tname = elem.parentNode.parentNode.querySelector('.filename').textContent.trim();\n\t\ttext = '[p][label for=\"apijsinput\"]' + apijs.i18n.translate(258) + '[/label][/p]' +\n\t\t\t\t'[input type=\"text\" name=\"name\" value=\"' + name + '\" spellcheck=\"false\" id=\"apijsinput\"]';\n\n\t\tapijs.dialog.dialogFormOptions(title, text, action, apijsRedmine.actionRenameAttachment, [id, action, token], 'editattach');\n\t};\n\n\tthis.actionRenameAttachment = function (action, args) {\n\n\t\t// vérification du nouveau nom\n\t\tif (typeof action == 'boolean') {\n\t\t\treturn true;\n\t\t}\n\t\t// sauvegarde du nouveau nom\n\t\telse if (typeof action == 'string') {\n\n\t\t\t// args = [id, action, token]\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', args[1] + '?id=' + args[0] + '&isAjax=true', true);\n\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\txhr.setRequestHeader('X-CSRF-Token', args[2]);\n\n\t\t\txhr.onreadystatechange = function () {\n\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\tif ([0, 200].has(xhr.status)) {\n\t\t\t\t\t\tif (xhr.responseText.indexOf('attachmentId') === 0) {\n\n\t\t\t\t\t\t\t// extrait l'id et le nom du fichier enregistré\n\t\t\t\t\t\t\tvar elem, id, name, subelem, text;\n\t\t\t\t\t\t\tid = xhr.responseText.slice(0, xhr.responseText.indexOf(':'));\n\t\t\t\t\t\t\tname = xhr.responseText.slice(xhr.responseText.indexOf(':') + 1);\n\n\t\t\t\t\t\t\t// nom\n\t\t\t\t\t\t\telem = document.getElementById(id);\n\t\t\t\t\t\t\telem.querySelector('.filename').textContent = name;\n\n\t\t\t\t\t\t\t// urls sur a/href et input/value et button.download/onclick et button.show/onclick\n\t\t\t\t\t\t\t// pas de maj de src et srcset sur img pour éviter un appel réseau inutile\n\t\t\t\t\t\t\tsubelem = elem.querySelector('input');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('value');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('value', name + text.substr(text.indexOf('|')));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubelem = elem.querySelector('a');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('href');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('href', text.substr(0, text.lastIndexOf('/') + 1) + name);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubelem = elem.querySelector('button.download');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('onclick');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('onclick', text.substr(0, text.lastIndexOf('/') + 1) + name + \"';\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubelem = elem.querySelector('button.show');\n\t\t\t\t\t\t\tif (subelem) {\n\t\t\t\t\t\t\t\ttext = subelem.getAttribute('onclick');\n\t\t\t\t\t\t\t\tsubelem.setAttribute('onclick', text.substr(0, text.lastIndexOf('/') + 1) + name + \"';\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tapijs.dialog.actionClose();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tapijsRedmine.error(xhr.responseText);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tapijsRedmine.error(xhr.status);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send('name=' + encodeURIComponent(document.getElementById('apijsinput').value));\n\t\t}\n\t};\n\n\tthis.removeAttachment = function (elem, id, action, token) {\n\t\tapijs.dialog.dialogConfirmation(apijs.i18n.translate(250), apijs.i18n.translate(251), apijsRedmine.actionRemoveAttachment, [id, action, token]);\n\t};\n\n\tthis.actionRemoveAttachment = function (args) {\n\n\t\t// args = [id, action, token]\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open('POST', args[1] + '?id=' + args[0] + '&isAjax=true', true);\n\t\txhr.setRequestHeader('X-CSRF-Token', args[2]);\n\n\t\txhr.onreadystatechange = function () {\n\n\t\t\tif (xhr.readyState === 4) {\n\t\t\t\tif ([0, 200].has(xhr.status)) {\n\t\t\t\t\tif (xhr.responseText.indexOf('attachmentId') === 0) {\n\n\t\t\t\t\t\t// supprime le fichier de la page grâce à son id\n\t\t\t\t\t\tvar attachment = document.getElementById(xhr.responseText), elems = attachment.parentNode, idx = 0;\n\t\t\t\t\t\tattachment.remove();\n\n\t\t\t\t\t\t// supprime la liste des fichiers\n\t\t\t\t\t\tif (elems.querySelectorAll('dl, li').length < 1) {\n\t\t\t\t\t\t\telems.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// ou réattribue les ids du diaporama (pas de réinitialisation, on remet juste les ids en place)\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\telems.querySelectorAll('a[id][type]').forEach(function (elem) {\n\t\t\t\t\t\t\t\telem.setAttribute('id', elem.getAttribute('id').slice(0, elem.getAttribute('id').lastIndexOf('.') + 1) + idx++);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tapijs.dialog.actionClose();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tapijsRedmine.error(xhr.responseText);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tapijsRedmine.error(xhr.status);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\txhr.send();\n\t};\n\n\tthis.clearCache = function (action) {\n\t\tapijs.dialog.dialogConfirmation(apijs.i18n.translate(259), apijs.i18n.translate(260), apijsRedmine.actionClearCache, action);\n\t};\n\n\tthis.actionClearCache = function (args) {\n\t\tapijs.dialog.remove('waiting', 'lock'); // obligatoire sinon demande de confirmation de quitter la page\n\t\tself.location.href = args;\n\t};\n\n})();\n\nif (typeof self.addEventListener == 'function')\n\tself.addEventListener('apijsload', apijsRedmine.init.bind(apijsRedmine));"],"names":["apijsRedmine","this","init","d","apijs","i18n","data","frca","cs","de","el","en","es","fr","hu","it","ja","nl","pl","pt","ro","ru","sk","tr","uk","zh","error","indexOf","dialog","dialogInformation","translate","remove","self","location","reload","editAttachment","elem","id","action","token","title","desc","parentNode","querySelector","textContent","trim","text","dialogFormOptions","actionEditAttachment","t1","select","args","xhr","XMLHttpRequest","open","setRequestHeader","onreadystatechange","readyState","has","status","responseText","slice","document","getElementById","value","lastIndexOf","actionClose","send","encodeURIComponent","renameAttachment","name","actionRenameAttachment","subelem","getAttribute","setAttribute","substr","removeAttachment","dialogConfirmation","actionRemoveAttachment","attachment","elems","idx","querySelectorAll","length","forEach","clearCache","actionClearCache","href","addEventListener","bind"],"mappings":";;;;;GAkBA;IAAIA,aAAe,IAAI,wBAItBC,KAAKC,KAAO,WAEX,IAAIC,EAAIC,MAAMC,KAAKC,KACdH,EAAEI,OAAMJ,EAAEI,KAAO,IAGtBJ,EAAEK,GAAG,KAAO,gBACZL,EAAEK,GAAG,KAAO,gFACZL,EAAEK,GAAG,KAAO,QACZL,EAAEM,GAAG,KAAO,qBACZN,EAAEM,GAAG,KAAO,oGACZN,EAAEM,GAAG,KAAO,SACZN,EAAEM,GAAG,KAAO,+HACZN,E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