utilizing improved GUI object in CLI
parent
557ed55144
commit
1b4a51ef05
7
main.js
7
main.js
|
@ -8,13 +8,6 @@ chrome.runtime.getBackgroundPage(function(result) {
|
|||
backgroundPage.connectionId = -1;
|
||||
});
|
||||
|
||||
// OS detection
|
||||
var OS = "Unknown";
|
||||
if (navigator.appVersion.indexOf("Win") != -1) OS = "Windows";
|
||||
else if (navigator.appVersion.indexOf("Mac") != -1) OS = "MacOS";
|
||||
else if (navigator.appVersion.indexOf("X11") != -1) OS = "UNIX";
|
||||
else if (navigator.appVersion.indexOf("Linux") != -1) OS = "Linux";
|
||||
|
||||
var timers = new Array();
|
||||
|
||||
function disable_timers() {
|
||||
|
|
|
@ -106,6 +106,7 @@ function send_slowly(out_arr, i, timeout_needle) {
|
|||
MAC only understands CR
|
||||
Linux and Unix only understand LF
|
||||
Windows understands (both) CRLF
|
||||
Chrome OS currenty unknown
|
||||
*/
|
||||
|
||||
var sequence_elements = 0;
|
||||
|
@ -130,12 +131,12 @@ function handle_CLI(data) {
|
|||
if (sequence_elements == 0) {
|
||||
switch (data) {
|
||||
case 10: // line feed
|
||||
if (OS == "Windows" || OS == "Linux" || OS == "UNIX") {
|
||||
if (GUI.operating_system == "Windows" || GUI.operating_system == "Linux" || GUI.operating_system == "UNIX") {
|
||||
$('.tab-cli .window .wrapper').append("<br />");
|
||||
}
|
||||
break;
|
||||
case 13: // carriage return
|
||||
if (OS == "MacOS") {
|
||||
if (GUI.operating_system == "MacOS") {
|
||||
$('.tab-cli .window .wrapper').append("<br />");
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue