diff --git a/CHANGELOG.md b/CHANGELOG.md index dd0ccca5e..c7eee4890 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ -## 1.6.5 +## 1.7.0 +### Features +* add option caseSensitiveAutocomplete default to true +### Bugs * fix jumping of terminal when created one after another and chaning the that have focus in Edge * fix issue that all terminals was enabled not the last one created -* fix issue that on click next terminal get focused on desktop with touch screen and on mobile (reported by @itsZN) +* fix issue that on click next terminal get focused on browsers with touch screen (reported by @itsZN) * fix missing default keymap in cmd plugin (found on SO by Arnaldo Montoya) * update dterm to enable terminal when is visible (when open) using IntersectionObserver * fix issue with focus on click on MacOS (reported by @RomanPerin) diff --git a/css/jquery.terminal-1.6.4.css b/css/jquery.terminal-1.6.4.css index fed040f3a..f8b5e35f4 100644 --- a/css/jquery.terminal-1.6.4.css +++ b/css/jquery.terminal-1.6.4.css @@ -12,7 +12,7 @@ * Copyright (c) 2011-2017 Jakub Jankiewicz * Released under the MIT license * - * Date: Mon, 04 Sep 2017 07:48:16 +0000 + * Date: Fri, 08 Sep 2017 09:18:15 +0000 */ .terminal .terminal-output .format, .cmd .format, .cmd .prompt, .cmd .prompt div, .terminal .terminal-output div div{ diff --git a/css/jquery.terminal-1.6.4.min.css b/css/jquery.terminal-1.6.4.min.css index ba98d152a..6e5d666e4 100644 --- a/css/jquery.terminal-1.6.4.min.css +++ b/css/jquery.terminal-1.6.4.min.css @@ -12,5 +12,5 @@ * Copyright (c) 2011-2017 Jakub Jankiewicz * Released under the MIT license * - * Date: Mon, 04 Sep 2017 07:48:16 +0000 + * Date: Fri, 08 Sep 2017 09:18:15 +0000 */.cmd .format,.cmd .prompt,.cmd .prompt div,.terminal .terminal-output .format,.terminal .terminal-output div div{display:inline-block}.cmd,.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6,.terminal pre{margin:0}.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6{line-height:1.2em}.cmd .clipboard{position:absolute;left:-16px;top:0;width:20px;height:16px;background:transparent;border:none;color:transparent;outline:none;padding:0;resize:none;z-index:0;overflow:hidden}.terminal .error{color:red}.terminal{position:relative;overflow-y:auto;overflow-x:hidden}.terminal>div{height:100%}.cmd{padding:0;position:relative;float:left}.cmd .inverted,.terminal .inverted{background-color:#aaa;color:#000}.cmd .cursor{border-bottom:3px solid transparent;margin-bottom:-3px;background-clip:content-box}.cmd .cursor.blink{-webkit-animation:a 1s infinite step-start;animation:a 1s infinite step-start;border-left:1px solid transparent;margin-left:-1px}.bar.cmd .inverted,.bar.terminal .inverted{border-left-color:#aaa}.cmd .prompt,.terminal .terminal-output div div{display:block;line-height:14px;height:auto}.cmd .prompt>span{float:left}.cmd,.terminal{font-family:monospace;color:#aaa;background-color:#000;font-size:12px;line-height:14px;box-sizing:border-box}.cmd div{float:left}.cmd div,.cmd div+span{clear:both}.cmd .prompt+div{clear:right}.terminal-output>div{min-height:14px}.terminal-output>div>div *{overflow-wrap:break-word;word-wrap:break-word}.terminal .terminal-output div span{display:inline-block}.cmd>span:not(.prompt){float:left}.cmd .prompt span.line{display:block;float:none}.cmd div,.cmd span,.terminal-output a,.terminal-output span,.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6,.terminal pre,.terminal td{-webkit-touch-callout:initial;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.terminal,.terminal-output,.terminal-output div{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@-moz-document url-prefix(){.terminal,.terminal-output,.terminal-output div{-webkit-touch-callout:initial;-webkit-user-select:initial;-moz-user-select:initial;-ms-user-select:initial;user-select:auto}}.terminal table{border-collapse:collapse}.terminal td{border:1px solid #aaa}.cmd .prompt span::-moz-selection,.cmd>div::-moz-selection,.cmd>div span::-moz-selection,.cmd>span::-moz-selection,.cmd>span span::-moz-selection,.cmd div::-moz-selection,.terminal .terminal-output div div::-moz-selection,.terminal .terminal-output div div a::-moz-selection,.terminal .terminal-output div span::-moz-selection,.terminal h1::-moz-selection,.terminal h2::-moz-selection,.terminal h3::-moz-selection,.terminal h4::-moz-selection,.terminal h5::-moz-selection,.terminal h6::-moz-selection,.terminal pre::-moz-selection,.terminal td::-moz-selection{background-color:#aaa;color:#000}.cmd .prompt span::selection,.cmd>div::selection,.cmd>div span::selection,.cmd>span::selection,.cmd>span span::selection,.cmd div::selection,.terminal .terminal-output div div::selection,.terminal .terminal-output div div a::selection,.terminal .terminal-output div span::selection,.terminal h1::selection,.terminal h2::selection,.terminal h3::selection,.terminal h4::selection,.terminal h5::selection,.terminal h6::selection,.terminal pre::selection,.terminal td::selection{background-color:hsla(0,0%,67%,.99);color:#000}.terminal .terminal-output div.error,.terminal .terminal-output div.error div{color:red}.tilda{position:fixed;top:0;left:0;width:100%;z-index:1}.clear{clear:both}.terminal a{color:#0f60ff}.terminal a:hover{color:red}.terminal .terminal-fill{position:absolute;left:0;top:-100%;width:100%;height:100%;margin:1px 0 0;border:none;opacity:0;pointer-events:none;box-sizing:border-box}.terminal,.terminal .terminal-fill{padding:10px}@-webkit-keyframes a{0%,to{background-color:#000;color:#aaa}50%{background-color:#bbb;color:#000}}@keyframes a{0%,to{background-color:#000;color:#aaa}50%{background-color:#bbb;color:#000}}@-webkit-keyframes terminal-bar{0%,to{border-left-color:#aaa}50%{border-left-color:#000}}@keyframes terminal-bar{0%,to{border-left-color:#aaa}50%{border-left-color:#000}}@-webkit-keyframes terminal-underline{0%,to{border-bottom-color:#aaa;position:relative;line-height:12px;border-left:none}50%{border-bottom-color:#000;position:relative;line-height:12px;border-left:none}}@keyframes terminal-underline{0%,to{border-bottom-color:#aaa;position:relative;line-height:11px;border-left:none}50%{border-bottom-color:#000;position:relative;line-height:11px;border-left:none}}@supports (--css:variables){.cmd,.terminal{color:var(--color,#aaa);background-color:var(--background,#000)}.cmd,.cmd .prompt,.terminal,.terminal .terminal-output div div{font-size:calc(var(--size, 1) * 12px);line-height:calc(var(--size, 1) * 14px)}.cmd .inverted,.terminal .inverted{background-color:var(--color,#aaa);color:var(--background,#000)}.cmd .cursor.blink{-webkit-animation:var(--animation,a) 1s infinite step-start;animation:var(--animation,a) 1s infinite step-start;color:var(--color,#aaa);background-color:var(--background,#000)}.cmd .prompt span::-moz-selection,.cmd>div::-moz-selection,.cmd>div span::-moz-selection,.cmd>span::-moz-selection,.cmd>span span::-moz-selection,.cmd div::-moz-selection,.terminal .terminal-output div div::-moz-selection,.terminal .terminal-output div div a::-moz-selection,.terminal .terminal-output div span::-moz-selection,.terminal h1::-moz-selection,.terminal h2::-moz-selection,.terminal h3::-moz-selection,.terminal h4::-moz-selection,.terminal h5::-moz-selection,.terminal h6::-moz-selection,.terminal pre::-moz-selection,.terminal td::-moz-selection{background-color:var(--color,#aaa);color:var(--background,#000)}.cmd .prompt span::selection,.cmd>div::selection,.cmd>div span::selection,.cmd>span::selection,.cmd>span span::selection,.cmd div::selection,.terminal .terminal-output div div::selection,.terminal .terminal-output div div a::selection,.terminal .terminal-output div span::selection,.terminal h1::selection,.terminal h2::selection,.terminal h3::selection,.terminal h4::selection,.terminal h5::selection,.terminal h6::selection,.terminal pre::selection,.terminal td::selection{background-color:var(--color,hsla(0,0%,67%,.99));color:var(--background,#000)}@-webkit-keyframes a{0%,to{background-color:var(--background,#000);color:var(--color,#aaa)}50%{background-color:var(--color,#aaa);color:var(--background,#000)}}@keyframes a{0%,to{background-color:var(--background,#000);color:var(--color,#aaa)}50%{background-color:var(--color,#aaa);color:var(--background,#000)}}@-webkit-keyframes terminal-bar{0%,to{border-left-color:var(--background,#000)}50%{border-left-color:var(--color,#aaa)}}@keyframes terminal-bar{0%,to{border-left-color:var(--background,#000)}50%{border-left-color:var(--color,#aaa)}}@-webkit-keyframes terminal-underline{0%,to{border-bottom-color:var(--color,#aaa);position:relative;line-height:calc(var(--size, 1) * 12px);border-left:none}50%{border-bottom-color:var(--background,#000);position:relative;line-height:calc(var(--size, 1) * 12px);border-left:none}}@keyframes terminal-underline{0%,to{border-bottom-color:var(--background,#000);position:relative;line-height:calc(var(--size, 1) * 12px);border-left:none}50%{border-bottom-color:var(--color,#aaa);position:relative;line-height:calc(var(--size, 1) * 12px);border-left:none}}} \ No newline at end of file diff --git a/css/jquery.terminal.css b/css/jquery.terminal.css index fed040f3a..f8b5e35f4 100644 --- a/css/jquery.terminal.css +++ b/css/jquery.terminal.css @@ -12,7 +12,7 @@ * Copyright (c) 2011-2017 Jakub Jankiewicz * Released under the MIT license * - * Date: Mon, 04 Sep 2017 07:48:16 +0000 + * Date: Fri, 08 Sep 2017 09:18:15 +0000 */ .terminal .terminal-output .format, .cmd .format, .cmd .prompt, .cmd .prompt div, .terminal .terminal-output div div{ diff --git a/css/jquery.terminal.min.css b/css/jquery.terminal.min.css index ba98d152a..6e5d666e4 100644 --- a/css/jquery.terminal.min.css +++ b/css/jquery.terminal.min.css @@ -12,5 +12,5 @@ * Copyright (c) 2011-2017 Jakub Jankiewicz * Released under the MIT license * - * Date: Mon, 04 Sep 2017 07:48:16 +0000 + * Date: Fri, 08 Sep 2017 09:18:15 +0000 */.cmd .format,.cmd .prompt,.cmd .prompt div,.terminal .terminal-output .format,.terminal .terminal-output div div{display:inline-block}.cmd,.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6,.terminal pre{margin:0}.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6{line-height:1.2em}.cmd .clipboard{position:absolute;left:-16px;top:0;width:20px;height:16px;background:transparent;border:none;color:transparent;outline:none;padding:0;resize:none;z-index:0;overflow:hidden}.terminal .error{color:red}.terminal{position:relative;overflow-y:auto;overflow-x:hidden}.terminal>div{height:100%}.cmd{padding:0;position:relative;float:left}.cmd .inverted,.terminal .inverted{background-color:#aaa;color:#000}.cmd .cursor{border-bottom:3px solid transparent;margin-bottom:-3px;background-clip:content-box}.cmd .cursor.blink{-webkit-animation:a 1s infinite step-start;animation:a 1s infinite step-start;border-left:1px solid transparent;margin-left:-1px}.bar.cmd .inverted,.bar.terminal .inverted{border-left-color:#aaa}.cmd .prompt,.terminal .terminal-output div div{display:block;line-height:14px;height:auto}.cmd .prompt>span{float:left}.cmd,.terminal{font-family:monospace;color:#aaa;background-color:#000;font-size:12px;line-height:14px;box-sizing:border-box}.cmd div{float:left}.cmd div,.cmd div+span{clear:both}.cmd .prompt+div{clear:right}.terminal-output>div{min-height:14px}.terminal-output>div>div *{overflow-wrap:break-word;word-wrap:break-word}.terminal .terminal-output div span{display:inline-block}.cmd>span:not(.prompt){float:left}.cmd .prompt span.line{display:block;float:none}.cmd div,.cmd span,.terminal-output a,.terminal-output span,.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6,.terminal pre,.terminal td{-webkit-touch-callout:initial;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.terminal,.terminal-output,.terminal-output div{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@-moz-document url-prefix(){.terminal,.terminal-output,.terminal-output div{-webkit-touch-callout:initial;-webkit-user-select:initial;-moz-user-select:initial;-ms-user-select:initial;user-select:auto}}.terminal table{border-collapse:collapse}.terminal td{border:1px solid #aaa}.cmd .prompt span::-moz-selection,.cmd>div::-moz-selection,.cmd>div span::-moz-selection,.cmd>span::-moz-selection,.cmd>span span::-moz-selection,.cmd div::-moz-selection,.terminal .terminal-output div div::-moz-selection,.terminal .terminal-output div div a::-moz-selection,.terminal .terminal-output div span::-moz-selection,.terminal h1::-moz-selection,.terminal h2::-moz-selection,.terminal h3::-moz-selection,.terminal h4::-moz-selection,.terminal h5::-moz-selection,.terminal h6::-moz-selection,.terminal pre::-moz-selection,.terminal td::-moz-selection{background-color:#aaa;color:#000}.cmd .prompt span::selection,.cmd>div::selection,.cmd>div span::selection,.cmd>span::selection,.cmd>span span::selection,.cmd div::selection,.terminal .terminal-output div div::selection,.terminal .terminal-output div div a::selection,.terminal .terminal-output div span::selection,.terminal h1::selection,.terminal h2::selection,.terminal h3::selection,.terminal h4::selection,.terminal h5::selection,.terminal h6::selection,.terminal pre::selection,.terminal td::selection{background-color:hsla(0,0%,67%,.99);color:#000}.terminal .terminal-output div.error,.terminal .terminal-output div.error div{color:red}.tilda{position:fixed;top:0;left:0;width:100%;z-index:1}.clear{clear:both}.terminal a{color:#0f60ff}.terminal a:hover{color:red}.terminal .terminal-fill{position:absolute;left:0;top:-100%;width:100%;height:100%;margin:1px 0 0;border:none;opacity:0;pointer-events:none;box-sizing:border-box}.terminal,.terminal .terminal-fill{padding:10px}@-webkit-keyframes a{0%,to{background-color:#000;color:#aaa}50%{background-color:#bbb;color:#000}}@keyframes a{0%,to{background-color:#000;color:#aaa}50%{background-color:#bbb;color:#000}}@-webkit-keyframes terminal-bar{0%,to{border-left-color:#aaa}50%{border-left-color:#000}}@keyframes terminal-bar{0%,to{border-left-color:#aaa}50%{border-left-color:#000}}@-webkit-keyframes terminal-underline{0%,to{border-bottom-color:#aaa;position:relative;line-height:12px;border-left:none}50%{border-bottom-color:#000;position:relative;line-height:12px;border-left:none}}@keyframes terminal-underline{0%,to{border-bottom-color:#aaa;position:relative;line-height:11px;border-left:none}50%{border-bottom-color:#000;position:relative;line-height:11px;border-left:none}}@supports (--css:variables){.cmd,.terminal{color:var(--color,#aaa);background-color:var(--background,#000)}.cmd,.cmd .prompt,.terminal,.terminal .terminal-output div div{font-size:calc(var(--size, 1) * 12px);line-height:calc(var(--size, 1) * 14px)}.cmd .inverted,.terminal .inverted{background-color:var(--color,#aaa);color:var(--background,#000)}.cmd .cursor.blink{-webkit-animation:var(--animation,a) 1s infinite step-start;animation:var(--animation,a) 1s infinite step-start;color:var(--color,#aaa);background-color:var(--background,#000)}.cmd .prompt span::-moz-selection,.cmd>div::-moz-selection,.cmd>div span::-moz-selection,.cmd>span::-moz-selection,.cmd>span span::-moz-selection,.cmd div::-moz-selection,.terminal .terminal-output div div::-moz-selection,.terminal .terminal-output div div a::-moz-selection,.terminal .terminal-output div span::-moz-selection,.terminal h1::-moz-selection,.terminal h2::-moz-selection,.terminal h3::-moz-selection,.terminal h4::-moz-selection,.terminal h5::-moz-selection,.terminal h6::-moz-selection,.terminal pre::-moz-selection,.terminal td::-moz-selection{background-color:var(--color,#aaa);color:var(--background,#000)}.cmd .prompt span::selection,.cmd>div::selection,.cmd>div span::selection,.cmd>span::selection,.cmd>span span::selection,.cmd div::selection,.terminal .terminal-output div div::selection,.terminal .terminal-output div div a::selection,.terminal .terminal-output div span::selection,.terminal h1::selection,.terminal h2::selection,.terminal h3::selection,.terminal h4::selection,.terminal h5::selection,.terminal h6::selection,.terminal pre::selection,.terminal td::selection{background-color:var(--color,hsla(0,0%,67%,.99));color:var(--background,#000)}@-webkit-keyframes a{0%,to{background-color:var(--background,#000);color:var(--color,#aaa)}50%{background-color:var(--color,#aaa);color:var(--background,#000)}}@keyframes a{0%,to{background-color:var(--background,#000);color:var(--color,#aaa)}50%{background-color:var(--color,#aaa);color:var(--background,#000)}}@-webkit-keyframes terminal-bar{0%,to{border-left-color:var(--background,#000)}50%{border-left-color:var(--color,#aaa)}}@keyframes terminal-bar{0%,to{border-left-color:var(--background,#000)}50%{border-left-color:var(--color,#aaa)}}@-webkit-keyframes terminal-underline{0%,to{border-bottom-color:var(--color,#aaa);position:relative;line-height:calc(var(--size, 1) * 12px);border-left:none}50%{border-bottom-color:var(--background,#000);position:relative;line-height:calc(var(--size, 1) * 12px);border-left:none}}@keyframes terminal-underline{0%,to{border-bottom-color:var(--background,#000);position:relative;line-height:calc(var(--size, 1) * 12px);border-left:none}50%{border-bottom-color:var(--color,#aaa);position:relative;line-height:calc(var(--size, 1) * 12px);border-left:none}}} \ No newline at end of file diff --git a/js/jquery.terminal-1.6.4.js b/js/jquery.terminal-1.6.4.js index 36cff5d6a..a5feeb2d4 100644 --- a/js/jquery.terminal-1.6.4.js +++ b/js/jquery.terminal-1.6.4.js @@ -31,7 +31,7 @@ * Copyright (c) 2007-2013 Alexandru Marasteanu * licensed under 3 clause BSD license * - * Date: Tue, 05 Sep 2017 14:13:07 +0000 + * Date: Fri, 08 Sep 2017 09:18:14 +0000 */ /* TODO: @@ -1398,7 +1398,7 @@ function fix_textarea() { // delay worked while experimenting self.oneTime(10, function() { - //clip.val(command); + clip.val(command); if (enabled) { self.oneTime(10, function() { try { @@ -3273,6 +3273,23 @@ } catch (e) {} $div.remove(); } + function all(array, fn) { + var same = array.filter(function(item) { return item[fn]() === item; }); + return same.length === array.length; + } + function string_case(string) { + var array = string.split(''); + if (all(array, 'toLowerCase')) { + return 'lower'; + } else if (all(array, 'toUpperCase')) { + return 'upper'; + } else { + return 'mixed'; + } + } + function same_case(string) { + return string_case(string) !== 'mixed'; + } // ----------------------------------------------------------------------- // :: TERMINAL PLUGIN CODE // ----------------------------------------------------------------------- @@ -3353,6 +3370,7 @@ onAjaxError: null, scrollBottomOffset: 20, wordAutocomplete: true, + caseSensitiveAutocomplete: true, clickTimeout: 200, request: $.noop, response: $.noop, @@ -4518,24 +4536,34 @@ // --------------------------------------------------------------------- // :: return string that are common in all elements of the array // --------------------------------------------------------------------- - function common_string(string, array) { + function common_string(string, array, matchCase) { if (!array.length) { return ''; } var found = false; + var type = string_case(string); + var result = []; loop: for (var j = string.length; j < array[0].length; ++j) { for (var i = 1; i < array.length; ++i) { - if (array[0].charAt(j) !== array[i].charAt(j)) { - break loop; + var a = array[0].charAt(j); + var b = array[i].charAt(j); + if (a !== b) { + if (matchCase || type === 'mixed') { + break loop; + } else if (a.toLowerCase() == b.toLowerCase()) { + if (type === 'lower') { + result.push(a.toLowerCase()); + } else { + result.push(a.toUpperCase()); + } + } + } else { + result.push(a); } } - found = true; } - if (found) { - return array[0].slice(0, j); - } - return ''; + return string + result.join(''); } // --------------------------------------------------------------------- // :: Keydown event handler @@ -4578,7 +4606,12 @@ // TODO: move this to cmd plugin // add completion = array | function // !!! Problem complete more then one key need terminal - var top = interpreters.top(), completion; + var top = interpreters.top(), completion, caseSensitive; + if (typeof top.caseSensitiveAutocomplete !== 'undefined') { + caseSensitive = top.caseSensitiveAutocomplete; + } else { + caseSensitive = settings.caseSensitiveAutocomplete; + } if (settings.completion && $.type(settings.completion) !== 'boolean' && top.completion === undefined) { @@ -4602,7 +4635,8 @@ self.complete(commands, { echo: true, word: settings.wordAutocomplete, - escape: settings.completionEscape + escape: settings.completionEscape, + caseSensitive: caseSensitive }); }); break; @@ -4610,7 +4644,8 @@ self.complete(completion, { echo: true, word: settings.wordAutocomplete, - escape: settings.completionEscape + escape: settings.completionEscape, + caseSensitive: caseSensitive }); break; default: @@ -5085,7 +5120,8 @@ } }); } - var regex = new RegExp('^' + safe); + var flags = options.caseSensitive ? '' : 'i'; + var regex = new RegExp('^' + safe, flags); var matched = []; for (var i = commands.length; i--;) { if (regex.test(commands[i])) { @@ -5096,6 +5132,14 @@ if (!quote && options.escape) { match = match.replace(/(["'() ])/g, '\\$1'); } + if (!options.caseSensitive && same_case(match)) { + console.log(match); + if (string.toLowerCase() === string) { + match = match.toLowerCase(); + } else if (string.toUpperCase() === string) { + match = match.toUpperCase(); + } + } matched.push(match); } } @@ -5129,7 +5173,7 @@ return true; } } else { - var common = common_string(string, matched); + var common = common_string(string, matched, options.caseSensitive); if (common) { replace(string, common); command = self.before_cursor(options.word); diff --git a/js/jquery.terminal-1.6.4.min.js b/js/jquery.terminal-1.6.4.min.js index f8f648e6c..469b57d2f 100644 --- a/js/jquery.terminal-1.6.4.min.js +++ b/js/jquery.terminal-1.6.4.min.js @@ -31,6 +31,6 @@ * Copyright (c) 2007-2013 Alexandru Marasteanu * licensed under 3 clause BSD license * - * Date: Tue, 05 Sep 2017 14:13:07 +0000 + * Date: Fri, 08 Sep 2017 09:18:14 +0000 */ -(function(e){var n=function(){if(!n.cache.hasOwnProperty(arguments[0])){n.cache[arguments[0]]=n.parse(arguments[0])}return n.format.call(null,n.cache[arguments[0]],arguments)};n.format=function(e,t){var o=1,a=e.length,s="",l,f=[],c,u,p,m,d,h;for(c=0;c>>0;break;case"x":l=l.toString(16);break;case"X":l=l.toString(16).toUpperCase();break}l=/[def]/.test(p[8])&&p[3]&&l>=0?" +"+l:l;d=p[4]?p[4]==="0"?"0":p[4].charAt(1):" ";h=p[6]-String(l).length;m=p[6]?i(d,h):"";f.push(p[5]?l+m:m+l)}}return f.join("")};n.cache={};n.parse=function(e){var n=e,t=[],r=[],i=0;while(n){if((t=/^[^\x25]+/.exec(n))!==null){r.push(t[0])}else if((t=/^\x25{2}/.exec(n))!==null){r.push("%")}else if((t=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n))!==null){if(t[2]){i|=1;var o=[],a=t[2],s=[];if((s=/^([a-z_][a-z_\d]*)/i.exec(a))!==null){o.push(s[1]);while((a=a.substring(s[0].length))!==""){if((s=/^\.([a-z_][a-z_\d]*)/i.exec(a))!==null){o.push(s[1])}else if((s=/^\[(\d+)\]/.exec(a))!==null){o.push(s[1])}else{throw"[sprintf] huh?"}}}else{throw"[sprintf] huh?"}t[2]=o}else{i|=2}if(i===3){throw"[sprintf] mixing positional and named placeholders is not (yet) supported"}r.push(t)}else{throw"[sprintf] huh?"}n=n.substring(t[0].length)}return r};var t=function(e,t,r){r=t.slice(0);r.splice(0,0,e);return n.apply(null,r)};function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(e,n){for(var t=[];n>0;t[--n]=e){}return t.join("")}e.sprintf=n;e.vsprintf=t})(typeof global!=="undefined"?global:window);(function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else if(typeof module==="object"&&module.exports){module.exports=function(n,t){if(t===undefined){if(typeof window!=="undefined"){t=require("jquery")}else{t=require("jquery")(n)}}e(t);return t}}else{e(jQuery)}})(function(e,n){"use strict";function t(){var n=e.Callbacks();var t=false;this.resolve=function(){n.fire();t=true};this.add=function(e){if(t){e()}else{n.add(e)}}}e.omap=function(n,t){var r={};e.each(n,function(e,i){r[e]=t.call(n,e,i)});return r};var r={clone_object:function(n){var t={};if(typeof n==="object"){if(e.isArray(n)){return this.clone_array(n)}else if(n===null){return n}else{for(var r in n){if(e.isArray(n[r])){t[r]=this.clone_array(n[r])}else if(typeof n[r]==="object"){t[r]=this.clone_object(n[r])}else{t[r]=n[r]}}}}return t},clone_array:function(n){if(!e.isFunction(Array.prototype.map)){throw new Error("Your browser don't support ES5 array map "+"use es5-shim")}return n.slice(0).map(function(e){if(typeof e==="object"){return this.clone_object(e)}else{return e}}.bind(this))}};var i=function(e){return r.clone_object(e)};var o=function(){var e="test",n=window.localStorage;try{n.setItem(e,"1");n.removeItem(e);return true}catch(e){return false}};var a=o();function s(e,n){var t;if(typeof e==="string"&&typeof n==="string"){localStorage[e]=n;return true}else if(typeof e==="object"&&typeof n==="undefined"){for(t in e){if(e.hasOwnProperty(t)){localStorage[t]=e[t]}}return true}return false}function l(e,n){var t,r,i;t=new Date;t.setTime(t.getTime()+31536e6);r="; expires="+t.toGMTString();if(typeof e==="string"&&typeof n==="string"){document.cookie=e+"="+n+r+"; path=/";return true}else if(typeof e==="object"&&typeof n==="undefined"){for(i in e){if(e.hasOwnProperty(i)){document.cookie=i+"="+e[i]+r+"; path=/"}}return true}return false}function f(e){return localStorage[e]}function c(e){var n,t,r,i;n=e+"=";t=document.cookie.split(";");for(r=0;ri&&i!==0||r.call(e,a)===false){m.timer.remove(e,t,r)}s.inProgress=false};s.$timerID=r.$timerID;if(!e.$timers[t][r.$timerID]){e.$timers[t][r.$timerID]=window.setInterval(s,n)}if(!this.global[t]){this.global[t]=[]}this.global[t].push(e)},remove:function(e,n,t){var r=e.$timers,i;if(r){if(!n){for(var o in r){if(r.hasOwnProperty(o)){this.remove(e,o,t)}}}else if(r[n]){if(t){if(t.$timerID){window.clearInterval(r[n][t.$timerID]);delete r[n][t.$timerID]}}else{for(var a in r[n]){if(r[n].hasOwnProperty(a)){window.clearInterval(r[n][a]);delete r[n][a]}}}for(i in r[n]){if(r[n].hasOwnProperty(i)){break}}if(!i){i=null;delete r[n]}}for(i in r){if(r.hasOwnProperty(i)){break}}if(!i){e.$timers=null}}}}});if(/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())){m(window).one("unload",function(){var e=m.timer.global;for(var n in e){if(e.hasOwnProperty(n)){var t=e[n],r=t.length;while(--r){m.timer.remove(t[r],n)}}}})}(function(e){if(!String.prototype.split.toString().match(/\[native/)){return}var n=String.prototype.split,t=/()??/.exec("")[1]===e,r;r=function(r,i,o){if(Object.prototype.toString.call(i)!=="[object RegExp]"){return n.call(r,i,o)}var a=[],s=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.extended?"x":"")+(i.sticky?"y":""),l=0,f,c,u,p;i=new RegExp(i.source,s+"g");r+="";if(!t){f=new RegExp("^"+i.source+"$(?!\\s)",s)}o=o===e?-1>>>0:o>>>0;while(c=i.exec(r)){u=c.index+c[0].length;if(u>l){a.push(r.slice(l,c.index));if(!t&&c.length>1){c[0].replace(f,function(){for(var n=1;n1&&c.index=o){break}}if(i.lastIndex===c.index){i.lastIndex++}}if(l===r.length){if(p||!i.test("")){a.push("")}}else{a.push(r.slice(l))}return a.length>o?a.slice(0,o):a};String.prototype.split=function(e,n){return r(this,e,n)};return r})();e.fn.caret=function(e){var n=this[0];var t=n.contentEditable==="true";if(arguments.length===0){if(window.getSelection){if(t){n.focus();var r=window.getSelection().getRangeAt(0),i=r.cloneRange();i.selectNodeContents(n);i.setEnd(r.endContainer,r.endOffset);return i.toString().length}return n.selectionStart}if(document.selection){n.focus();if(t){var r=document.selection.createRange(),i=document.body.createTextRange();i.moveToElementText(n);i.setEndPoint("EndToEnd",r);return i.text.length}var e=0,o=n.createTextRange(),i=document.selection.createRange().duplicate(),a=i.getBookmark();o.moveToBookmark(a);while(o.moveStart("character",-1)!==0)e++;return e}return 0}if(e===-1)e=this[t?"text":"val"]().length;if(window.getSelection){if(t){n.focus();window.getSelection().collapse(n.firstChild,e)}else n.setSelectionRange(e,e)}else if(document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(n);o.moveStart("character",e);o.collapse(true);o.select()}if(!t)n.focus();return e};var d=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,20)};e.fn.resizer=function(n){var t=arguments[0]==="unbind";if(!t&&!e.isFunction(n)){throw new Error('Invalid argument, it need to a function of string "unbind".')}return this.each(function(){var r=e(this);if(t){e(this).removeData("callbacks").find(".resizer").remove()}else if(r.data("callbacks")){e(this).data("callbacks").push(n)}else{r.data("callbacks",[n]);var i=this;var o=e("
").addClass("resizer").appendTo(this)[0];var a="position: absolute; left: 0; top: 0; right: 0; bottom: 0; "+"overflow: hidden; z-index: -1; visibility: hidden;";var s="position: absolute; left: 0; top: 0; transition: 0s;";o.style.cssText=a;o.innerHTML='
'+'
'+"
"+'
'+'
'+"
";var l=o.childNodes[0];var f=l.childNodes[0];var c=o.childNodes[1];var u,p,m,h;var g=i.offsetWidth;var v=i.offsetHeight;var y=function(){f.style.width="100000px";f.style.height="100000px";l.scrollLeft=1e5;l.scrollTop=1e5;c.scrollLeft=1e5;c.scrollTop=1e5};y();var w=function(){p=0;if(!u){return}g=m;v=h;var e=r.data("callbacks");if(e&&e.length){e.forEach(function(e){e()})}};var b=function(){m=i.offsetWidth;h=i.offsetHeight;u=m!==g||h!==v;if(u&&!p){p=d(w)}y()};e(l).on("scroll",b);e(c).on("scroll",b)}})};function h(e){e.attr({role:"presentation","aria-hidden":"true"})}function g(n){var t=n?[n]:[];var r=0;e.extend(this,{get:function(){return t},rotate:function(){if(!t.filter(Boolean).length){return}if(t.length===1){return t[0]}else{if(r===t.length-1){r=0}else{++r}if(t[r]){return t[r]}else{return this.rotate()}}},length:function(){return t.length},remove:function(e){delete t[e]},set:function(e){for(var n=t.length;n--;){if(t[n]===e){r=n;return}}this.append(e)},front:function(){if(t.length){var e=r;var n=false;while(!t[e]){e++;if(e>t.length){if(n){break}e=0;n=true}}return t[e]}},map:function(e){return t.filter(Boolean).map(e)},forEach:function(e){t.filter(Boolean).forEach(e)},append:function(e){t.push(e)}})}function v(n){var t=n instanceof Array?n:n?[n]:[];e.extend(this,{data:function(){return t},map:function(n){return e.map(t,n)},size:function(){return t.length},pop:function(){if(t.length===0){return null}else{var e=t[t.length-1];t=t.slice(0,t.length-1);return e}},push:function(e){t=t.concat([e]);return e},top:function(){return t.length>0?t[t.length-1]:null},clone:function(){return new v(t.slice(0))}})}function y(n,t,r){var i=true;var o="";if(typeof n==="string"&&n!==""){o=n+"_"}o+="commands";var a;if(r){a=[]}else{a=e.Storage.get(o);a=a?JSON.parse(a):[]}var s=a.length-1;e.extend(this,{append:function(n){if(i){if(a[a.length-1]!==n){a.push(n);if(t&&a.length>t){a=a.slice(-t)}s=a.length-1;if(!r){e.Storage.set(o,JSON.stringify(a))}}}},set:function(n){if(n instanceof Array){a=n;if(!r){e.Storage.set(o,JSON.stringify(a))}}},data:function(){return a},reset:function(){s=a.length-1},last:function(){return a[a.length-1]},end:function(){return s===a.length-1},position:function(){return s},current:function(){return a[s]},next:function(){if(s0){--s}if(e!==-1){return a[s]}},clear:function(){a=[];this.purge()},enabled:function(){return i},enable:function(){i=true},purge:function(){if(!r){e.Storage.remove(o)}},disable:function(){i=false}})}var w=0;e.fn.cmd=function(t){var r=this;var i=r.data("cmd");if(i){return i}var o=w++;r.addClass("cmd");r.append(''+' ');h(r.find("span").not(":eq(0)"));var a=e("