commit 6a28e8b040583dc17cec49977854cce4362d2385
parent c562d145ec5faf096db9a0f2c8c6f9b4aedef935
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 1 Jun 2009 08:23:16 +0000
- Make note font size configurable through preferences
- Make note font configurable through extensions.zotero.note.fontFamily hidden pref (for now)
- Additional CSS rules can be added through extensions.zotero.note.css hidden pref
- Give TinyMCE note body #zotero-tinymce-note id for more specific external customization
- Remove status bar position option from visible preferences...
Diffstat:
7 files changed, 56 insertions(+), 27 deletions(-)
diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml
@@ -294,6 +294,28 @@
self._editor.focus();
self._focus = false;
}
+
+ // Add CSS rules to notes
+ if (self.mode == 'note') {
+ var css = "body#zotero-tinymce.mceContentBody, "
+ + "body#zotero-tinymce-note.mceContentBody p, "
+ + "body#zotero-tinymce-note.mceContentBody pre { "
+ + "font-size: "
+ + Zotero.Prefs.get('note.fontSize') + "px; "
+ + "} "
+ + "body#zotero-tinymce-note.mceContentBody, "
+ + "body#zotero-tinymce-note.mceContentBody p { "
+ + "font-family: "
+ + Zotero.Prefs.get('note.fontFamily') + "; "
+ + "}"
+ + Zotero.Prefs.get('note.css');
+
+ var doc = editor.contentDocument;
+ var head = doc.getElementsByTagName("head")[0];
+ var style = doc.createElement("style");
+ style.innerHTML = css;
+ head.appendChild(style);
+ }
});
if (self._eventHandler) {
diff --git a/chrome/content/zotero/preferences/preferences.xul b/chrome/content/zotero/preferences/preferences.xul
@@ -44,8 +44,8 @@ To add a new preference:
label="&zotero.preferences.prefpane.general;"
image="chrome://zotero/skin/prefs-general.png">
<preferences>
- <preference id="pref-zoteroPaneOnTop" name="extensions.zotero.zoteroPaneOnTop" type="bool"/>
<preference id="pref-fontSize" name="extensions.zotero.fontSize" type="string"/>
+ <preference id="pref-noteFontSize" name="extensions.zotero.note.fontSize" type="string"/>
<preference id="pref-statusBarIcon" name="extensions.zotero.statusBarIcon" type="int"/>
<preference id="pref-automaticScraperUpdates" name="extensions.zotero.automaticScraperUpdates" type="bool"/>
<preference id="pref-reportTranslationFailure" name="extensions.zotero.reportTranslationFailure" type="bool"/>
@@ -68,19 +68,15 @@ To add a new preference:
</columns>
<rows>
- <row align="center">
+ <row>
<hbox align="center">
- <label value="&zotero.preferences.position;" control="positionMenu"/>
- </hbox>
- <hbox id="position-menu-box" align="center">
- <menulist id="positionMenu" preference="pref-zoteroPaneOnTop">
- <menupopup>
- <menuitem label="&zotero.preferences.position.above;" value="true"/>
- <menuitem label="&zotero.preferences.position.below;" value="false"/>
- </menupopup>
- </menulist>
- <label value="&zotero.preferences.position.browser;"/>
+ <label value="&zotero.preferences.statusBarIcon;" control="statusBarIcon"/>
</hbox>
+ <radiogroup id="statusBarIcon" orient="horizontal" preference="pref-statusBarIcon">
+ <radio src="chrome://zotero/skin/zotero_status_bar.png" value="2"/>
+ <radio src="chrome://zotero/skin/zotero_status_bar_compact.png" value="1"/>
+ <radio label="&zotero.preferences.statusBarIcon.none;" value="0"/>
+ </radiogroup>
</row>
<row>
@@ -95,14 +91,27 @@ To add a new preference:
</row>
<row>
+ <!-- TODO: localize -->
<hbox align="center">
- <label value="&zotero.preferences.statusBarIcon;" control="statusBarIcon"/>
+ <label value="Note font size:" control="noteFontSize"/>
+ </hbox>
+ <hbox>
+ <menulist id="noteFontSize" preference="pref-noteFontSize" editable="true">
+ <menupopup>
+ <menuitem label="11"/>
+ <menuitem label="12"/>
+ <menuitem label="13"/>
+ <menuitem label="14"/>
+ <menuitem label="18"/>
+ <menuitem label="24"/>
+ <menuitem label="36"/>
+ <menuitem label="48"/>
+ <menuitem label="64"/>
+ <menuitem label="72"/>
+ <menuitem label="96"/>
+ </menupopup>
+ </menulist>
</hbox>
- <radiogroup id="statusBarIcon" orient="horizontal" preference="pref-statusBarIcon">
- <radio src="chrome://zotero/skin/zotero_status_bar.png" value="2"/>
- <radio src="chrome://zotero/skin/zotero_status_bar_compact.png" value="1"/>
- <radio label="&zotero.preferences.statusBarIcon.none;" value="0"/>
- </radiogroup>
</row>
</rows>
</grid>
diff --git a/chrome/content/zotero/tinymce/note.html b/chrome/content/zotero/tinymce/note.html
@@ -7,6 +7,7 @@
<script type="text/javascript">
tinyMCE.init({
// General options
+ body_id : "zotero-tinymce-note",
mode : "none",
theme : "advanced",
content_css : "chrome://zotero/skin/tinymce/note-content.css",
diff --git a/chrome/content/zotero/tinymce/noteview.html b/chrome/content/zotero/tinymce/noteview.html
@@ -12,6 +12,7 @@ table.mceLayout > tbody > tr.mceLast {
<script type="text/javascript">
tinyMCE.init({
// General options
+ body_id : "zotero-tinymce-note",
mode : "none",
theme : "advanced",
content_css : "chrome://zotero/skin/tinymce/note-content.css",
diff --git a/chrome/locale/en-US/zotero/preferences.dtd b/chrome/locale/en-US/zotero/preferences.dtd
@@ -5,10 +5,6 @@
<!ENTITY zotero.preferences.prefpane.general "General">
<!ENTITY zotero.preferences.userInterface "User Interface">
-<!ENTITY zotero.preferences.position "Display Zotero">
-<!ENTITY zotero.preferences.position.above "above">
-<!ENTITY zotero.preferences.position.below "below">
-<!ENTITY zotero.preferences.position.browser "browser content">
<!ENTITY zotero.preferences.statusBarIcon "Status bar icon:">
<!ENTITY zotero.preferences.statusBarIcon.none "None">
<!ENTITY zotero.preferences.fontSize "Font size:">
diff --git a/chrome/skin/default/zotero/tinymce/note-content.css b/chrome/skin/default/zotero/tinymce/note-content.css
@@ -1,8 +1,3 @@
-body, td, pre {
- font-size: 11px;
- font-family: Lucida Grande, Tahoma, Verdana, Helvetica, sans-serif;
-}
-
pre {
font-family: -moz-fixed;
}
diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js
@@ -67,6 +67,11 @@ pref("extensions.zotero.fulltext.textMaxLength", 500000);
pref("extensions.zotero.fulltext.pdfMaxPages", 100);
pref("extensions.zotero.search.useLeftBound", true);
+// Notes
+pref("extensions.zotero.note.fontFamily", "Lucida Grande, Tahoma, Verdana, Helvetica, sans-serif");
+pref("extensions.zotero.note.fontSize", "11");
+pref("extensions.zotero.note.css", "");
+
// Reports
pref("extensions.zotero.report.includeAllChildItems", true);
pref("extensions.zotero.report.combineChildItems", true);