summaryrefslogtreecommitdiffabout
path: root/content
Side-by-side diff
Diffstat (limited to 'content') (more/less context) (ignore whitespace changes)
-rw-r--r--content/generated-content.js4
-rw-r--r--content/generated-content.xul1
2 files changed, 5 insertions, 0 deletions
diff --git a/content/generated-content.js b/content/generated-content.js
index 0ad08bb..f9addd6 100644
--- a/content/generated-content.js
+++ b/content/generated-content.js
@@ -1,17 +1,21 @@
var generated = {
fireflix: null,
data: null,
init: function() {
this.fireflix = window.arguments[0];
this.data = window.arguments[1];
this.databox = document.getElementById('data');
this.databox.value = this.data;
this.databox.select();
},
copy: function() {
var ch = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper);
ch.copyString(this.data);
+ },
+ nolf: function() {
+ this.databox.value = this.data.replace(/[\r\n]/,'');
+ document.getElementById('nolf').disabled = true;
}
};
diff --git a/content/generated-content.xul b/content/generated-content.xul
index 2a91efa..fd508c2 100644
--- a/content/generated-content.xul
+++ b/content/generated-content.xul
@@ -1,20 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xsml-stylesheet href="fireflix.css" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://fireflix/locale/fireflix.dtd">
<dialog
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="generated_content"
buttons="accept"
defaultbutton="accept"
title="&generated.title;"
onload="generated.init()"
>
<script src="generated-content.js" type="application/x-javascript"/>
<vbox class="generated wholething" flex="1">
<textbox flex="1" minheight="300" minwidth="300" id="data" multiline="true" readonly="true" />
+ <button id="nolf" label="&generated.nolf;" oncommand="generated.nolf()" />
<button id="copy" label="&generated.copy;" oncommand="generated.copy()" />
</vbox>
</dialog>