-
Notifications
You must be signed in to change notification settings - Fork 298
webrepl.html: Automatically resize the terminal to fill the window. #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Is that really how we want it to be done? My idea was to offer a dropbox with couple of standard sizes (like 80x24 or 132x50). |
I think this way is more convenient: no need to select anything. There's nothing else on the page so the room is just wasted otherwise. Users can then resize their browser window to get exactly the terminal size they want. With a drop-down, what if I want something in between the available options? Test it out here: http://micropython.org/webrepl/index2.html |
Currently. What will happen when there's something else? Will it work as expected or we need to just switch it back to fixed size? If the latter, should be apply it in the 1st place? The test page you give has big left, right, bottom margins (I wasn't even sure it expands vertically due to bottom margin). Is it expected? Generally, it's ok, I just wonder how future proof it is. We definitely can apply it and see how it goes. |
Yes the margins are deliberate. It also has a maximum (and minimum) width and height cutoff. All these things are tunable. |
Great, let's merge it. |
It still has a few bugs (can't scroll when window is too small) and I didn't test it on anything but Firefox. BTW, do you want to use jQuery (or similar)? If not we will always be resorting to writing lots of idiomatic JS to do simple things like register event handlers. |
I'd want to stay away from JS as much as possible and hope that somewhere else contributes useful features. There's also recent (?) movement to dump jQuery as big old bloat. I don't know whether the alternative is "idiomatic JS" (yes, I'd prefer that, but I already said I'd prefer not to write JS at all), or some more lightweight lib, I'm not current on JS stuff (I guess I'm definitely against heavy-weight stuff like AngularJS, but again, arguing why it's useful are up to whoever wants to add more functionality to webrepl). |
No one ever is, it changes too fast :) But there are some ok jQuery alternatives that are much more light weight. For now we can get away without using it but in the future might need it. [I hope you appreciate that term.js is already 150k. I minified it down to 54k at micropython.org/webrepl] |
Exactly, why I don't want jquery and other heavy stuff. If going "heavy stuff" way, we'd rather start with a web IDE then and see how integrate webrepl protocol into it. |
#outer { | ||
position: fixed; | ||
} | ||
|
||
/* | ||
.terminal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this section is commented in it would be possible to override the font-size (and the other properties) from the html rather than using the default ones from the terminal.js file (see my pull request). The terminal.js also uses 11px (pixels) as default font size - maybe somehting resolution independant is better? E.g. "14pt", or "small", "medium"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I'm apparently no master in writing github line comments :)
I meant the .terminal section
scaling works ok on safari and chrome (on OSX). Thanks, that's great to have. |
The terminal widget is resized depending on the size of its containing window. The minimum size is 80x24 characters and the maximum is 150x80 (these numbers can be tuned if needed). There is also a small margin on the right side and the bottom.
eadb697
to
e935155
Compare
Ok, I simplified this patch to only do resizing, not centring. Merged and available at http://micropython.org/webrepl/. |
Nice, thanks!
|
Also centres the terminal.