From a663966c4f3cd1bc0ca34e99f9adadf2ed2ceeaa Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 28 Jul 2006 04:09:40 +0000 Subject: [PATCH] closes #2, clipboard export for the moment, this feature is disabled on the mac, since firefox can't handle HTML on the clipboard (and thus we can't copy the fully formatted bibliography). i can re-enable it if it would be useful regardless. --- .../chromeFiles/content/scholar/fileInterface.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/chrome/chromeFiles/content/scholar/fileInterface.js b/chrome/chromeFiles/content/scholar/fileInterface.js index 65a6afe35..09da94680 100644 --- a/chrome/chromeFiles/content/scholar/fileInterface.js +++ b/chrome/chromeFiles/content/scholar/fileInterface.js @@ -143,6 +143,22 @@ Scholar_File_Interface = new function() { fStream.close(); } + } else if(io.output == "copy-to-clipboard") { + // copy to clipboard + var transferable = Components.classes["@mozilla.org/widget/transferable;1"]. + createInstance(Components.interfaces.nsITransferable); + + var str = Components.classes["@mozilla.org/supports-string;1"]. + createInstance(Components.interfaces.nsISupportsString); + str.data = bibliography; + + // add data + transferable.addDataFlavor("text/html"); + transferable.setTransferData("text/html", str, bibliography.length*2); + + var clipboardService = Components.classes["@mozilla.org/widget/clipboard;1"]. + getService(Components.interfaces.nsIClipboard); + clipboardService.setData(transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard); } } } \ No newline at end of file