├── .gitignore ├── README.md ├── build.sh ├── chrome.manifest ├── chrome ├── content │ ├── Bridge.cs │ ├── Bridge.exe │ ├── ZoteroQuickLook │ │ └── coq.scpt │ ├── addCitationDialogOverlay.xul │ ├── include.js │ ├── includeDialog.js │ ├── includeQuickFormat.js │ ├── overlay.xul │ ├── quickFormatOverlay.xul │ ├── zoteroquicklook.js │ ├── zoteroquicklook.pl │ ├── zoteroquicklookdialog.js │ └── zoteroquicklookquickformat.js ├── locale │ └── en-US │ │ └── zoteroquicklook.dtd └── skin │ └── default │ └── overlay.css ├── defaults └── preferences │ └── defaults.js ├── install.rdf ├── update-altwindows.rdf └── update.rdf /.gitignore: -------------------------------------------------------------------------------- 1 | builds 2 | github.token -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ZoteroQuickLook 2 | =============== 3 | 4 | This open source project implements QuickLook in Zotero. 5 | 6 | # Status 7 | 8 | This plugin is not currently being actively maintained. It may not work with current or beta versions of Zotero. If someone is interested in taking over maintenance of the plugin, please contact @bwiernik. 9 | 10 | # Installing 11 | 12 | To install ZoteroQuickLook, download the latest version of `zoteroquicklook.zoteroplugin` from the Releases section of this GitHub repo. In **Zotero** (not in Firefox), open Tools -> Add-ons. Then drag the `zoteroquicklook.zoteroplugin` file onto the Zotero Add-ons window. 13 | 14 | ## Installing on Mac 15 | On Mac, ZoteroQuickLook uses macOS's native QuickLook functionality. No additional steps are needed. 16 | 17 | ## Installing on Linux 18 | 19 | On Linux, you must install [Gloobus-Preview](https://launchpad.net/gloobus-preview), a QuickLook-like preview software. On Ubuntu you can do this by running the following commands in terminal: 20 | 21 | ``` 22 | sudo add-apt-repository ppa:gloobus-dev/gloobus-preview 23 | sudo apt-get update 24 | sudo apt-get upgrade 25 | sudo apt-get install gloobus-preview 26 | ``` 27 | 28 | For other distributions and versions the installation might be different. 29 | 30 | If you do not like Gloobus, you can define a custom QuickLook command: 31 | 1. Install the software you want to use for previewing files. The software must be able to take a file name as a command line parameter. 32 | 1. Open the Config Editor in Zotero's Advanced preferences pane. 33 | 1. Search for `extensions.zoteroquicklook.customviewcommand`. Set the value for this config to the full path of the executable that you want to use to show the files. 34 | 35 | ## Installing on Windows 36 | 37 | On Windows, you must first install a QuickLook tool. By default, ZoteroQuickLook is set up to work with [QuickLook](https://github.com/QL-Win/QuickLook/releases). Note that you must install QuickLook using either the `.msi` installer or through the Windows Store. If you use the `.zip` version of QuickLook, you must also set up a custom view command. 38 | 39 | Alternative QuickLook tools for Windows include [Seer](http://1218.io), [WinQuickLook](https://github.com/shibayan/WinQuickLook), and the paid software [MaComfort](https://leonardo.re/macomfort/). In my experience, the default option, QuickLook, is the most stable and powerful and least resource intensive option. You can choose another QuickLook program if you like. The software must be able to take a file name as a command line parameter. 40 | 41 | After installing a QuickLook program, set ZoteroQuickLook to use this program: 42 | 1. Open the Config Editor in Zotero's Advanced preferences pane. 43 | 1. Search for `extensions.zoteroquicklook.customviewcommand`. Set the value for this config to the full path of the executable that you want to use to show the files. 44 | 45 | ### Alternative build for Windows 46 | 47 | Installing the extension on Windows sometimes fails with the error message: "ZoteroQuickLook cannot be installed because Zotero cannot modify the needed file." This is a Windows specific problem caused by the 256 character filename length limitation. This limit is reached during unpacking the xpi archive when installing the extension. Mozilla has fixed the issue by eliminating unpacking of extensions by default and running them directly from the xpi archive. However, this solution does not work for ZoteroQuickLook because on Mac and Linux, the extension uses executable files that need to be unpacked so that they can be run. These files are not used on Windows and there is a parallel version of ZoteroQuickLook that supports running directly from the xpi file. This version is called `zoteroquicklook-windows.xpi` and is available from the Releases section of this GitHub repo. 48 | 49 | You can read more about the problem on [Stack Overflow](http://stackoverflow.com/questions/7872489/addon-cannot-be-installed-by-an-error-of-not-be-able-to-modify-the-needed-file) and the pages linked to from there. 50 | 51 | # Getting support 52 | 53 | Please post any questions or bugs to the Zotero forums. Include "ZoteroQuickLook" in the thread title. Also include the following information: 54 | - Operating system and version (e.g., macOS 10.13.2) 55 | - Zotero version 56 | - ZoteroQuickLook version 57 | - Detailed description of your problem 58 | - A link to a log file (see the next section) 59 | - If on windows, whether loading the alternative Windows build fixes the issue 60 | 61 | ## Log files 62 | 63 | Log file will sometimes be helpful in diagnosing possible issues, so you need to submit a log file when asking for support. 64 | 65 | To create a log file, in Zotero, follow these steps: 66 | 1. Click Help -> Debug Output Logging -> Restart with Logging Enabled…. 67 | 1. After Zotero restarts, click Help -> View Output. 68 | 1. Copy the content of the log that appears and paste it to (gist.github.com). 69 | 1. Click "Create secret gist", then copy paste the URL of the gist to your thread on the Zotero forums. 70 | 71 | The important information is in the beginning of the log. Here are example lines from the beginning of a log file. Make sure that your log file starts with similar lines to ensure that the log is complete. 72 | 73 | ``` 74 | zotero(3): Using data directory /Users/user/Zotero/ 75 | 76 | zotero(3): IPC: Initializing pipe at /Users/user/Zotero/pipes/1376326753918 77 | 78 | zotero(3): Loading in full mode 79 | 80 | zotero(3): Opening database 'zotero' 81 | ``` 82 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Roslyn\csc.exe" /target:winexe /out:./chrome/content/Bridge.exe "./chrome/content/Bridge.cs" 4 | zip -r builds/zoteroquicklook.zoteroplugin chrome defaults install.rdf chrome.manifest -x .* 5 | -------------------------------------------------------------------------------- /chrome.manifest: -------------------------------------------------------------------------------- 1 | content zoteroquicklook chrome/content/ 2 | locale zoteroquicklook en-US chrome/locale/en-US/ 3 | skin zoteroquicklook default chrome/skin/default/ 4 | 5 | overlay chrome://browser/content/browser.xul chrome://zoteroquicklook/content/overlay.xul 6 | overlay chrome://zotero/content/zoteroPane.xul chrome://zoteroquicklook/content/overlay.xul 7 | overlay chrome://zotero/content/integration/addCitationDialog.xul chrome://zoteroquicklook/content/addCitationDialogOverlay.xul 8 | overlay chrome://zotero/content/integration/quickFormat.xul chrome://zoteroquicklook/content/quickFormatOverlay.xul 9 | -------------------------------------------------------------------------------- /chrome/content/Bridge.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.IO.Pipes; 4 | using System.Security.Principal; 5 | using System.Windows.Forms; 6 | 7 | namespace Bridge 8 | { 9 | internal static class Program 10 | { 11 | private static void Main(string[] args) 12 | { 13 | if (args.Length == 0) 14 | { 15 | MessageBox.Show("Usage: Bridge.exe \"\""); 16 | return; 17 | } 18 | 19 | SendMessage(Toggle, args[0]); 20 | } 21 | 22 | private static readonly string PipeName = "QuickLook.App.Pipe." + WindowsIdentity.GetCurrent().User?.Value; 23 | private const string Toggle = "QuickLook.App.PipeMessages.Toggle"; 24 | 25 | private static void SendMessage(string pipeMessage, string path = null) 26 | { 27 | if (path == null) 28 | path = ""; 29 | 30 | try 31 | { 32 | using (var client = new NamedPipeClientStream(".", PipeName, PipeDirection.Out)) 33 | { 34 | client.Connect(1000); 35 | 36 | using (var writer = new StreamWriter(client)) 37 | { 38 | writer.WriteLine($"{pipeMessage}|{path}"); 39 | writer.Flush(); 40 | } 41 | } 42 | } 43 | catch (Exception e) 44 | { 45 | MessageBox.Show("QuickLook cannot be reached. Please run/install QuickLook (http://pooi.moe/QuickLook/) or specify a custom view command instead."); 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /chrome/content/Bridge.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mronkko/ZoteroQuickLook/38c47737ca8a68ce26a8e8ba300b633392e8c137/chrome/content/Bridge.exe -------------------------------------------------------------------------------- /chrome/content/ZoteroQuickLook/coq.scpt: -------------------------------------------------------------------------------- 1 | try 2 | do shell script "PIPE=\"/Users/Shared/.zoteroIntegrationPipe_$LOGNAME\"; if [ ! -e \"$PIPE\" ]; then PIPE='~/.zoteroIntegrationPipe'; fi; if [ -e \"$PIPE\" ]; then echo 'MacWord2008 quickLook '" & quoted form of POSIX path of (path to current application) & " > \"$PIPE\"; else exit 1; fi;" 3 | on error 4 | display alert "Word could not communicate with Zotero. Please ensure that Firefox is open and try again." as critical 5 | end try 6 | -------------------------------------------------------------------------------- /chrome/content/addCitationDialogOverlay.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |