summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-08-15 01:34:13 -0400
committerJules Laplace <jules@okfoc.us>2015-08-15 01:35:01 -0400
commit9dd80f5ce12ab90be1fb341c590d2dbfb651af93 (patch)
tree75673aa2b1bbd262a2fdba964134747b369ef53d /js
parent1cedc0db871443254b63db97e41c86b0848da44a (diff)
remove html import functionality
Diffstat (limited to 'js')
-rw-r--r--js/clipboard.js51
1 files changed, 1 insertions, 50 deletions
diff --git a/js/clipboard.js b/js/clipboard.js
index 41019a2..94a061d 100644
--- a/js/clipboard.js
+++ b/js/clipboard.js
@@ -12,7 +12,6 @@ var clipboard = (function () {
// import_irssi.addEventListener("change", exports.setFormat("irssi"))
// import_mirc.addEventListener("change", exports.setFormat("mirc"))
import_button.addEventListener("click", exports.import_colorcode)
- import_html.addEventListener("click", exports.import_html)
export_button.addEventListener("click", exports.export_data)
save_button.addEventListener("click", exports.save_png)
upload_button.addEventListener("click", exports.upload_png)
@@ -65,10 +64,7 @@ var clipboard = (function () {
types.forEach(function(type, i){
console.log(type)
// this can be text/plain or text/html..
- if (type.match('text/plain') && types.length > 1) {
- return
- }
- else if (type.match('text/')) {
+ if (type.match('text/plain')) {
import_textarea.value = e.clipboardData.getData(type)
}
else {
@@ -78,51 +74,6 @@ var clipboard = (function () {
},
- import_html: function () {
- var alphabet = {}
- toArray("ABCDEFGHIJKLMNOP").forEach(function(c,i){ alphabet[c] = i })
-
- var rapper = document.createElement("div")
- rapper.innerHTML = import_textarea.value
- var y = 0;
- undo.new()
- toArray(rapper.childNodes).forEach(function(span){
- if (span.nodeName !== "SPAN") { return }
- var x = 0;
- var row = canvas.aa[y++]
- if (! row) return
- toArray(span.childNodes).forEach(function(el){
- if (x >= row.length) return;
- var line;
- var colorcode = el.nodeName;
- if (colorcode === "SPAN") {
- colorcode = "F" + css_lookup[el.style.color]
- line = el.innerText || el.textContent
- }
- else if (colorcode === "#text") {
- colorcode = "FA"
- line = el.nodeValue
- }
- else {
- line = el.innerText || el.textContent
- }
- if (colorcode[0] !== "F") { return }
- if (colorcode.length == 2) { colorcode += "BB" }
-
- for (var i = 0; i < line.length; i++, x++) {
- var lex = row[x]
- undo.save_lex(x, y, lex)
- if (! lex) return
- lex.char = line[i]
- lex.fg = alphabet[ colorcode[1] ]
- lex.bg = alphabet[ colorcode[3] ]
- lex.opacity = 1
- lex.build()
- }
- })
- })
- },
-
import_colorcode: function () {
var data = import_textarea.value