From e4f19974d316590efbc1814a83d98afffa5be2ce Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 10:23:33 -0400 Subject: [PATCH 001/126] Add jsconfig.json for TSServer completions --- jsconfig.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 jsconfig.json diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..454de63 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "es6" + }, + "exclude": [ + "node_modules" + ] +} From 1a38a6eca99b2a40e40c257d3b3e90a39f67696f Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 10:26:07 -0400 Subject: [PATCH 002/126] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b5bb2..af79162 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ * In version 3.2.0b: + + Update item select link to newer format used by recent version of Zotero + Add functions to copy select links and web links to collections + Add copy/paste item field functions From a0f71185b26a7204366714299fe59bdea30c9e45 Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 10:38:26 -0400 Subject: [PATCH 003/126] Document new collection links commands --- docs/COMMANDS.md | 49 ++++++++++++++++++------------ i18n/de/readme/docs/COMMANDS.md | 49 ++++++++++++++++++------------ i18n/es/readme/docs/COMMANDS.md | 49 ++++++++++++++++++------------ i18n/fr/readme/docs/COMMANDS.md | 49 ++++++++++++++++++------------ i18n/zh-CN/readme/docs/COMMANDS.md | 49 ++++++++++++++++++------------ 5 files changed, 150 insertions(+), 95 deletions(-) diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md index 99296b4..a89adcb 100644 --- a/docs/COMMANDS.md +++ b/docs/COMMANDS.md @@ -42,34 +42,34 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), Set all selected items to be related to each other. * __QuickCopy items:__ - Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. - There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). - These items will copy to the clipboard using alternative export translators. - To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. - Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. + Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. + There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). + These items will copy to the clipboard using alternative export translators. + To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. + Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. + Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. + Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. * __Copy Zotero URIs:__ - Copy (www.zotero.org) links to the clipboard for each selected item. - If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). - If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + Copy (www.zotero.org) links to the clipboard for each selected item. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. * __Create book section:__ - Create a book section item from the currently selected book item. + Create a book section item from the currently selected book item. - The new item is created by duplicating the book item and changing its type to book section. - Author entries for the book item are converted to "book author" entries for the new book section item. - The new book section item is added as a related item to the original book item. - Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. + The new item is created by duplicating the book item and changing its type to book section. + Author entries for the book item are converted to "book author" entries for the new book section item. + The new book section item is added as a related item to the original book item. + Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. - This function only works when a single book item is selected. - Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. - There is no prompt to confirm this loss of fields from the created book section item. + This function only works when a single book item is selected. + Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. + There is no prompt to confirm this loss of fields from the created book section item. * __Create book item:__ Create a book item from teh currently selected book section item. @@ -101,6 +101,17 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), * __Paste all items fields__ (Paste-all): paste all fields from source, even if they are empty. +### Collection menu functions + +* __Copy select collection link:__ + Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. + Following links from other applications can select the collection in the Zotero Standalone client but might require additional set up. + +* __Copy Zotero URI:__ + Copy (www.zotero.org) link to the clipboard for the selected collection. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + ### Navigating the UI and editing items via keyboard shortcuts Zutilo currently implements several keyboard shortcuts that are useful for editing Zotero items. diff --git a/i18n/de/readme/docs/COMMANDS.md b/i18n/de/readme/docs/COMMANDS.md index 99296b4..a89adcb 100644 --- a/i18n/de/readme/docs/COMMANDS.md +++ b/i18n/de/readme/docs/COMMANDS.md @@ -42,34 +42,34 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), Set all selected items to be related to each other. * __QuickCopy items:__ - Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. - There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). - These items will copy to the clipboard using alternative export translators. - To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. - Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. + Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. + There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). + These items will copy to the clipboard using alternative export translators. + To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. + Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. + Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. + Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. * __Copy Zotero URIs:__ - Copy (www.zotero.org) links to the clipboard for each selected item. - If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). - If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + Copy (www.zotero.org) links to the clipboard for each selected item. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. * __Create book section:__ - Create a book section item from the currently selected book item. + Create a book section item from the currently selected book item. - The new item is created by duplicating the book item and changing its type to book section. - Author entries for the book item are converted to "book author" entries for the new book section item. - The new book section item is added as a related item to the original book item. - Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. + The new item is created by duplicating the book item and changing its type to book section. + Author entries for the book item are converted to "book author" entries for the new book section item. + The new book section item is added as a related item to the original book item. + Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. - This function only works when a single book item is selected. - Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. - There is no prompt to confirm this loss of fields from the created book section item. + This function only works when a single book item is selected. + Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. + There is no prompt to confirm this loss of fields from the created book section item. * __Create book item:__ Create a book item from teh currently selected book section item. @@ -101,6 +101,17 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), * __Paste all items fields__ (Paste-all): paste all fields from source, even if they are empty. +### Collection menu functions + +* __Copy select collection link:__ + Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. + Following links from other applications can select the collection in the Zotero Standalone client but might require additional set up. + +* __Copy Zotero URI:__ + Copy (www.zotero.org) link to the clipboard for the selected collection. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + ### Navigating the UI and editing items via keyboard shortcuts Zutilo currently implements several keyboard shortcuts that are useful for editing Zotero items. diff --git a/i18n/es/readme/docs/COMMANDS.md b/i18n/es/readme/docs/COMMANDS.md index 99296b4..a89adcb 100644 --- a/i18n/es/readme/docs/COMMANDS.md +++ b/i18n/es/readme/docs/COMMANDS.md @@ -42,34 +42,34 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), Set all selected items to be related to each other. * __QuickCopy items:__ - Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. - There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). - These items will copy to the clipboard using alternative export translators. - To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. - Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. + Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. + There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). + These items will copy to the clipboard using alternative export translators. + To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. + Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. + Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. + Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. * __Copy Zotero URIs:__ - Copy (www.zotero.org) links to the clipboard for each selected item. - If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). - If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + Copy (www.zotero.org) links to the clipboard for each selected item. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. * __Create book section:__ - Create a book section item from the currently selected book item. + Create a book section item from the currently selected book item. - The new item is created by duplicating the book item and changing its type to book section. - Author entries for the book item are converted to "book author" entries for the new book section item. - The new book section item is added as a related item to the original book item. - Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. + The new item is created by duplicating the book item and changing its type to book section. + Author entries for the book item are converted to "book author" entries for the new book section item. + The new book section item is added as a related item to the original book item. + Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. - This function only works when a single book item is selected. - Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. - There is no prompt to confirm this loss of fields from the created book section item. + This function only works when a single book item is selected. + Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. + There is no prompt to confirm this loss of fields from the created book section item. * __Create book item:__ Create a book item from teh currently selected book section item. @@ -101,6 +101,17 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), * __Paste all items fields__ (Paste-all): paste all fields from source, even if they are empty. +### Collection menu functions + +* __Copy select collection link:__ + Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. + Following links from other applications can select the collection in the Zotero Standalone client but might require additional set up. + +* __Copy Zotero URI:__ + Copy (www.zotero.org) link to the clipboard for the selected collection. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + ### Navigating the UI and editing items via keyboard shortcuts Zutilo currently implements several keyboard shortcuts that are useful for editing Zotero items. diff --git a/i18n/fr/readme/docs/COMMANDS.md b/i18n/fr/readme/docs/COMMANDS.md index 99296b4..a89adcb 100644 --- a/i18n/fr/readme/docs/COMMANDS.md +++ b/i18n/fr/readme/docs/COMMANDS.md @@ -42,34 +42,34 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), Set all selected items to be related to each other. * __QuickCopy items:__ - Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. - There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). - These items will copy to the clipboard using alternative export translators. - To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. - Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. + Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. + There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). + These items will copy to the clipboard using alternative export translators. + To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. + Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. + Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. + Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. * __Copy Zotero URIs:__ - Copy (www.zotero.org) links to the clipboard for each selected item. - If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). - If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + Copy (www.zotero.org) links to the clipboard for each selected item. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. * __Create book section:__ - Create a book section item from the currently selected book item. + Create a book section item from the currently selected book item. - The new item is created by duplicating the book item and changing its type to book section. - Author entries for the book item are converted to "book author" entries for the new book section item. - The new book section item is added as a related item to the original book item. - Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. + The new item is created by duplicating the book item and changing its type to book section. + Author entries for the book item are converted to "book author" entries for the new book section item. + The new book section item is added as a related item to the original book item. + Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. - This function only works when a single book item is selected. - Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. - There is no prompt to confirm this loss of fields from the created book section item. + This function only works when a single book item is selected. + Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. + There is no prompt to confirm this loss of fields from the created book section item. * __Create book item:__ Create a book item from teh currently selected book section item. @@ -101,6 +101,17 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), * __Paste all items fields__ (Paste-all): paste all fields from source, even if they are empty. +### Collection menu functions + +* __Copy select collection link:__ + Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. + Following links from other applications can select the collection in the Zotero Standalone client but might require additional set up. + +* __Copy Zotero URI:__ + Copy (www.zotero.org) link to the clipboard for the selected collection. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + ### Navigating the UI and editing items via keyboard shortcuts Zutilo currently implements several keyboard shortcuts that are useful for editing Zotero items. diff --git a/i18n/zh-CN/readme/docs/COMMANDS.md b/i18n/zh-CN/readme/docs/COMMANDS.md index 99296b4..a89adcb 100644 --- a/i18n/zh-CN/readme/docs/COMMANDS.md +++ b/i18n/zh-CN/readme/docs/COMMANDS.md @@ -42,34 +42,34 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), Set all selected items to be related to each other. * __QuickCopy items:__ - Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. - There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). - These items will copy to the clipboard using alternative export translators. - To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. - Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. + Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. + There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). + These items will copy to the clipboard using alternative export translators. + To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. + Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. + Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. + Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. * __Copy Zotero URIs:__ - Copy (www.zotero.org) links to the clipboard for each selected item. - If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). - If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + Copy (www.zotero.org) links to the clipboard for each selected item. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. * __Create book section:__ - Create a book section item from the currently selected book item. + Create a book section item from the currently selected book item. - The new item is created by duplicating the book item and changing its type to book section. - Author entries for the book item are converted to "book author" entries for the new book section item. - The new book section item is added as a related item to the original book item. - Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. + The new item is created by duplicating the book item and changing its type to book section. + Author entries for the book item are converted to "book author" entries for the new book section item. + The new book section item is added as a related item to the original book item. + Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. - This function only works when a single book item is selected. - Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. - There is no prompt to confirm this loss of fields from the created book section item. + This function only works when a single book item is selected. + Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. + There is no prompt to confirm this loss of fields from the created book section item. * __Create book item:__ Create a book item from teh currently selected book section item. @@ -101,6 +101,17 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), * __Paste all items fields__ (Paste-all): paste all fields from source, even if they are empty. +### Collection menu functions + +* __Copy select collection link:__ + Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. + Following links from other applications can select the collection in the Zotero Standalone client but might require additional set up. + +* __Copy Zotero URI:__ + Copy (www.zotero.org) link to the clipboard for the selected collection. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + ### Navigating the UI and editing items via keyboard shortcuts Zutilo currently implements several keyboard shortcuts that are useful for editing Zotero items. From b3d409c9934ed67128c36d8f745bee2592fbbd9d Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 10:40:49 -0400 Subject: [PATCH 004/126] Remove documentation related to Zotero Firefox addon --- docs/COMMANDS.md | 69 ++---------------------------- i18n/de/readme/docs/COMMANDS.md | 69 ++---------------------------- i18n/es/readme/docs/COMMANDS.md | 69 ++---------------------------- i18n/fr/readme/docs/COMMANDS.md | 69 ++---------------------------- i18n/zh-CN/readme/docs/COMMANDS.md | 69 ++---------------------------- 5 files changed, 15 insertions(+), 330 deletions(-) diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md index a89adcb..650c2dd 100644 --- a/docs/COMMANDS.md +++ b/docs/COMMANDS.md @@ -47,12 +47,11 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), These items will copy to the clipboard using alternative export translators. To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. - The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). + The config editor can be opened from the Advanced pane of Zotero's preferences window. * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item. + Following links from other applications can select items in the Zotero Standalone client but might require additional set up. * __Copy Zotero URIs:__ Copy (www.zotero.org) links to the clipboard for each selected item. @@ -222,68 +221,6 @@ However, when the pane is shown, the thicker vertical divider ("splitter", "grip * __Open style editor:__ Open the style editor window (normally accessible from the advanced section of Zotero's preferences). -### Firefox browser shortcut functions - -The following shortcut functions are only available in the Zotero Firefox addon. - -* __Focus Zotero:__ - Make Zotero visible if it is not. - Focus Zotero so that, e.g., `Tab` and the arrow keys work on the Zotero UI rather than the previously focused element of Firefox's UI. - -* __Hide Zotero:__ - Hide Zotero if it was visible. - -* __Toggle Zotero:__ - Show Zotero if it was not visible. - Otherwise hide Zotero. - -* __Save webpage as a Zotero item:__ - Save the current page as a webpage item in Zotero. - -* __Save item:__ - Add an item to the Zotero library based on the reference content of the current webpage (equivalent to clicking on the little page/book icon in the Firefox address bar). - In Zotero, the function that creates the item from the web page content is referred to as a `translator`. - -* __Save item without attachments:__ - Create an item in a similar manner to "Save item" but __do not__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item with attachments:__ - Create an item in a similar manner to "Save item" but __do__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item (reverse attachment pref):__ - Create an item in a similar manner to "Save item" but only save attachments if Zotero is set not to save attachments in its preferences. - -* __Attach current page:__ - Attach the current browser page to the selected Zotero item. - This function works best when the current web page is a PDF opened with Firefox's internal PDF viewer. - -### Firefox browser menu functions - -These functions add items to the Zotero "Save item" button's menu and to the Firefox right-click menu. -Any of the menu items can be set to hidden in Zutilo's preferences. - -* __Attaching webpages and links to Zotero items:__ - Zutilo adds context menu items to Firefox for attaching the current page or the current link target (if a link is selected in the current web page) to the item currently selected in Zotero. - Attaching the current web page is also available as a keyboard shortcut. - - How the attachment is processed depends on the attachment method set in Zutilo's preferences. - If the method is 'Import', an imported attachment is created from the page/link. - If the method is 'Prompt for linked file', a file prompt appears to allow the user to specify a new file. - The page/link is saved to this file and then a linked file attachment (linked to the downloaded file) is created. - If the method is 'Prompt after first', an imported attachment is created if the selected item has no previous attachments (not counting webpage snapshot attachments). - Otherwise, the file prompt for creating a linked file attachment is shown. - If the shift key is pressed when the attachment function is activated, a prompt for a linked file is shown regardless of Zutilo's preference setting. - If the control key is pressed, the attachment is imported regardless of Zutilo's preference setting. - -* __Save item from a current webpage with or without attachments:__ - Zutilo adds extra menu items to the context menu of Zotero's "Save item" button that save an item for the current page with or without extracting the page's associated PDF's and other files. - That is, if the "Automatically attach PDFs and other files" preference is selected in Zotero, Zutilo adds menu items for saving the item without attachments. - One menu item is created for each "Save to Zotero" method that applies to the current page. - If the preference is not selected, Zutilo adds menu items for saving an item with the attachments. - - This function works by toggling the associated files preference in Zotero, creating the item, and then toggling the preference back to its original state. - Because Zotero translates pages asynchronously (and thus simultaneously), translations made with this function should be allowed to finish before starting normal page translations with Zotero (since otherwise the state of the "Associated files" preference will depend on the timing of the simultaneous translations). - ### Better BibTeX functions The following functions are only available when [Better BibTeX](https://github.com/retorquere/zotero-better-bibtex) is installed (and only for Zotero version 5.0 or higher). diff --git a/i18n/de/readme/docs/COMMANDS.md b/i18n/de/readme/docs/COMMANDS.md index a89adcb..650c2dd 100644 --- a/i18n/de/readme/docs/COMMANDS.md +++ b/i18n/de/readme/docs/COMMANDS.md @@ -47,12 +47,11 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), These items will copy to the clipboard using alternative export translators. To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. - The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). + The config editor can be opened from the Advanced pane of Zotero's preferences window. * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item. + Following links from other applications can select items in the Zotero Standalone client but might require additional set up. * __Copy Zotero URIs:__ Copy (www.zotero.org) links to the clipboard for each selected item. @@ -222,68 +221,6 @@ However, when the pane is shown, the thicker vertical divider ("splitter", "grip * __Open style editor:__ Open the style editor window (normally accessible from the advanced section of Zotero's preferences). -### Firefox browser shortcut functions - -The following shortcut functions are only available in the Zotero Firefox addon. - -* __Focus Zotero:__ - Make Zotero visible if it is not. - Focus Zotero so that, e.g., `Tab` and the arrow keys work on the Zotero UI rather than the previously focused element of Firefox's UI. - -* __Hide Zotero:__ - Hide Zotero if it was visible. - -* __Toggle Zotero:__ - Show Zotero if it was not visible. - Otherwise hide Zotero. - -* __Save webpage as a Zotero item:__ - Save the current page as a webpage item in Zotero. - -* __Save item:__ - Add an item to the Zotero library based on the reference content of the current webpage (equivalent to clicking on the little page/book icon in the Firefox address bar). - In Zotero, the function that creates the item from the web page content is referred to as a `translator`. - -* __Save item without attachments:__ - Create an item in a similar manner to "Save item" but __do not__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item with attachments:__ - Create an item in a similar manner to "Save item" but __do__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item (reverse attachment pref):__ - Create an item in a similar manner to "Save item" but only save attachments if Zotero is set not to save attachments in its preferences. - -* __Attach current page:__ - Attach the current browser page to the selected Zotero item. - This function works best when the current web page is a PDF opened with Firefox's internal PDF viewer. - -### Firefox browser menu functions - -These functions add items to the Zotero "Save item" button's menu and to the Firefox right-click menu. -Any of the menu items can be set to hidden in Zutilo's preferences. - -* __Attaching webpages and links to Zotero items:__ - Zutilo adds context menu items to Firefox for attaching the current page or the current link target (if a link is selected in the current web page) to the item currently selected in Zotero. - Attaching the current web page is also available as a keyboard shortcut. - - How the attachment is processed depends on the attachment method set in Zutilo's preferences. - If the method is 'Import', an imported attachment is created from the page/link. - If the method is 'Prompt for linked file', a file prompt appears to allow the user to specify a new file. - The page/link is saved to this file and then a linked file attachment (linked to the downloaded file) is created. - If the method is 'Prompt after first', an imported attachment is created if the selected item has no previous attachments (not counting webpage snapshot attachments). - Otherwise, the file prompt for creating a linked file attachment is shown. - If the shift key is pressed when the attachment function is activated, a prompt for a linked file is shown regardless of Zutilo's preference setting. - If the control key is pressed, the attachment is imported regardless of Zutilo's preference setting. - -* __Save item from a current webpage with or without attachments:__ - Zutilo adds extra menu items to the context menu of Zotero's "Save item" button that save an item for the current page with or without extracting the page's associated PDF's and other files. - That is, if the "Automatically attach PDFs and other files" preference is selected in Zotero, Zutilo adds menu items for saving the item without attachments. - One menu item is created for each "Save to Zotero" method that applies to the current page. - If the preference is not selected, Zutilo adds menu items for saving an item with the attachments. - - This function works by toggling the associated files preference in Zotero, creating the item, and then toggling the preference back to its original state. - Because Zotero translates pages asynchronously (and thus simultaneously), translations made with this function should be allowed to finish before starting normal page translations with Zotero (since otherwise the state of the "Associated files" preference will depend on the timing of the simultaneous translations). - ### Better BibTeX functions The following functions are only available when [Better BibTeX](https://github.com/retorquere/zotero-better-bibtex) is installed (and only for Zotero version 5.0 or higher). diff --git a/i18n/es/readme/docs/COMMANDS.md b/i18n/es/readme/docs/COMMANDS.md index a89adcb..650c2dd 100644 --- a/i18n/es/readme/docs/COMMANDS.md +++ b/i18n/es/readme/docs/COMMANDS.md @@ -47,12 +47,11 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), These items will copy to the clipboard using alternative export translators. To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. - The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). + The config editor can be opened from the Advanced pane of Zotero's preferences window. * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item. + Following links from other applications can select items in the Zotero Standalone client but might require additional set up. * __Copy Zotero URIs:__ Copy (www.zotero.org) links to the clipboard for each selected item. @@ -222,68 +221,6 @@ However, when the pane is shown, the thicker vertical divider ("splitter", "grip * __Open style editor:__ Open the style editor window (normally accessible from the advanced section of Zotero's preferences). -### Firefox browser shortcut functions - -The following shortcut functions are only available in the Zotero Firefox addon. - -* __Focus Zotero:__ - Make Zotero visible if it is not. - Focus Zotero so that, e.g., `Tab` and the arrow keys work on the Zotero UI rather than the previously focused element of Firefox's UI. - -* __Hide Zotero:__ - Hide Zotero if it was visible. - -* __Toggle Zotero:__ - Show Zotero if it was not visible. - Otherwise hide Zotero. - -* __Save webpage as a Zotero item:__ - Save the current page as a webpage item in Zotero. - -* __Save item:__ - Add an item to the Zotero library based on the reference content of the current webpage (equivalent to clicking on the little page/book icon in the Firefox address bar). - In Zotero, the function that creates the item from the web page content is referred to as a `translator`. - -* __Save item without attachments:__ - Create an item in a similar manner to "Save item" but __do not__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item with attachments:__ - Create an item in a similar manner to "Save item" but __do__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item (reverse attachment pref):__ - Create an item in a similar manner to "Save item" but only save attachments if Zotero is set not to save attachments in its preferences. - -* __Attach current page:__ - Attach the current browser page to the selected Zotero item. - This function works best when the current web page is a PDF opened with Firefox's internal PDF viewer. - -### Firefox browser menu functions - -These functions add items to the Zotero "Save item" button's menu and to the Firefox right-click menu. -Any of the menu items can be set to hidden in Zutilo's preferences. - -* __Attaching webpages and links to Zotero items:__ - Zutilo adds context menu items to Firefox for attaching the current page or the current link target (if a link is selected in the current web page) to the item currently selected in Zotero. - Attaching the current web page is also available as a keyboard shortcut. - - How the attachment is processed depends on the attachment method set in Zutilo's preferences. - If the method is 'Import', an imported attachment is created from the page/link. - If the method is 'Prompt for linked file', a file prompt appears to allow the user to specify a new file. - The page/link is saved to this file and then a linked file attachment (linked to the downloaded file) is created. - If the method is 'Prompt after first', an imported attachment is created if the selected item has no previous attachments (not counting webpage snapshot attachments). - Otherwise, the file prompt for creating a linked file attachment is shown. - If the shift key is pressed when the attachment function is activated, a prompt for a linked file is shown regardless of Zutilo's preference setting. - If the control key is pressed, the attachment is imported regardless of Zutilo's preference setting. - -* __Save item from a current webpage with or without attachments:__ - Zutilo adds extra menu items to the context menu of Zotero's "Save item" button that save an item for the current page with or without extracting the page's associated PDF's and other files. - That is, if the "Automatically attach PDFs and other files" preference is selected in Zotero, Zutilo adds menu items for saving the item without attachments. - One menu item is created for each "Save to Zotero" method that applies to the current page. - If the preference is not selected, Zutilo adds menu items for saving an item with the attachments. - - This function works by toggling the associated files preference in Zotero, creating the item, and then toggling the preference back to its original state. - Because Zotero translates pages asynchronously (and thus simultaneously), translations made with this function should be allowed to finish before starting normal page translations with Zotero (since otherwise the state of the "Associated files" preference will depend on the timing of the simultaneous translations). - ### Better BibTeX functions The following functions are only available when [Better BibTeX](https://github.com/retorquere/zotero-better-bibtex) is installed (and only for Zotero version 5.0 or higher). diff --git a/i18n/fr/readme/docs/COMMANDS.md b/i18n/fr/readme/docs/COMMANDS.md index a89adcb..650c2dd 100644 --- a/i18n/fr/readme/docs/COMMANDS.md +++ b/i18n/fr/readme/docs/COMMANDS.md @@ -47,12 +47,11 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), These items will copy to the clipboard using alternative export translators. To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. - The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). + The config editor can be opened from the Advanced pane of Zotero's preferences window. * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item. + Following links from other applications can select items in the Zotero Standalone client but might require additional set up. * __Copy Zotero URIs:__ Copy (www.zotero.org) links to the clipboard for each selected item. @@ -222,68 +221,6 @@ However, when the pane is shown, the thicker vertical divider ("splitter", "grip * __Open style editor:__ Open the style editor window (normally accessible from the advanced section of Zotero's preferences). -### Firefox browser shortcut functions - -The following shortcut functions are only available in the Zotero Firefox addon. - -* __Focus Zotero:__ - Make Zotero visible if it is not. - Focus Zotero so that, e.g., `Tab` and the arrow keys work on the Zotero UI rather than the previously focused element of Firefox's UI. - -* __Hide Zotero:__ - Hide Zotero if it was visible. - -* __Toggle Zotero:__ - Show Zotero if it was not visible. - Otherwise hide Zotero. - -* __Save webpage as a Zotero item:__ - Save the current page as a webpage item in Zotero. - -* __Save item:__ - Add an item to the Zotero library based on the reference content of the current webpage (equivalent to clicking on the little page/book icon in the Firefox address bar). - In Zotero, the function that creates the item from the web page content is referred to as a `translator`. - -* __Save item without attachments:__ - Create an item in a similar manner to "Save item" but __do not__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item with attachments:__ - Create an item in a similar manner to "Save item" but __do__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item (reverse attachment pref):__ - Create an item in a similar manner to "Save item" but only save attachments if Zotero is set not to save attachments in its preferences. - -* __Attach current page:__ - Attach the current browser page to the selected Zotero item. - This function works best when the current web page is a PDF opened with Firefox's internal PDF viewer. - -### Firefox browser menu functions - -These functions add items to the Zotero "Save item" button's menu and to the Firefox right-click menu. -Any of the menu items can be set to hidden in Zutilo's preferences. - -* __Attaching webpages and links to Zotero items:__ - Zutilo adds context menu items to Firefox for attaching the current page or the current link target (if a link is selected in the current web page) to the item currently selected in Zotero. - Attaching the current web page is also available as a keyboard shortcut. - - How the attachment is processed depends on the attachment method set in Zutilo's preferences. - If the method is 'Import', an imported attachment is created from the page/link. - If the method is 'Prompt for linked file', a file prompt appears to allow the user to specify a new file. - The page/link is saved to this file and then a linked file attachment (linked to the downloaded file) is created. - If the method is 'Prompt after first', an imported attachment is created if the selected item has no previous attachments (not counting webpage snapshot attachments). - Otherwise, the file prompt for creating a linked file attachment is shown. - If the shift key is pressed when the attachment function is activated, a prompt for a linked file is shown regardless of Zutilo's preference setting. - If the control key is pressed, the attachment is imported regardless of Zutilo's preference setting. - -* __Save item from a current webpage with or without attachments:__ - Zutilo adds extra menu items to the context menu of Zotero's "Save item" button that save an item for the current page with or without extracting the page's associated PDF's and other files. - That is, if the "Automatically attach PDFs and other files" preference is selected in Zotero, Zutilo adds menu items for saving the item without attachments. - One menu item is created for each "Save to Zotero" method that applies to the current page. - If the preference is not selected, Zutilo adds menu items for saving an item with the attachments. - - This function works by toggling the associated files preference in Zotero, creating the item, and then toggling the preference back to its original state. - Because Zotero translates pages asynchronously (and thus simultaneously), translations made with this function should be allowed to finish before starting normal page translations with Zotero (since otherwise the state of the "Associated files" preference will depend on the timing of the simultaneous translations). - ### Better BibTeX functions The following functions are only available when [Better BibTeX](https://github.com/retorquere/zotero-better-bibtex) is installed (and only for Zotero version 5.0 or higher). diff --git a/i18n/zh-CN/readme/docs/COMMANDS.md b/i18n/zh-CN/readme/docs/COMMANDS.md index a89adcb..650c2dd 100644 --- a/i18n/zh-CN/readme/docs/COMMANDS.md +++ b/i18n/zh-CN/readme/docs/COMMANDS.md @@ -47,12 +47,11 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), These items will copy to the clipboard using alternative export translators. To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. - The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). + The config editor can be opened from the Advanced pane of Zotero's preferences window. * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item. + Following links from other applications can select items in the Zotero Standalone client but might require additional set up. * __Copy Zotero URIs:__ Copy (www.zotero.org) links to the clipboard for each selected item. @@ -222,68 +221,6 @@ However, when the pane is shown, the thicker vertical divider ("splitter", "grip * __Open style editor:__ Open the style editor window (normally accessible from the advanced section of Zotero's preferences). -### Firefox browser shortcut functions - -The following shortcut functions are only available in the Zotero Firefox addon. - -* __Focus Zotero:__ - Make Zotero visible if it is not. - Focus Zotero so that, e.g., `Tab` and the arrow keys work on the Zotero UI rather than the previously focused element of Firefox's UI. - -* __Hide Zotero:__ - Hide Zotero if it was visible. - -* __Toggle Zotero:__ - Show Zotero if it was not visible. - Otherwise hide Zotero. - -* __Save webpage as a Zotero item:__ - Save the current page as a webpage item in Zotero. - -* __Save item:__ - Add an item to the Zotero library based on the reference content of the current webpage (equivalent to clicking on the little page/book icon in the Firefox address bar). - In Zotero, the function that creates the item from the web page content is referred to as a `translator`. - -* __Save item without attachments:__ - Create an item in a similar manner to "Save item" but __do not__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item with attachments:__ - Create an item in a similar manner to "Save item" but __do__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item (reverse attachment pref):__ - Create an item in a similar manner to "Save item" but only save attachments if Zotero is set not to save attachments in its preferences. - -* __Attach current page:__ - Attach the current browser page to the selected Zotero item. - This function works best when the current web page is a PDF opened with Firefox's internal PDF viewer. - -### Firefox browser menu functions - -These functions add items to the Zotero "Save item" button's menu and to the Firefox right-click menu. -Any of the menu items can be set to hidden in Zutilo's preferences. - -* __Attaching webpages and links to Zotero items:__ - Zutilo adds context menu items to Firefox for attaching the current page or the current link target (if a link is selected in the current web page) to the item currently selected in Zotero. - Attaching the current web page is also available as a keyboard shortcut. - - How the attachment is processed depends on the attachment method set in Zutilo's preferences. - If the method is 'Import', an imported attachment is created from the page/link. - If the method is 'Prompt for linked file', a file prompt appears to allow the user to specify a new file. - The page/link is saved to this file and then a linked file attachment (linked to the downloaded file) is created. - If the method is 'Prompt after first', an imported attachment is created if the selected item has no previous attachments (not counting webpage snapshot attachments). - Otherwise, the file prompt for creating a linked file attachment is shown. - If the shift key is pressed when the attachment function is activated, a prompt for a linked file is shown regardless of Zutilo's preference setting. - If the control key is pressed, the attachment is imported regardless of Zutilo's preference setting. - -* __Save item from a current webpage with or without attachments:__ - Zutilo adds extra menu items to the context menu of Zotero's "Save item" button that save an item for the current page with or without extracting the page's associated PDF's and other files. - That is, if the "Automatically attach PDFs and other files" preference is selected in Zotero, Zutilo adds menu items for saving the item without attachments. - One menu item is created for each "Save to Zotero" method that applies to the current page. - If the preference is not selected, Zutilo adds menu items for saving an item with the attachments. - - This function works by toggling the associated files preference in Zotero, creating the item, and then toggling the preference back to its original state. - Because Zotero translates pages asynchronously (and thus simultaneously), translations made with this function should be allowed to finish before starting normal page translations with Zotero (since otherwise the state of the "Associated files" preference will depend on the timing of the simultaneous translations). - ### Better BibTeX functions The following functions are only available when [Better BibTeX](https://github.com/retorquere/zotero-better-bibtex) is installed (and only for Zotero version 5.0 or higher). From 4d0e39715a59180164da088f6214e2994de7c3af Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 10:52:01 -0400 Subject: [PATCH 005/126] Remove content related to addons.mozilla.org --- Makefile | 20 ++------------ .../babelzilla/Add_external_locale_files.py | 27 ------------------- scripts/babelzilla/README.md | 6 ----- .../Remove_external_locale_files.py | 24 ----------------- 4 files changed, 2 insertions(+), 75 deletions(-) delete mode 100755 scripts/babelzilla/Add_external_locale_files.py delete mode 100644 scripts/babelzilla/README.md delete mode 100755 scripts/babelzilla/Remove_external_locale_files.py diff --git a/Makefile b/Makefile index 4968c3c..0d203fe 100644 --- a/Makefile +++ b/Makefile @@ -3,12 +3,11 @@ BLDDIR = build LOCALES := $(shell ls i18n) INTERNAL_READMES := $(patsubst %, addon/chrome/locale/%/zutilo/README.html, $(LOCALES)) -AMO_READMES := $(patsubst %, $(BLDDIR)/amo_readme/%/README.html, $(LOCALES)) # Necessary because zip copies leading directories if run from above targets ABS_BLDDIR := $(shell realpath $(BLDDIR)) -all: xpi amo_readme +all: xpi 0x0: $(BLDDIR)/zutilo.xpi curl -F'file=@$(BLDDIR)/zutilo.xpi' https://0x0.st @@ -26,25 +25,10 @@ addon/chrome/locale/%/zutilo/README.html: $(BLDDIR)/internal_readme/$*/README.md > \ addon/chrome/locale/$*/zutilo/README.html -amo_readme: $(AMO_READMES) - -$(BLDDIR)/amo_readme/%/README.html: - @mkdir -p $(dir $@) - scripts/substitute_relative_links \ - --link-root https://www.github.com/willsALMANJ/Zutilo/blob/master/i18n/$*/readme \ - i18n/$*/readme/README.md \ - $(BLDDIR)/amo_readme/$*/README.md - pandoc -f markdown_strict -t html \ - $(BLDDIR)/amo_readme/$*/README.md > \ - $(BLDDIR)/amo_readme/$*/README.html - # Strip tags not allowed on addons.mozilla.org - sed -e 's/

//' -e 's#

#\n#' -e 's/h[1-9]>/strong>/g' -e 's#br />#\n#' \ - -i $(BLDDIR)/amo_readme/$*/README.html - clean: rm -f $(BLDDIR)/zutilo.xpi rm -f $(INTERNAL_READMES) rm -f $(AMO_READMES) rm -rf $(BLDDIR)/internal_readme/* -.PHONY: all clean xpi amo_readme +.PHONY: all clean xpi diff --git a/scripts/babelzilla/Add_external_locale_files.py b/scripts/babelzilla/Add_external_locale_files.py deleted file mode 100755 index a6f24ef..0000000 --- a/scripts/babelzilla/Add_external_locale_files.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python - -# Save an html version of Zutilo's readme without

flags and with -# flags changed to -import os, sys -import os.path -import shutil - -zutiloDir = os.path.dirname(os.path.realpath(sys.argv[0])) + '/../../' -internalLocales = zutiloDir + 'chrome/locale/' -externalLocale = zutiloDir + 'Extra/locale/' -internalSubdirectory = 'zutilo' -ignoredFiles = ['.DS_Store'] - -locales = [name for name in os.listdir(externalLocale) - if os.path.isdir(os.path.join(externalLocale, name))] - -for locale in locales: - extLocaleDir = os.path.join(externalLocale, locale) - files = [name for name in os.listdir(extLocaleDir) - if os.path.isfile(os.path.join(extLocaleDir, name))] - - intLocaleDir = os.path.join(internalLocales, locale) - intLocaleDir = os.path.join(intLocaleDir, internalSubdirectory) - for file0 in files: - if file0 not in ignoredFiles: - shutil.copy(os.path.join(extLocaleDir, file0), intLocaleDir) diff --git a/scripts/babelzilla/README.md b/scripts/babelzilla/README.md deleted file mode 100644 index 2a0b948..0000000 --- a/scripts/babelzilla/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# BabelZilla scripts -The purpose of these scripts is to copy locale files not included in the Zutilo `xpi` file into the addon directory, so that they would be included in the Zutilo `xpi` (and then also to remove). -The reason for doing this is that BabelZilla only accepts `xpi` files, so if you want strings to be translated they have to be formated as addon locale strings. -Zutilo has some auxiliary strings like the captions for the figures shown (addons.mozilla.org) which also need to be translated, so those have to be copied into the `xpi` file for BabelZilla to include them. - -__NOTE:__ These scripts are out of date because BabelZilla has not been used to translate Zutilo in a long time. They could be updated if anyone wanted to translate Zutilo using BabelZilla. diff --git a/scripts/babelzilla/Remove_external_locale_files.py b/scripts/babelzilla/Remove_external_locale_files.py deleted file mode 100755 index 1e3fd5f..0000000 --- a/scripts/babelzilla/Remove_external_locale_files.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python - -import os, sys -import os.path - -zutiloDir = os.path.dirname(os.path.realpath(sys.argv[0])) + '/../../' -internalLocales = zutiloDir + 'chrome/locale/' -externalLocale = zutiloDir + 'Extra/locale/' -internalSubdirectory = 'zutilo' -ignoredFiles = ['.DS_Store'] - -locales = [name for name in os.listdir(externalLocale) - if os.path.isdir(os.path.join(externalLocale, name))] - -for locale in locales: - extLocaleDir = os.path.join(externalLocale, locale) - files = [name for name in os.listdir(extLocaleDir) - if os.path.isfile(os.path.join(extLocaleDir, name))] - - intLocaleDir = os.path.join(internalLocales, locale) - intLocaleDir = os.path.join(intLocaleDir, internalSubdirectory) - for file0 in files: - if file0 not in ignoredFiles: - os.remove(os.path.join(intLocaleDir, file0)) From 9db692f3f4d9c9074508c1928ced727ac874f8a2 Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 10:52:22 -0400 Subject: [PATCH 006/126] Mirror top-level English docs to internal copies --- i18n/en-US/readme/CHANGELOG.md | 6 ++ i18n/en-US/readme/docs/COMMANDS.md | 129 +++++++++++------------------ i18n/en-US/readme/docs/USAGE.md | 98 ++++++++++++++++++++++ 3 files changed, 151 insertions(+), 82 deletions(-) diff --git a/i18n/en-US/readme/CHANGELOG.md b/i18n/en-US/readme/CHANGELOG.md index 56ac0b5..af79162 100644 --- a/i18n/en-US/readme/CHANGELOG.md +++ b/i18n/en-US/readme/CHANGELOG.md @@ -1,3 +1,9 @@ +* In version 3.2.0b: + + + Update item select link to newer format used by recent version of Zotero + + Add functions to copy select links and web links to collections + + Add copy/paste item field functions + * In version 3.1.0: + Update Chinese translation diff --git a/i18n/en-US/readme/docs/COMMANDS.md b/i18n/en-US/readme/docs/COMMANDS.md index a441aed..650c2dd 100644 --- a/i18n/en-US/readme/docs/COMMANDS.md +++ b/i18n/en-US/readme/docs/COMMANDS.md @@ -42,34 +42,33 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), Set all selected items to be related to each other. * __QuickCopy items:__ - Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. - There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). - These items will copy to the clipboard using alternative export translators. - To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. - Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. - The config editor can be opened from the Advanced pane of Zotero's preferences window (or by visiting `about:config` if using Zotero as a Firefox add-on). + Copy selected items to the clipboard using the "Default output format" specified in the "Export" section of Zotero's preferences. + There are also two alternative QuickCopy items (labeled "alt 1" and "alt 2"). + These items will copy to the clipboard using alternative export translators. + To select the translators used by these functions, the corresponding preferences `extensions.zutilo.quickcopy_alt1` and `extensions.zutilo.quickcopy_alt2` must be set in the config editor. + Each preference should be set to whatever appears in the config editor for the `export.quickCopy.setting` preference when the desired translator is set as the "Default output format" in Zotero's preferences. + The config editor can be opened from the Advanced pane of Zotero's preferences window. * __Copy select item links:__ - Copy links of the form "zotero://select/items/ITEM_ID" to the clipboard for each selected item. - Pasting such a link into the Firefox address bar will select the corresponding item in the Zotero Firefox plugin. - Following links from other applications and having the links select items in the Zotero Standalone client may also be achievable but might require additional set up. + Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item. + Following links from other applications can select items in the Zotero Standalone client but might require additional set up. * __Copy Zotero URIs:__ - Copy (www.zotero.org) links to the clipboard for each selected item. - If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). - If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + Copy (www.zotero.org) links to the clipboard for each selected item. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. * __Create book section:__ - Create a book section item from the currently selected book item. + Create a book section item from the currently selected book item. - The new item is created by duplicating the book item and changing its type to book section. - Author entries for the book item are converted to "book author" entries for the new book section item. - The new book section item is added as a related item to the original book item. - Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. + The new item is created by duplicating the book item and changing its type to book section. + Author entries for the book item are converted to "book author" entries for the new book section item. + The new book section item is added as a related item to the original book item. + Finally, the title textbox for the new item is focused so that a new title for the book section may be entered. - This function only works when a single book item is selected. - Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. - There is no prompt to confirm this loss of fields from the created book section item. + This function only works when a single book item is selected. + Note that some fields (number of pages and short title, as of late 2014) apply only to book items and not book section items. + There is no prompt to confirm this loss of fields from the created book section item. * __Create book item:__ Create a book item from teh currently selected book section item. @@ -86,6 +85,32 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), * __Relocate child items:__ Move all items stored in Zutilo's internal clipboard (put there by the "Copy child items" function) to the currently selected item. +* __Copy item fields:__ + Copies all source-item metadata fields to the clipboard. + The data copied is all data visible in the right panel only (not tags, not notes). + +* __Paste into empty item fields:__ + (‘Paste-into-empty’) paste where source has value and target has none/empty. + Authors from the source are merged in even if the target already has authors. + +* __Paste non-empty item fields__ + (‘Paste-non-empty’): paste where source has value. + Replaces authors if there is an author field in the pasted data. + +* __Paste all items fields__ + (Paste-all): paste all fields from source, even if they are empty. + +### Collection menu functions + +* __Copy select collection link:__ + Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. + Following links from other applications can select the collection in the Zotero Standalone client but might require additional set up. + +* __Copy Zotero URI:__ + Copy (www.zotero.org) link to the clipboard for the selected collection. + If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org). + If you do not have a (www.zotero.org) profile, a placeholder link is still generated but might not be useful. + ### Navigating the UI and editing items via keyboard shortcuts Zutilo currently implements several keyboard shortcuts that are useful for editing Zotero items. @@ -196,68 +221,6 @@ However, when the pane is shown, the thicker vertical divider ("splitter", "grip * __Open style editor:__ Open the style editor window (normally accessible from the advanced section of Zotero's preferences). -### Firefox browser shortcut functions - -The following shortcut functions are only available in the Zotero Firefox addon. - -* __Focus Zotero:__ - Make Zotero visible if it is not. - Focus Zotero so that, e.g., `Tab` and the arrow keys work on the Zotero UI rather than the previously focused element of Firefox's UI. - -* __Hide Zotero:__ - Hide Zotero if it was visible. - -* __Toggle Zotero:__ - Show Zotero if it was not visible. - Otherwise hide Zotero. - -* __Save webpage as a Zotero item:__ - Save the current page as a webpage item in Zotero. - -* __Save item:__ - Add an item to the Zotero library based on the reference content of the current webpage (equivalent to clicking on the little page/book icon in the Firefox address bar). - In Zotero, the function that creates the item from the web page content is referred to as a `translator`. - -* __Save item without attachments:__ - Create an item in a similar manner to "Save item" but __do not__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item with attachments:__ - Create an item in a similar manner to "Save item" but __do__ save attachment files for the item regardless of whether or not Zotero is set to save such attachments in its preferences. - -* __Save item (reverse attachment pref):__ - Create an item in a similar manner to "Save item" but only save attachments if Zotero is set not to save attachments in its preferences. - -* __Attach current page:__ - Attach the current browser page to the selected Zotero item. - This function works best when the current web page is a PDF opened with Firefox's internal PDF viewer. - -### Firefox browser menu functions - -These functions add items to the Zotero "Save item" button's menu and to the Firefox right-click menu. -Any of the menu items can be set to hidden in Zutilo's preferences. - -* __Attaching webpages and links to Zotero items:__ - Zutilo adds context menu items to Firefox for attaching the current page or the current link target (if a link is selected in the current web page) to the item currently selected in Zotero. - Attaching the current web page is also available as a keyboard shortcut. - - How the attachment is processed depends on the attachment method set in Zutilo's preferences. - If the method is 'Import', an imported attachment is created from the page/link. - If the method is 'Prompt for linked file', a file prompt appears to allow the user to specify a new file. - The page/link is saved to this file and then a linked file attachment (linked to the downloaded file) is created. - If the method is 'Prompt after first', an imported attachment is created if the selected item has no previous attachments (not counting webpage snapshot attachments). - Otherwise, the file prompt for creating a linked file attachment is shown. - If the shift key is pressed when the attachment function is activated, a prompt for a linked file is shown regardless of Zutilo's preference setting. - If the control key is pressed, the attachment is imported regardless of Zutilo's preference setting. - -* __Save item from a current webpage with or without attachments:__ - Zutilo adds extra menu items to the context menu of Zotero's "Save item" button that save an item for the current page with or without extracting the page's associated PDF's and other files. - That is, if the "Automatically attach PDFs and other files" preference is selected in Zotero, Zutilo adds menu items for saving the item without attachments. - One menu item is created for each "Save to Zotero" method that applies to the current page. - If the preference is not selected, Zutilo adds menu items for saving an item with the attachments. - - This function works by toggling the associated files preference in Zotero, creating the item, and then toggling the preference back to its original state. - Because Zotero translates pages asynchronously (and thus simultaneously), translations made with this function should be allowed to finish before starting normal page translations with Zotero (since otherwise the state of the "Associated files" preference will depend on the timing of the simultaneous translations). - ### Better BibTeX functions The following functions are only available when [Better BibTeX](https://github.com/retorquere/zotero-better-bibtex) is installed (and only for Zotero version 5.0 or higher). @@ -267,3 +230,5 @@ The following functions are only available when [Better BibTeX](https://github.c * __Unpin key:__ Unpin the key for the currently selected items. * __Force-refresh key:__ Force-refresh the key for the currently selected items. + + diff --git a/i18n/en-US/readme/docs/USAGE.md b/i18n/en-US/readme/docs/USAGE.md index 666c883..ff9dfa2 100644 --- a/i18n/en-US/readme/docs/USAGE.md +++ b/i18n/en-US/readme/docs/USAGE.md @@ -24,3 +24,101 @@ In Zutilo's preferences, these functions can be set to create either imported or Note that Zutilo's linked file attachment method triggers ZotFile, so, if ZotFile is set up to rename and move attachments, it will rename and move the ones saved this way no matter where you choose to save them with Zutilo's prompt. ZotFile has a "only ask if item has other attachments" option. This option works well with the Zutilo option to prompt for the location of attachments after the first. + +### Item field modification functions + +Zutilo provides several functions for copying and pasting item fields. +The functions are meant to help completing metadata manually. Here are some use cases. + +#### Copy + Paste-into-empty: Completing records + +You have a series of PDFs, for which metadata is not recognised automatically, such as the chapters of a book. +You want to copy a set of metadata from the ‘source record’ to ‘target records’, without overwritten the information already available in the target records. + +1. You complete a ‘book section’ record for the first PDF (including editors, book title, publication year, etc). + +2. You then use Copy on this record, and Paste-into-empty onto all of the other records. + In this, you don’t need to worry about existing metadata (in the target records) as this is not overwritten. + +For example, if the target records already have titles and authors, those titles are kept while editors, book title, publication year, etc is merged into the record. +You can be sure that no information from the target records is lost. + +#### Copy + Paste-non-empty: Conforming records + +You have a series of PDFs for which metadata was recognised, such as papers contained in a journal volume. +However, the name of the journal and the year of the volume are incorrect. + +1. Create a new journal paper record and enter the required information (name of the journal and year). + +2. Copy the record. + +3. Paste-non-empty the target records. This copies all non-empty fields from the source onto the target. + +As a result, the target records now all have the same Journal name and the same name (irrespective of the prior setting). + +#### Copying authors + +Copy+Paste-into-empty, Copy+Paste-non-empty and Copy+Paste-non-empty behave differently with regard to copying authors. + +* Copy+Paste-into-empty merges additional authors: Authors present in the source are added to the target. + +* Copy+Paste-non-empty replaces authors: Authors present in the source replace authors present in the target. +In other words, the authors in the target are removed, and the authors from the source are added to the target. + +* Copy+Paste-all replaces authors; if the author field in the source is empty, then authors in the target are also cleared. + +The above option offer some likely scenarios, while keeping the number of paste-options to just three. +Three examples which aren’t covered are + +1. Completing records but not adding to authors. + To do this, duplicate the source record, remove the authors and then do a Paste-into-empty. + +2. Conforming records but not replacing authors. + To do this, duplicate the source record, remove the authors and then do a Paste-non-empty. + +3. Conforming records but merging authors. + To do this, duplicate the source record, remove the authors and then do a Paste-non-empty. +Then copy the original source record, and do a Paste-into-empty. + +#### Copy + Paste-all: Copying item metadata between libraries + +If you are using copy + Paste-all, in sequence and onto the same item type, you are setting all source fields to the target (in a sense, duplicating the item). +A use case for this is this is to easily sync items across two libraries. +You have an item with correct metadata in one library, but with incorrect metadata in another library. +Copy + Paste-all command copies all metadata from the item in one library onto the other. +It updates fields on the target from the source. +This also clears all fields in the target that are empty in the source. + +1. An item was copied from library A to B. + The metadata in A is subsequently corrected, and now needs to be copied onto the target item in library B. + +2. Copy the source item in library A + +3. Paste-all onto the target item in library B + +4. The metadata of the target item is now identical to the source item. + +Note that effectively Copy+Paste-all is similar to a duplicate. +However, in some circumstances it’s easier to do. + +* For example, between libraries you’d first have to duplicate, then drag the item, then move attachments in the new library. + Creation time would also not be preserved. + +* Suppose you create one item, you duplicate it. + You move all the PDFs to the duplicates as needed. +Now you notice a mistake (involving an empty field, e.g. moving Series to Series Title, while clearing Series). +You just correct the original record, and use Paste-all. +The Series filled is cleared, and Series TItle is filled. + +#### Copy + edit + Paste-all: Clearing certain item fields in a large number of records + +You are creating a public library B from a library A. +In this process, you want to clear some fields from a set of items in library B. +For example, you may wish to remove a set of archive locations, or extras, or similar. + +1. Create a blank item (of the same type), copy it. + +2. Edit the JSON on the clipboard to keep only fields to be cleared. + +3. Then use Paste-all to clear those fields in a number of source items. + From 73b427b27979e9239c8efc7f1886ada846bffefd Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 10:58:03 -0400 Subject: [PATCH 007/126] Fix remaining eslint errors in bootstrap.js --- addon/bootstrap.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/addon/bootstrap.js b/addon/bootstrap.js index f8c9362..9d1ce02 100644 --- a/addon/bootstrap.js +++ b/addon/bootstrap.js @@ -5,23 +5,11 @@ "use strict"; /* global Components, Services */ -/* global Zutilo */ +/* global Zutilo, APP_SHUTDOWN */ const {classes: Cc, utils: Cu} = Components; Cu.import("resource://gre/modules/Services.jsm"); -const BOOTSTRAP_REASONS = [ - "", // the bootstrap reason is 1 based - "APP_STARTUP", - "APP_SHUTDOWN", - "ADDON_ENABLE", - "ADDON_DISABLE", - "ADDON_INSTALL", - "ADDON_UNINSTALL", - "ADDON_UPGRADE", - "ADDON_DOWNGRADE" -]; - // eslint-disable-next-line no-unused-vars function install(data, reason) { From 651344e6435af7da603269f589f83ccccb5d2648 Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 11:40:56 -0400 Subject: [PATCH 008/126] Fix eslint warnings in zutilo.jsm --- addon/chrome/content/zutilo/zutilo.jsm | 52 ++++++++++++-------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/addon/chrome/content/zutilo/zutilo.jsm b/addon/chrome/content/zutilo/zutilo.jsm index 754fe49..26346a9 100644 --- a/addon/chrome/content/zutilo/zutilo.jsm +++ b/addon/chrome/content/zutilo/zutilo.jsm @@ -3,14 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 'use strict' -/* global gBrowser, window, document, AddonManager, Components, Services */ +/* global AddonManager, Components, Services */ /* global CustomizableUI */ +// eslint-disable-next-line no-unused-vars var EXPORTED_SYMBOLS = ['Zutilo']; -var Cc = Components.classes -var Ci = Components.interfaces -var Cu = Components.utils +const {classes: Cc, interfaces: Ci, utils: Cu} = Components; Cu.import('resource://gre/modules/AddonManager.jsm'); Cu.import('resource://gre/modules/Services.jsm'); @@ -34,9 +33,9 @@ var Zutilo = { 'copyCreators', 'copyItems', 'copyItems_alt1', 'copyItems_alt2', 'copyZoteroSelectLink', 'copyZoteroItemURI', 'createBookSection', 'createBookItem', 'copyChildIDs', 'relocateChildren', - 'copyJSON', 'pasteJSONIntoEmptyFields', 'pasteJSONFromNonEmptyFields', 'pasteJSONAll', + 'copyJSON', 'pasteJSONIntoEmptyFields', 'pasteJSONFromNonEmptyFields', 'pasteJSONAll' ], - collection: ['copyZoteroCollectionSelectLink', 'copyZoteroCollectionURI'], + collection: ['copyZoteroCollectionSelectLink', 'copyZoteroCollectionURI'] }, ffcacmFunctions: [ {name: 'attachPage', @@ -50,7 +49,7 @@ var Zutilo = { itemClipboard: [], - appName: function() { + appName: (function() { var appInfo = Cc['@mozilla.org/xre/app-info;1']. getService(Ci.nsIXULAppInfo); var appName; @@ -73,7 +72,7 @@ var Zutilo = { } return appName; - }(), + }()), /********************************************/ // Zutilo setup functions @@ -130,9 +129,9 @@ var Zutilo = { }, false) }, - onCloseWindow: function(xulWindow) {}, + onCloseWindow: function(_xulWindow) {}, - onWindowTitleChange: function(xulWindow, newTitle) {} + onWindowTitleChange: function(_xulWindow, _newTitle) {} }, loadWindowChrome: function(scope) { @@ -173,7 +172,7 @@ var Zutilo = { switch (topic) { case 'zutilo-zoteroitemmenu-update': - case 'zutilo-zoterocollectionmenu-update': + case 'zutilo-zoterocollectionmenu-update': { const menuName = (topic.includes('item') ? 'item' : 'collection') while (windows.hasMoreElements()) { tmpWin = windows.getNext(); @@ -187,7 +186,7 @@ var Zutilo = { } } break; - + } case 'zutilo-shortcut-update': while (windows.hasMoreElements()) { tmpWin = windows.getNext(); @@ -258,7 +257,7 @@ var Zutilo = { escapeForRegExp: function(str) { // Escape all symbols with special regular expression meanings // Function taken from http://stackoverflow.com/a/6969486 - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); + return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); } }; @@ -327,27 +326,22 @@ Zutilo.Prefs = { } } catch (e) { - throw ('Invalid Zutilo pref call for ' + pref); + throw new Error('Invalid Zutilo pref call for ' + pref); } return prefVal; }, set: function(pref, value) { - try { - switch (this.prefBranch.getPrefType(pref)){ - case this.prefBranch.PREF_BOOL: - return this.prefBranch.setBoolPref(pref, value); - case this.prefBranch.PREF_STRING: - return this.prefBranch.setCharPref(pref, value); - case this.prefBranch.PREF_INT: - return this.prefBranch.setIntPref(pref, value); - } - } - catch (e) { - throw(e); - // throw ('Invalid preference "' + pref + '"'); + switch (this.prefBranch.getPrefType(pref)){ + case this.prefBranch.PREF_BOOL: + return this.prefBranch.setBoolPref(pref, value); + case this.prefBranch.PREF_STRING: + return this.prefBranch.setCharPref(pref, value); + case this.prefBranch.PREF_INT: + return this.prefBranch.setIntPref(pref, value); } + return false; }, @@ -356,7 +350,7 @@ Zutilo.Prefs = { this.prefBranch.clearUserPref(pref); } catch (e) { - throw ('Invalid preference "' + pref + '"'); + throw new Error('Invalid preference "' + pref + '"'); } }, @@ -414,7 +408,7 @@ Zutilo.Prefs = { /* Zotero save button methods */ var saveIconListener = { - onWidgetAdded: function(widgetID, area, position) { + onWidgetAdded: function(widgetID, _area, _position) { if (widgetID == 'zotero-toolbar-buttons' || widgetID == 'zotero-toolbar-save-button-single') { var windows = Services.wm.getEnumerator('navigator:browser') From 392605477a145954ad48eb3d440dd5be7fc657fc Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 12:09:12 -0400 Subject: [PATCH 009/126] Rename zutilo.jsm to zutilo.js Can't find any other way for TSServer not to treat zutilo.jsm as a typescript file instead of a javascript file. --- addon/bootstrap.js | 4 ++-- addon/chrome/content/zutilo/firefoxOverlay.js | 2 +- addon/chrome/content/zutilo/keys.js | 2 +- addon/chrome/content/zutilo/preferences.js | 2 +- addon/chrome/content/zutilo/zoteroNotActive.js | 2 +- addon/chrome/content/zutilo/zoteroOverlay.js | 2 +- addon/chrome/content/zutilo/{zutilo.jsm => zutilo.js} | 0 addon/chrome/content/zutilo/zutiloChrome.js | 2 +- addon/chrome/content/zutilo/zutiloUpgraded.js | 2 +- docs/DEVELOPERS.md | 2 +- i18n/de/readme/docs/DEVELOPERS.md | 2 +- i18n/en-US/readme/docs/DEVELOPERS.md | 2 +- i18n/es/readme/docs/DEVELOPERS.md | 2 +- i18n/fr/readme/docs/DEVELOPERS.md | 2 +- i18n/zh-CN/readme/docs/DEVELOPERS.md | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) rename addon/chrome/content/zutilo/{zutilo.jsm => zutilo.js} (100%) diff --git a/addon/bootstrap.js b/addon/bootstrap.js index 9d1ce02..15f807a 100644 --- a/addon/bootstrap.js +++ b/addon/bootstrap.js @@ -17,7 +17,7 @@ function install(data, reason) { // eslint-disable-next-line no-unused-vars function startup(data, reason) { - Cu.import("chrome://zutilo/content/zutilo.jsm"); + Cu.import("chrome://zutilo/content/zutilo.js"); Zutilo.init(); } @@ -47,7 +47,7 @@ function shutdown(data, reason) { Cc["@mozilla.org/intl/stringbundle;1"]. getService(Components.interfaces.nsIStringBundleService).flushBundles(); - Cu.unload("chrome://zutilo/content/zutilo.jsm"); + Cu.unload("chrome://zutilo/content/zutilo.js"); } // eslint-disable-next-line no-unused-vars diff --git a/addon/chrome/content/zutilo/firefoxOverlay.js b/addon/chrome/content/zutilo/firefoxOverlay.js index d94159e..d4b4b7f 100644 --- a/addon/chrome/content/zutilo/firefoxOverlay.js +++ b/addon/chrome/content/zutilo/firefoxOverlay.js @@ -11,7 +11,7 @@ Components.utils.import('resource://gre/modules/Services.jsm'); /******************************************/ // Include core modules /******************************************/ -Components.utils.import('chrome://zutilo/content/zutilo.jsm'); +Components.utils.import('chrome://zutilo/content/zutilo.js'); /******************************************/ // Firefox overlay diff --git a/addon/chrome/content/zutilo/keys.js b/addon/chrome/content/zutilo/keys.js index 59aad7e..c18dd1e 100644 --- a/addon/chrome/content/zutilo/keys.js +++ b/addon/chrome/content/zutilo/keys.js @@ -13,7 +13,7 @@ /********************************************/ Components.utils.import('resource://gre/modules/AddonManager.jsm'); Components.utils.import('resource://gre/modules/Services.jsm'); -Components.utils.import('chrome://zutilo/content/zutilo.jsm'); +Components.utils.import('chrome://zutilo/content/zutilo.js'); /********************************************/ // Define keys object diff --git a/addon/chrome/content/zutilo/preferences.js b/addon/chrome/content/zutilo/preferences.js index df56750..469b305 100644 --- a/addon/chrome/content/zutilo/preferences.js +++ b/addon/chrome/content/zutilo/preferences.js @@ -6,7 +6,7 @@ 'use strict'; /* global window, document, Components */ /* global keyconfigOnLoad, Zutilo */ -Components.utils.import('chrome://zutilo/content/zutilo.jsm'); +Components.utils.import('chrome://zutilo/content/zutilo.js'); // eslint-disable-next-line no-unused-vars function initializePrefWindow() { diff --git a/addon/chrome/content/zutilo/zoteroNotActive.js b/addon/chrome/content/zutilo/zoteroNotActive.js index 95d26e0..7554b01 100644 --- a/addon/chrome/content/zutilo/zoteroNotActive.js +++ b/addon/chrome/content/zutilo/zoteroNotActive.js @@ -6,7 +6,7 @@ 'use strict'; /* global window, document, Components */ /* global Zutilo */ -Components.utils.import('chrome://zutilo/content/zutilo.jsm'); +Components.utils.import('chrome://zutilo/content/zutilo.js'); // eslint-disable-next-line no-unused-vars function onAccept() { diff --git a/addon/chrome/content/zutilo/zoteroOverlay.js b/addon/chrome/content/zutilo/zoteroOverlay.js index 77c853d..c59e117 100644 --- a/addon/chrome/content/zutilo/zoteroOverlay.js +++ b/addon/chrome/content/zutilo/zoteroOverlay.js @@ -8,7 +8,7 @@ /* global Zotero, ZoteroPane, ZOTERO_CONFIG */ /* global Zutilo, ZutiloChrome */ Components.utils.import('resource://gre/modules/Services.jsm'); -Components.utils.import('chrome://zutilo/content/zutilo.jsm'); +Components.utils.import('chrome://zutilo/content/zutilo.js'); Components.utils.import('resource://zotero/config.js'); function debug(msg, err) { diff --git a/addon/chrome/content/zutilo/zutilo.jsm b/addon/chrome/content/zutilo/zutilo.js similarity index 100% rename from addon/chrome/content/zutilo/zutilo.jsm rename to addon/chrome/content/zutilo/zutilo.js diff --git a/addon/chrome/content/zutilo/zutiloChrome.js b/addon/chrome/content/zutilo/zutiloChrome.js index fc63d1f..5464698 100644 --- a/addon/chrome/content/zutilo/zutiloChrome.js +++ b/addon/chrome/content/zutilo/zutiloChrome.js @@ -13,7 +13,7 @@ var Ci = Components.interfaces var Cu = Components.utils Cu.import('resource://gre/modules/AddonManager.jsm'); Cu.import('resource://gre/modules/Services.jsm'); -Cu.import('chrome://zutilo/content/zutilo.jsm'); +Cu.import('chrome://zutilo/content/zutilo.js'); /******************************************/ // Initialization diff --git a/addon/chrome/content/zutilo/zutiloUpgraded.js b/addon/chrome/content/zutilo/zutiloUpgraded.js index 26ec5b1..a0c1afd 100644 --- a/addon/chrome/content/zutilo/zutiloUpgraded.js +++ b/addon/chrome/content/zutilo/zutiloUpgraded.js @@ -5,7 +5,7 @@ 'use strict'; /* global window, document, Components */ -Components.utils.import('chrome://zutilo/content/zutilo.jsm'); +Components.utils.import('chrome://zutilo/content/zutilo.js'); function upgradeInit() { var upgradeDescription = document. diff --git a/docs/DEVELOPERS.md b/docs/DEVELOPERS.md index 74be237..4806621 100644 --- a/docs/DEVELOPERS.md +++ b/docs/DEVELOPERS.md @@ -15,7 +15,7 @@ The `make` machinery is mainly used for converting the README files from `markdo Most of the Zutilo logic is contained in the files in `addon/chrome/content/zutilo`. The highlights are: -* `zutilo.jsm` +* `zutilo.js` - `addon/bootstrap.js` loads this file when Zutilo starts up and it handles the rest of the Zutilo setup. - This file defines the `Zutilo` module. - The `Zutilo` module contains properties about Zutilo that are window independent. diff --git a/i18n/de/readme/docs/DEVELOPERS.md b/i18n/de/readme/docs/DEVELOPERS.md index 74be237..4806621 100644 --- a/i18n/de/readme/docs/DEVELOPERS.md +++ b/i18n/de/readme/docs/DEVELOPERS.md @@ -15,7 +15,7 @@ The `make` machinery is mainly used for converting the README files from `markdo Most of the Zutilo logic is contained in the files in `addon/chrome/content/zutilo`. The highlights are: -* `zutilo.jsm` +* `zutilo.js` - `addon/bootstrap.js` loads this file when Zutilo starts up and it handles the rest of the Zutilo setup. - This file defines the `Zutilo` module. - The `Zutilo` module contains properties about Zutilo that are window independent. diff --git a/i18n/en-US/readme/docs/DEVELOPERS.md b/i18n/en-US/readme/docs/DEVELOPERS.md index 74be237..4806621 100644 --- a/i18n/en-US/readme/docs/DEVELOPERS.md +++ b/i18n/en-US/readme/docs/DEVELOPERS.md @@ -15,7 +15,7 @@ The `make` machinery is mainly used for converting the README files from `markdo Most of the Zutilo logic is contained in the files in `addon/chrome/content/zutilo`. The highlights are: -* `zutilo.jsm` +* `zutilo.js` - `addon/bootstrap.js` loads this file when Zutilo starts up and it handles the rest of the Zutilo setup. - This file defines the `Zutilo` module. - The `Zutilo` module contains properties about Zutilo that are window independent. diff --git a/i18n/es/readme/docs/DEVELOPERS.md b/i18n/es/readme/docs/DEVELOPERS.md index 74be237..4806621 100644 --- a/i18n/es/readme/docs/DEVELOPERS.md +++ b/i18n/es/readme/docs/DEVELOPERS.md @@ -15,7 +15,7 @@ The `make` machinery is mainly used for converting the README files from `markdo Most of the Zutilo logic is contained in the files in `addon/chrome/content/zutilo`. The highlights are: -* `zutilo.jsm` +* `zutilo.js` - `addon/bootstrap.js` loads this file when Zutilo starts up and it handles the rest of the Zutilo setup. - This file defines the `Zutilo` module. - The `Zutilo` module contains properties about Zutilo that are window independent. diff --git a/i18n/fr/readme/docs/DEVELOPERS.md b/i18n/fr/readme/docs/DEVELOPERS.md index 74be237..4806621 100644 --- a/i18n/fr/readme/docs/DEVELOPERS.md +++ b/i18n/fr/readme/docs/DEVELOPERS.md @@ -15,7 +15,7 @@ The `make` machinery is mainly used for converting the README files from `markdo Most of the Zutilo logic is contained in the files in `addon/chrome/content/zutilo`. The highlights are: -* `zutilo.jsm` +* `zutilo.js` - `addon/bootstrap.js` loads this file when Zutilo starts up and it handles the rest of the Zutilo setup. - This file defines the `Zutilo` module. - The `Zutilo` module contains properties about Zutilo that are window independent. diff --git a/i18n/zh-CN/readme/docs/DEVELOPERS.md b/i18n/zh-CN/readme/docs/DEVELOPERS.md index 74be237..4806621 100644 --- a/i18n/zh-CN/readme/docs/DEVELOPERS.md +++ b/i18n/zh-CN/readme/docs/DEVELOPERS.md @@ -15,7 +15,7 @@ The `make` machinery is mainly used for converting the README files from `markdo Most of the Zutilo logic is contained in the files in `addon/chrome/content/zutilo`. The highlights are: -* `zutilo.jsm` +* `zutilo.js` - `addon/bootstrap.js` loads this file when Zutilo starts up and it handles the rest of the Zutilo setup. - This file defines the `Zutilo` module. - The `Zutilo` module contains properties about Zutilo that are window independent. From 88be7855c5a24e16f3dc6c19bceec74544c1ce1e Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 13:16:01 -0400 Subject: [PATCH 010/126] Fix null key error The key update function gets triggered on reinstall if shortcut preferences are present from a previous install before the keys get set up for that new install. --- addon/chrome/content/zutilo/zoteroOverlay.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addon/chrome/content/zutilo/zoteroOverlay.js b/addon/chrome/content/zutilo/zoteroOverlay.js index c59e117..2901c5e 100644 --- a/addon/chrome/content/zutilo/zoteroOverlay.js +++ b/addon/chrome/content/zutilo/zoteroOverlay.js @@ -1294,6 +1294,12 @@ ZutiloChrome.zoteroOverlay = { updateKey: function(keyLabel) { var key = document.getElementById(Zutilo.keys.keyID(keyLabel)); + if (key === null) { + // updateKey gets triggered before keys have been set when Zutilo + // is reinstalled if shortcuts had been set during the previous + // install previously defined + return + } key.removeAttribute('modifiers'); key.removeAttribute('key'); From a399de9bc0fe8b87f5bb85a63e1a2c35aa566a6f Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 13:20:22 -0400 Subject: [PATCH 011/126] Add more collection function documentation --- docs/COMMANDS.md | 4 +++- i18n/de/readme/docs/COMMANDS.md | 4 +++- i18n/en-US/readme/docs/COMMANDS.md | 4 +++- i18n/es/readme/docs/COMMANDS.md | 4 +++- i18n/fr/readme/docs/COMMANDS.md | 4 +++- i18n/zh-CN/readme/docs/COMMANDS.md | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md index 650c2dd..328925c 100644 --- a/docs/COMMANDS.md +++ b/docs/COMMANDS.md @@ -1,5 +1,5 @@ ### Item menu functions -Each of the functions below can be called from the Zotero item menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). +Each of the functions below can be called from the Zotero item context menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy tags:__ @@ -101,6 +101,8 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), (Paste-all): paste all fields from source, even if they are empty. ### Collection menu functions +Each of the functions below can be called from the Zotero collection context menu (accessed by right-clicking on a collection in the collections pane at the right of Zotero where all the collections are listed). +In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy select collection link:__ Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. diff --git a/i18n/de/readme/docs/COMMANDS.md b/i18n/de/readme/docs/COMMANDS.md index 650c2dd..328925c 100644 --- a/i18n/de/readme/docs/COMMANDS.md +++ b/i18n/de/readme/docs/COMMANDS.md @@ -1,5 +1,5 @@ ### Item menu functions -Each of the functions below can be called from the Zotero item menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). +Each of the functions below can be called from the Zotero item context menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy tags:__ @@ -101,6 +101,8 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), (Paste-all): paste all fields from source, even if they are empty. ### Collection menu functions +Each of the functions below can be called from the Zotero collection context menu (accessed by right-clicking on a collection in the collections pane at the right of Zotero where all the collections are listed). +In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy select collection link:__ Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. diff --git a/i18n/en-US/readme/docs/COMMANDS.md b/i18n/en-US/readme/docs/COMMANDS.md index 650c2dd..328925c 100644 --- a/i18n/en-US/readme/docs/COMMANDS.md +++ b/i18n/en-US/readme/docs/COMMANDS.md @@ -1,5 +1,5 @@ ### Item menu functions -Each of the functions below can be called from the Zotero item menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). +Each of the functions below can be called from the Zotero item context menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy tags:__ @@ -101,6 +101,8 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), (Paste-all): paste all fields from source, even if they are empty. ### Collection menu functions +Each of the functions below can be called from the Zotero collection context menu (accessed by right-clicking on a collection in the collections pane at the right of Zotero where all the collections are listed). +In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy select collection link:__ Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. diff --git a/i18n/es/readme/docs/COMMANDS.md b/i18n/es/readme/docs/COMMANDS.md index 650c2dd..328925c 100644 --- a/i18n/es/readme/docs/COMMANDS.md +++ b/i18n/es/readme/docs/COMMANDS.md @@ -1,5 +1,5 @@ ### Item menu functions -Each of the functions below can be called from the Zotero item menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). +Each of the functions below can be called from the Zotero item context menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy tags:__ @@ -101,6 +101,8 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), (Paste-all): paste all fields from source, even if they are empty. ### Collection menu functions +Each of the functions below can be called from the Zotero collection context menu (accessed by right-clicking on a collection in the collections pane at the right of Zotero where all the collections are listed). +In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy select collection link:__ Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. diff --git a/i18n/fr/readme/docs/COMMANDS.md b/i18n/fr/readme/docs/COMMANDS.md index 650c2dd..328925c 100644 --- a/i18n/fr/readme/docs/COMMANDS.md +++ b/i18n/fr/readme/docs/COMMANDS.md @@ -1,5 +1,5 @@ ### Item menu functions -Each of the functions below can be called from the Zotero item menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). +Each of the functions below can be called from the Zotero item context menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy tags:__ @@ -101,6 +101,8 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), (Paste-all): paste all fields from source, even if they are empty. ### Collection menu functions +Each of the functions below can be called from the Zotero collection context menu (accessed by right-clicking on a collection in the collections pane at the right of Zotero where all the collections are listed). +In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy select collection link:__ Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. diff --git a/i18n/zh-CN/readme/docs/COMMANDS.md b/i18n/zh-CN/readme/docs/COMMANDS.md index 650c2dd..328925c 100644 --- a/i18n/zh-CN/readme/docs/COMMANDS.md +++ b/i18n/zh-CN/readme/docs/COMMANDS.md @@ -1,5 +1,5 @@ ### Item menu functions -Each of the functions below can be called from the Zotero item menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). +Each of the functions below can be called from the Zotero item context menu (accessed by right-clicking in the items pane in the middle of Zotero where all of a collection's items are listed). In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy tags:__ @@ -101,6 +101,8 @@ In the Zutilo preferences (accessed from the same menu as Zotero's preferences), (Paste-all): paste all fields from source, even if they are empty. ### Collection menu functions +Each of the functions below can be called from the Zotero collection context menu (accessed by right-clicking on a collection in the collections pane at the right of Zotero where all the collections are listed). +In the Zutilo preferences (accessed from the same menu as Zotero's preferences), each of these functions can be set to show up in the Zotero item menu, in a Zutilo submenu of the Zotero item menu, or not to appear at all. * __Copy select collection link:__ Copy links of the form "zotero://select/library/collections/ITEM_ID" to the clipboard for the selected collection. From 11e1026da031950d5f8a4f599da52ff3754ac6ba Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Tue, 27 Aug 2019 14:43:42 -0400 Subject: [PATCH 012/126] Remove support for Firefox --- README.md | 18 +- addon/bootstrap.js | 3 - addon/chrome/content/zutilo/firefoxOverlay.js | 513 ------------------ addon/chrome/content/zutilo/keys.js | 61 --- addon/chrome/content/zutilo/preferences.js | 12 - addon/chrome/content/zutilo/preferences.xul | 107 +--- .../chrome/content/zutilo/zoteroNotActive.js | 27 - .../chrome/content/zutilo/zoteroNotActive.xul | 36 -- addon/chrome/content/zutilo/zoteroOverlay.js | 12 +- addon/chrome/content/zutilo/zutilo.js | 94 +--- addon/chrome/content/zutilo/zutiloChrome.js | 33 +- addon/chrome/locale/de/zutilo/zutilo.dtd | 36 +- .../chrome/locale/de/zutilo/zutilo.properties | 34 +- addon/chrome/locale/en-US/zutilo/zutilo.dtd | 28 - .../locale/en-US/zutilo/zutilo.properties | 20 - addon/chrome/locale/es/zutilo/zutilo.dtd | 38 +- .../chrome/locale/es/zutilo/zutilo.properties | 34 +- addon/chrome/locale/fr/zutilo/zutilo.dtd | 28 - .../chrome/locale/fr/zutilo/zutilo.properties | 54 +- addon/chrome/locale/zh-CN/zutilo/zutilo.dtd | 28 - .../locale/zh-CN/zutilo/zutilo.properties | 68 +-- addon/install.rdf | 9 - docs/BUGS.md | 13 +- docs/DEVELOPERS.md | 3 - i18n/de/readme/README.md | 18 +- i18n/de/readme/docs/BUGS.md | 13 +- i18n/de/readme/docs/DEVELOPERS.md | 3 - i18n/en-US/readme/README.md | 18 +- i18n/en-US/readme/docs/BUGS.md | 13 +- i18n/en-US/readme/docs/DEVELOPERS.md | 3 - i18n/es/readme/README.md | 18 +- i18n/es/readme/docs/BUGS.md | 13 +- i18n/es/readme/docs/DEVELOPERS.md | 3 - i18n/fr/readme/README.md | 18 +- i18n/fr/readme/docs/BUGS.md | 13 +- i18n/fr/readme/docs/DEVELOPERS.md | 3 - i18n/zh-CN/readme/README.md | 18 +- i18n/zh-CN/readme/docs/BUGS.md | 13 +- i18n/zh-CN/readme/docs/DEVELOPERS.md | 3 - 39 files changed, 114 insertions(+), 1365 deletions(-) delete mode 100644 addon/chrome/content/zutilo/firefoxOverlay.js delete mode 100644 addon/chrome/content/zutilo/zoteroNotActive.js delete mode 100644 addon/chrome/content/zutilo/zoteroNotActive.xul diff --git a/README.md b/README.md index 0cb2f26..3d1ffd9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Zutilo -Zutilo is a plugin for [Zotero](http://www.zotero.org/) (both the Firefox addon and the standalone client). +Zutilo is a plugin for [Zotero](http://www.zotero.org/). Zutilo adds several functions not available in base Zotero through extra menu items and keyboard shortcuts. Here are some of Zutilo's features: @@ -7,7 +7,6 @@ Here are some of Zutilo's features: * Select and right-click to relate several items * Copy items to the clipboard in several formats * Keyboard shortcuts for editing items and focusing and hiding different elements of the Zotero user interface -* Right-click to save link or document as an attachment to currently selected item (only for Zotero as a Firefox addon) Zutilo strives to enable whatever Zotero workflow is desired and otherwise to get out of the way. All of Zutilo's graphical elements can be disabled individually, so that unwanted features do not clutter the user interface. @@ -25,7 +24,7 @@ Then select the downloaded `zutilo.xpi` file. ## Getting started -Zutilo can be customized via its preferences window, which can reached either via the Firefox Addons Manager or the Zotero action menu (the gear icon). +Zutilo can be customized via its preferences window, which can reached via the Zotero Addons Manager or the Tools menu. ### Zotero item menu @@ -40,18 +39,7 @@ All of the functions that can appear in the item menu can also be called by keyb Zutilo also provides some additional keyboard shortcut functions that are not available from the item menu. By default, no keyboard shortcuts are defined. A shortcut key combination can be set for each function in Zutilo's preferences. -If the key combination is already assigned for another Firefox function, a warning will be displayed. - -### Firefox specific functions - -Zutilo adds entries to the Zotero address bar icon's menu for saving items into Zotero with the opposite attachment behavior from that set in Zotero's preferences. -So if you have Zotero set to download attachments when saving an item, Zutilo will add an entry to save the item without attachments. -The extra menu items can be disabled in Zutilo's preferences. - -Zutilo adds two entries to right-click menu in Firefox, one to save the current page as an attachment (most useful when the page is a pdf) and another to save a link as an attachment (if a link was right-clicked). -These menu items appear the Zotero submenu of the Firefox right-click menu. -In Zutilo's preferences, the menu items can be set to appear in the right-click menu directly (instead of the Zotero submenu) or can be disabled. -Whether the attachment files are imported to Zotero or downloaded and linked to Zotero items can be also be set in Zutilo's preferences. +If the key combination is already assigned for another function, a warning will be displayed. ## Usage notes diff --git a/addon/bootstrap.js b/addon/bootstrap.js index 15f807a..3a07754 100644 --- a/addon/bootstrap.js +++ b/addon/bootstrap.js @@ -32,9 +32,6 @@ function shutdown(data, reason) { var tmpWin=windows.getNext(); tmpWin.ZutiloChrome.removeXUL(); - if (typeof tmpWin.ZutiloChrome.firefoxOverlay != 'undefined') { - tmpWin.ZutiloChrome.firefoxOverlay.unload(); - } if (typeof tmpWin.ZutiloChrome.zoteroOverlay != 'undefined') { tmpWin.ZutiloChrome.zoteroOverlay.unload(); } diff --git a/addon/chrome/content/zutilo/firefoxOverlay.js b/addon/chrome/content/zutilo/firefoxOverlay.js deleted file mode 100644 index d4b4b7f..0000000 --- a/addon/chrome/content/zutilo/firefoxOverlay.js +++ /dev/null @@ -1,513 +0,0 @@ -/* Copyright 2012 Will Shanks. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -'use strict'; -/* global gBrowser, window, document, Components, Services */ -/* global Zotero, Zotero_Browser */ -/* global Zutilo, ZutiloChrome */ -Components.utils.import('resource://gre/modules/Services.jsm'); -/******************************************/ -// Include core modules -/******************************************/ -Components.utils.import('chrome://zutilo/content/zutilo.js'); - -/******************************************/ -// Firefox overlay -/******************************************/ -ZutiloChrome.firefoxOverlay = { - warnedThisSession: false, - cleanupQueue: [], - isScraping: false, - scrapeTimeout: null, - - init: function() { - window.setTimeout(function() { - if (typeof ZutiloChrome != 'undefined') { - Zutilo.checkZoteroActiveAndCallIf(false, - ZutiloChrome.firefoxOverlay, - ZutiloChrome.firefoxOverlay.warnZoteroNotActive); - var overlayFunc = function() {this.firefoxZoteroOverlay()} - Zutilo.checkZoteroActiveAndCallIf(true, - ZutiloChrome.firefoxOverlay, - overlayFunc); - } - }, 500); - }, - - unload: function() { - for (var index = 0; index < this.cleanupQueue.length; index++) { - this.cleanupQueue[index](); - } - }, - - warnZoteroNotActive: function() { - var showWarn = Zutilo.Prefs.get('warnZoteroNotActive'); - - if (showWarn && !this.warnedThisSession) { - window.openDialog('chrome://zutilo/content/zoteroNotActive.xul', - 'zutilo-zoteroNotActive-window', 'chrome,centerscreen'); - this.warnedThisSession = true; - } - }, - - /**************************************************************************/ - // Load Firefox-specific overlay that is relevant only when Zotero is active - /**************************************************************************/ - firefoxZoteroOverlay: function() { - this.refreshContentAreaContextMenu = refreshContentAreaContextMenu; - this.scrapeThisPage = scrapeThisPage - - setupContentAreaContextMenu() - setupStatusPopup() - }, - - /**************************************************************************/ - // Attach link functions - /**************************************************************************/ - - /* Attach the file located at url to the currently selected item in Zotero. - - url: string with url to attach - processType: string mode to use for processing the attachment. If - unspecified, determine from Zutilo preferences and mimeType - Possible values.... - Zotero: use Zotero's default import and filenaming. - prompt: prompt the user for a file location, import attach with - Zotero, and then move the attachment to the file location and - change to linked file attachment - ZotFile: import using Zotero and then pass the attachment to - ZotFile.renameAttachment() - */ - attachURLToCurrentItem: function(url, processType) { - // Error check item selection and get Zotero item - var zitems = ZutiloChrome.zoteroOverlay.getSelectedItems('regular'); - if (!ZutiloChrome.zoteroOverlay.checkItemNumber(zitems, - 'regularSingle')) { - return - } - var zitem = zitems[0]; - - this.attachURLToItem(zitem, url, processType); - }, - - attachURLToItem: function(zitem, url, processType) { - var allowedProcesses = ['prompt', 'Zotero', 'promptAfterOne']; - if (allowedProcesses.indexOf(processType) == -1) { - processType = Zutilo.Prefs.get('attachmentImportProcessType'); - } - - // Prompt if there is an existing non-snapshot attachment - if (processType == 'promptAfterOne') { - var attachments = Zotero.Items.get(zitem.getAttachments(false)); - var existingAttachments = false; - // Check for existing non-snapshot attachments - for (var index = 0; index < attachments.length; index++) { - if (!(attachments[index].attachmentLinkMode == - Zotero.Attachments.LINK_MODE_IMPORTED_URL && - attachments[index].attachmentMIMEType != - 'application/pdf')) { - existingAttachments = true; - break - } - } - if (existingAttachments) { - processType = 'prompt'; - } else { - processType = 'Zotero'; - } - } - - function mimeCallback(mimeType, _hasNativeHandler) { - function zoteroImport(attachmentCallback) { - if (Zotero.version.split('.')[0] < 5) { - // XXX: Legacy 4.0 - Zotero.Attachments.importFromURL(url, zitem.id, undefined, - undefined, - undefined, mimeType, - undefined, - attachmentCallback) - } else { - Zotero.Promise.coroutine(function*() { - let attachmentItem = - yield Zotero.Attachments.importFromURL( - {url: url, - parentItemID: zitem.id, - contentType: mimeType}) - if (attachmentCallback !== null) { - attachmentCallback(attachmentItem) - } - })() - } - } - - function moveAttachment(attachmentItem) { - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes['@mozilla.org/filepicker;1'] - .createInstance(nsIFilePicker); - var strName = 'zutilo.attachments.selectDestination'; - fp.init(window, - Zutilo._bundle.GetStringFromName(strName), - nsIFilePicker.modeSave); - fp.appendFilters(nsIFilePicker.filterAll); - - var importedFile = attachmentItem.getFile(); - fp.defaultString = ZutiloChrome.firefoxOverlay. - adjustZoteroExtension(url, importedFile.leafName) - - fp.open(function(result) { - if (result == nsIFilePicker.returnOK || - result == nsIFilePicker.returnReplace) { - // Move attachment file to chosen directory and - // attach as linked file. - importedFile.moveTo(fp.file.parent, - fp.file.leafName); - if (Zotero.version.split('.')[0] < 5) { - // XXX: Legacy 4.0 - Zotero.Attachments.linkFromFile(fp.file, - zitem.itemID) - } else { - Zotero.Attachments. - linkFromFile({file: fp.file, - parentItemID: zitem.itemID}) - } - } - if (Zotero.version.split('.')[0] < 5) { - // XXX: Legacy 4.0 - attachmentItem.erase() - } else { - attachmentItem.eraseTx() - } - }) - } - - // Choose process type for mimeType - if (processType == 'prompt') { - // Prompt for file name and location - zoteroImport(moveAttachment) - } else if (processType == 'Zotero') { - // Use Zotero importFromURL() - zoteroImport(function() {}); - } - } - - if (Zotero.version.split('.')[0] < 5) { - // XXX: Legacy 4.0 - Zotero.MIME.getMIMETypeFromURL(url, mimeCallback) - } else { - Zotero.MIME.getMIMETypeFromURL(url).then(function(result) { - mimeCallback(result[0], result[1]) - }) - } - }, - - adjustZoteroExtension: function(url, zoteroFileName) { - /* Zotero compresses file extensions based on MIME type (e.g. all - text files get converted to '.txt'. Here we try to put back the - original extension if it can be guessed from the URL. We have to be - conservative though because sometimes URL's are misleading (e.g. pdf's - on arxiv.org whose urls don't include the 'pdf' part) and Zotero gets - them right by looking at the MIME type. */ - var extensionPosition = url.lastIndexOf('.'); - var urlExtension = - extensionPosition == -1 ? '' : url.substr(extensionPosition + 1); - if (urlExtension.length == 3 || urlExtension.length == 4) { - var re = new RegExp('[a-z]', 'i'); - if (re.test(urlExtension[0])) { - zoteroFileName = zoteroFileName.substr(0, - zoteroFileName.lastIndexOf('.')) + '.' + urlExtension; - } - } - - return zoteroFileName - } -}; - -/************************************************************************/ -// Firefox contentAreaContextMenu -/************************************************************************/ - -function setupContentAreaContextMenu() { - var FFContAreaContMenu = document. - getElementById('contentAreaContextMenu'); - var ZoteroSubmenu = document. - getElementById('zotero-content-area-context-menu'); - - appendCACMCommandItems(FFContAreaContMenu, 'zutilo-ffcacm-', - ZoteroSubmenu.nextSibling); - - var ZoteroSubmenuPopup = document. - getElementById('zotero-context-item-from-page').parentElement; - var ZoteroSubmenuSeparator = document.createElement('menuseparator'); - var ZoteroSubmenuSeparatorID = 'zutilo-ffcacm-zoterosubmenu-separator'; - ZoteroSubmenuSeparator. - setAttribute('id', 'zutilo-ffcacm-zoterosubmenu-separator'); - ZoteroSubmenuPopup.appendChild(ZoteroSubmenuSeparator); - ZutiloChrome.XULRootElements.push(ZoteroSubmenuSeparatorID); - appendCACMCommandItems(ZoteroSubmenuPopup, - 'zutilo-ffcacm-zoterosubmenu-'); - - FFContAreaContMenu.addEventListener('popupshowing', - ZutiloChrome.firefoxOverlay.refreshContentAreaContextMenu, false); - ZutiloChrome.firefoxOverlay.cleanupQueue.push(cleanupFFCACM); -} - -// CACM = contentAreaContextMenu -function appendCACMCommandItems(parentElement, IDPrefix, nextElement) { - - var attachPageCmd = function(event) { - var processType; - if (event.shiftKey) { - processType = 'prompt'; - } else if (event.ctrlKey) { - processType = 'Zotero'; - } - ZutiloChrome.firefoxOverlay.attachURLToCurrentItem( - gBrowser.currentURI.spec, processType); - }; - - var attachLinkCmd = function(event) { - var processType; - if (event.shiftKey) { - processType = 'prompt'; - } else if (event.ctrlKey) { - processType = 'Zotero'; - } - ZutiloChrome.firefoxOverlay.attachURLToCurrentItem( - window.gContextMenu.linkURL, processType); - }; - - var commands = [attachPageCmd, attachLinkCmd]; - - for (var index = 0; index < Zutilo.ffcacmFunctions.length; index++) { - appendCACMSingleItem(parentElement, IDPrefix, - Zutilo.ffcacmFunctions[index].name, - commands[index], nextElement); - } -} - -function appendCACMSingleItem(parentElement, IDPrefix, IDSuffix, command, - nextElement) { - var menuEl = document.createElement('menuitem'); - var elementID = IDPrefix + IDSuffix; - menuEl.setAttribute('id', elementID); - menuEl.setAttribute('label', - Zutilo._bundle.GetStringFromName('zutilo.ffcacm.' + IDSuffix)); - menuEl.addEventListener('command', command, false); - parentElement.insertBefore(menuEl, nextElement); - ZutiloChrome.XULRootElements.push(elementID); -} - -function refreshContentAreaContextMenu() { - var showMenuSeparator = false; - - for (var index = 0; index < Zutilo.ffcacmFunctions.length; index++) { - var prefVal = Zutilo.Prefs.get( - Zutilo.ffcacmFunctions[index].name + 'Appearance'); - - var ffcacmMenuItem = document.getElementById( - 'zutilo-ffcacm-' + Zutilo.ffcacmFunctions[index].name); - var zoteroMenuItem = document.getElementById( - 'zutilo-ffcacm-zoterosubmenu-' + - Zutilo.ffcacmFunctions[index].name); - - var doNotShow = false; - if (Zutilo.ffcacmFunctions[index].condition == 'onLink') { - if (!window.gContextMenu.onLink) { - doNotShow = true; - } - } - - if (prefVal == 'Firefox') { - zoteroMenuItem.hidden = true; - ffcacmMenuItem.hidden = doNotShow; - } else if (prefVal == 'Zotero') { - ffcacmMenuItem.hidden = true; - zoteroMenuItem.hidden = doNotShow; - if (!doNotShow) { - showMenuSeparator = true; - } - } else { - zoteroMenuItem.hidden = true; - ffcacmMenuItem.hidden = true; - } - } - - var menuSeparator = - document.getElementById('zutilo-ffcacm-zoterosubmenu-separator'); - if (showMenuSeparator) { - menuSeparator.hidden = false; - } else { - menuSeparator.hidden = true; - } -} - -function cleanupFFCACM() { - var FFContAreaContMenu = document. - getElementById('contentAreaContextMenu'); - FFContAreaContMenu.removeEventListener('popupshowing', - ZutiloChrome.firefoxOverlay.refreshContentAreaContextMenu, false); -} - - -/**************************************************************************/ -// Status bar icon functions -/**************************************************************************/ -function getStatusPopup() { - var statusPopupEl = [] - var oldElement = document. - getElementById('zotero-status-image-context'); - // For version > 4.0.26.1 - if (oldElement) { - statusPopupEl.push(oldElement) - } else { - for (let buttonID of ['zotero-toolbar-save-button', - 'zotero-toolbar-save-button-single']) { - let statusButton = document.getElementById(buttonID) - if (statusButton) { - statusPopupEl.push(statusButton.children[0]) - } - } - } - - return statusPopupEl -} - -function setupStatusPopup() { - var statusPopupEl = getStatusPopup() - for (let menupopup of statusPopupEl) { - menupopup.addEventListener('popupshowing', statusPopupListener, false) - } - - if (statusPopupEl) { - ZutiloChrome.firefoxOverlay.cleanupQueue.push(cleanupStatusPopup) - } -} -ZutiloChrome.firefoxOverlay.setupStatusPopup = setupStatusPopup - -function cleanupStatusPopup() { - var statusPopupEl = getStatusPopup() - if (statusPopupEl) { - for (let menupopup of statusPopupEl) { - menupopup.removeEventListener('popupshowing', - statusPopupListener, false) - } - } -} - -function statusPopupListener(e) { - if (!Zutilo.Prefs.get('showStatusPopupItems')) { - return - } - - var popup = e.target; - - // Get array of relevant status popup entries that correspond to normal - // translators which might download attachment items. - var translatorEntries = [] - for (let entry of popup.children) { - if (entry.tagName == 'menuseparator') { - break - } else { - translatorEntries.push(entry) - } - } - - // Ignore the last two entries before the first menuseparator because they - // are generic web page translators. - translatorEntries.splice(translatorEntries.length - 2, 2) - if (translatorEntries.length === 0) { - return - } - - // Add menu separator and new entries - var menuSep = document.createElement('menuseparator'); - menuSep.setAttribute('id', 'zutilo-zoterostatuspopup-menusep'); - popup.appendChild(menuSep); - - // New entries should have callbacks that call doCommand on existing - // entries and watch isScraping to change associated files preference - for (let entry of translatorEntries) { - addStatusEntry(popup, entry) - } -} - -function addStatusEntry(popup, entry) { - var labelEnd - var strRoot = 'zutilo.pagescrape.statusPopup.' - if (Zotero.Prefs.get('downloadAssociatedFiles')) { - labelEnd = ' ' + Zutilo._bundle. - GetStringFromName(strRoot + 'noAttachments') - } else { - labelEnd = ' ' + Zutilo._bundle. - GetStringFromName(strRoot + 'withAttachments') - } - - var menuitem = document.createElement('menuitem') - var label = entry.label + labelEnd - menuitem.setAttribute('label', label) - menuitem.setAttribute('class', 'menuitem-iconic') - - menuitem.addEventListener('command', - function(e) { - // Must stop propagation to prevent Zotero - // from also saving item with its default - // behavior - e.stopPropagation() - scrapeThisPage('opposite', entry)}, - false); - popup.appendChild(menuitem); -} - -function scrapeThisPage(filesBehavior, entry) { - // Don't allow simultaneous scraping - if (Zotero_Browser.isScraping) { - let strRoot = 'zutilo.pagescrape.multipleExecution.' - Services.prompt.alert(null, - Zutilo._bundle. - GetStringFromName(strRoot + 'title'), - Zutilo._bundle. - GetStringFromName(strRoot + 'body')) - return - } - - // Default to default translator - if (typeof entry === 'undefined') { - entry = document.getElementById('zotero-toolbar-save-button') - } - - // Flip associated files pref - let filesBool = Zotero.Prefs.get('downloadAssociatedFiles') - if (filesBehavior == 'with') { - Zotero.Prefs.set('downloadAssociatedFiles', true) - } else if (filesBehavior == 'without') { - Zotero.Prefs.set('downloadAssociatedFiles', false) - } else { - // opposite - Zotero.Prefs.set('downloadAssociatedFiles', !filesBool) - } - - // Define clean up actions to restore previous state after scraping - function cleanupScraping() { - Zotero.Prefs.set('downloadAssociatedFiles', filesBool) - Zotero_Browser.unwatch('isScraping') - ZutiloChrome.firefoxOverlay.isScraping = false - window.clearTimeout(ZutiloChrome.firefoxOverlay.scrapeTimeout) - } - - // Watch for end of scraping so that clean up can be done - Zotero_Browser.watch('isScraping', function(id, oldval, newval) { - if (newval === false) { - cleanupScraping() - } - }) - - // Set timer to clean up if watch never triggers (due to some failure) - ZutiloChrome.firefoxOverlay.scrapeTimeout = - window.setTimeout(cleanupScraping, 60000) - - // Start translation - ZutiloChrome.firefoxOverlay.isScraping = true - entry.doCommand() -} diff --git a/addon/chrome/content/zutilo/keys.js b/addon/chrome/content/zutilo/keys.js index c18dd1e..b1e60d6 100644 --- a/addon/chrome/content/zutilo/keys.js +++ b/addon/chrome/content/zutilo/keys.js @@ -353,67 +353,6 @@ keys.shortcuts.toggleZoteroItemPaneStickySplitter = function(win) { 'toggle', true) }; -/********************************************/ -// Firefox only shortcuts -/********************************************/ -if (Zutilo.appName == 'Firefox') { - - /********************************************/ - // Zutilo's Firefox scraping functions - /********************************************/ - keys.categories.attachPage = 'attachments' - keys.shortcuts.attachPage = function(win) { - win.ZutiloChrome.firefoxOverlay.attachURLToCurrentItem( - win.content.location.href) - }; - - keys.categories.saveItemZutilo = 'itemcreation' - keys.shortcuts.saveItemZutilo = function(win) { - win.ZutiloChrome.firefoxOverlay.scrapeThisPage('opposite') - }; - - keys.categories.saveItemWithAttachments = 'itemcreation' - keys.shortcuts.saveItemWithAttachments = function(win) { - win.ZutiloChrome.firefoxOverlay.scrapeThisPage('with') - }; - - keys.categories.saveItemWithoutAttachments = 'itemcreation' - keys.shortcuts.saveItemWithoutAttachments = function(win) { - win.ZutiloChrome.firefoxOverlay.scrapeThisPage('without') - }; - - /***********************************************/ - // Zotero functions (i.e. not Zutilo functions) - /***********************************************/ - keys.categories.toggleZotero = 'uinavigation' - keys.shortcuts.toggleZotero = function(win) { - win.ZoteroOverlay.toggleDisplay() - }; - - keys.categories.focusZotero = 'uinavigation' - keys.shortcuts.focusZotero = function(win) { - win.ZoteroOverlay.toggleDisplay(true) - }; - - keys.categories.hideZotero = 'uinavigation' - keys.shortcuts.hideZotero = function(win) { - win.ZoteroOverlay.toggleDisplay(false) - }; - - keys.categories.saveItemZotero = 'itemcreation' - keys.shortcuts.saveItemZotero = function(win) { - // jscs: disable requireCamelCaseOrUpperCaseIdentifiers - win.Zotero_Browser.scrapeThisPage() - // jscs: enable requireCamelCaseOrUpperCaseIdentifiers - }; - - keys.categories.websiteItem = 'itemcreation' - keys.shortcuts.websiteItem = function(win) { - win.ZoteroPane.addItemFromPage() - }; - -} - AddonManager.getAddonByID('better-bibtex@iris-advies.com', function(aAddon) { if (aAddon === null || !aAddon.isActive) { return diff --git a/addon/chrome/content/zutilo/preferences.js b/addon/chrome/content/zutilo/preferences.js index 469b305..3853dd5 100644 --- a/addon/chrome/content/zutilo/preferences.js +++ b/addon/chrome/content/zutilo/preferences.js @@ -10,18 +10,6 @@ Components.utils.import('chrome://zutilo/content/zutilo.js'); // eslint-disable-next-line no-unused-vars function initializePrefWindow() { - if (Zutilo.appName == 'Firefox') { - // Hide Zotero Standalone specific preference window elements - document.getElementById('general-standalone-label'). - setAttribute('hidden', true); - } else { - // Hide Firefox specific preference window elements - document.getElementById('general-checkbox-zoteroNotActive'). - setAttribute('hidden', true); - document.getElementById('zutilo-prefpane-ui-browser-menus'). - setAttribute('hidden', true); - } - keyconfigOnLoad(); } diff --git a/addon/chrome/content/zutilo/preferences.xul b/addon/chrome/content/zutilo/preferences.xul index db55b5c..1721557 100644 --- a/addon/chrome/content/zutilo/preferences.xul +++ b/addon/chrome/content/zutilo/preferences.xul @@ -15,21 +15,7 @@ title="&zutilo.preferences.title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="initializePrefWindow();"> - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -202,15 +103,11 @@