From f749e5272cdd1cf18d1703fc9d88716ce7d17ebd Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 17 Sep 2007 20:33:23 +0000 Subject: [PATCH] Add tooltip ("Save to Zotero") to the scrape icon, with the translator used in parentheses (e.g. "Save to Zotero (Library Catalog (Voyager))" to help with user debugging Also added a few things to help with right-to-left languages: - chromedir attribute on zotero-pane - Zotero.dir property containing 'ltr' or 'rtl' - Zotero.localeJoin(arr, separator=' ') to join an array into a string in the proper locale order --- chrome/content/zotero/browser.js | 14 ++++++++++ chrome/content/zotero/overlay.xul | 11 ++++++-- chrome/content/zotero/xpcom/zotero.js | 29 ++++++++++++++++++++ chrome/locale/en-US/zotero/zotero.properties | 1 + 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 4ddd3f223..bc6ffc18f 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -420,6 +420,7 @@ var Zotero_Browser = new function() { var captureIcon = tab.getCaptureIcon(); if(captureIcon) { Zotero_Browser.statusImage.src = captureIcon; + Zotero_Browser.statusImage.tooltipText = tab.getCaptureTooltip(); Zotero_Browser.statusImage.hidden = false; } else { Zotero_Browser.statusImage.hidden = true; @@ -664,6 +665,19 @@ Zotero_Browser.Tab.prototype.getCaptureIcon = function() { return false; } +Zotero_Browser.Tab.prototype.getCaptureTooltip = function() { + if (this.page.translators && this.page.translators.length) { + var arr = [Zotero.getString('ingester.saveToZotero')]; + if (this.page.translators[0].itemType == 'multiple') { + arr.push('...'); + } + arr.push (' ' , '(' + this.page.translators[0].label + ')'); + return Zotero.localeJoin(arr, ''); + } + return ''; +} + + /**********CALLBACKS**********/ /* diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul index 8b9ae3ec8..134f358b3 100644 --- a/chrome/content/zotero/overlay.xul +++ b/chrome/content/zotero/overlay.xul @@ -21,7 +21,13 @@ ***** END LICENSE BLOCK ***** --> - + + + %globalDTD; + + %zoteroDTD; +]> @@ -73,7 +79,8 @@ onmouseup="ZoteroPane.updateTagSelectorSize()"/>