diff --git a/customize.dist/translations/messages.es.js b/customize.dist/translations/messages.es.js index 57eb41f9e..ce4bcb788 100644 --- a/customize.dist/translations/messages.es.js +++ b/customize.dist/translations/messages.es.js @@ -452,6 +452,9 @@ define(function () { out.poll_locked = "Cerrado"; out.poll_unlocked = "Abierto"; + out.poll_show_help_button = "Mostrar ayuda"; + out.poll_hide_help_button = "Esconder ayuda"; + // 1.8.0 - Idopogo out.common_connectionLost = "Connexión perdida
El documento está ahora en modo solo lectura hasta que la conexión vuelva."; diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 70d804652..0372d6081 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -202,6 +202,9 @@ define(function () { out.poll_locked = "Verrouillé"; out.poll_unlocked = "Déverrouillé"; + out.poll_show_help_button = "Afficher l'aide"; + out.poll_hide_help_button = "Cacher l'aide"; + // Canvas out.canvas_clear = "Nettoyer"; out.canvas_delete = "Supprimer la sélection"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 6d4f07c02..dd14ad8da 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -204,6 +204,9 @@ define(function () { out.poll_locked = "Locked"; out.poll_unlocked = "Unlocked"; + out.poll_show_help_button = "Show help"; + out.poll_hide_help_button = "Hide help"; + // Canvas out.canvas_clear = "Clear"; out.canvas_delete = "Delete selection"; diff --git a/www/poll/index.html b/www/poll/index.html index 31226d989..22280e8a9 100644 --- a/www/poll/index.html +++ b/www/poll/index.html @@ -28,7 +28,7 @@
- +
diff --git a/www/poll/main.js b/www/poll/main.js index 0ff5dc0e0..05009b5b1 100644 --- a/www/poll/main.js +++ b/www/poll/main.js @@ -142,12 +142,10 @@ define([ var setTablePublished = function (bool) { if (bool) { if (APP.$publish) { APP.$publish.hide(); } - if (APP.$admin) { APP.$admin.show(); } $('#create-option').hide(); $('.remove[data-rt-id^="y"], .edit[data-rt-id^="y"]').hide(); } else { if (APP.$publish) { APP.$publish.show(); } - if (APP.$admin) { APP.$admin.hide(); } $('#create-option').show(); $('.remove[data-rt-id^="y"], .edit[data-rt-id^="y"]').show(); } @@ -432,6 +430,15 @@ define([ }); }; + var showHelp = function(help) { + if (typeof help === 'undefined') { help = !$('#howItWorks').is(':visible'); } + + var msg = (help ? Messages.poll_hide_help_button : Messages.poll_show_help_button); + + $('#howItWorks').toggle(help); + $('#help').text(msg).attr('title', msg); + }; + var Title; var UserList; @@ -498,9 +505,9 @@ var ready = function (info, userid, readOnly) { }); // #publish button is removed in readonly - APP.$admin = $('#admin') + APP.$help = $('#help') .click(function () { - publish(false); + showHelp(); }); // Title @@ -702,7 +709,7 @@ var create = function (info) { }; if (readOnly) { - $('#commit, #create-user, #create-option, #publish, #admin').remove(); + $('#commit, #create-user, #create-option, #publish').remove(); } var parsedHash = Cryptpad.parsePadUrl(window.location.href); @@ -732,7 +739,7 @@ var create = function (info) { if (e) { console.error(e); } }); } else if (value === "1") { - $('#howItWorks').hide(); + showHelp(false); } });