Added a checkbox to ignore global settings

This commit is contained in:
mluto 2013-01-29 21:45:24 +01:00
parent c7b83928b0
commit 0266ea3066
4 changed files with 11 additions and 1 deletions

View file

@ -35,6 +35,7 @@
"pad.settings.globalView": "Global View",
"pad.settings.globalView.warning": "Warning: This will affect everyone's view of this pad.",
"pad.settings.language": "Language:",
"pad.settings.ignoreglobal": "Ignore global settings",
"pad.importExport.import_export": "Import/Export",
"pad.importExport.import": "Upload any text file or document",
"pad.importExport.importSuccessful": "Successful!",

View file

@ -426,6 +426,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
}
else if (msg.type == "GLOBAL_SETTING_CHANGED")
{
if(!pad.padOptions.ignoreGlobalSettings)
pad.changeViewOption(msg.setting, msg.value, true);
}
else if (msg.type == "SERVER_MESSAGE")

View file

@ -86,6 +86,10 @@ var padeditor = (function()
{
pad.collabClient.changeGlobalSetting("showAuthorColors", $("#options-global-colorscheck").prop('checked'));
});
padutils.bindCheckboxChange($("#options-ignore-global"), function()
{
pad.padOptions.ignoreGlobalSettings = $("#options-ignore-global").prop('checked');
});
$("#global-viewfontmenu").change(function()
{
pad.collabClient.changeGlobalSetting("useMonospaceFont", $("#global-viewfontmenu").val() == 'monospace');

View file

@ -217,6 +217,10 @@
<input type="checkbox" id="options-linenoscheck" checked>
<label for="options-linenoscheck" data-l10n-id="pad.settings.linenocheck"></label>
</p>
<p>
<input type="checkbox" id="options-ignore-global">
<label for="options-ignore-global" data-l10n-id="pad.settings.ignoreglobal"></label>
</p>
<% e.end_block(); %>
<table>
<% e.begin_block("mySettings.dropdowns"); %>