From 4d870598726adfc4203b6342b2691fcf2d5ed25f Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sun, 3 Jun 2018 18:03:23 +0800 Subject: [PATCH] remove unneeded virtual_input We have already introduced a virtual textarea for every platform. This one seems redundant. However, some features may still not work perfectly on a mobile browser --- butterfly/static/ext.js | 88 ++++---------------------------- butterfly/static/ext.min.js | 2 +- butterfly/static/main.js | 6 +++ butterfly/static/main.min.js | 4 +- coffees/ext/virtual_input.coffee | 80 ----------------------------- coffees/term.coffee | 2 + 6 files changed, 21 insertions(+), 161 deletions(-) delete mode 100644 coffees/ext/virtual_input.coffee diff --git a/butterfly/static/ext.js b/butterfly/static/ext.js index 1e69c11..9cc98e2 100644 --- a/butterfly/static/ext.js +++ b/butterfly/static/ext.js @@ -1,5 +1,5 @@ (function() { - var Popup, Selection, _set_theme_href, _theme, alt, cancel, clean_ansi, copy, ctrl, escape, first, histSize, linkify, maybePack, nextLeaf, packSize, popup, previousLeaf, selection, setAlarm, tags, tid, virtualInput, walk, + var Popup, Selection, _set_theme_href, _theme, cancel, clean_ansi, copy, escape, histSize, linkify, maybePack, nextLeaf, packSize, popup, previousLeaf, selection, setAlarm, tags, tid, walk, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; clean_ansi = function(data) { @@ -121,14 +121,14 @@ }); addEventListener('copy', copy = function(e) { - var data, end, j, len1, line, ref, sel; + var data, end, j, len, line, ref, sel; document.getElementsByTagName('body')[0].contentEditable = false; butterfly.bell("copied"); e.clipboardData.clearData(); sel = getSelection().toString().replace(/\u00A0/g, ' ').replace(/\u2007/g, ' '); data = ''; ref = sel.split('\n'); - for (j = 0, len1 = ref.length; j < len1; j++) { + for (j = 0, len = ref.length; j < len; j++) { line = ref[j]; if (line.slice(-1) === '\u23CE') { end = ''; @@ -185,10 +185,10 @@ }); walk = function(node, callback) { - var child, j, len1, ref, results; + var child, j, len, ref, results; ref = node.childNodes; results = []; - for (j = 0, len1 = ref.length; j < len1; j++) { + for (j = 0, len = ref.length; j < len; j++) { child = ref[j]; callback.call(child); results.push(walk(child, callback)); @@ -661,7 +661,7 @@ } oReq = new XMLHttpRequest(); oReq.addEventListener('load', function() { - var j, len1, out, ref, response, session; + var j, len, out, ref, response, session; response = JSON.parse(this.responseText); out = '
'; out += '

Session list

'; @@ -670,7 +670,7 @@ } else { out += '