diff --git a/butterfly/sass/_layout.sass b/butterfly/sass/_layout.sass index 64458a1..2ba16fa 100644 --- a/butterfly/sass/_layout.sass +++ b/butterfly/sass/_layout.sass @@ -30,5 +30,13 @@ body[data-native-scroll="yes"] #wrapper overflow-y: auto + ::-webkit-scrollbar + background: $bg + width: .5em + height: .5em + + ::-webkit-scrollbar-thumb + background: $fg + .terminal outline: none diff --git a/butterfly/sass/main.sass b/butterfly/sass/main.sass index 4bdd97e..ea5f6c3 100644 --- a/butterfly/sass/main.sass +++ b/butterfly/sass/main.sass @@ -16,10 +16,10 @@ /* along with this program. If not, see . */ @import font -@import layout @import fx @import colors @import 16_colors @import 256_colors +@import layout @import cursor @import term_styles diff --git a/butterfly/static/main.css b/butterfly/static/main.css index 45c6078..1d79ad8 100644 --- a/butterfly/static/main.css +++ b/butterfly/static/main.css @@ -63,36 +63,6 @@ body { font-family: "SourceCodePro"; line-height: 1.2; } -/* *-* coding: utf-8 *-* */ -/* This file is part of butterfly */ -/* butterfly Copyright (C) 2014 Florian Mounier */ -/* This program is free software: you can redistribute it and/or modify */ -/* it under the terms of the GNU General Public License as published by */ -/* the Free Software Foundation, either version 3 of the License, or */ -/* (at your option) any later version. */ -/* This program is distributed in the hope that it will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* GNU General Public License for more details. */ -/* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ -html, body { - height: 100%; - margin: 0; - padding: 0; - line-height: 1.2; } - -#wrapper { - height: 100%; - overflow: hidden; - white-space: nowrap; } - -body[data-native-scroll="yes"] #wrapper { - overflow-y: auto; } - -.terminal { - outline: none; } - /* *-* coding: utf-8 *-* */ /* This file is part of butterfly */ /* butterfly Copyright (C) 2014 Florian Mounier */ @@ -3030,6 +3000,42 @@ body[data-native-scroll="yes"] #wrapper { .fg-color-257.reverse-video { background-color: #f4ead5 !important; } +/* *-* coding: utf-8 *-* */ +/* This file is part of butterfly */ +/* butterfly Copyright (C) 2014 Florian Mounier */ +/* This program is free software: you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation, either version 3 of the License, or */ +/* (at your option) any later version. */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program. If not, see . */ +html, body { + height: 100%; + margin: 0; + padding: 0; + line-height: 1.2; } + +#wrapper { + height: 100%; + overflow: hidden; + white-space: nowrap; } + +body[data-native-scroll="yes"] #wrapper { + overflow-y: auto; } +body[data-native-scroll="yes"] ::-webkit-scrollbar { + background: #110f13; + width: .5em; + height: .5em; } +body[data-native-scroll="yes"] ::-webkit-scrollbar-thumb { + background: #f4ead5; } + +.terminal { + outline: none; } + /* *-* coding: utf-8 *-* */ /* This file is part of butterfly */ /* butterfly Copyright (C) 2014 Florian Mounier */ diff --git a/butterfly/static/main.js b/butterfly/static/main.js index 69da9ff..da16230 100644 --- a/butterfly/static/main.js +++ b/butterfly/static/main.js @@ -1115,13 +1115,14 @@ console.log("HTML escapes are disabled"); break; } - html = "
" + content + "
"; if (this.native_scroll) { - this.next_line(); + html = document.createElement('div'); + html.classList.add('inline-html'); + html.innerHTML = content; this.html[this.y] = html; this.updateRange(this.y); - this.next_line(); } else { + html = "
" + content + "
"; this.screen[this.y + this.ybase][this.x] = [this.curAttr, html]; line = 0; while (line < this.get_html_height_in_lines(html) - 1) { diff --git a/coffees/term.coffee b/coffees/term.coffee index 2308995..a5d49bf 100644 --- a/coffees/term.coffee +++ b/coffees/term.coffee @@ -1069,13 +1069,14 @@ class Terminal console.log "HTML escapes are disabled" break - html = "
" + content + "
" if @native_scroll - @next_line() + html = document.createElement 'div' + html.classList.add 'inline-html' + html.innerHTML = content @html[@y] = html @updateRange @y - @next_line() else + html = "
" + content + "
" @screen[@y + @ybase][@x] = [ @curAttr html