poll: Add show help button

pull/1/head
Pierre Bondoerffer 8 years ago
parent 5d565660a9
commit 685b352db8
No known key found for this signature in database
GPG Key ID: C0C7C0C5063F2236

@ -452,6 +452,9 @@ define(function () {
out.poll_locked = "Cerrado"; out.poll_locked = "Cerrado";
out.poll_unlocked = "Abierto"; out.poll_unlocked = "Abierto";
out.poll_show_help_button = "Mostrar ayuda";
out.poll_hide_help_button = "Esconder ayuda";
// 1.8.0 - Idopogo // 1.8.0 - Idopogo
out.common_connectionLost = "<b>Connexión perdida</b><br>El documento está ahora en modo solo lectura hasta que la conexión vuelva."; out.common_connectionLost = "<b>Connexión perdida</b><br>El documento está ahora en modo solo lectura hasta que la conexión vuelva.";

@ -202,6 +202,9 @@ define(function () {
out.poll_locked = "Verrouillé"; out.poll_locked = "Verrouillé";
out.poll_unlocked = "Déverrouillé"; out.poll_unlocked = "Déverrouillé";
out.poll_show_help_button = "Afficher l'aide";
out.poll_hide_help_button = "Cacher l'aide";
// Canvas // Canvas
out.canvas_clear = "Nettoyer"; out.canvas_clear = "Nettoyer";
out.canvas_delete = "Supprimer la sélection"; out.canvas_delete = "Supprimer la sélection";

@ -204,6 +204,9 @@ define(function () {
out.poll_locked = "Locked"; out.poll_locked = "Locked";
out.poll_unlocked = "Unlocked"; out.poll_unlocked = "Unlocked";
out.poll_show_help_button = "Show help";
out.poll_hide_help_button = "Hide help";
// Canvas // Canvas
out.canvas_clear = "Clear"; out.canvas_clear = "Clear";
out.canvas_delete = "Delete selection"; out.canvas_delete = "Delete selection";

@ -28,7 +28,7 @@
<div class="upper"> <div class="upper">
<button id="publish" data-localization-title="poll_publish_button" data-localization="poll_publish_button" style="display: none;">publish poll</button> <button id="publish" data-localization-title="poll_publish_button" data-localization="poll_publish_button" style="display: none;">publish poll</button>
<button id="admin" data-localization-title="poll_admin_button" data-localization="poll_admin_button" style="display: none;">admin</button> <button id="help" data-localization-title="poll_show_help_button" data-localization="poll_show_help_button">help</button>
</div> </div>
<div class="realtime"> <div class="realtime">

@ -142,12 +142,10 @@ define([
var setTablePublished = function (bool) { var setTablePublished = function (bool) {
if (bool) { if (bool) {
if (APP.$publish) { APP.$publish.hide(); } if (APP.$publish) { APP.$publish.hide(); }
if (APP.$admin) { APP.$admin.show(); }
$('#create-option').hide(); $('#create-option').hide();
$('.remove[data-rt-id^="y"], .edit[data-rt-id^="y"]').hide(); $('.remove[data-rt-id^="y"], .edit[data-rt-id^="y"]').hide();
} else { } else {
if (APP.$publish) { APP.$publish.show(); } if (APP.$publish) { APP.$publish.show(); }
if (APP.$admin) { APP.$admin.hide(); }
$('#create-option').show(); $('#create-option').show();
$('.remove[data-rt-id^="y"], .edit[data-rt-id^="y"]').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 Title;
var UserList; var UserList;
@ -498,9 +505,9 @@ var ready = function (info, userid, readOnly) {
}); });
// #publish button is removed in readonly // #publish button is removed in readonly
APP.$admin = $('#admin') APP.$help = $('#help')
.click(function () { .click(function () {
publish(false); showHelp();
}); });
// Title // Title
@ -702,7 +709,7 @@ var create = function (info) {
}; };
if (readOnly) { if (readOnly) {
$('#commit, #create-user, #create-option, #publish, #admin').remove(); $('#commit, #create-user, #create-option, #publish').remove();
} }
var parsedHash = Cryptpad.parsePadUrl(window.location.href); var parsedHash = Cryptpad.parsePadUrl(window.location.href);
@ -732,7 +739,7 @@ var create = function (info) {
if (e) { console.error(e); } if (e) { console.error(e); }
}); });
} else if (value === "1") { } else if (value === "1") {
$('#howItWorks').hide(); showHelp(false);
} }
}); });

Loading…
Cancel
Save