From d018133e9bf691434e061c1f7f5b093cce09be09 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 1 Aug 2022 15:02:42 -0400 Subject: [PATCH] fx-compat: Use html-tooltip everywhere And convert tooltiptext attributes on item box HTML elements to titles. --- chrome/content/zotero/elements/itemBox.js | 10 +++++----- chrome/content/zotero/zoteroPane.xhtml | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/elements/itemBox.js b/chrome/content/zotero/elements/itemBox.js index cb61daa2b8..d1657ac5de 100644 --- a/chrome/content/zotero/elements/itemBox.js +++ b/chrome/content/zotero/elements/itemBox.js @@ -562,7 +562,7 @@ th.classList.add("pointer"); // TODO: make getFieldValue non-private and use below instead th.addEventListener('click', () => Zotero.launchURL(th.nextSibling.firstChild.value || th.nextSibling.firstChild.textContent)); - th.setAttribute("tooltiptext", Zotero.getString('pane.item.viewOnline.tooltip')); + th.setAttribute('title', Zotero.getString('pane.item.viewOnline.tooltip')); } else if (fieldName == 'DOI' && val && typeof val == 'string') { // Pull out DOI, in case there's a prefix @@ -577,7 +577,7 @@ .replace(/"/g, '%22'); th.classList.add("pointer"); th.addEventListener('click', event => ZoteroPane_Local.loadURI(doi, event)); - th.setAttribute("tooltiptext", Zotero.getString('pane.item.viewOnline.tooltip')); + th.setAttribute('title', Zotero.getString('pane.item.viewOnline.tooltip')); valueElement.oncontextmenu = (event) => { this._id('zotero-doi-menu').openPopupAtScreen( event.screenX + 1, @@ -1043,7 +1043,7 @@ // Switch to single-field mode if (fieldMode == 1) { button.style.background = `url("chrome://zotero/skin/textfield-dual${Zotero.hiDPISuffix}.png") center/21px auto no-repeat`; - button.setAttribute('tooltiptext', Zotero.getString('pane.item.switchFieldMode.two')); + button.setAttribute('title', Zotero.getString('pane.item.switchFieldMode.two')); lastName.setAttribute('fieldMode', '1'); button.setAttribute('onclick', "this.getRootNode().host.switchCreatorMode(this.closest('tr'), 0, false, true)"); lastName.setAttribute('flex', '1'); @@ -1083,7 +1083,7 @@ // Switch to two-field mode else { button.style.background = `url("chrome://zotero/skin/textfield-single${Zotero.hiDPISuffix}.png") center/21px auto no-repeat`; - button.setAttribute('tooltiptext', Zotero.getString('pane.item.switchFieldMode.one')); + button.setAttribute('title', Zotero.getString('pane.item.switchFieldMode.one')); lastName.setAttribute('fieldMode', '0'); button.setAttribute('onclick', "this.getRootNode().host.switchCreatorMode(this.closest('tr'), 1, false, true)"); lastName.setAttribute('flex', '0'); @@ -1403,7 +1403,7 @@ // Display the SQL date as a tooltip for date fields // TEMP - filingDate if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date') || fieldName == 'filingDate') { - valueElement.setAttribute('tooltiptext', + valueElement.setAttribute('title', Zotero.Date.multipartToSQL(this.item.getField(fieldName, true))); } diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml index 2500c341bb..40d0fc2137 100644 --- a/chrome/content/zotero/zoteroPane.xhtml +++ b/chrome/content/zotero/zoteroPane.xhtml @@ -52,7 +52,8 @@ width="1000" height="600" persist="screenX screenY width height sizemode" xmlns:html="http://www.w3.org/1999/xhtml" - style="display: flex;"> + style="display: flex;" + tooltip="html-tooltip"> @@ -844,7 +845,7 @@ oncommand="ZoteroPane_Local.search()"/> - +