Skip to content

Commit

Permalink
correct linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ml1nk committed Mar 4, 2018
1 parent edfb55b commit 3a80675
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 29 deletions.
21 changes: 12 additions & 9 deletions js/jquery.terminal-1.12.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
* licensed under 3 clause BSD license
*
* Date: Sun, 04 Mar 2018 02:41:15 +0000
* Date: Sun, 04 Mar 2018 02:47:13 +0000
*/

/* TODO:
Expand Down Expand Up @@ -2592,7 +2592,7 @@
self.data('cmd', self);
if (!('KeyboardEvent' in window && 'key' in window.KeyboardEvent.prototype)) {
setTimeout(function() {
throw new Error('key event property not supported try https://github.'+
throw new Error('key event property not supported try https://github.' +
'com/inexorabletash/polyfill/blob/master/keyboard.js');
}, 0);
}
Expand Down Expand Up @@ -2860,7 +2860,7 @@
}
$.terminal = {
version: 'DEV',
date: 'Sun, 04 Mar 2018 02:41:15 +0000',
date: 'Sun, 04 Mar 2018 02:47:13 +0000',
// colors from http://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -3144,22 +3144,25 @@
// => first line gets ignored
// Fix: we add a character if necessary and remove it later
var addchar = false;
if(
line[line.length-1] === "]" &&
i<array.length-1 &&
array[i+1][0] !== "[" // differentiate ]\n[ from ]\n]
if (
line[line.length - 1] === "]" &&
i < array.length - 1 &&
array[i + 1][0] !== "[" // differentiate ]\n[ from ]\n]
)
{
addchar = true;
}

var line_length = line.length;

$.terminal.iterate_formatting(addchar ? line + " " : line, function(data) {
$.terminal.iterate_formatting(addchar ? line + " " : line,
function(data) {
// we don't iterate over last closing bracket
var last_bracket = data.index === line_length - 2 &&
line[data.index + 1] === ']';
var last_iteraction = data.index === line_length - (addchar ? 0 : 1) || last_bracket;
var last_iteraction =
data.index === line_length - (addchar ? 0 : 1) ||
last_bracket;
if (data.length >= length || last_iteraction ||
(data.length === length - 1 &&
strlen(line[data.index + 1]) === 2)) {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-1.12.1.min.js

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -2592,7 +2592,7 @@
self.data('cmd', self);
if (!('KeyboardEvent' in window && 'key' in window.KeyboardEvent.prototype)) {
setTimeout(function() {
throw new Error('key event property not supported try https://github.'+
throw new Error('key event property not supported try https://github.' +
'com/inexorabletash/polyfill/blob/master/keyboard.js');
}, 0);
}
Expand Down Expand Up @@ -3144,22 +3144,25 @@
// => first line gets ignored
// Fix: we add a character if necessary and remove it later
var addchar = false;
if(
line[line.length-1] === "]" &&
i<array.length-1 &&
array[i+1][0] !== "[" // differentiate ]\n[ from ]\n]
if (
line[line.length - 1] === "]" &&
i < array.length - 1 &&
array[i + 1][0] !== "[" // differentiate ]\n[ from ]\n]
)
{
addchar = true;
}

var line_length = line.length;

$.terminal.iterate_formatting(addchar ? line + " " : line, function(data) {
$.terminal.iterate_formatting(addchar ? line + " " : line,
function(data) {
// we don't iterate over last closing bracket
var last_bracket = data.index === line_length - 2 &&
line[data.index + 1] === ']';
var last_iteraction = data.index === line_length - (addchar ? 0 : 1) || last_bracket;
var last_iteraction =
data.index === line_length - (addchar ? 0 : 1) ||
last_bracket;
if (data.length >= length || last_iteraction ||
(data.length === length - 1 &&
strlen(line[data.index + 1]) === 2)) {
Expand Down
21 changes: 12 additions & 9 deletions js/jquery.terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
* licensed under 3 clause BSD license
*
* Date: Sun, 04 Mar 2018 02:41:15 +0000
* Date: Sun, 04 Mar 2018 02:47:13 +0000
*/

/* TODO:
Expand Down Expand Up @@ -2592,7 +2592,7 @@
self.data('cmd', self);
if (!('KeyboardEvent' in window && 'key' in window.KeyboardEvent.prototype)) {
setTimeout(function() {
throw new Error('key event property not supported try https://github.'+
throw new Error('key event property not supported try https://github.' +
'com/inexorabletash/polyfill/blob/master/keyboard.js');
}, 0);
}
Expand Down Expand Up @@ -2860,7 +2860,7 @@
}
$.terminal = {
version: 'DEV',
date: 'Sun, 04 Mar 2018 02:41:15 +0000',
date: 'Sun, 04 Mar 2018 02:47:13 +0000',
// colors from http://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -3144,22 +3144,25 @@
// => first line gets ignored
// Fix: we add a character if necessary and remove it later
var addchar = false;
if(
line[line.length-1] === "]" &&
i<array.length-1 &&
array[i+1][0] !== "[" // differentiate ]\n[ from ]\n]
if (
line[line.length - 1] === "]" &&
i < array.length - 1 &&
array[i + 1][0] !== "[" // differentiate ]\n[ from ]\n]
)
{
addchar = true;
}

var line_length = line.length;

$.terminal.iterate_formatting(addchar ? line + " " : line, function(data) {
$.terminal.iterate_formatting(addchar ? line + " " : line,
function(data) {
// we don't iterate over last closing bracket
var last_bracket = data.index === line_length - 2 &&
line[data.index + 1] === ']';
var last_iteraction = data.index === line_length - (addchar ? 0 : 1) || last_bracket;
var last_iteraction =
data.index === line_length - (addchar ? 0 : 1) ||
last_bracket;
if (data.length >= length || last_iteraction ||
(data.length === length - 1 &&
strlen(line[data.index + 1]) === 2)) {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

0 comments on commit 3a80675

Please sign in to comment.