commit a663966c4f3cd1bc0ca34e99f9adadf2ed2ceeaa
parent 6305e4cadad8f8d65193491763d9d06bb0db47e6
Author: Simon Kornblith <simon@simonster.com>
Date: Fri, 28 Jul 2006 04:09:40 +0000
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.
Diffstat:
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git 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