diff options
author | Matěj Cepl <mcepl@redhat.com> | 2010-06-21 01:21:23 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2010-06-21 01:21:23 +0200 |
commit | 9c78d98edef12613da157c8cfa366bf937edd422 (patch) | |
tree | 5a6e61a9bca39bcfa71ae48dbe08c8b5c756e81b /lib/clipboard.js | |
parent | 47b6e6fb91372b54bb309e57c14e3f9f987e0322 (diff) | |
download | bugzilla-triage-9c78d98edef12613da157c8cfa366bf937edd422.tar.gz |
Logger works and some cleanup
Juhuuu, logger works (almost, I haven't tested generation of reports yet)
remove all trailing blank space
Diffstat (limited to 'lib/clipboard.js')
-rw-r--r-- | lib/clipboard.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/clipboard.js b/lib/clipboard.js index 0051a55..c601649 100644 --- a/lib/clipboard.js +++ b/lib/clipboard.js @@ -35,7 +35,7 @@ var getMethod = exports.get = function getMethod( flavor ) { if (flavor === undefined) { flavor = "plain"; } - + if (flavor === "plain") { mimeType = "text/unicode"; } else if (favor === "html") { @@ -45,7 +45,7 @@ var getMethod = exports.get = function getMethod( flavor ) { } clip = getClipboard(); - + trans = createTransferable(); trans.addDataFlavor(mimeType); @@ -66,12 +66,12 @@ var getMethod = exports.get = function getMethod( flavor ) { var setMethod = exports.set = function setMethod(content, flavor) { var mimeType = "", stuff = {}; var len = 0, clipId = 0, clip = {}, trans = {}; - + // flavor argument is optional if (flavor === undefined) { flavor = "plain"; } - + if (flavor === "plain") { mimeType = "text/unicode"; } else if (favor === "html") { @@ -80,21 +80,21 @@ var setMethod = exports.set = function setMethod(content, flavor) { throw new Error("Unsupported flavor '" + flavor + "'!"); } - stuff = Cc["@mozilla.org/supports-string;1"]. + stuff = Cc["@mozilla.org/supports-string;1"]. createInstance(Ci.nsISupportsString); if (!stuff) { return false; - } + } stuff.data = content; - len = content.length * 2; + len = content.length * 2; clip = getClipboard(); - + trans = createTransferable(); trans.addDataFlavor(mimeType); trans.setTransferData(mimeType, stuff, content.length * 2); - + clip.setData(trans, null, clip.kGlobalClipboard); return true; }; |