From 3ab06b6ebce023dd018d88421d348d42e39bb684 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 26 Jun 2013 07:54:54 +0000 Subject: [PATCH 1/6] fix(css) ::selection -> elements::selection --- css/reset.css | 8 +------- css/style.css | 12 ++++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/css/reset.css b/css/reset.css index 3008d4e2..f6003d74 100644 --- a/css/reset.css +++ b/css/reset.css @@ -20,12 +20,6 @@ body { margin: 0; font-size: 1em; line-height: 1.4; } /* ::selection { background: #fe57a1; color: #fff; text-shadow: none; } */ -::-moz-selection{ text-shadow: none; opacity: 0;} -::selection { - text-shadow: none; - opacity: 0; - background-color:white; /* opera */ -} /* ============================================================================= @@ -81,4 +75,4 @@ a:hover, a:active { outline: 0; } a[href]:after { content: " (" attr(href) ")"; } .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */ @page { margin: 0.5cm; } -} \ No newline at end of file +} diff --git a/css/style.css b/css/style.css index 52c66f0e..b83371da 100644 --- a/css/style.css +++ b/css/style.css @@ -31,6 +31,18 @@ body{ background-color:white; } +#fm::-moz-selection, #left>li::-moz-selection, #right>li::-moz-selection, .path::-moz-selection, .fm-header::-moz-selection, +.mini-icon::-moz-selection, .name::-moz-selection, .size::-moz-selection, .owner::-moz-selection, .mode::-moz-selection { + text-shadow: none; opacity: 0; +} + +#fm::selection, #left>li::selection, #right>li::selection, .path::selection, .fm-header::selection, +.mini-icon::selection, .name::selection, .size::selection, .owner::selection, .mode::selection { + text-shadow: none; + opacity: 0; + background-color:white; /* opera */ +} + .path-icon{ position: relative; top: 3px; From 3298add52ae0310a15ef75c7a2f2c6bf2196fb8d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 26 Jun 2013 07:56:08 +0000 Subject: [PATCH 2/6] chore(console) remove poor css --- lib/client/terminal/jq-console/jqconsole.css | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/client/terminal/jq-console/jqconsole.css b/lib/client/terminal/jq-console/jqconsole.css index 32681805..93e90b06 100644 --- a/lib/client/terminal/jq-console/jqconsole.css +++ b/lib/client/terminal/jq-console/jqconsole.css @@ -19,10 +19,7 @@ .error-msg, .log-msg{ background-color: #f5f5f5; display: block; - font: monospace 16px "Droid Sans Mono"; - white-space: pre-wrap; - word-break: normal; - word-wrap: normal; + font: 16px "Droid Sans Mono"; margin: 10px; padding: 10px; background: beige; @@ -36,6 +33,7 @@ padding: 10px; padding-bottom: 10px; } + .jqconsole-cursor { background-color: #999; } From 20d8d3922c8164550305b69741b52ead2f256f3b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 26 Jun 2013 08:05:08 +0000 Subject: [PATCH 3/6] fix(console) remove odd \n --- lib/client/console.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/client/console.js b/lib/client/console.js index c0786fea..f4b90021 100644 --- a/lib/client/console.js +++ b/lib/client/console.js @@ -72,14 +72,26 @@ var CloudCmd, Util, DOM, $; this.log = function(pText){ if (jqconsole) - jqconsole.Write(pText + '\n', 'log-msg'); + jqconsole.Write( addNewLine(pText), 'log-msg'); }; - this.error = function(pText){ + this.error = function(pText){ if (jqconsole) - jqconsole.Write(pText + '\n', 'error-msg'); + jqconsole.Write( addNewLine(pText), 'error-msg'); }; + function addNewLine(pText){ + var lNewLine, n = pText && pText.length; + + if(n && pText[n-1] !== '\n') + lNewLine = '\n'; + else + lNewLine = ''; + + return pText + lNewLine; + } + + function load(pCallBack){ Util.time(Name + ' load'); From 5e4848d31e40ff537d3e518cbad3e895c3e1aec4 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 26 Jun 2013 08:25:49 +0000 Subject: [PATCH 4/6] feature(view) add width --- lib/client/view.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/client/view.js b/lib/client/view.js index 5d1db367..4f1a1e41 100644 --- a/lib/client/view.js +++ b/lib/client/view.js @@ -26,6 +26,8 @@ var CloudCmd, Util, DOM, CloudFunc, $; closeEffect : 'none', autoSize : false, height : window.innerHeight, + width : window.innerWidth/1.75, + helpers : { overlay : { css : { From beb6a0f6039241b076a084d86bee3a6e067f66dc Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 26 Jun 2013 10:01:50 +0000 Subject: [PATCH 5/6] fix(console) focus -> focus, scroll off --- lib/client/console.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/client/console.js b/lib/client/console.js index f4b90021..38254bdf 100644 --- a/lib/client/console.js +++ b/lib/client/console.js @@ -1,4 +1,4 @@ -var CloudCmd, Util, DOM, $; +var CloudCmd, Util, DOM, $, jqconsole; (function(CloudCmd, Util, DOM){ 'use strict'; @@ -6,8 +6,9 @@ var CloudCmd, Util, DOM, $; function ConsoleProto(CloudCmd, Util, DOM){ var Name = 'Console', - jqconsole, + //jqconsole, Element, + MouseBinded, Key = CloudCmd.Key, Images = DOM.Images, Console = this; @@ -61,8 +62,24 @@ var CloudCmd, Util, DOM, $; handler(); } - CloudCmd.View.show(Element, function(){ - jqconsole.$input_source.focus(); + CloudCmd.View.show(Element, function(){ + var l$Console = jqconsole.$console, + l$Input = jqconsole.$input_source, + lFocus = l$Input.focus.bind(l$Input); + + lFocus(); + + if (!MouseBinded) { + MouseBinded = true; + + $(l$Console).unbind('mouseup'); + $(l$Console).mouseup(function(){ + var lTop = l$Console.scrollTop(); + + lFocus(); + l$Console.scrollTop(lTop); + }); + } }); }; From 7303dd0c6215b5b15016b3737fedf1770ba04548 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 26 Jun 2013 11:29:36 +0000 Subject: [PATCH 6/6] feature(console) add ansi colors --- lib/client/console.js | 1 + lib/client/terminal/jq-console/ansi.css | 173 ++++++++++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 lib/client/terminal/jq-console/ansi.css diff --git a/lib/client/console.js b/lib/client/console.js index 38254bdf..06b9b245 100644 --- a/lib/client/console.js +++ b/lib/client/console.js @@ -116,6 +116,7 @@ var CloudCmd, Util, DOM, $, jqconsole; lFiles = [ lDir + 'jqconsole.js', lDir + 'jqconsole.css', + lDir + 'ansi.css', CloudCmd.LIBDIRCLIENT + 'terminal/jquery-terminal/jquery-migrate-1.0.0.js' ]; diff --git a/lib/client/terminal/jq-console/ansi.css b/lib/client/terminal/jq-console/ansi.css new file mode 100644 index 00000000..e84d4794 --- /dev/null +++ b/lib/client/terminal/jq-console/ansi.css @@ -0,0 +1,173 @@ + +.jqconsole-ansi-bold { + /* font-weight: bold; */ +} + +.jqconsole-ansi-lighter { + font-weight: lighter; +} + +.jqconsole-ansi-italic { + font-style: italic; +} + +.jqconsole-ansi-underline { + text-decoration: underline; +} + +@-webkit-keyframes blinker { + from { opacity: 1.0; } + to { opacity: 0.0; } +} + +@-moz-keyframes blinker { + from { opacity: 1.0; } + to { opacity: 0.0; } +} + +@-ms-keyframes blinker { + from { opacity: 1.0; } + to { opacity: 0.0; } +} + +@-o-keyframes blinker { + from { opacity: 1.0; } + to { opacity: 0.0; } +} + +.jqconsole-ansi-blink { + -webkit-animation-name: blinker; + -moz-animation-name: blinker; + -ms-animation-name: blinker; + -o-animation-name: blinker; + -webkit-animation-iteration-count: infinite; + -moz-animation-iteration-count: infinite; + -ms-animation-iteration-count: infinite; + -o-animation-iteration-count: infinite; + -webkit-animation-timing-function: cubic-bezier(1.0,0,0,1.0); + -ms-animation-timing-function: cubic-bezier(1.0,0,0,1.0); + -o-animation-timing-function: cubic-bezier(1.0,0,0,1.0); + -moz-animation-timing-function: cubic-bezier(1.0,0,0,1.0); + -webkit-animation-duration: 1s; + -moz-animation-duration: 1s; + -o-animation-duration: 1s; + -ms-animation-duration: 1s; +} + +.jqconsole-ansi-blink-rapid { + -webkit-animation-name: blinker; + -moz-animation-name: blinker; + -ms-animation-name: blinker; + -o-animation-name: blinker; + -webkit-animation-iteration-count: infinite; + -moz-animation-iteration-count: infinite; + -ms-animation-iteration-count: infinite; + -o-animation-iteration-count: infinite; + -webkit-animation-timing-function: cubic-bezier(1.0,0,0,1.0); + -ms-animation-timing-function: cubic-bezier(1.0,0,0,1.0); + -o-animation-timing-function: cubic-bezier(1.0,0,0,1.0); + -moz-animation-timing-function: cubic-bezier(1.0,0,0,1.0); + -webkit-animation-duration: 0.5s; + -moz-animation-duration: 0.5s; + -o-animation-duration: 0.5s; + -ms-animation-duration: 0.5s; +} + + +.jqconsole-ansi-hidden { + visibility:hidden; +} + +.jqconsole-ansi-line-through { + text-decoration: line-through; +} + +.jqconsole-ansi-fonts-1 { + +} +.jqconsole-ansi-fonts-2 { + +} +.jqconsole-ansi-fonts-3 { + +} +.jqconsole-ansi-fonts-4 { + +} +.jqconsole-ansi-fonts-5 { + +} +.jqconsole-ansi-fonts-6 { + +} +.jqconsole-ansi-fonts-7 { + +} +.jqconsole-ansi-fonts-8 { + +} +.jqconsole-ansi-fonts-9 { + +} + +.jqconsole-ansi-fraktur { + +} + +.jqconsole-ansi-color-black { + color: black; +} +.jqconsole-ansi-color-red { + color: red; +} +.jqconsole-ansi-color-green { + color: #65b04b; +} +.jqconsole-ansi-color-yellow { + color: #fed563; +} +.jqconsole-ansi-color-blue { + color: rgb(49,123,249); +} +.jqconsole-ansi-color-magenta { + color: magenta; +} +.jqconsole-ansi-color-cyan { + color: cyan; +} +.jqconsole-ansi-color-white { + color: white; +} + +.jqconsole-ansi-background-color-black { + background-color: black; +} +.jqconsole-ansi-background-color-red { + background-color: red; +} +.jqconsole-ansi-background-color-green { + background-color: #65b04b; +} +.jqconsole-ansi-background-color-yellow { + background-color: #fed563; +} +.jqconsole-ansi-background-color-blue { + background-color: blue; +} +.jqconsole-ansi-background-color-magenta { + background-color: magenta; +} +.jqconsole-ansi-background-color-cyan { + background-color: cyan; +} +.jqconsole-ansi-background-color-white { + background-color: white; +} + +.jqconsole-ansi-framed { + border: 1px solid; +} +.jqconsole-ansi-overline { + text-decoration: overline; +} +