Skip to content

Commit

Permalink
Improve sub-browser display; add unixkcd command.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromakode committed Apr 1, 2010
1 parent 5060f37 commit fc3214a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion style.css
Expand Up @@ -32,7 +32,8 @@ div#indicators span { background-color:#FFF; color:#000; display:none; }
div#cform { height:1px; left:0; position:absolute; top:0; width:1px; }
img { color:#FFF; font-size:x-small; } /* for broken images */
img.comic { background:white; padding:5px; }
iframe { margin:5px 0; }
iframe { margin:0; border:none; }
div.browser { margin:5px 2px; outline:2px solid gray; }
form#searchform input[type=text] { background-color:#000; border:1px solid #FFF; color:#FFF; font-family:"Courier New",Courier,monospace; width:100px; }
form#searchform input[type=submit] { background-color:#FFF; border:1px solid #000; color:#000; font-family:"Courier New",Courier,monospace; font-size:1em; }
div#credit { position:absolute; bottom:0; color:#FFF; font-size:xx-small; opacity:.25; }
Expand Down
16 changes: 11 additions & 5 deletions xkcd_cli.js
Expand Up @@ -309,11 +309,13 @@ TerminalShell.commands['reddit'] = function(terminal, num) {
TerminalShell.commands['wget'] = TerminalShell.commands['curl'] = function(terminal, dest) {
if (dest) {
terminal.setWorking(true);
var browser = $('<iframe>')
.attr('src', dest).width("100%").height(600)
.one('load', function() {
terminal.setWorking(false);
});
var browser = $('<div>')
.addClass('browser')
.append($('<iframe>')
.attr('src', dest).width("100%").height(600)
.one('load', function() {
terminal.setWorking(false);
}));
terminal.print(browser);
return browser;
} else {
Expand All @@ -337,6 +339,10 @@ TerminalShell.commands['irc'] = function(terminal, nick) {
}
};

TerminalShell.commands['unixkcd'] = function(terminal, nick) {
TerminalShell.commands['curl'](terminal, "http://www.xkcd.com/unixkcd/");
};

TerminalShell.commands['apt-get'] = function(terminal, subcmd) {
if (!this.sudo && (subcmd in {'update':true, 'upgrade':true, 'dist-upgrade':true})) {
terminal.print('E: Unable to lock the administration directory, are you root?');
Expand Down

0 comments on commit fc3214a

Please sign in to comment.