diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index d2f9bb478..0cff06bee 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -105,6 +105,7 @@ var Zotero_Browser = new function() { Zotero_Browser._scrapePopupShowing = false; Zotero.Ingester.ProxyMonitor.init(); Zotero.Ingester.MIMEHandler.init(); + Zotero.Cite.MIMEHandler.init(); Zotero.Translate.init(); window.addEventListener("load", diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index 54c0a8f93..42a09f8ab 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -146,6 +146,9 @@ function populateQuickCopyList() { function buildQuickCopyFormatDropDown(menulist, currentFormat) { + menulist.selectedItem = null; + menulist.removeAllItems(); + // Prevent Cmd-w from setting "Wikipedia" menulist.onkeydown = function (event) { if ((Zotero.isMac && event.metaKey) || event.ctrlKey) { @@ -769,7 +772,26 @@ function runIntegrityCheck() { } -function rebuildTranslators() { +function updateTranslators() { + Zotero.Schema.updateScrapersRemote(true, function (xmlhttp, updated) { + var button = document.getElementById('updateButton'); + if (button) { + if (updated===-1) { + var label = Zotero.getString('zotero.preferences.update.upToDate'); + } + else if (updated) { + var label = Zotero.getString('zotero.preferences.update.updated'); + } + else { + var label = Zotero.getString('zotero.preferences.update.error'); + } + button.setAttribute('label', label); + } + }); +} + + +function resetTranslatorsAndStyles() { var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); @@ -778,9 +800,31 @@ function rebuildTranslators() { var index = ps.confirmEx(null, Zotero.getString('general.warning'), - Zotero.getString('zotero.preferences.advanced.rebuildTranslators.changesLost'), + Zotero.getString('zotero.preferences.advanced.resetTranslatorsAndStyles.changesLost'), buttonFlags, - Zotero.getString('zotero.preferences.advanced.rebuildTranslators.rebuildTable'), + Zotero.getString('zotero.preferences.advanced.resetTranslatorsAndStyles'), + null, null, null, {}); + + if (index == 0) { + Zotero.Schema.rebuildTranslatorsAndStylesTables(function (xmlhttp, updated) { + populateQuickCopyList(); + }); + } +} + + +function resetTranslators() { + var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Components.interfaces.nsIPromptService); + + var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING) + + (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL); + + var index = ps.confirmEx(null, + Zotero.getString('general.warning'), + Zotero.getString('zotero.preferences.advanced.resetTranslators.changesLost'), + buttonFlags, + Zotero.getString('zotero.preferences.advanced.resetTranslators'), null, null, null, {}); if (index == 0) { @@ -789,6 +833,28 @@ function rebuildTranslators() { } +function resetStyles() { + var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Components.interfaces.nsIPromptService); + + var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING) + + (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL); + + var index = ps.confirmEx(null, + Zotero.getString('general.warning'), + Zotero.getString('zotero.preferences.advanced.resetStyles.changesLost'), + buttonFlags, + Zotero.getString('zotero.preferences.advanced.resetStyles'), + null, null, null, {}); + + if (index == 0) { + Zotero.Schema.rebuildStylesTable(function (xmlhttp, updated) { + populateQuickCopyList(); + }); + } +} + + function onOpenURLSelected() { var openURLMenu = document.getElementById('openURLMenu'); diff --git a/chrome/content/zotero/preferences/preferences.xul b/chrome/content/zotero/preferences/preferences.xul index 6550d5d9b..042b2d109 100644 --- a/chrome/content/zotero/preferences/preferences.xul +++ b/chrome/content/zotero/preferences/preferences.xul @@ -114,7 +114,7 @@ To add a new preference: -