Skip to content

Commit

Permalink
merge with devel
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed May 13, 2018
2 parents 44b4feb + 4fb35d5 commit 5d6f3e8
Show file tree
Hide file tree
Showing 20 changed files with 1,124 additions and 426 deletions.
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
## Next (1.15.0)

### Features
* allow to invoke terminal and cmd methods from extended commands (`[[ terminal::set_prompt(">>> ") ]]`)
* new API method invoke_key that allow to invoke shortcut `terminal.invoke_key('CTRL+L')` will clear the terminal
* shift+backspace now do the same thing as backspace

### Bugs
* fix wider characters in IE (#380)[https://github.com/jcubic/jquery.terminal/issues/380]
* fix issue with number of characters when terminal is added to DOM after creation in IE
* fix scrolling on body in Safari
* fix exception when entering JSON with literal strings (#389)[https://github.com/jcubic/jquery.terminal/issues/389]
* fix orphaned closing bracket on multiline echo (#390)[https://github.com/jcubic/jquery.terminal/issues/390]
* fix whitespace insert after first character after first focus (#391)[https://github.com/jcubic/jquery.terminal/issues/391]
* fix open link when click on url from exception

## 1.14.0

### Features
* pass options to formatters and accept option unixFormattingEscapeBrackets in unix_formatting
(PR by [Marcel Link](https://github.com/ml1nk)
* pass options to formatters and accept option `unixFormattingEscapeBrackets` in `unix_formatting`
(PR by [Marcel Link](https://github.com/ml1nk))
* improve performance of repaint and layout whole page when changing content of the terminal
* use ch unit for wide characters if browser support it (it have wide support then css variables)
* keymap terminal method and allow to set shortcuts on runtime
Expand Down
55 changes: 34 additions & 21 deletions README.md

Large diffs are not rendered by default.

41 changes: 22 additions & 19 deletions contributors
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ var https = require('https');
var path = require('path');
var fs = require('fs');
var argv = require('optimist').argv;
var request = require('request');


function split_equal(array, length) {
var result = [];
var len = array.length;
if (len < length) {
return array;
return [array];
} else if (length < 0) {
throw new Error("split_equal: length can't be negative");
}
Expand All @@ -19,33 +21,27 @@ function split_equal(array, length) {
return result;
}

function get(host, path) {
function get(url, query) {
var options = {
host: host,
path: path,
url: url,
qs: query,
headers: {
'User-Agent': 'Node.js'
}
};
if (argv.auth) {
options.auth = argv.auth;
}
//return;
return new Promise(function(resolve, reject) {
https.get(options, function(res) {
request(options, function(error, res, body) {
if (res.statusCode == 200) {
var output = '';
res.setEncoding('utf8');

res.on('data', function (chunk) {
output += chunk;
});

res.on('end', function() {
resolve(JSON.parse(output));
});
resolve(JSON.parse(body));
} else if (+res.headers['x-ratelimit-remaining'] == 0) {
var date = new Date(+res.headers['x-ratelimit-reset']*1000);
reject('Rate limit util ' + date);
} else {
reject('Error code ' + res.statusCode);
}
});
});
Expand All @@ -56,10 +52,16 @@ if (argv.u && argv.r) {
var user = argv.u;
var repo = argv.r;
var path = '/repos/' + user + '/' + repo + '/contributors';
get('api.github.com', path + '?per_page=100').then(function(contributors) {
var query = {
"per_page": 100
};
if (argv.t) {
query['access_token'] = argv.t;
}
get('https://api.github.com' + path, query).then(function(contributors) {
return Promise.all(contributors.map(function(contributor) {
var path = contributor.url.replace(/https:\/\/[^\/]+/, '');
return get('api.github.com', path).then(function(user) {
return get('https://api.github.com' + path, query).then(function(user) {
if (user.name || user.login) {
var object = {
name: user.name || user.login
Expand All @@ -82,8 +84,9 @@ if (argv.u && argv.r) {
}).filter(Boolean));
}).then(function(contributors) {
if (argv.m) {
var align = '| :---: | :---: | :---: | :---: | :---: | :---: | :---: |';
var rows = split_equal(contributors, 7).map(function(list) {
var split = split_equal(contributors, 7);
var align = new Array(split[0].length + 1).join('| :---: ') + ' |';
var rows = split.map(function(list) {
return '| ' + list.map(function(contributor) {
return '[<img src="' + contributor.avatar + '" width="100px;"/>' +
'<br /><sub>' + contributor.name + '</sub>](' +
Expand Down
7 changes: 4 additions & 3 deletions css/jquery.terminal-1.14.0.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 1.14.0
* \/ /____/ version DEV
* http://terminal.jcubic.pl
*
* This file is part of jQuery Terminal.
*
* Copyright (c) 2011-2018 Jakub Jankiewicz <http://jcubic.pl>
* Released under the MIT license
*
* Date: Sat, 24 Mar 2018 16:04:13 +0000
* Date: Sat, 12 May 2018 08:39:20 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd .prompt, .cmd .prompt div, .terminal .terminal-output div div{
Expand Down Expand Up @@ -244,6 +244,7 @@ terminal .terminal-output > div {
}
.terminal .terminal-output div.error, .terminal .terminal-output div.error div {
color: red;
color: var(--error-color, red);
}
.tilda {
position: fixed;
Expand Down Expand Up @@ -281,7 +282,7 @@ terminal .terminal-output > div {
height: 100%;
margin: 1px 0 0;
border: none;
opacity: 0;
opacity: 0.01;
pointer-events: none;
box-sizing: border-box;
}
Expand Down
6 changes: 3 additions & 3 deletions css/jquery.terminal-1.14.0.min.css

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion css/jquery.terminal-src.css
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ terminal .terminal-output > div {
}
.terminal .terminal-output div.error, .terminal .terminal-output div.error div {
color: red;
color: var(--error-color, red);
}
.tilda {
position: fixed;
Expand Down Expand Up @@ -281,7 +282,7 @@ terminal .terminal-output > div {
height: 100%;
margin: 1px 0 0;
border: none;
opacity: 0;
opacity: 0.01;
pointer-events: none;
box-sizing: border-box;
}
Expand Down
7 changes: 4 additions & 3 deletions css/jquery.terminal.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 1.14.0
* \/ /____/ version DEV
* http://terminal.jcubic.pl
*
* This file is part of jQuery Terminal.
*
* Copyright (c) 2011-2018 Jakub Jankiewicz <http://jcubic.pl>
* Released under the MIT license
*
* Date: Sat, 24 Mar 2018 16:04:13 +0000
* Date: Sat, 12 May 2018 08:39:20 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd .prompt, .cmd .prompt div, .terminal .terminal-output div div{
Expand Down Expand Up @@ -244,6 +244,7 @@ terminal .terminal-output > div {
}
.terminal .terminal-output div.error, .terminal .terminal-output div.error div {
color: red;
color: var(--error-color, red);
}
.tilda {
position: fixed;
Expand Down Expand Up @@ -281,7 +282,7 @@ terminal .terminal-output > div {
height: 100%;
margin: 1px 0 0;
border: none;
opacity: 0;
opacity: 0.01;
pointer-events: none;
box-sizing: border-box;
}
Expand Down
6 changes: 3 additions & 3 deletions css/jquery.terminal.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions import.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdn.rawgit.com/jcubic/jquery.terminal/master/js/jquery.terminal.min.js"></script>
<script src="https://cdn.rawgit.com/jcubic/jquery.terminal/devel/js/jquery.terminal.min.js"></script>
<style>
body {
min-height: 100vh;
Expand All @@ -11,7 +11,7 @@
</style>
<script>
(function() {
var url = 'https://cdn.rawgit.com/jcubic/jquery.terminal/master/css/jquery.terminal.min.css';
var url = 'https://cdn.rawgit.com/jcubic/jquery.terminal/devel/css/jquery.terminal.min.css';
var $ = jQuery.noConflict();
$('<link href="' + url + '" rel="stylesheet"/>').appendTo('head');
var importDoc = document.currentScript.ownerDocument;
Expand Down
37 changes: 37 additions & 0 deletions js/jquery.terminal-1.12.1.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 5d6f3e8

Please sign in to comment.