mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-06-05 20:09:42 +00:00
Interesting Fixes
This commit is contained in:
@@ -22,7 +22,7 @@ html, body
|
||||
color: $fg
|
||||
|
||||
body
|
||||
margin-bottom: .5em
|
||||
padding-bottom: .5em
|
||||
white-space: nowrap
|
||||
overflow-x: hidden
|
||||
overflow-y: scroll
|
||||
|
||||
@@ -258,6 +258,14 @@
|
||||
return maybePack();
|
||||
});
|
||||
|
||||
Terminal.on('clear', function() {
|
||||
var hist, newHist;
|
||||
newHist = document.createElement('div');
|
||||
newHist.id = 'packed';
|
||||
hist = document.getElementById('packed');
|
||||
return butterfly.body.replaceChild(newHist, hist);
|
||||
});
|
||||
|
||||
Popup = (function() {
|
||||
function Popup() {
|
||||
this.el = document.getElementById('popup');
|
||||
|
||||
2
butterfly/static/ext.min.js
vendored
2
butterfly/static/ext.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -2804,7 +2804,7 @@ html, body {
|
||||
color: #f4ead5; }
|
||||
|
||||
body {
|
||||
margin-bottom: .5em;
|
||||
padding-bottom: .5em;
|
||||
white-space: nowrap;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
this.prefix = "";
|
||||
this.screen = [];
|
||||
this.shift = 0;
|
||||
for (row = k = 0, ref = this.rows; 0 <= ref ? k <= ref : k >= ref; row = 0 <= ref ? ++k : --k) {
|
||||
for (row = k = 0, ref = this.rows - 1; 0 <= ref ? k <= ref : k >= ref; row = 0 <= ref ? ++k : --k) {
|
||||
this.screen.push(this.blankLine(false, false));
|
||||
}
|
||||
this.setupStops();
|
||||
@@ -692,7 +692,11 @@
|
||||
div.classList.add('extended');
|
||||
}
|
||||
div.innerHTML = (this.lineToDom(y, line, active)).join('');
|
||||
results.push(this.active = div);
|
||||
if (active) {
|
||||
this.active = div;
|
||||
this.cursor = div.querySelectorAll('.cursor')[0];
|
||||
}
|
||||
results.push(div);
|
||||
} else {
|
||||
results.push(void 0);
|
||||
}
|
||||
@@ -727,8 +731,13 @@
|
||||
if (force == null) {
|
||||
force = false;
|
||||
}
|
||||
if ((ref = this.active) != null) {
|
||||
ref.classList.remove('active');
|
||||
if (this.active != null) {
|
||||
this.active.classList.remove('active');
|
||||
}
|
||||
if (this.cursor) {
|
||||
if ((ref = this.cursor.parentNode) != null) {
|
||||
ref.replaceChild(this.document.createTextNode(this.cursor.textContent), this.cursor);
|
||||
}
|
||||
}
|
||||
dom = this.screenToDom(force);
|
||||
this.writeDom(dom);
|
||||
@@ -737,16 +746,14 @@
|
||||
};
|
||||
|
||||
Terminal.prototype._cursorBlink = function() {
|
||||
var cursor;
|
||||
this.cursorState ^= 1;
|
||||
cursor = this.term.querySelector(".cursor");
|
||||
if (!cursor) {
|
||||
if (!this.cursor) {
|
||||
return;
|
||||
}
|
||||
if (cursor.classList.contains("reverse-video")) {
|
||||
return cursor.classList.remove("reverse-video");
|
||||
if (this.cursor.classList.contains("reverse-video")) {
|
||||
return this.cursor.classList.remove("reverse-video");
|
||||
} else {
|
||||
return cursor.classList.add("reverse-video");
|
||||
return this.cursor.classList.add("reverse-video");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1787,6 +1794,9 @@
|
||||
if (this.y >= this.rows) {
|
||||
this.y = this.rows - 1;
|
||||
}
|
||||
if (this.y < 0) {
|
||||
this.y = 0;
|
||||
}
|
||||
if (this.x >= this.cols) {
|
||||
this.x = this.cols - 1;
|
||||
}
|
||||
@@ -1946,12 +1956,10 @@
|
||||
};
|
||||
|
||||
Terminal.prototype.clearScrollback = function() {
|
||||
var results;
|
||||
results = [];
|
||||
while (this.term.childElementCount > this.rows) {
|
||||
results.push(this.term.firstChild.remove());
|
||||
this.term.firstChild.remove();
|
||||
}
|
||||
return results;
|
||||
return this.emit('clear');
|
||||
};
|
||||
|
||||
Terminal.prototype.tabSet = function() {
|
||||
|
||||
4
butterfly/static/main.min.js
vendored
4
butterfly/static/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -21,3 +21,9 @@ maybePack = ->
|
||||
Terminal.on 'refresh', ->
|
||||
clearTimeout tid if tid
|
||||
maybePack()
|
||||
|
||||
Terminal.on 'clear', ->
|
||||
newHist = document.createElement 'div'
|
||||
newHist.id = 'packed'
|
||||
hist = document.getElementById 'packed'
|
||||
butterfly.body.replaceChild newHist, hist
|
||||
|
||||
@@ -194,7 +194,7 @@ class Terminal
|
||||
@prefix = ""
|
||||
@screen = []
|
||||
@shift = 0
|
||||
for row in [0..@rows]
|
||||
for row in [0..@rows - 1]
|
||||
@screen.push @blankLine(false, false)
|
||||
@setupStops()
|
||||
@skipNextKey = null
|
||||
@@ -513,7 +513,10 @@ class Terminal
|
||||
div.classList.add 'active' if active
|
||||
div.classList.add 'extended' if line.extra
|
||||
div.innerHTML = (@lineToDom y, line, active).join('')
|
||||
@active = div
|
||||
if active
|
||||
@active = div
|
||||
@cursor = div.querySelectorAll('.cursor')[0]
|
||||
div
|
||||
|
||||
writeDom: (dom) ->
|
||||
r = Math.max @term.childElementCount - @rows, 0
|
||||
@@ -533,7 +536,11 @@ class Terminal
|
||||
@screen = @screen.slice -@rows
|
||||
|
||||
refresh: (force=false) ->
|
||||
@active?.classList.remove('active')
|
||||
if @active?
|
||||
@active.classList.remove('active')
|
||||
if @cursor
|
||||
@cursor.parentNode?.replaceChild(
|
||||
@document.createTextNode(@cursor.textContent), @cursor)
|
||||
dom = @screenToDom(force)
|
||||
@writeDom dom
|
||||
@nativeScrollTo()
|
||||
@@ -541,12 +548,11 @@ class Terminal
|
||||
|
||||
_cursorBlink: ->
|
||||
@cursorState ^= 1
|
||||
cursor = @term.querySelector(".cursor")
|
||||
return unless cursor
|
||||
if cursor.classList.contains("reverse-video")
|
||||
cursor.classList.remove "reverse-video"
|
||||
return unless @cursor
|
||||
if @cursor.classList.contains("reverse-video")
|
||||
@cursor.classList.remove "reverse-video"
|
||||
else
|
||||
cursor.classList.add "reverse-video"
|
||||
@cursor.classList.add "reverse-video"
|
||||
|
||||
showCursor: ->
|
||||
unless @cursorState
|
||||
@@ -1598,6 +1604,7 @@ class Terminal
|
||||
|
||||
# make sure the cursor stays on screen
|
||||
@y = @rows - 1 if @y >= @rows
|
||||
@y = 0 if @y < 0
|
||||
@x = @cols - 1 if @x >= @cols
|
||||
@scrollTop = 0
|
||||
@scrollBottom = @rows - 1
|
||||
@@ -1704,6 +1711,7 @@ class Terminal
|
||||
# Drop DOM history
|
||||
while @term.childElementCount > @rows
|
||||
@term.firstChild.remove()
|
||||
@emit 'clear'
|
||||
|
||||
# ESC H Tab Set (HTS is 0x88).
|
||||
tabSet: ->
|
||||
|
||||
Reference in New Issue
Block a user