From 48432d2b09d92d5855bfe9f2b782ed77112313b8 Mon Sep 17 00:00:00 2001
From: mluto
Date: Sun, 27 Jan 2013 20:57:47 +0100
Subject: [PATCH] Made warning bold and gray, sync checkbox-states, fixed
initial checkbox-states, fixed engrish
---
src/locales/en.json | 2 +-
src/static/css/pad.css | 3 ++-
src/static/js/pad.js | 10 ++++++----
src/static/js/pad_editor.js | 12 +++++++++---
src/templates/pad.html | 2 +-
5 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/src/locales/en.json b/src/locales/en.json
index 7f351dd06..8d6f67491 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -33,7 +33,7 @@
"pad.settings.fontType.normal": "Normal",
"pad.settings.fontType.monospaced": "Monospace",
"pad.settings.globalView": "Global View",
- "pad.settings.globalView.warning": "Warning: This will effect everyones view of this pad.",
+ "pad.settings.globalView.warning": "Warning: This will affect everyone's view of this pad.",
"pad.settings.language": "Language:",
"pad.importExport.import_export": "Import/Export",
"pad.importExport.import": "Upload any text file or document",
diff --git a/src/static/css/pad.css b/src/static/css/pad.css
index 4c9e71d80..25afa4310 100644
--- a/src/static/css/pad.css
+++ b/src/static/css/pad.css
@@ -808,7 +808,8 @@ input[type=checkbox] {
z-index: 500;
}
#globalViewWarning {
- color: red;
+ color: gray;
+ font-weight: bold;
font-size: 10px;
}
.stickyChat {
diff --git a/src/static/js/pad.js b/src/static/js/pad.js
index 58b7700e7..51d8ed3f7 100644
--- a/src/static/js/pad.js
+++ b/src/static/js/pad.js
@@ -374,21 +374,23 @@ function handshake()
// via a collabClient-message when they're changed later.
var viewSettings = clientVars.viewSettings;
+ // set the private options here if there is no global setting
+ $("#options-global-colorscheck").prop("checked", $("#options-colorscheck").prop("checked"));
+ $("#options-global-linenoscheck").prop("checked", $("#options-linenoscheck").prop("checked"));
+ $("#global-viewfontmenu").val($("#global-viewfontmenu").val());
+
// check if they are set, if they are overwrite whatever is set by the user
if (typeof(viewSettings.showLineNumbers) != "undefined")
{
pad.changeViewOption('showLineNumbers', viewSettings.showLineNumbers, true);
- $("#options-global-linenoscheck").prop('checked', viewSettings.showLineNumbers);
}
if (typeof(viewSettings.showAuthorColors) != "undefined")
{
pad.changeViewOption('showAuthorColors', viewSettings.showAuthorColors, true);
- $("#options-global-colorscheck").prop('checked', viewSettings.showAuthorColors);
}
if (typeof(viewSettings.useMonospaceFont) != "undefined")
{
- pad.changeViewOption('useMonospaceFont', viewSettings.useMonospaceFont, true);
- $("#global-viewfontmenu").val(viewSettings.useMonospaceFont ? "monospace" : "normal");
+ pad.changeViewOption('useMonospaceFont', viewSettings.useMonospaceFont, true);
}
// if the globalUserName value is set we need to tell the server and the client about the new authorname
diff --git a/src/static/js/pad_editor.js b/src/static/js/pad_editor.js
index bc21535e2..aa152c4b2 100644
--- a/src/static/js/pad_editor.js
+++ b/src/static/js/pad_editor.js
@@ -128,12 +128,16 @@ var padeditor = (function()
v = getOption('showLineNumbers', true);
self.ace.setProperty("showslinenumbers", v);
- if(!global)
+ if(global)
+ padutils.setCheckbox($("#options-global-linenoscheck"), v);
+ else
padutils.setCheckbox($("#options-linenoscheck"), v);
v = getOption('showAuthorColors', true);
self.ace.setProperty("showsauthorcolors", v);
- if(!global)
+ if(global)
+ padutils.setCheckbox($("#options-global-colorscheck"), v);
+ else
padutils.setCheckbox($("#options-colorscheck"), v);
// Override from parameters if true
if (settings.noColors !== false)
@@ -141,7 +145,9 @@ var padeditor = (function()
v = getOption('useMonospaceFont', false);
self.ace.setProperty("textface", (v ? "monospace" : "Arial, sans-serif"));
- if(!global)
+ if(global)
+ $("#global-viewfontmenu").val(v ? "monospace" : "normal");
+ else
$("#viewfontmenu").val(v ? "monospace" : "normal");
},
dispose: function()
diff --git a/src/templates/pad.html b/src/templates/pad.html
index e3933af50..e966ac88d 100644
--- a/src/templates/pad.html
+++ b/src/templates/pad.html
@@ -254,7 +254,7 @@
-
+
<% e.begin_block("globalSettings.dropdowns"); %>