From f5c988f918b38d2878a5ffaa1f5ef4dc2c5682aa Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 25 Sep 2009 08:30:07 +0000 Subject: [PATCH] - add resizer to integration windows - don't automatically resize integration windows if a button is pressed - move integration js/xul to integration subdirectory --- chrome/content/zotero/bibliography.js | 3 +- .../{ => integration}/addCitationDialog.js | 18 +++---- .../{ => integration}/addCitationDialog.xul | 28 ++++------- .../editBibliographyDialog.js | 0 .../editBibliographyDialog.xul | 10 ++-- .../integration/integrationDocPrefs.xul | 45 +++++++++++++++++ chrome/content/zotero/integrationDocPrefs.xul | 48 ------------------- chrome/content/zotero/xpcom/integration.js | 12 ++--- chrome/skin/default/zotero/zotero.css | 5 ++ 9 files changed, 77 insertions(+), 92 deletions(-) rename chrome/content/zotero/{ => integration}/addCitationDialog.js (94%) rename chrome/content/zotero/{ => integration}/addCitationDialog.xul (92%) rename chrome/content/zotero/{ => integration}/editBibliographyDialog.js (100%) rename chrome/content/zotero/{ => integration}/editBibliographyDialog.xul (95%) create mode 100644 chrome/content/zotero/integration/integrationDocPrefs.xul delete mode 100644 chrome/content/zotero/integrationDocPrefs.xul diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js index 59b40aa0b9..c5f014abd6 100644 --- a/chrome/content/zotero/bibliography.js +++ b/chrome/content/zotero/bibliography.js @@ -42,8 +42,7 @@ var Zotero_File_Interface_Bibliography = new function() { function init() { // Set font size from pref // Affects bibliography.xul and integrationDocPrefs.xul - var sbc = document.getElementById('zotero-bibliography-container'); - if(sbc) Zotero.setFontSize(sbc); + Zotero.setFontSize(document.documentElement); if(window.arguments && window.arguments.length) { _io = window.arguments[0]; diff --git a/chrome/content/zotero/addCitationDialog.js b/chrome/content/zotero/integration/addCitationDialog.js similarity index 94% rename from chrome/content/zotero/addCitationDialog.js rename to chrome/content/zotero/integration/addCitationDialog.js index d50194572c..16de7f0dfc 100644 --- a/chrome/content/zotero/addCitationDialog.js +++ b/chrome/content/zotero/integration/addCitationDialog.js @@ -57,8 +57,8 @@ var Zotero_Citation_Dialog = new function () { * initialize add citation dialog */ function load() { - document.getElementById("multiple-sources-button").label = Zotero.getString("citation.multipleSources"); - document.getElementById("show-editor-button").label = Zotero.getString("citation.showEditor"); + document.documentElement.getButton("extra1").label = Zotero.getString("citation.multipleSources"); + document.documentElement.getButton("extra2").label = Zotero.getString("citation.showEditor"); io = window.arguments[0].wrappedJSObject; @@ -145,7 +145,7 @@ var Zotero_Citation_Dialog = new function () { // var itemDataID = itemID+"::"+0; document.getElementById("multiple-sources").hidden = undefined; document.getElementById("zotero-add-citation-dialog").width = "750"; - document.getElementById("multiple-sources-button").label = Zotero.getString("citation.singleSource"); + document.documentElement.getButton("extra1").label = Zotero.getString("citation.singleSource"); // move user field content to multiple before adding XXXXX if (itemID) { // _itemData[itemDataID] = new Object(); @@ -157,8 +157,6 @@ var Zotero_Citation_Dialog = new function () { _itemData[itemID][box] = element[_preserveData[box]]; } } - window.sizeToContent(); - window.moveTo((window.screenX-75), window.screenY); treeItemSelected(); // disable adding info until citation added _itemSelected(false); @@ -172,9 +170,7 @@ var Zotero_Citation_Dialog = new function () { } else { document.getElementById("multiple-sources").hidden = true; document.getElementById("zotero-add-citation-dialog").width = "600"; - document.getElementById("multiple-sources-button").label = Zotero.getString("citation.multipleSources"); - window.sizeToContent(); - window.moveTo((window.screenX+75), window.screenY); + document.documentElement.getButton("extra1").label = Zotero.getString("citation.multipleSources"); // enable all fields for(var i in _preserveData) { @@ -345,16 +341,14 @@ var Zotero_Citation_Dialog = new function () { _previewShown = !_previewShown; if(_previewShown) { - document.getElementById("show-editor-button").label = Zotero.getString("citation.hideEditor"); - window.sizeToContent(); + document.documentElement.getButton("extra2").label = Zotero.getString("citation.hideEditor"); if(text) { editor.value = text; } else { _updatePreview(); } } else { - document.getElementById("show-editor-button").label = Zotero.getString("citation.showEditor"); - window.sizeToContent(); + document.documentElement.getButton("extra2").label = Zotero.getString("citation.showEditor"); } } diff --git a/chrome/content/zotero/addCitationDialog.xul b/chrome/content/zotero/integration/addCitationDialog.xul similarity index 92% rename from chrome/content/zotero/addCitationDialog.xul rename to chrome/content/zotero/integration/addCitationDialog.xul index f7ec8747e5..30550f0eb7 100644 --- a/chrome/content/zotero/addCitationDialog.xul +++ b/chrome/content/zotero/integration/addCitationDialog.xul @@ -21,6 +21,7 @@ ***** END LICENSE BLOCK ***** --> + @@ -35,16 +36,18 @@ onunload="doUnload();" ondialogaccept="return Zotero_Citation_Dialog.accept();" ondialogcancel="Zotero_Citation_Dialog.cancel();" - xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - style="padding: 0" - persist="screenX screenY width height"> + persist="screenX screenY width height" + resizable="true" + buttons="extra1,extra2,accept,cancel" + ondialogextra2="Zotero_Citation_Dialog.toggleEditor()" + ondialogextra1="Zotero_Citation_Dialog.toggleMultipleSources()"> -