diff --git a/README.md b/README.md index de5cdb18fd1ca772c182f6ab407d6676280e994e..1b8374eca7e78d94a905200e7121c1a9372cbfa8 100755 --- a/README.md +++ b/README.md @@ -3,15 +3,3 @@ PĹ™evod html dokumentace do md formátu ------------------- **RUÄŚNĂŤ ÄŚIĹ TÄšNĂŤ** ------------------ - -**StaĹľenĂ souborĹŻ:** - -```bash -html_md.sh -w -``` - -**Konverze html do md** - -```bash -html_md.sh -c -``` diff --git a/docs.it4i/css/tty-player.css b/docs.it4i/css/tty-player.css deleted file mode 100644 index bf316b5bccff7f378f63e1de3784469358bd502c..0000000000000000000000000000000000000000 --- a/docs.it4i/css/tty-player.css +++ /dev/null @@ -1,219 +0,0 @@ -.terminal { - font-family: monospace, monospace; - cursor: text; - line-height: initial; -} - -tty-player { - border: 2px solid #285577; - border-top: 1px solid #4c7899; - margin: 0 auto; -} - -tty-player .title { - background: #285577; - border-bottom: 1px solid #4c7899; - color: #fff; - font-family: sans-serif; - font-weight: bold; - padding: 0.2em; - line-height: 1; - height: 1em; - cursor: default; -} - -tty-player menu { - display: none; -} - -tty-player { - display: inline-block; - position: relative; -} - -tty-player:not([controls]) tty-player-controls { - display: none; -} - -tty-player-poster { - /* XXX: <video> has an overlay with play button if [controls] over the poster *image*, but here we have an overlay with play button regardless. Perhaps specifying a poster currentTime or script might work? */ - background: rgba(53, 47, 47, 0.5); - opacity: 0.5; - transition: opacity 0.2s linear; - background-repeat: no-repeat; - background-position: center; - background-image: url("data:image/svg+xml,%3C?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3E%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='66'%20height='66'%3E%3Cfilter%20id='f'%3E%3CfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20.5%200'/%3E%3CfeGaussianBlur%20result='r'%20stdDeviation='2'/%3E%3CfeComposite%20in='SourceGraphic'%20in2='r'/%3E%3C/filter%3E%3Cpath%20fill='%23ddd'%20stroke='%23ccc'%20stroke-width='1'%20d='M33,5.5A27.5,27.5%200%200%200%205.5,33%2027.5,27.5%200%200%200%2033,60.5%2027.5,27.5%200%200%200%2060.5,33%2027.5,27.5%200%200%200%2033,5.5Zm-9.5,13%2025,14.5-25,14.5%200,-29z'%20filter='url(%23f)'/%3E%3C/svg%3E"); - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; -} - -tty-player[controls] tty-player-poster { - bottom: 28px; -} - -tty-player:hover tty-player-poster { - opacity: 1; -} - -tty-player-controls { - position: absolute; - left: 0; - right: 0; - bottom: 0; - background: rgba(53, 47, 47, 0.5); - opacity: 0; - display: flex; - flex-direction: row; - transition: opacity 0.2s linear; - cursor: default; -} - -/* Browsers tend to show the controls when a <video> ends, too; I, however, am not doing this for now at least as the controls will overlap with what is often the most important part of the terminal (the bottom). For this reason, I haven’t hooked up any support for that either, only showing controls persistently when the poster is up. */ -tty-player-controls.poster, -tty-player:hover tty-player-controls { - opacity: 1; -} - -tty-player-controls input[type=range], tty-player-controls button { - margin: 0; - padding: 0; - border: none; - background: none; - font: inherit; - line-height: inherit; - -moz-appearance: none; - -webkit-appearance: none; -} - -tty-player-controls button { - padding: 0; - background: none; - opacity: 0.75; - flex: 0 1 auto; - line-height: 1; - width: 28px; - height: 28px; -} - -tty-player-controls button:hover { - color: #777; - opacity: 1; -} - -tty-player-controls input[type=range] { - flex: 1; - height: 8px; - margin: 10px 5px; -} - -tty-player-controls button { - background-repeat: no-repeat; - background-position: center; -} - -tty-player-controls button.play { - background-image: url("data:image/svg+xml,%3C?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3E%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='14'%20height='16'%3E%3Cpath%20fill='%23ccc'%20d='M0,0%200,16%2014,8Z'/%3E%3C/svg%3E"); -} - -tty-player-controls button.pause { - background-image: url("data:image/svg+xml,%3C?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3E%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='14'%20height='16'%3E%3Cpath%20fill='%23ccc'%20d='M1,0L1,16L5,16L5,0L0,0zM9,0L9,16L13,16L13,0L9,0z'/%3E%3C/svg%3E"); -} - -tty-player-controls input[type=range]:focus { - box-shadow: none; - outline: none; -} - -tty-player-controls input[type=range]::-moz-range-track, -tty-player-controls input[type=range]::-moz-range-thumb, -tty-player-controls input[type=range]::-moz-range-progress { - border-radius: 4px; - height: 8px; -} - -tty-player-controls input[type=range]::-moz-range-track { - background: rgba(255, 255, 255, 0.5); -} - -tty-player-controls input[type=range]::-moz-range-thumb { - -moz-appearance: none; - width: 0; - background: transparent; - border: 0; - border-radius: 0; - box-shadow: 0; - position: relative; -} - -tty-player-controls input[type=range]::-moz-range-progress { - background: #fff; -} - -input[type=range] { - overflow: hidden; -} - -tty-player-controls input[type=range]::-webkit-slider-runnable-track { - -webkit-appearance: none; - height: 8px; - background: rgba(255, 255, 255, 0.5); - //border-radius: 4px; -} - -tty-player-controls input[type=range]::-webkit-slider-thumb:before { - position: absolute; - top: 0; - right: 50%; - left: -9999px; - background: #fff; - content: ''; - height: 8px; - pointer-events: none; -} - -tty-player-controls input[type=range]::-webkit-slider-thumb { - -webkit-appearance: none; - width: 0; - height: 0; - position: relative; -} - -/* I have not altered IE’s styles because I feel them already satisfactory */ - -tty-player-controls .current-time { - position: absolute; - color: #ddd; - background: #888; - font-family: sans-serif; - font-size: 12px; - display: block; - box-shadow: 0 1px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.2); - padding: 0 5px; - line-height: 16px; - border-radius: 4px; - top: -7px; -} - -tty-player-controls .current-time::after { - content: ""; - position: absolute; - width: 8px; - height: 8px; - background: linear-gradient(-45deg, #888 50%, transparent 50%); - box-shadow: 1px 1px rgba(0, 0, 0, 0.5), 1px 1px 1px rgba(0, 0, 0, 0.5); - bottom: -3px; - left: 50%; - margin-left: -5px; - transform: rotate(45deg); -} - -tty-player-controls .duration { - font-family: sans-serif; - font-size: 12px; - color: #999; - line-height: 18px; - padding: 5px; -} diff --git a/docs.it4i/js/term.min.js b/docs.it4i/js/term.min.js deleted file mode 100644 index 7ede8386c8fdd2974bfdf4e0ef3fd9c701719518..0000000000000000000000000000000000000000 --- a/docs.it4i/js/term.min.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(){"use strict";var window=this,document=this.document;function EventEmitter(){this._events=this._events||{}}EventEmitter.prototype.addListener=function(type,listener){this._events[type]=this._events[type]||[];this._events[type].push(listener)};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.removeListener=function(type,listener){if(!this._events[type])return;var obj=this._events[type],i=obj.length;while(i--){if(obj[i]===listener||obj[i].listener===listener){obj.splice(i,1);return}}};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.removeAllListeners=function(type){if(this._events[type])delete this._events[type]};EventEmitter.prototype.once=function(type,listener){function on(){var args=Array.prototype.slice.call(arguments);this.removeListener(type,on);return listener.apply(this,args)}on.listener=listener;return this.on(type,on)};EventEmitter.prototype.emit=function(type){if(!this._events[type])return;var args=Array.prototype.slice.call(arguments,1),obj=this._events[type],l=obj.length,i=0;for(;i<l;i++){obj[i].apply(this,args)}};EventEmitter.prototype.listeners=function(type){return this._events[type]=this._events[type]||[]};var normal=0,escaped=1,csi=2,osc=3,charset=4,dcs=5,ignore=6;function Terminal(options){var self=this;if(!(this instanceof Terminal)){return new Terminal(arguments[0],arguments[1],arguments[2])}EventEmitter.call(this);if(typeof options==="number"){options={cols:arguments[0],rows:arguments[1],handler:arguments[2]}}options=options||{};each(keys(Terminal.defaults),function(key){if(options[key]==null){options[key]=Terminal.options[key];if(Terminal[key]!==Terminal.defaults[key]){options[key]=Terminal[key]}}self[key]=options[key]});if(options.colors.length===8){options.colors=options.colors.concat(Terminal._colors.slice(8))}else if(options.colors.length===16){options.colors=options.colors.concat(Terminal._colors.slice(16))}else if(options.colors.length===10){options.colors=options.colors.slice(0,-2).concat(Terminal._colors.slice(8,-2),options.colors.slice(-2))}else if(options.colors.length===18){options.colors=options.colors.slice(0,-2).concat(Terminal._colors.slice(16,-2),options.colors.slice(-2))}this.colors=options.colors;this.options=options;this.parent=options.body||options.parent||(document?document.getElementsByTagName("body")[0]:null);this.cols=options.cols||options.geometry[0];this.rows=options.rows||options.geometry[1];if(options.handler){this.on("data",options.handler)}this.ybase=0;this.ydisp=0;this.x=0;this.y=0;this.cursorState=0;this.cursorHidden=false;this.convertEol;this.state=0;this.queue="";this.scrollTop=0;this.scrollBottom=this.rows-1;this.applicationKeypad=false;this.applicationCursor=false;this.originMode=false;this.insertMode=false;this.wraparoundMode=false;this.normal=null;this.prefixMode=false;this.selectMode=false;this.visualMode=false;this.searchMode=false;this.searchDown;this.entry="";this.entryPrefix="Search: ";this._real;this._selected;this._textarea;this.charset=null;this.gcharset=null;this.glevel=0;this.charsets=[null];this.decLocator;this.x10Mouse;this.vt200Mouse;this.vt300Mouse;this.normalMouse;this.mouseEvents;this.sendFocus;this.utfMouse;this.sgrMouse;this.urxvtMouse;this.element;this.children;this.refreshStart;this.refreshEnd;this.savedX;this.savedY;this.savedCols;this.readable=true;this.writable=true;this.defAttr=0<<18|257<<9|256<<0;this.curAttr=this.defAttr;this.params=[];this.currentParam=0;this.prefix="";this.postfix="";this.lines=[];var i=this.rows;while(i--){this.lines.push(this.blankLine())}this.tabs;this.setupStops()}inherits(Terminal,EventEmitter);Terminal.prototype.eraseAttr=function(){return this.defAttr&~511|this.curAttr&511};Terminal.tangoColors=["#2e3436","#cc0000","#4e9a06","#c4a000","#3465a4","#75507b","#06989a","#d3d7cf","#555753","#ef2929","#8ae234","#fce94f","#729fcf","#ad7fa8","#34e2e2","#eeeeec"];Terminal.xtermColors=["#000000","#cd0000","#00cd00","#cdcd00","#0000ee","#cd00cd","#00cdcd","#e5e5e5","#7f7f7f","#ff0000","#00ff00","#ffff00","#5c5cff","#ff00ff","#00ffff","#ffffff"];Terminal.colors=function(){var colors=Terminal.tangoColors.slice(),r=[0,95,135,175,215,255],i;i=0;for(;i<216;i++){out(r[i/36%6|0],r[i/6%6|0],r[i%6])}i=0;for(;i<24;i++){r=8+i*10;out(r,r,r)}function out(r,g,b){colors.push("#"+hex(r)+hex(g)+hex(b))}function hex(c){c=c.toString(16);return c.length<2?"0"+c:c}return colors}();Terminal.colors[256]="#000000";Terminal.colors[257]="#f0f0f0";Terminal._colors=Terminal.colors.slice();Terminal.vcolors=function(){var out=[],colors=Terminal.colors,i=0,color;for(;i<256;i++){color=parseInt(colors[i].substring(1),16);out.push([color>>16&255,color>>8&255,color&255])}return out}();Terminal.defaults={colors:Terminal.colors,convertEol:false,termName:"xterm",geometry:[80,24],cursorBlink:true,visualBell:false,popOnBell:false,scrollback:1e3,screenKeys:false,debug:false,useStyle:false};Terminal.options={};each(keys(Terminal.defaults),function(key){Terminal[key]=Terminal.defaults[key];Terminal.options[key]=Terminal.defaults[key]});Terminal.focus=null;Terminal.prototype.focus=function(){if(Terminal.focus===this)return;if(Terminal.focus){Terminal.focus.blur()}if(this.sendFocus)this.send("[I");this.showCursor();Terminal.focus=this};Terminal.prototype.blur=function(){if(Terminal.focus!==this)return;this.cursorState=0;this.refresh(this.y,this.y);if(this.sendFocus)this.send("[O");Terminal.focus=null};Terminal.prototype.initGlobal=function(){var document=this.document;Terminal._boundDocs=Terminal._boundDocs||[];if(~indexOf(Terminal._boundDocs,document)){return}Terminal._boundDocs.push(document);Terminal.bindPaste(document);Terminal.bindKeys(document);Terminal.bindCopy(document);if(this.isMobile){this.fixMobile(document)}if(this.useStyle){Terminal.insertStyle(document,this.colors[256],this.colors[257])}};Terminal.bindPaste=function(document){var window=document.defaultView;on(window,"paste",function(ev){var term=Terminal.focus;if(!term)return;if(ev.clipboardData){term.send(ev.clipboardData.getData("text/plain"))}else if(term.context.clipboardData){term.send(term.context.clipboardData.getData("Text"))}term.element.contentEditable="inherit";return cancel(ev)})};Terminal.bindKeys=function(document){on(document,"keydown",function(ev){if(!Terminal.focus)return;var target=ev.target||ev.srcElement;if(!target)return;if(target===Terminal.focus.element||target===Terminal.focus.context||target===Terminal.focus.document||target===Terminal.focus.body||target===Terminal._textarea||target===Terminal.focus.parent){return Terminal.focus.keyDown(ev)}},true);on(document,"keypress",function(ev){if(!Terminal.focus)return;var target=ev.target||ev.srcElement;if(!target)return;if(target===Terminal.focus.element||target===Terminal.focus.context||target===Terminal.focus.document||target===Terminal.focus.body||target===Terminal._textarea||target===Terminal.focus.parent){return Terminal.focus.keyPress(ev)}},true);on(document,"mousedown",function(ev){if(!Terminal.focus)return;var el=ev.target||ev.srcElement;if(!el)return;do{if(el===Terminal.focus.element)return}while(el=el.parentNode);Terminal.focus.blur()})};Terminal.bindCopy=function(document){var window=document.defaultView;on(window,"copy",function(ev){var term=Terminal.focus;if(!term)return;if(!term._selected)return;var textarea=term.getCopyTextarea();var text=term.grabText(term._selected.x1,term._selected.x2,term._selected.y1,term._selected.y2);term.emit("copy",text);textarea.focus();textarea.textContent=text;textarea.value=text;textarea.setSelectionRange(0,text.length);setTimeout(function(){term.element.focus();term.focus()},1)})};Terminal.prototype.fixMobile=function(document){var self=this;var textarea=document.createElement("textarea");textarea.style.position="absolute";textarea.style.left="-32000px";textarea.style.top="-32000px";textarea.style.width="0px";textarea.style.height="0px";textarea.style.opacity="0";textarea.style.backgroundColor="transparent";textarea.style.borderStyle="none";textarea.style.outlineStyle="none";textarea.autocapitalize="none";textarea.autocorrect="off";document.getElementsByTagName("body")[0].appendChild(textarea);Terminal._textarea=textarea;setTimeout(function(){textarea.focus()},1e3);if(this.isAndroid){on(textarea,"change",function(){var value=textarea.textContent||textarea.value;textarea.value="";textarea.textContent="";self.send(value+"\r")})}};Terminal.insertStyle=function(document,bg,fg){var style=document.getElementById("term-style");if(style)return;var head=document.getElementsByTagName("head")[0];if(!head)return;var style=document.createElement("style");style.id="term-style";style.innerHTML=""+".terminal {\n"+" float: left;\n"+" border: "+bg+" solid 5px;\n"+' font-family: "DejaVu Sans Mono", "Liberation Mono", monospace;\n'+" font-size: 11px;\n"+" color: "+fg+";\n"+" background: "+bg+";\n"+"}\n"+"\n"+".terminal-cursor {\n"+" color: "+bg+";\n"+" background: "+fg+";\n"+"}\n";head.insertBefore(style,head.firstChild)};Terminal.prototype.open=function(parent){var self=this,i=0,div;this.parent=parent||this.parent;if(!this.parent){throw new Error("Terminal requires a parent element.")}this.context=this.parent.ownerDocument.defaultView;this.document=this.parent.ownerDocument;this.body=this.document.getElementsByTagName("body")[0];if(this.context.navigator&&this.context.navigator.userAgent){this.isMac=!!~this.context.navigator.userAgent.indexOf("Mac");this.isIpad=!!~this.context.navigator.userAgent.indexOf("iPad");this.isIphone=!!~this.context.navigator.userAgent.indexOf("iPhone");this.isAndroid=!!~this.context.navigator.userAgent.indexOf("Android");this.isMobile=this.isIpad||this.isIphone||this.isAndroid;this.isMSIE=!!~this.context.navigator.userAgent.indexOf("MSIE")}this.element=this.document.createElement("div");this.element.className="terminal";this.element.style.outline="none";this.element.setAttribute("tabindex",0);this.element.setAttribute("spellcheck","false");this.element.style.backgroundColor=this.colors[256];this.element.style.color=this.colors[257];this.children=[];for(;i<this.rows;i++){div=this.document.createElement("div");this.element.appendChild(div);this.children.push(div)}this.parent.appendChild(this.element);this.refresh(0,this.rows-1);if(!("useEvents"in this.options)||this.options.useEvents){this.initGlobal()}if(!("useFocus"in this.options)||this.options.useFocus){this.focus();this.startBlink();on(this.element,"focus",function(){self.focus();if(self.isMobile){Terminal._textarea.focus()}});on(this.element,"mousedown",function(){self.focus()});on(this.element,"mousedown",function(ev){var button=ev.button!=null?+ev.button:ev.which!=null?ev.which-1:null;if(self.isMSIE){button=button===1?0:button===4?1:button}if(button!==2)return;self.element.contentEditable="true";setTimeout(function(){self.element.contentEditable="inherit"},1)},true)}if(!("useMouse"in this.options)||this.options.useMouse){this.bindMouse()}if(!("useFocus"in this.options)||this.options.useFocus){setTimeout(function(){self.element.focus()},100)}if(Terminal.brokenBold==null){Terminal.brokenBold=isBoldBroken(this.document)}};Terminal.prototype.bindMouse=function(){var el=this.element,self=this,pressed=32;var wheelEvent="onmousewheel"in this.context?"mousewheel":"DOMMouseScroll";function sendButton(ev){var button,pos;button=getButton(ev);pos=getCoords(ev);if(!pos)return;sendEvent(button,pos);switch(ev.type){case"mousedown":pressed=button;break;case"mouseup":pressed=32;break;case wheelEvent:break}}function sendMove(ev){var button=pressed,pos;pos=getCoords(ev);if(!pos)return;button+=32;sendEvent(button,pos)}function encode(data,ch){if(!self.utfMouse){if(ch===255)return data.push(0);if(ch>127)ch=127;data.push(ch)}else{if(ch===2047)return data.push(0);if(ch<127){data.push(ch)}else{if(ch>2047)ch=2047;data.push(192|ch>>6);data.push(128|ch&63)}}}function sendEvent(button,pos){if(self.vt300Mouse){button&=3;pos.x-=32;pos.y-=32;var data="[24";if(button===0)data+="1";else if(button===1)data+="3";else if(button===2)data+="5";else if(button===3)return;else data+="0";data+="~["+pos.x+","+pos.y+"]\r";self.send(data);return}if(self.decLocator){button&=3;pos.x-=32;pos.y-=32;if(button===0)button=2;else if(button===1)button=4;else if(button===2)button=6;else if(button===3)button=3;self.send("["+button+";"+(button===3?4:0)+";"+pos.y+";"+pos.x+";"+(pos.page||0)+"&w");return}if(self.urxvtMouse){pos.x-=32;pos.y-=32;pos.x++;pos.y++;self.send("["+button+";"+pos.x+";"+pos.y+"M");return}if(self.sgrMouse){pos.x-=32;pos.y-=32;self.send("[<"+((button&3)===3?button&~3:button)+";"+pos.x+";"+pos.y+((button&3)===3?"m":"M"));return}var data=[];encode(data,button);encode(data,pos.x);encode(data,pos.y);self.send("[M"+String.fromCharCode.apply(String,data))}function getButton(ev){var button,shift,meta,ctrl,mod;switch(ev.type){case"mousedown":button=ev.button!=null?+ev.button:ev.which!=null?ev.which-1:null;if(self.isMSIE){button=button===1?0:button===4?1:button}break;case"mouseup":button=3;break;case"DOMMouseScroll":button=ev.detail<0?64:65;break;case"mousewheel":button=ev.wheelDeltaY>0?64:65;break}shift=ev.shiftKey?4:0;meta=ev.metaKey?8:0;ctrl=ev.ctrlKey?16:0;mod=shift|meta|ctrl;if(self.vt200Mouse){mod&=ctrl}else if(!self.normalMouse){mod=0}button=32+(mod<<2)+button;return button}function getCoords(ev){var x,y,w,h,el;if(ev.pageX==null)return;x=ev.pageX;y=ev.pageY;el=self.element;while(el&&el!==self.document.documentElement){x-=el.offsetLeft;y-=el.offsetTop;el="offsetParent"in el?el.offsetParent:el.parentNode}w=self.element.clientWidth;h=self.element.clientHeight;x=Math.round(x/w*self.cols);y=Math.round(y/h*self.rows);if(x<0)x=0;if(x>self.cols)x=self.cols;if(y<0)y=0;if(y>self.rows)y=self.rows;x+=32;y+=32;return{x:x,y:y,type:ev.type===wheelEvent?"mousewheel":ev.type}}on(el,"mousedown",function(ev){if(!self.mouseEvents)return;sendButton(ev);self.focus();if(self.vt200Mouse){sendButton({__proto__:ev,type:"mouseup"});return cancel(ev)}if(self.normalMouse)on(self.document,"mousemove",sendMove);if(!self.x10Mouse){on(self.document,"mouseup",function up(ev){sendButton(ev);if(self.normalMouse)off(self.document,"mousemove",sendMove);off(self.document,"mouseup",up);return cancel(ev)})}return cancel(ev)});on(el,wheelEvent,function(ev){if(!self.mouseEvents)return;if(self.x10Mouse||self.vt300Mouse||self.decLocator)return;sendButton(ev);return cancel(ev)});on(el,wheelEvent,function(ev){if(self.mouseEvents)return;if(self.applicationKeypad)return;if(ev.type==="DOMMouseScroll"){self.scrollDisp(ev.detail<0?-5:5)}else{self.scrollDisp(ev.wheelDeltaY>0?-5:5)}return cancel(ev)})};Terminal.prototype.destroy=function(){this.readable=false;this.writable=false;this._events={};this.handler=function(){};this.write=function(){};if(this.element.parentNode){this.element.parentNode.removeChild(this.element)}};Terminal.prototype.refresh=function(start,end){var x,y,i,line,out,ch,width,data,attr,bg,fg,flags,row,parent;if(end-start>=this.rows/2){parent=this.element.parentNode;if(parent)parent.removeChild(this.element)}width=this.cols;y=start;if(end>=this.lines.length){this.log("`end` is too large. Most likely a bad CSR.");end=this.lines.length-1}for(;y<=end;y++){row=y+this.ydisp;line=this.lines[row];out="";if(y===this.y&&this.cursorState&&(this.ydisp===this.ybase||this.selectMode)&&!this.cursorHidden){x=this.x}else{x=-1}attr=this.defAttr;i=0;for(;i<width;i++){data=line[i][0];ch=line[i][1];if(i===x)data=-1;if(data!==attr){if(attr!==this.defAttr){out+="</span>"}if(data!==this.defAttr){if(data===-1){out+='<span class="reverse-video terminal-cursor">'}else{out+='<span style="';bg=data&511;fg=data>>9&511;flags=data>>18;if(flags&1){if(!Terminal.brokenBold){out+="font-weight:bold;"}if(fg<8)fg+=8}if(flags&2){out+="text-decoration:underline;"}if(flags&4){if(flags&2){out=out.slice(0,-1);out+=" blink;"}else{out+="text-decoration:blink;"}}if(flags&8){bg=data>>9&511;fg=data&511;if(flags&1&&fg<8)fg+=8}if(flags&16){out+="visibility:hidden;"}if(bg!==256){out+="background-color:"+this.colors[bg]+";"}if(fg!==257){out+="color:"+this.colors[fg]+";"}out+='">'}}}switch(ch){case"&":out+="&";break;case"<":out+="<";break;case">":out+=">";break;default:if(ch<=" "){out+=" "}else{if(isWide(ch))i++;out+=ch}break}attr=data}if(attr!==this.defAttr){out+="</span>"}this.children[y].innerHTML=out}if(parent)parent.appendChild(this.element)};Terminal.prototype._cursorBlink=function(){if(Terminal.focus!==this)return;this.cursorState^=1;this.refresh(this.y,this.y)};Terminal.prototype.showCursor=function(){if(!this.cursorState){this.cursorState=1;this.refresh(this.y,this.y)}else{}};Terminal.prototype.startBlink=function(){if(!this.cursorBlink)return;var self=this;this._blinker=function(){self._cursorBlink()};this._blink=setInterval(this._blinker,500)};Terminal.prototype.refreshBlink=function(){if(!this.cursorBlink)return;clearInterval(this._blink);this._blink=setInterval(this._blinker,500)};Terminal.prototype.scroll=function(){var row;if(++this.ybase===this.scrollback){this.ybase=this.ybase/2|0;this.lines=this.lines.slice(-(this.ybase+this.rows)+1)}this.ydisp=this.ybase;row=this.ybase+this.rows-1;row-=this.rows-1-this.scrollBottom;if(row===this.lines.length){this.lines.push(this.blankLine())}else{this.lines.splice(row,0,this.blankLine())}if(this.scrollTop!==0){if(this.ybase!==0){this.ybase--;this.ydisp=this.ybase}this.lines.splice(this.ybase+this.scrollTop,1)}this.updateRange(this.scrollTop);this.updateRange(this.scrollBottom)};Terminal.prototype.scrollDisp=function(disp){this.ydisp+=disp;if(this.ydisp>this.ybase){this.ydisp=this.ybase}else if(this.ydisp<0){this.ydisp=0}this.refresh(0,this.rows-1)};Terminal.prototype.write=function(data){var l=data.length,i=0,j,cs,ch;this.refreshStart=this.y;this.refreshEnd=this.y;if(this.ybase!==this.ydisp){this.ydisp=this.ybase;this.maxRange()}for(;i<l;i++){ch=data[i];switch(this.state){case normal:switch(ch){case"":this.bell();break;case"\n":case"":case"\f":if(this.convertEol){this.x=0}this.y++;if(this.y>this.scrollBottom){this.y--;this.scroll()}break;case"\r":this.x=0;break;case"\b":if(this.x>0){this.x--}break;case" ":this.x=this.nextStop();break;case"":this.setgLevel(1);break;case"":this.setgLevel(0);break;case"":this.state=escaped;break;default:if(ch>=" "){if(this.charset&&this.charset[ch]){ch=this.charset[ch]}if(this.x>=this.cols){this.x=0;this.y++;if(this.y>this.scrollBottom){this.y--;this.scroll()}}this.lines[this.y+this.ybase][this.x]=[this.curAttr,ch];this.x++;this.updateRange(this.y);if(isWide(ch)){j=this.y+this.ybase;if(this.cols<2||this.x>=this.cols){this.lines[j][this.x-1]=[this.curAttr," "];break}this.lines[j][this.x]=[this.curAttr," "];this.x++}}break}break;case escaped:switch(ch){case"[":this.params=[];this.currentParam=0;this.state=csi;break;case"]":this.params=[];this.currentParam=0;this.state=osc;break;case"P":this.params=[];this.currentParam=0;this.state=dcs;break;case"_":this.state=ignore;break;case"^":this.state=ignore;break;case"c":this.reset();break;case"E":this.x=0;case"D":this.index();break;case"M":this.reverseIndex();break;case"%":this.setgLevel(0);this.setgCharset(0,Terminal.charsets.US);this.state=normal;i++;break;case"(":case")":case"*":case"+":case"-":case".":switch(ch){case"(":this.gcharset=0;break;case")":this.gcharset=1;break;case"*":this.gcharset=2;break;case"+":this.gcharset=3;break;case"-":this.gcharset=1;break;case".":this.gcharset=2;break}this.state=charset;break;case"/":this.gcharset=3;this.state=charset;i--;break;case"N":break;case"O":break;case"n":this.setgLevel(2);break;case"o":this.setgLevel(3);break;case"|":this.setgLevel(3);break;case"}":this.setgLevel(2);break;case"~":this.setgLevel(1);break;case"7":this.saveCursor();this.state=normal;break;case"8":this.restoreCursor();this.state=normal;break;case"#":this.state=normal;i++;break;case"H":this.tabSet();break;case"=":this.log("Serial port requested application keypad.");this.applicationKeypad=true;this.state=normal;break;case">":this.log("Switching back to normal keypad.");this.applicationKeypad=false;this.state=normal;break;default:this.state=normal;this.error("Unknown ESC control: %s.",ch);break}break;case charset:switch(ch){case"0":cs=Terminal.charsets.SCLD;break;case"A":cs=Terminal.charsets.UK;break;case"B":cs=Terminal.charsets.US;break;case"4":cs=Terminal.charsets.Dutch;break;case"C":case"5":cs=Terminal.charsets.Finnish;break;case"R":cs=Terminal.charsets.French;break;case"Q":cs=Terminal.charsets.FrenchCanadian;break;case"K":cs=Terminal.charsets.German;break;case"Y":cs=Terminal.charsets.Italian;break;case"E":case"6":cs=Terminal.charsets.NorwegianDanish;break;case"Z":cs=Terminal.charsets.Spanish;break;case"H":case"7":cs=Terminal.charsets.Swedish;break;case"=":cs=Terminal.charsets.Swiss;break;case"/":cs=Terminal.charsets.ISOLatin;i++;break;default:cs=Terminal.charsets.US;break}this.setgCharset(this.gcharset,cs);this.gcharset=null;this.state=normal;break;case osc:if(ch===""||ch===""){if(ch==="")i++;this.params.push(this.currentParam);switch(this.params[0]){case 0:case 1:case 2:if(this.params[1]){this.title=this.params[1];this.handleTitle(this.title)}break;case 3:break;case 4:case 5:break;case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:break;case 46:break;case 50:break;case 51:break;case 52:break;case 104:case 105:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:break}this.params=[];this.currentParam=0;this.state=normal}else{if(!this.params.length){if(ch>="0"&&ch<="9"){this.currentParam=this.currentParam*10+ch.charCodeAt(0)-48}else if(ch===";"){this.params.push(this.currentParam);this.currentParam=""}}else{this.currentParam+=ch}}break;case csi:if(ch==="?"||ch===">"||ch==="!"){this.prefix=ch;break}if(ch>="0"&&ch<="9"){this.currentParam=this.currentParam*10+ch.charCodeAt(0)-48;break}if(ch==="$"||ch==='"'||ch===" "||ch==="'"){this.postfix=ch;break}this.params.push(this.currentParam);this.currentParam=0;if(ch===";")break;this.state=normal;switch(ch){case"A":this.cursorUp(this.params);break;case"B":this.cursorDown(this.params);break;case"C":this.cursorForward(this.params);break;case"D":this.cursorBackward(this.params);break;case"H":this.cursorPos(this.params);break;case"J":this.eraseInDisplay(this.params);break;case"K":this.eraseInLine(this.params);break;case"m":if(!this.prefix){this.charAttributes(this.params)}break;case"n":if(!this.prefix){this.deviceStatus(this.params)}break;case"@":this.insertChars(this.params);break;case"E":this.cursorNextLine(this.params);break;case"F":this.cursorPrecedingLine(this.params);break;case"G":this.cursorCharAbsolute(this.params);break;case"L":this.insertLines(this.params);break;case"M":this.deleteLines(this.params);break;case"P":this.deleteChars(this.params);break;case"X":this.eraseChars(this.params);break;case"`":this.charPosAbsolute(this.params);break;case"a":this.HPositionRelative(this.params);break;case"c":this.sendDeviceAttributes(this.params);break;case"d":this.linePosAbsolute(this.params);break;case"e":this.VPositionRelative(this.params);break;case"f":this.HVPosition(this.params);break;case"h":this.setMode(this.params);break;case"l":this.resetMode(this.params);break;case"r":this.setScrollRegion(this.params);break;case"s":this.saveCursor(this.params);break;case"u":this.restoreCursor(this.params);break;case"I":this.cursorForwardTab(this.params);break;case"S":this.scrollUp(this.params);break;case"T":if(this.params.length<2&&!this.prefix){this.scrollDown(this.params)}break;case"Z":this.cursorBackwardTab(this.params);break;case"b":this.repeatPrecedingCharacter(this.params);break;case"g":this.tabClear(this.params);break;case"p":switch(this.prefix){case"!":this.softReset(this.params);break}break;case"t":if(this.postfix==="$"){this.reverseAttrInRectangle(this.params)}else if(this.postfix===" "){this.setWarningBellVolume(this.params)}else{if(this.prefix===">"){this.setTitleModeFeature(this.params)}else{this.manipulateWindow(this.params)}}break;default:this.error("Unknown CSI code: %s.",ch);break}this.prefix="";this.postfix="";break;case dcs:if(ch===""||ch===""){if(ch==="")i++;switch(this.prefix){case"":break;case"$q":var pt=this.currentParam,valid=false;switch(pt){case'"q':pt='0"q';break;case'"p':pt='61"p';break;case"r":pt=""+(this.scrollTop+1)+";"+(this.scrollBottom+1)+"r";break;case"m":pt="0m";break;default:this.error("Unknown DCS Pt: %s.",pt);pt="";break}this.send("P"+ +valid+"$r"+pt+"\\");break;case"+p":break;case"+q":var pt=this.currentParam,valid=false;this.send("P"+ +valid+"+r"+pt+"\\");break;default:this.error("Unknown DCS prefix: %s.",this.prefix);break}this.currentParam=0;this.prefix="";this.state=normal}else if(!this.currentParam){if(!this.prefix&&ch!=="$"&&ch!=="+"){this.currentParam=ch}else if(this.prefix.length===2){this.currentParam=ch}else{this.prefix+=ch}}else{this.currentParam+=ch}break;case ignore:if(ch===""||ch===""){if(ch==="")i++;this.state=normal}break}}this.updateRange(this.y);this.refresh(this.refreshStart,this.refreshEnd)};Terminal.prototype.writeln=function(data){this.write(data+"\r\n")};Terminal.prototype.keyDown=function(ev){var self=this,key;switch(ev.keyCode){case 8:if(ev.shiftKey){key="\b";break}key="";break;case 9:if(ev.shiftKey){key="[Z";break}key=" ";break;case 13:key="\r";break;case 27:key="";break;case 37:if(this.applicationCursor){key="OD";break}key="[D";break;case 39:if(this.applicationCursor){key="OC";break}key="[C";break;case 38:if(this.applicationCursor){key="OA";break}if(ev.ctrlKey){this.scrollDisp(-1);return cancel(ev)}else{key="[A"}break;case 40:if(this.applicationCursor){key="OB";break}if(ev.ctrlKey){this.scrollDisp(1);return cancel(ev)}else{key="[B"}break;case 46:key="[3~";break;case 45:key="[2~";break;case 36:if(this.applicationKeypad){key="OH";break}key="OH";break;case 35:if(this.applicationKeypad){key="OF";break}key="OF";break;case 33:if(ev.shiftKey){this.scrollDisp(-(this.rows-1));return cancel(ev)}else{key="[5~"}break;case 34:if(ev.shiftKey){this.scrollDisp(this.rows-1);return cancel(ev)}else{key="[6~"}break;case 112:key="OP";break;case 113:key="OQ";break;case 114:key="OR";break;case 115:key="OS";break;case 116:key="[15~";break;case 117:key="[17~";break;case 118:key="[18~";break;case 119:key="[19~";break;case 120:key="[20~";break;case 121:key="[21~";break;case 122:key="[23~";break;case 123:key="[24~";break;default:if(ev.ctrlKey){if(ev.keyCode>=65&&ev.keyCode<=90){if(this.screenKeys){if(!this.prefixMode&&!this.selectMode&&ev.keyCode===65){this.enterPrefix();return cancel(ev)}}if(this.prefixMode&&ev.keyCode===86){this.leavePrefix();return}if((this.prefixMode||this.selectMode)&&ev.keyCode===67){if(this.visualMode){setTimeout(function(){self.leaveVisual()},1)}return}key=String.fromCharCode(ev.keyCode-64)}else if(ev.keyCode===32){key=String.fromCharCode(0)}else if(ev.keyCode>=51&&ev.keyCode<=55){key=String.fromCharCode(ev.keyCode-51+27)}else if(ev.keyCode===56){key=String.fromCharCode(127)}else if(ev.keyCode===219){key=String.fromCharCode(27)}else if(ev.keyCode===221){key=String.fromCharCode(29)}}else if(!this.isMac&&ev.altKey||this.isMac&&ev.metaKey){if(ev.keyCode>=65&&ev.keyCode<=90){key=""+String.fromCharCode(ev.keyCode+32)}else if(ev.keyCode===192){key="`"}else if(ev.keyCode>=48&&ev.keyCode<=57){key=""+(ev.keyCode-48)}}break}if(!key)return true;if(this.prefixMode){this.leavePrefix();return cancel(ev)}if(this.selectMode){this.keySelect(ev,key);return cancel(ev)}this.emit("keydown",ev);this.emit("key",key,ev);this.showCursor();this.handler(key);return cancel(ev)};Terminal.prototype.setgLevel=function(g){this.glevel=g;this.charset=this.charsets[g]};Terminal.prototype.setgCharset=function(g,charset){this.charsets[g]=charset;if(this.glevel===g){this.charset=charset}};Terminal.prototype.keyPress=function(ev){var key;cancel(ev);if(ev.charCode){key=ev.charCode}else if(ev.which==null){key=ev.keyCode}else if(ev.which!==0&&ev.charCode!==0){key=ev.which}else{return false}if(!key||ev.ctrlKey||ev.altKey||ev.metaKey)return false;key=String.fromCharCode(key);if(this.prefixMode){this.leavePrefix();this.keyPrefix(ev,key);return false}if(this.selectMode){this.keySelect(ev,key);return false}this.emit("keypress",key,ev);this.emit("key",key,ev);this.showCursor();this.handler(key);return false};Terminal.prototype.send=function(data){var self=this;if(!this.queue){setTimeout(function(){self.handler(self.queue);self.queue=""},1)}this.queue+=data};Terminal.prototype.bell=function(){this.emit("bell");if(!this.visualBell)return;var self=this;this.element.style.borderColor="white";setTimeout(function(){self.element.style.borderColor=""},10);if(this.popOnBell)this.focus()};Terminal.prototype.log=function(){if(!this.debug)return;if(!this.context.console||!this.context.console.log)return;var args=Array.prototype.slice.call(arguments);this.context.console.log.apply(this.context.console,args)};Terminal.prototype.error=function(){if(!this.debug)return;if(!this.context.console||!this.context.console.error)return;var args=Array.prototype.slice.call(arguments);this.context.console.error.apply(this.context.console,args)};Terminal.prototype.resize=function(x,y){var line,el,i,j,ch;if(x<1)x=1;if(y<1)y=1;j=this.cols;if(j<x){ch=[this.defAttr," "];i=this.lines.length;while(i--){while(this.lines[i].length<x){this.lines[i].push(ch)}}}else if(j>x){i=this.lines.length;while(i--){while(this.lines[i].length>x){this.lines[i].pop()}}}this.setupStops(j);this.cols=x;j=this.rows;if(j<y){el=this.element;while(j++<y){if(this.lines.length<y+this.ybase){this.lines.push(this.blankLine())}if(this.children.length<y){line=this.document.createElement("div");el.appendChild(line);this.children.push(line)}}}else if(j>y){while(j-->y){if(this.lines.length>y+this.ybase){this.lines.pop()}if(this.children.length>y){el=this.children.pop();if(!el)continue;el.parentNode.removeChild(el)}}}this.rows=y;if(this.y>=y)this.y=y-1;if(this.x>=x)this.x=x-1;this.scrollTop=0;this.scrollBottom=y-1;this.refresh(0,this.rows-1);this.normal=null;this.emit("resize",this.cols,this.rows)};Terminal.prototype.updateRange=function(y){if(y<this.refreshStart)this.refreshStart=y;if(y>this.refreshEnd)this.refreshEnd=y};Terminal.prototype.maxRange=function(){this.refreshStart=0;this.refreshEnd=this.rows-1};Terminal.prototype.setupStops=function(i){if(i!=null){if(!this.tabs[i]){i=this.prevStop(i)}}else{this.tabs={};i=0}for(;i<this.cols;i+=8){this.tabs[i]=true}};Terminal.prototype.prevStop=function(x){if(x==null)x=this.x;while(!this.tabs[--x]&&x>0);return x>=this.cols?this.cols-1:x<0?0:x};Terminal.prototype.nextStop=function(x){if(x==null)x=this.x;while(!this.tabs[++x]&&x<this.cols);return x>=this.cols?this.cols-1:x<0?0:x};Terminal.prototype.eraseRight=function(x,y){var line=this.lines[this.ybase+y],ch=[this.eraseAttr()," "];for(;x<this.cols;x++){line[x]=ch}this.updateRange(y)};Terminal.prototype.eraseLeft=function(x,y){var line=this.lines[this.ybase+y],ch=[this.eraseAttr()," "];x++;while(x--)line[x]=ch;this.updateRange(y)};Terminal.prototype.eraseLine=function(y){this.eraseRight(0,y)};Terminal.prototype.blankLine=function(cur){var attr=cur?this.eraseAttr():this.defAttr;var ch=[attr," "],line=[],i=0;for(;i<this.cols;i++){line[i]=ch}return line};Terminal.prototype.ch=function(cur){return cur?[this.eraseAttr()," "]:[this.defAttr," "]};Terminal.prototype.is=function(term){var name=this.termName;return(name+"").indexOf(term)===0};Terminal.prototype.handler=function(data){this.emit("data",data)};Terminal.prototype.handleTitle=function(title){this.emit("title",title)};Terminal.prototype.index=function(){this.y++;if(this.y>this.scrollBottom){this.y--;this.scroll()}this.state=normal};Terminal.prototype.reverseIndex=function(){var j;this.y--;if(this.y<this.scrollTop){this.y++;this.lines.splice(this.y+this.ybase,0,this.blankLine(true));j=this.rows-1-this.scrollBottom;this.lines.splice(this.rows-1+this.ybase-j+1,1);this.updateRange(this.scrollTop);this.updateRange(this.scrollBottom)}this.state=normal};Terminal.prototype.reset=function(){this.options.rows=this.rows;this.options.cols=this.cols; -Terminal.call(this,this.options);this.refresh(0,this.rows-1)};Terminal.prototype.tabSet=function(){this.tabs[this.x]=true;this.state=normal};Terminal.prototype.cursorUp=function(params){var param=params[0];if(param<1)param=1;this.y-=param;if(this.y<0)this.y=0};Terminal.prototype.cursorDown=function(params){var param=params[0];if(param<1)param=1;this.y+=param;if(this.y>=this.rows){this.y=this.rows-1}};Terminal.prototype.cursorForward=function(params){var param=params[0];if(param<1)param=1;this.x+=param;if(this.x>=this.cols){this.x=this.cols-1}};Terminal.prototype.cursorBackward=function(params){var param=params[0];if(param<1)param=1;this.x-=param;if(this.x<0)this.x=0};Terminal.prototype.cursorPos=function(params){var row,col;row=params[0]-1;if(params.length>=2){col=params[1]-1}else{col=0}if(row<0){row=0}else if(row>=this.rows){row=this.rows-1}if(col<0){col=0}else if(col>=this.cols){col=this.cols-1}this.x=col;this.y=row};Terminal.prototype.eraseInDisplay=function(params){var j;switch(params[0]){case 0:this.eraseRight(this.x,this.y);j=this.y+1;for(;j<this.rows;j++){this.eraseLine(j)}break;case 1:this.eraseLeft(this.x,this.y);j=this.y;while(j--){this.eraseLine(j)}break;case 2:j=this.rows;while(j--)this.eraseLine(j);break;case 3:;break}};Terminal.prototype.eraseInLine=function(params){switch(params[0]){case 0:this.eraseRight(this.x,this.y);break;case 1:this.eraseLeft(this.x,this.y);break;case 2:this.eraseLine(this.y);break}};Terminal.prototype.charAttributes=function(params){if(params.length===1&¶ms[0]===0){this.curAttr=this.defAttr;return}var l=params.length,i=0,flags=this.curAttr>>18,fg=this.curAttr>>9&511,bg=this.curAttr&511,p;for(;i<l;i++){p=params[i];if(p>=30&&p<=37){fg=p-30}else if(p>=40&&p<=47){bg=p-40}else if(p>=90&&p<=97){p+=8;fg=p-90}else if(p>=100&&p<=107){p+=8;bg=p-100}else if(p===0){flags=this.defAttr>>18;fg=this.defAttr>>9&511;bg=this.defAttr&511}else if(p===1){flags|=1}else if(p===4){flags|=2}else if(p===5){flags|=4}else if(p===7){flags|=8}else if(p===8){flags|=16}else if(p===22){flags&=~1}else if(p===24){flags&=~2}else if(p===25){flags&=~4}else if(p===27){flags&=~8}else if(p===28){flags&=~16}else if(p===39){fg=this.defAttr>>9&511}else if(p===49){bg=this.defAttr&511}else if(p===38){if(params[i+1]===2){i+=2;fg=matchColor(params[i]&255,params[i+1]&255,params[i+2]&255);if(fg===-1)fg=511;i+=2}else if(params[i+1]===5){i+=2;p=params[i]&255;fg=p}}else if(p===48){if(params[i+1]===2){i+=2;bg=matchColor(params[i]&255,params[i+1]&255,params[i+2]&255);if(bg===-1)bg=511;i+=2}else if(params[i+1]===5){i+=2;p=params[i]&255;bg=p}}else if(p===100){fg=this.defAttr>>9&511;bg=this.defAttr&511}else{this.error("Unknown SGR attribute: %d.",p)}}this.curAttr=flags<<18|fg<<9|bg};Terminal.prototype.deviceStatus=function(params){if(!this.prefix){switch(params[0]){case 5:this.send("[0n");break;case 6:this.send("["+(this.y+1)+";"+(this.x+1)+"R");break}}else if(this.prefix==="?"){switch(params[0]){case 6:this.send("[?"+(this.y+1)+";"+(this.x+1)+"R");break;case 15:break;case 25:break;case 26:break;case 53:break}}};Terminal.prototype.insertChars=function(params){var param,row,j,ch;param=params[0];if(param<1)param=1;row=this.y+this.ybase;j=this.x;ch=[this.eraseAttr()," "];while(param--&&j<this.cols){this.lines[row].splice(j++,0,ch);this.lines[row].pop()}};Terminal.prototype.cursorNextLine=function(params){var param=params[0];if(param<1)param=1;this.y+=param;if(this.y>=this.rows){this.y=this.rows-1}this.x=0};Terminal.prototype.cursorPrecedingLine=function(params){var param=params[0];if(param<1)param=1;this.y-=param;if(this.y<0)this.y=0;this.x=0};Terminal.prototype.cursorCharAbsolute=function(params){var param=params[0];if(param<1)param=1;this.x=param-1};Terminal.prototype.insertLines=function(params){var param,row,j;param=params[0];if(param<1)param=1;row=this.y+this.ybase;j=this.rows-1-this.scrollBottom;j=this.rows-1+this.ybase-j+1;while(param--){this.lines.splice(row,0,this.blankLine(true));this.lines.splice(j,1)}this.updateRange(this.y);this.updateRange(this.scrollBottom)};Terminal.prototype.deleteLines=function(params){var param,row,j;param=params[0];if(param<1)param=1;row=this.y+this.ybase;j=this.rows-1-this.scrollBottom;j=this.rows-1+this.ybase-j;while(param--){this.lines.splice(j+1,0,this.blankLine(true));this.lines.splice(row,1)}this.updateRange(this.y);this.updateRange(this.scrollBottom)};Terminal.prototype.deleteChars=function(params){var param,row,ch;param=params[0];if(param<1)param=1;row=this.y+this.ybase;ch=[this.eraseAttr()," "];while(param--){this.lines[row].splice(this.x,1);this.lines[row].push(ch)}};Terminal.prototype.eraseChars=function(params){var param,row,j,ch;param=params[0];if(param<1)param=1;row=this.y+this.ybase;j=this.x;ch=[this.eraseAttr()," "];while(param--&&j<this.cols){this.lines[row][j++]=ch}};Terminal.prototype.charPosAbsolute=function(params){var param=params[0];if(param<1)param=1;this.x=param-1;if(this.x>=this.cols){this.x=this.cols-1}};Terminal.prototype.HPositionRelative=function(params){var param=params[0];if(param<1)param=1;this.x+=param;if(this.x>=this.cols){this.x=this.cols-1}};Terminal.prototype.sendDeviceAttributes=function(params){if(params[0]>0)return;if(!this.prefix){if(this.is("xterm")||this.is("rxvt-unicode")||this.is("screen")){this.send("[?1;2c")}else if(this.is("linux")){this.send("[?6c")}}else if(this.prefix===">"){if(this.is("xterm")){this.send("[>0;276;0c")}else if(this.is("rxvt-unicode")){this.send("[>85;95;0c")}else if(this.is("linux")){this.send(params[0]+"c")}else if(this.is("screen")){this.send("[>83;40003;0c")}}};Terminal.prototype.linePosAbsolute=function(params){var param=params[0];if(param<1)param=1;this.y=param-1;if(this.y>=this.rows){this.y=this.rows-1}};Terminal.prototype.VPositionRelative=function(params){var param=params[0];if(param<1)param=1;this.y+=param;if(this.y>=this.rows){this.y=this.rows-1}};Terminal.prototype.HVPosition=function(params){if(params[0]<1)params[0]=1;if(params[1]<1)params[1]=1;this.y=params[0]-1;if(this.y>=this.rows){this.y=this.rows-1}this.x=params[1]-1;if(this.x>=this.cols){this.x=this.cols-1}};Terminal.prototype.setMode=function(params){if(typeof params==="object"){var l=params.length,i=0;for(;i<l;i++){this.setMode(params[i])}return}if(!this.prefix){switch(params){case 4:this.insertMode=true;break;case 20:break}}else if(this.prefix==="?"){switch(params){case 1:this.applicationCursor=true;break;case 2:this.setgCharset(0,Terminal.charsets.US);this.setgCharset(1,Terminal.charsets.US);this.setgCharset(2,Terminal.charsets.US);this.setgCharset(3,Terminal.charsets.US);break;case 3:this.savedCols=this.cols;this.resize(132,this.rows);break;case 6:this.originMode=true;break;case 7:this.wraparoundMode=true;break;case 12:break;case 66:this.log("Serial port requested application keypad.");this.applicationKeypad=true;break;case 9:case 1e3:case 1002:case 1003:this.x10Mouse=params===9;this.vt200Mouse=params===1e3;this.normalMouse=params>1e3;this.mouseEvents=true;this.element.style.cursor="default";this.log("Binding to mouse events.");break;case 1004:this.sendFocus=true;break;case 1005:this.utfMouse=true;break;case 1006:this.sgrMouse=true;break;case 1015:this.urxvtMouse=true;break;case 25:this.cursorHidden=false;break;case 1049:;case 47:case 1047:if(!this.normal){var normal={lines:this.lines,ybase:this.ybase,ydisp:this.ydisp,x:this.x,y:this.y,scrollTop:this.scrollTop,scrollBottom:this.scrollBottom,tabs:this.tabs};this.reset();this.normal=normal;this.showCursor()}break}}};Terminal.prototype.resetMode=function(params){if(typeof params==="object"){var l=params.length,i=0;for(;i<l;i++){this.resetMode(params[i])}return}if(!this.prefix){switch(params){case 4:this.insertMode=false;break;case 20:break}}else if(this.prefix==="?"){switch(params){case 1:this.applicationCursor=false;break;case 3:if(this.cols===132&&this.savedCols){this.resize(this.savedCols,this.rows)}delete this.savedCols;break;case 6:this.originMode=false;break;case 7:this.wraparoundMode=false;break;case 12:break;case 66:this.log("Switching back to normal keypad.");this.applicationKeypad=false;break;case 9:case 1e3:case 1002:case 1003:this.x10Mouse=false;this.vt200Mouse=false;this.normalMouse=false;this.mouseEvents=false;this.element.style.cursor="";break;case 1004:this.sendFocus=false;break;case 1005:this.utfMouse=false;break;case 1006:this.sgrMouse=false;break;case 1015:this.urxvtMouse=false;break;case 25:this.cursorHidden=true;break;case 1049:;case 47:case 1047:if(this.normal){this.lines=this.normal.lines;this.ybase=this.normal.ybase;this.ydisp=this.normal.ydisp;this.x=this.normal.x;this.y=this.normal.y;this.scrollTop=this.normal.scrollTop;this.scrollBottom=this.normal.scrollBottom;this.tabs=this.normal.tabs;this.normal=null;this.refresh(0,this.rows-1);this.showCursor()}break}}};Terminal.prototype.setScrollRegion=function(params){if(this.prefix)return;this.scrollTop=(params[0]||1)-1;this.scrollBottom=(params[1]||this.rows)-1;this.x=0;this.y=0};Terminal.prototype.saveCursor=function(params){this.savedX=this.x;this.savedY=this.y};Terminal.prototype.restoreCursor=function(params){this.x=this.savedX||0;this.y=this.savedY||0};Terminal.prototype.cursorForwardTab=function(params){var param=params[0]||1;while(param--){this.x=this.nextStop()}};Terminal.prototype.scrollUp=function(params){var param=params[0]||1;while(param--){this.lines.splice(this.ybase+this.scrollTop,1);this.lines.splice(this.ybase+this.scrollBottom,0,this.blankLine())}this.updateRange(this.scrollTop);this.updateRange(this.scrollBottom)};Terminal.prototype.scrollDown=function(params){var param=params[0]||1;while(param--){this.lines.splice(this.ybase+this.scrollBottom,1);this.lines.splice(this.ybase+this.scrollTop,0,this.blankLine())}this.updateRange(this.scrollTop);this.updateRange(this.scrollBottom)};Terminal.prototype.initMouseTracking=function(params){};Terminal.prototype.resetTitleModes=function(params){};Terminal.prototype.cursorBackwardTab=function(params){var param=params[0]||1;while(param--){this.x=this.prevStop()}};Terminal.prototype.repeatPrecedingCharacter=function(params){var param=params[0]||1,line=this.lines[this.ybase+this.y],ch=line[this.x-1]||[this.defAttr," "];while(param--)line[this.x++]=ch};Terminal.prototype.tabClear=function(params){var param=params[0];if(param<=0){delete this.tabs[this.x]}else if(param===3){this.tabs={}}};Terminal.prototype.mediaCopy=function(params){};Terminal.prototype.setResources=function(params){};Terminal.prototype.disableModifiers=function(params){};Terminal.prototype.setPointerMode=function(params){};Terminal.prototype.softReset=function(params){this.cursorHidden=false;this.insertMode=false;this.originMode=false;this.wraparoundMode=false;this.applicationKeypad=false;this.applicationCursor=false;this.scrollTop=0;this.scrollBottom=this.rows-1;this.curAttr=this.defAttr;this.x=this.y=0;this.charset=null;this.glevel=0;this.charsets=[null]};Terminal.prototype.requestAnsiMode=function(params){};Terminal.prototype.requestPrivateMode=function(params){};Terminal.prototype.setConformanceLevel=function(params){};Terminal.prototype.loadLEDs=function(params){};Terminal.prototype.setCursorStyle=function(params){};Terminal.prototype.setCharProtectionAttr=function(params){};Terminal.prototype.restorePrivateValues=function(params){};Terminal.prototype.setAttrInRectangle=function(params){var t=params[0],l=params[1],b=params[2],r=params[3],attr=params[4];var line,i;for(;t<b+1;t++){line=this.lines[this.ybase+t];for(i=l;i<r;i++){line[i]=[attr,line[i][1]]}}this.updateRange(params[0]);this.updateRange(params[2])};Terminal.prototype.savePrivateValues=function(params){};Terminal.prototype.manipulateWindow=function(params){switch(params[0]){case 8:this.resize(params[2],params[1]);break}};Terminal.prototype.reverseAttrInRectangle=function(params){};Terminal.prototype.setTitleModeFeature=function(params){};Terminal.prototype.setWarningBellVolume=function(params){};Terminal.prototype.setMarginBellVolume=function(params){};Terminal.prototype.copyRectangle=function(params){};Terminal.prototype.enableFilterRectangle=function(params){};Terminal.prototype.requestParameters=function(params){};Terminal.prototype.selectChangeExtent=function(params){};Terminal.prototype.fillRectangle=function(params){var ch=params[0],t=params[1],l=params[2],b=params[3],r=params[4];var line,i;for(;t<b+1;t++){line=this.lines[this.ybase+t];for(i=l;i<r;i++){line[i]=[line[i][0],String.fromCharCode(ch)]}}this.updateRange(params[1]);this.updateRange(params[3])};Terminal.prototype.enableLocatorReporting=function(params){var val=params[0]>0};Terminal.prototype.eraseRectangle=function(params){var t=params[0],l=params[1],b=params[2],r=params[3];var line,i,ch;ch=[this.eraseAttr()," "];for(;t<b+1;t++){line=this.lines[this.ybase+t];for(i=l;i<r;i++){line[i]=ch}}this.updateRange(params[0]);this.updateRange(params[2])};Terminal.prototype.setLocatorEvents=function(params){};Terminal.prototype.selectiveEraseRectangle=function(params){};Terminal.prototype.requestLocatorPosition=function(params){};Terminal.prototype.insertColumns=function(){var param=params[0],l=this.ybase+this.rows,ch=[this.eraseAttr()," "],i;while(param--){for(i=this.ybase;i<l;i++){this.lines[i].splice(this.x+1,0,ch);this.lines[i].pop()}}this.maxRange()};Terminal.prototype.deleteColumns=function(){var param=params[0],l=this.ybase+this.rows,ch=[this.eraseAttr()," "],i;while(param--){for(i=this.ybase;i<l;i++){this.lines[i].splice(this.x,1);this.lines[i].push(ch)}}this.maxRange()};Terminal.prototype.enterPrefix=function(){this.prefixMode=true};Terminal.prototype.leavePrefix=function(){this.prefixMode=false};Terminal.prototype.enterSelect=function(){this._real={x:this.x,y:this.y,ydisp:this.ydisp,ybase:this.ybase,cursorHidden:this.cursorHidden,lines:this.copyBuffer(this.lines),write:this.write};this.write=function(){};this.selectMode=true;this.visualMode=false;this.cursorHidden=false;this.refresh(this.y,this.y)};Terminal.prototype.leaveSelect=function(){this.x=this._real.x;this.y=this._real.y;this.ydisp=this._real.ydisp;this.ybase=this._real.ybase;this.cursorHidden=this._real.cursorHidden;this.lines=this._real.lines;this.write=this._real.write;delete this._real;this.selectMode=false;this.visualMode=false;this.refresh(0,this.rows-1)};Terminal.prototype.enterVisual=function(){this._real.preVisual=this.copyBuffer(this.lines);this.selectText(this.x,this.x,this.ydisp+this.y,this.ydisp+this.y);this.visualMode=true};Terminal.prototype.leaveVisual=function(){this.lines=this._real.preVisual;delete this._real.preVisual;delete this._selected;this.visualMode=false;this.refresh(0,this.rows-1)};Terminal.prototype.enterSearch=function(down){this.entry="";this.searchMode=true;this.searchDown=down;this._real.preSearch=this.copyBuffer(this.lines);this._real.preSearchX=this.x;this._real.preSearchY=this.y;var bottom=this.ydisp+this.rows-1;for(var i=0;i<this.entryPrefix.length;i++){this.lines[bottom][i]=[this.defAttr&~511|4,this.entryPrefix[i]]}this.y=this.rows-1;this.x=this.entryPrefix.length;this.refresh(this.rows-1,this.rows-1)};Terminal.prototype.leaveSearch=function(){this.searchMode=false;if(this._real.preSearch){this.lines=this._real.preSearch;this.x=this._real.preSearchX;this.y=this._real.preSearchY;delete this._real.preSearch;delete this._real.preSearchX;delete this._real.preSearchY}this.refresh(this.rows-1,this.rows-1)};Terminal.prototype.copyBuffer=function(lines){var lines=lines||this.lines,out=[];for(var y=0;y<lines.length;y++){out[y]=[];for(var x=0;x<lines[y].length;x++){out[y][x]=[lines[y][x][0],lines[y][x][1]]}}return out};Terminal.prototype.getCopyTextarea=function(text){var textarea=this._copyTextarea,document=this.document;if(!textarea){textarea=document.createElement("textarea");textarea.style.position="absolute";textarea.style.left="-32000px";textarea.style.top="-32000px";textarea.style.width="0px";textarea.style.height="0px";textarea.style.opacity="0";textarea.style.backgroundColor="transparent";textarea.style.borderStyle="none";textarea.style.outlineStyle="none";document.getElementsByTagName("body")[0].appendChild(textarea);this._copyTextarea=textarea}return textarea};Terminal.prototype.copyText=function(text){var self=this,textarea=this.getCopyTextarea();this.emit("copy",text);textarea.focus();textarea.textContent=text;textarea.value=text;textarea.setSelectionRange(0,text.length);setTimeout(function(){self.element.focus();self.focus()},1)};Terminal.prototype.selectText=function(x1,x2,y1,y2){var ox1,ox2,oy1,oy2,tmp,x,y,xl,attr;if(this._selected){ox1=this._selected.x1;ox2=this._selected.x2;oy1=this._selected.y1;oy2=this._selected.y2;if(oy2<oy1){tmp=ox2;ox2=ox1;ox1=tmp;tmp=oy2;oy2=oy1;oy1=tmp}if(ox2<ox1&&oy1===oy2){tmp=ox2;ox2=ox1;ox1=tmp}for(y=oy1;y<=oy2;y++){x=0;xl=this.cols-1;if(y===oy1){x=ox1}if(y===oy2){xl=ox2}for(;x<=xl;x++){if(this.lines[y][x].old!=null){attr=this.lines[y][x].old;delete this.lines[y][x].old;this.lines[y][x]=[attr,this.lines[y][x][1]]}}}y1=this._selected.y1;x1=this._selected.x1}y1=Math.max(y1,0);y1=Math.min(y1,this.ydisp+this.rows-1);y2=Math.max(y2,0);y2=Math.min(y2,this.ydisp+this.rows-1);this._selected={x1:x1,x2:x2,y1:y1,y2:y2};if(y2<y1){tmp=x2;x2=x1;x1=tmp;tmp=y2;y2=y1;y1=tmp}if(x2<x1&&y1===y2){tmp=x2;x2=x1;x1=tmp}for(y=y1;y<=y2;y++){x=0;xl=this.cols-1;if(y===y1){x=x1}if(y===y2){xl=x2}for(;x<=xl;x++){attr=this.lines[y][x][0];this.lines[y][x]=[attr&~511|(511<<9|4),this.lines[y][x][1]];this.lines[y][x].old=attr}}y1=y1-this.ydisp;y2=y2-this.ydisp;y1=Math.max(y1,0);y1=Math.min(y1,this.rows-1);y2=Math.max(y2,0);y2=Math.min(y2,this.rows-1);this.refresh(0,this.rows-1)};Terminal.prototype.grabText=function(x1,x2,y1,y2){var out="",buf="",ch,x,y,xl,tmp;if(y2<y1){tmp=x2;x2=x1;x1=tmp;tmp=y2;y2=y1;y1=tmp}if(x2<x1&&y1===y2){tmp=x2;x2=x1;x1=tmp}for(y=y1;y<=y2;y++){x=0;xl=this.cols-1;if(y===y1){x=x1}if(y===y2){xl=x2}for(;x<=xl;x++){ch=this.lines[y][x][1];if(ch===" "){buf+=ch;continue}if(buf){out+=buf;buf=""}out+=ch;if(isWide(ch))x++}buf="";out+="\n"}for(x=x2,y=y2;x<this.cols;x++){if(this.lines[y][x][1]!==" "){out=out.slice(0,-1);break}}return out};Terminal.prototype.keyPrefix=function(ev,key){if(key==="k"||key==="&"){this.destroy()}else if(key==="p"||key==="]"){this.emit("request paste")}else if(key==="c"){this.emit("request create")}else if(key>="0"&&key<="9"){key=+key-1;if(!~key)key=9;this.emit("request term",key)}else if(key==="n"){this.emit("request term next")}else if(key==="P"){this.emit("request term previous")}else if(key===":"){this.emit("request command mode")}else if(key==="["){this.enterSelect()}};Terminal.prototype.keySelect=function(ev,key){this.showCursor();if(this.searchMode||key==="n"||key==="N"){return this.keySearch(ev,key)}if(key===""){var y=this.ydisp+this.y;if(this.ydisp===this.ybase){this.y=Math.min(this.y+(this.rows-1)/2|0,this.rows-1);this.refresh(0,this.rows-1)}else{this.scrollDisp((this.rows-1)/2|0)}if(this.visualMode){this.selectText(this.x,this.x,y,this.ydisp+this.y)}return}if(key===""){var y=this.ydisp+this.y;if(this.ydisp===0){this.y=Math.max(this.y-(this.rows-1)/2|0,0);this.refresh(0,this.rows-1)}else{this.scrollDisp(-(this.rows-1)/2|0)}if(this.visualMode){this.selectText(this.x,this.x,y,this.ydisp+this.y)}return}if(key===""){var y=this.ydisp+this.y;this.scrollDisp(this.rows-1);if(this.visualMode){this.selectText(this.x,this.x,y,this.ydisp+this.y)}return}if(key===""){var y=this.ydisp+this.y;this.scrollDisp(-(this.rows-1));if(this.visualMode){this.selectText(this.x,this.x,y,this.ydisp+this.y)}return}if(key==="k"||key==="[A"){var y=this.ydisp+this.y;this.y--;if(this.y<0){this.y=0;this.scrollDisp(-1)}if(this.visualMode){this.selectText(this.x,this.x,y,this.ydisp+this.y)}else{this.refresh(this.y,this.y+1)}return}if(key==="j"||key==="[B"){var y=this.ydisp+this.y;this.y++;if(this.y>=this.rows){this.y=this.rows-1;this.scrollDisp(1)}if(this.visualMode){this.selectText(this.x,this.x,y,this.ydisp+this.y)}else{this.refresh(this.y-1,this.y)}return}if(key==="h"||key==="[D"){var x=this.x;this.x--;if(this.x<0){this.x=0}if(this.visualMode){this.selectText(x,this.x,this.ydisp+this.y,this.ydisp+this.y)}else{this.refresh(this.y,this.y)}return}if(key==="l"||key==="[C"){var x=this.x;this.x++;if(this.x>=this.cols){this.x=this.cols-1}if(this.visualMode){this.selectText(x,this.x,this.ydisp+this.y,this.ydisp+this.y)}else{this.refresh(this.y,this.y)}return}if(key==="v"||key===" "){if(!this.visualMode){this.enterVisual()}else{this.leaveVisual()}return}if(key==="y"){if(this.visualMode){var text=this.grabText(this._selected.x1,this._selected.x2,this._selected.y1,this._selected.y2);this.copyText(text);this.leaveVisual()}return}if(key==="q"||key===""){if(this.visualMode){this.leaveVisual()}else{this.leaveSelect()}return}if(key==="w"||key==="W"){var ox=this.x;var oy=this.y;var oyd=this.ydisp;var x=this.x;var y=this.y;var yb=this.ydisp;var saw_space=false;for(;;){var line=this.lines[yb+y];while(x<this.cols){if(line[x][1]<=" "){saw_space=true}else if(saw_space){break}x++}if(x>=this.cols)x=this.cols-1;if(x===this.cols-1&&line[x][1]<=" "){x=0;if(++y>=this.rows){y--;if(++yb>this.ybase){yb=this.ybase;x=this.x;break}}continue}break}this.x=x,this.y=y;this.scrollDisp(-this.ydisp+yb);if(this.visualMode){this.selectText(ox,this.x,oy+oyd,this.ydisp+this.y)}return}if(key==="b"||key==="B"){var ox=this.x;var oy=this.y;var oyd=this.ydisp;var x=this.x;var y=this.y;var yb=this.ydisp;for(;;){var line=this.lines[yb+y];var saw_space=x>0&&line[x][1]>" "&&line[x-1][1]>" ";while(x>=0){if(line[x][1]<=" "){if(saw_space&&(x+1<this.cols&&line[x+1][1]>" ")){x++;break}else{saw_space=true}}x--}if(x<0)x=0;if(x===0&&(line[x][1]<=" "||!saw_space)){x=this.cols-1;if(--y<0){y++;if(--yb<0){yb++;x=0;break}}continue}break}this.x=x,this.y=y;this.scrollDisp(-this.ydisp+yb);if(this.visualMode){this.selectText(ox,this.x,oy+oyd,this.ydisp+this.y)}return}if(key==="e"||key==="E"){var x=this.x+1;var y=this.y;var yb=this.ydisp;if(x>=this.cols)x--;for(;;){var line=this.lines[yb+y];while(x<this.cols){if(line[x][1]<=" "){x++}else{break}}while(x<this.cols){if(line[x][1]<=" "){if(x-1>=0&&line[x-1][1]>" "){x--;break}}x++}if(x>=this.cols)x=this.cols-1;if(x===this.cols-1&&line[x][1]<=" "){x=0;if(++y>=this.rows){y--;if(++yb>this.ybase){yb=this.ybase;break}}continue}break}this.x=x,this.y=y;this.scrollDisp(-this.ydisp+yb);if(this.visualMode){this.selectText(ox,this.x,oy+oyd,this.ydisp+this.y)}return}if(key==="^"||key==="0"){var ox=this.x;if(key==="0"){this.x=0}else if(key==="^"){var line=this.lines[this.ydisp+this.y];var x=0;while(x<this.cols){if(line[x][1]>" "){break}x++}if(x>=this.cols)x=this.cols-1;this.x=x}if(this.visualMode){this.selectText(ox,this.x,this.ydisp+this.y,this.ydisp+this.y)}else{this.refresh(this.y,this.y)}return}if(key==="$"){var ox=this.x;var line=this.lines[this.ydisp+this.y];var x=this.cols-1;while(x>=0){if(line[x][1]>" "){if(this.visualMode&&x<this.cols-1)x++;break}x--}if(x<0)x=0;this.x=x;if(this.visualMode){this.selectText(ox,this.x,this.ydisp+this.y,this.ydisp+this.y)}else{this.refresh(this.y,this.y)}return}if(key==="g"||key==="G"){var ox=this.x;var oy=this.y;var oyd=this.ydisp;if(key==="g"){this.x=0,this.y=0;this.scrollDisp(-this.ydisp)}else if(key==="G"){this.x=0,this.y=this.rows-1;this.scrollDisp(this.ybase)}if(this.visualMode){this.selectText(ox,this.x,oy+oyd,this.ydisp+this.y)}return}if(key==="H"||key==="M"||key==="L"){var ox=this.x;var oy=this.y;if(key==="H"){this.x=0,this.y=0}else if(key==="M"){this.x=0,this.y=this.rows/2|0}else if(key==="L"){this.x=0,this.y=this.rows-1}if(this.visualMode){this.selectText(ox,this.x,this.ydisp+oy,this.ydisp+this.y)}else{this.refresh(oy,oy);this.refresh(this.y,this.y)}return}if(key==="{"||key==="}"){var ox=this.x;var oy=this.y;var oyd=this.ydisp;var line;var saw_full=false;var found=false;var first_is_space=-1;var y=this.y+(key==="{"?-1:1);var yb=this.ydisp;var i;if(key==="{"){if(y<0){y++;if(yb>0)yb--}}else if(key==="}"){if(y>=this.rows){y--;if(yb<this.ybase)yb++}}for(;;){line=this.lines[yb+y];for(i=0;i<this.cols;i++){if(line[i][1]>" "){if(first_is_space===-1){first_is_space=0}saw_full=true;break}else if(i===this.cols-1){if(first_is_space===-1){first_is_space=1}else if(first_is_space===0){found=true}else if(first_is_space===1){if(saw_full)found=true}break}}if(found)break;if(key==="{"){y--;if(y<0){y++;if(yb>0)yb--;else break}}else if(key==="}"){y++;if(y>=this.rows){y--;if(yb<this.ybase)yb++;else break}}}if(!found){if(key==="{"){y=0;yb=0}else if(key==="}"){y=this.rows-1;yb=this.ybase}}this.x=0,this.y=y;this.scrollDisp(-this.ydisp+yb);if(this.visualMode){this.selectText(ox,this.x,oy+oyd,this.ydisp+this.y)}return}if(key==="/"||key==="?"){if(!this.visualMode){this.enterSearch(key==="/")}return}return false};Terminal.prototype.keySearch=function(ev,key){if(key===""){this.leaveSearch();return}if(key==="\r"||!this.searchMode&&(key==="n"||key==="N")){this.leaveSearch();var entry=this.entry;if(!entry){this.refresh(0,this.rows-1);return}var ox=this.x;var oy=this.y;var oyd=this.ydisp;var line;var found=false;var wrapped=false;var x=this.x+1;var y=this.ydisp+this.y;var yb,i;var up=key==="N"?this.searchDown:!this.searchDown;for(;;){line=this.lines[y];while(x<this.cols){for(i=0;i<entry.length;i++){if(x+i>=this.cols)break;if(line[x+i][1]!==entry[i]){break}else if(line[x+i][1]===entry[i]&&i===entry.length-1){found=true;break}}if(found)break;x+=i+1}if(found)break;x=0;if(!up){y++;if(y>this.ybase+this.rows-1){if(wrapped)break;wrapped=true;y=0}}else{y--;if(y<0){if(wrapped)break;wrapped=true;y=this.ybase+this.rows-1}}}if(found){if(y-this.ybase<0){yb=y;y=0;if(yb>this.ybase){y=yb-this.ybase;yb=this.ybase}}else{yb=this.ybase;y-=this.ybase}this.x=x,this.y=y;this.scrollDisp(-this.ydisp+yb);if(this.visualMode){this.selectText(ox,this.x,oy+oyd,this.ydisp+this.y)}return}this.refresh(0,this.rows-1);return}if(key==="\b"||key===""){if(this.entry.length===0)return;var bottom=this.ydisp+this.rows-1;this.entry=this.entry.slice(0,-1);var i=this.entryPrefix.length+this.entry.length;this.lines[bottom][i]=[this.lines[bottom][i][0]," "];this.x--;this.refresh(this.rows-1,this.rows-1);this.refresh(this.y,this.y);return}if(key.length===1&&key>=" "&&key<="~"){var bottom=this.ydisp+this.rows-1;this.entry+=key;var i=this.entryPrefix.length+this.entry.length-1;this.lines[bottom][i]=[this.defAttr&~511|4,key];this.x++;this.refresh(this.rows-1,this.rows-1);this.refresh(this.y,this.y);return}return false};Terminal.charsets={};Terminal.charsets.SCLD={"`":"â—†",a:"â–’",b:" ",c:"\f",d:"\r",e:"\n",f:"°",g:"±",h:"â¤",i:"",j:"â”",k:"â”",l:"┌",m:"â””",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"â”´",w:"┬",x:"│",y:"≤",z:"≥","{":"Ď€","|":"≠","}":"ÂŁ","~":"·"};Terminal.charsets.UK=null;Terminal.charsets.US=null;Terminal.charsets.Dutch=null;Terminal.charsets.Finnish=null;Terminal.charsets.French=null;Terminal.charsets.FrenchCanadian=null;Terminal.charsets.German=null;Terminal.charsets.Italian=null;Terminal.charsets.NorwegianDanish=null;Terminal.charsets.Spanish=null;Terminal.charsets.Swedish=null;Terminal.charsets.Swiss=null;Terminal.charsets.ISOLatin=null;function on(el,type,handler,capture){el.addEventListener(type,handler,capture||false)}function off(el,type,handler,capture){el.removeEventListener(type,handler,capture||false)}function cancel(ev){if(ev.preventDefault)ev.preventDefault();ev.returnValue=false;if(ev.stopPropagation)ev.stopPropagation();ev.cancelBubble=true;return false}function inherits(child,parent){function f(){this.constructor=child}f.prototype=parent.prototype;child.prototype=new f}function isBoldBroken(document){var body=document.getElementsByTagName("body")[0];var terminal=document.createElement("div");terminal.className="terminal";var line=document.createElement("div");var el=document.createElement("span");el.innerHTML="hello world";line.appendChild(el);terminal.appendChild(line);body.appendChild(terminal);var w1=el.scrollWidth;el.style.fontWeight="bold";var w2=el.scrollWidth;body.removeChild(terminal);return w1!==w2}var String=this.String;var setTimeout=this.setTimeout;var setInterval=this.setInterval;function indexOf(obj,el){var i=obj.length;while(i--){if(obj[i]===el)return i}return-1}function isWide(ch){if(ch<="＀")return false;return ch>="ďĽ"&&ch<="ďľľ"||ch>="ďż‚"&&ch<="ᅦ"||ch>="ᅧ"&&ch<="ᅬ"||ch>="ďż’"&&ch<="ďż—"||ch>="ďżš"&&ch<="ďżś"||ch>="ďż "&&ch<="₩"||ch>="│"&&ch<="ďż®"}function matchColor(r1,g1,b1){var hash=r1<<16|g1<<8|b1;if(matchColor._cache[hash]!=null){return matchColor._cache[hash]}var ldiff=Infinity,li=-1,i=0,c,r2,g2,b2,diff;for(;i<Terminal.vcolors.length;i++){c=Terminal.vcolors[i];r2=c[0];g2=c[1];b2=c[2];diff=matchColor.distance(r1,g1,b1,r2,g2,b2);if(diff===0){li=i;break}if(diff<ldiff){ldiff=diff;li=i}}return matchColor._cache[hash]=li}matchColor._cache={};matchColor.distance=function(r1,g1,b1,r2,g2,b2){return Math.pow(30*(r1-r2),2)+Math.pow(59*(g1-g2),2)+Math.pow(11*(b1-b2),2)};function each(obj,iter,con){if(obj.forEach)return obj.forEach(iter,con);for(var i=0;i<obj.length;i++){iter.call(con,obj[i],i,obj)}}function keys(obj){if(Object.keys)return Object.keys(obj);var key,keys=[];for(key in obj){if(Object.prototype.hasOwnProperty.call(obj,key)){keys.push(key)}}return keys}Terminal.EventEmitter=EventEmitter;Terminal.inherits=inherits;Terminal.on=on;Terminal.off=off;Terminal.cancel=cancel;if(typeof module!=="undefined"){module.exports=Terminal}else{this.Terminal=Terminal}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file diff --git a/docs.it4i/js/tty-player.js b/docs.it4i/js/tty-player.js deleted file mode 100644 index 04ab2e44bb6c38938a015b2de6e7ba0d86500b12..0000000000000000000000000000000000000000 --- a/docs.it4i/js/tty-player.js +++ /dev/null @@ -1,1716 +0,0 @@ -// W069 is “['x'] is better written in dot notation”, but Closure Compiler wants ['x']. -// jshint -W069 -// jshint bitwise: false -// ==ClosureCompiler== -// @output_file_name tty-player.min.js -// @compilation_level ADVANCED_OPTIMIZATIONS -// ==/ClosureCompiler== -/* global MediaError, TimeRanges, Terminal, HTMLElement */ -;(function() { -"use strict"; - -var textDecoder = "TextDecoder" in window ? new TextDecoder() : null; -/// @param {Array<number>|Uint8Array} array -function decodeUTF8(array) { - if (array instanceof Array || !textDecoder) { - return decodeURIComponent(Array.prototype.map.call(array, function(ord) { - return "%" + ("0" + ord.toString(16)).substr(-2); - }).join("")); - } else { - return textDecoder.decode(array); - } -} - -/// parseDataURI("data:foo/bar;base64,MTIzNA==#foo") === "1234" -/// @param {string} uri -function parseDataURI(uri) { - // [whole uri, "base64" or undefined, data] - var chunks = /^data:([^,]*),([^#]+)/.exec(uri); - if (chunks === null) { - return null; - } - var data = decodeURIComponent(chunks[2]); - var mime = chunks[1].replace(/;base64$/, ""); - return [mime, mime === chunks[1] ? data : atob(data)]; -} - -/// @param {Array<number>|Uint8Array} array -function byteArrayToString(array) { - // String.fromCharCode.apply can for too large values overflow the call stack. - // Hence this, though I doubt we actually use large enough strings to worry. - // http://stackoverflow.com/a/12713326 - var CHUNK_SIZE = 0x8000; - var c = []; - for (var i = 0; i < array.length; i += CHUNK_SIZE) { - c.push(String.fromCharCode.apply(null, array["subarray" in array ? "subarray" : "slice"](i, i + CHUNK_SIZE))); - } - return c.join(""); -} - -function parseNPT(npt) { - // Format: [npt:]([h:]mm:ss|seconds)[.subsecond] - // I’ve decided to be lazy and allow "1:2:3.4" as well as "1:02:03.4" - // This makes it [npt:][[h:]m:]s[.subsecond] - var match = /^(?:npt:)?(?:(?:(\d+):)?(\d+):)?(\d+(?:\.\d+)?)$/i.exec(npt); - return match ? (match[1] || 0) * 3600 + (match[2] || 0) * 60 + match[3] : null; -} - -function classifyPosterURL(url) { - if (!url) { - // There is no poster. - return {type: null}; - } - switch (/^(?:(.*):)?/.exec(url)[1]) { - case "npt": - var time = parseNPT(url); - return time ? {type: "npt", time: time} : {type: null}; - case "data": - var data = parseDataURI(url); - if (/^text\/plain$/i.test(data[0])) { - return {type: "text", data: data[1]}; - } - } - // TODO: treat all the other possibilities as images. - return {type: null}; -} - -/// @param {ArrayBuffer|Array<number>} source -function parseTTYRec(source) { - var isArray = source instanceof Array; - var utf8 = true; - var dimensions = null; - var data = []; - var byteOffset = 0; - var timeOffset = 0; - var sourceLength = isArray ? source.length : source.byteLength; - while (byteOffset < sourceLength) { - var sec, usec, len; - if (!isArray) { - var header = new DataView(source, byteOffset); - sec = header.getUint32(0, true); - usec = header.getUint32(4, true); - len = header.getUint32(8, true); - } else { - sec = source[byteOffset] + - (source[byteOffset + 1] << 8) + - (source[byteOffset + 2] << 16) + - (source[byteOffset + 3] << 24); - usec = source[byteOffset + 4] + - (source[byteOffset + 5] << 8) + - (source[byteOffset + 6] << 16) + - (source[byteOffset + 7] << 24); - len = source[byteOffset + 8] + - (source[byteOffset + 9] << 8) + - (source[byteOffset + 10] << 16) + - (source[byteOffset + 11] << 24); - } - var time = sec + (usec / 1000000); - byteOffset += 12; - var payload = isArray ? source.slice(byteOffset, byteOffset + len) - : new Uint8Array(source, byteOffset, len); - payload = utf8 ? decodeUTF8(payload) : byteArrayToString(payload); - if (byteOffset === 12) { - // First chunk might be metadata; this is how termrec does it, for example. - timeOffset = time; - var metadata = /^\x1b%(G|@)\x1b\[8;([0-9]+);([0-9]+)t$/.exec(payload); - if (metadata) { - utf8 = metadata[1] === "G"; - dimensions = { - rows: +metadata[2], - cols: +metadata[3] - }; - } - } - time -= timeOffset; - byteOffset += len; - data.push([payload, time]); - } - return { - // Heuristic: if the time offset is large enough, it’s probably a timestamp. - startDate: timeOffset >= 1e8 ? new Date(timeOffset * 1000) : null, - dimensions: dimensions, - data: data - }; -} - -function formatTime(time) { - var seconds = time | 0; - var minutes = seconds / 60 | 0; - seconds = ("0" + (seconds % 60)).substr(-2); - if (minutes >= 60) { - var hours = minutes / 60 | 0; - minutes = ("0" + (minutes % 60)).substr(-2); - return hours + ":" + minutes + ":" + seconds; - } else { - return minutes + ":" + seconds; - } -} - -function blankableAttributeProperty(name) { - return { - get: function() { - var value = this.getAttribute(name); - return value === null ? "" : value.trim(); - }, - set: function(value) { - this.setAttribute(name, value); - } - }; -} - -function attributeBooleanProperty(name) { - return { - get: function() { - return this.hasAttribute(name); - }, - set: function(bool) { - if (bool) { - this.setAttribute(name, ""); - } else { - this.removeAttribute(name); - } - } - }; -} - -function invalidStateError() { - document.createElement("video").currentTime = 1; -} - -/** @const */ var NETWORK_EMPTY = 0; -/** @const */ var NETWORK_IDLE = 1; -/** @const */ var NETWORK_LOADING = 2; -/** @const */ var NETWORK_NO_SOURCE = 3; - -/** @const */ var HAVE_NOTHING = 0; -/** @const */ var HAVE_METADATA = 1; -/** @const */ var HAVE_CURRENT_DATA = 2; -/** @const */ var HAVE_FUTURE_DATA = 3; -/** @const */ var HAVE_ENOUGH_DATA = 4; - -// Annoyingly, with things like MediaError, one apparently can’t construct them in any way. -// I might need to do something like this. -var My = {}; -// Note that the constants on MediaError are *not* on My.MediaError, though they are on instances. -My.MediaError = /** @constructor */ function(code) { - Object.defineProperty(this, "code", {value: code}); -}; -My.MediaError.prototype = Object.create(MediaError.prototype); - -/** @const */ var EMPTY_TIME_RANGES = document.createElement("video").played; - -My.TimeRanges = /** @constructor */ function(ranges) { - Object.defineProperty(this, "length", {value: ranges.length}); - this["_"] = ranges; -}; -My.TimeRanges.prototype = Object.create(TimeRanges.prototype); - -My.TimeRanges.prototype["start"] = function(i) { - if (i < this["length"]) { - return this["_"][i][0]; - } else { - return EMPTY_TIME_RANGES["end"](0); // Throws IndexSizeError - } -}; - -My.TimeRanges.prototype["end"] = function(i) { - if (i < this["length"]) { - return this["_"][i][1]; - } else { - return EMPTY_TIME_RANGES["end"](0); // Throws IndexSizeError - } -}; - -/** @const */ var MEDIA_ERR_ABORTED = 1; -/** @const */ var MEDIA_ERR_NETWORK = 2; -/** @const */ var MEDIA_ERR_DECODE = 3; -/** @const */ var MEDIA_ERR_SRC_NOT_SUPPORTED = 4; - -/** @const */ var ERROR_DETAILS = { - 1: ["MEDIA_ERR_ABORTED", "The fetching process for the media resource was aborted by the user agent at the user's request."], - 2: ["MEDIA_ERR_NETWORK", "A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable."], - 3: ["MEDIA_ERR_DECODE", "An error of some description occurred while decoding the media resource, after the resource was established to be usable."], - 4: ["MEDIA_ERR_SRC_NOT_SUPPORTED", "The media resource indicated by the \x1b[4msrc\x1b[24m attribute was not suitable."] -}; - -/** @const */ var FANCY_TECHNICAL_ERROR_EXPLANATIONS = true; - -var menuIdSequence = 0; - -function makeMenu(ttyPlayer) { - // Make a context menu with these items: - // - Play/Pause - // - Show/Hide Controls - // - // Firefox also has the following ones deemed unnecessary: - // - // - Mute/Unmute - // - Play Speed > - // - Slow Motion (0.5Ă—) - // - Normal Speed (1Ă—) - // - High Speed (1.5Ă—) - // - Ludicrous Speed (2Ă—) - // - Show Statistics - // - Full Screen - // - // Chrome has Show controls (lowercase c) as a toggle and adds a Loop item. - var menu = document.createElement("menu"); - if (!("type" in menu)) { - return null; - } - - try { - menu.type = "context"; - } catch (e) { - // IE 11, "Invalid argument." - } - if (menu.type !== "context") { - return null; - } - menu.id = "treplay-contextmenu-" + menuIdSequence++; - - var playPause = document.createElement("menuitem"); - playPause.onclick = function() { - if (ttyPlayer["paused"]) { - ttyPlayer["play"](); - } else { - ttyPlayer["pause"](); - } - }; - function setPlayPauseDetails(label, path) { - playPause.label = label; - playPause.icon = "data:image/svg+xml,%3C?xml version='1.0' encoding='UTF-8' standalone='no'?%3E%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath stroke='%23999' stroke-width='1' fill='%23eee' d='" + path + "'/%3E%3C/svg%3E"; - } - function onPlay() { - setPlayPauseDetails("Pause", "m2.5,1.5 0,13 4,0 0,-13zm7,0 0,13 4,0 0,-13z"); - } - function onPause() { - setPlayPauseDetails("Play", "m2.5,2 0,12 11,-6z"); - } - onPause(); - ttyPlayer.addEventListener("play", onPlay); - ttyPlayer.addEventListener("pause", onPause); - - var controls = document.createElement("menuitem"); - menu.onControlsShownOrHidden = function() { - if (ttyPlayer["controls"]) { - controls.label = "Hide Controls"; - } else { - controls.label = "Show Controls"; - } - }; - menu.onControlsShownOrHidden(); - controls.onclick = function() { - ttyPlayer["controls"] = !ttyPlayer["controls"]; - }; - - menu.appendChild(playPause); - menu.appendChild(controls); - return menu; -} - -// TODO: reset() hides the cursor; patch term.js so if useFocus === false it is shown by default? -var stockReset = Terminal.prototype["reset"]; -Terminal.prototype["reset"] = function() { - stockReset.call(this); - if ("useFocus" in this["options"] && !this["options"]["useFocus"]) { - this["showCursor"](); - } -}; - -// IDL for this code: -// -// interface HTMLTTYPlayerElement : HTMLMediaElement { -// attribute DOMString defaultTitle; -// attribute DOMString title; -// -// readonly attribute unsigned long cols; -// readonly attribute unsigned long rows; -// void resize(unsigned long cols, unsigned long rows); -// -// attribute EventHandler ontitlechange; -// -// // This one is straight from HTMLVideoElement. -// attribute DOMString poster; -// -// // s/void/avoid/ -// void pretendToBeAVideo(); -// } -// -// IDL taken from HTML 5 spec: -// -// enum CanPlayTypeEnum { "" /* empty string */, "maybe", "probably" }; -// interface HTMLMediaElement : HTMLElement { -// -// // error state -// readonly attribute MediaError? error; -// -// // network state -// attribute DOMString src; -// readonly attribute DOMString currentSrc; -// attribute DOMString crossOrigin; -// const unsigned short NETWORK_EMPTY = 0; -// const unsigned short NETWORK_IDLE = 1; -// const unsigned short NETWORK_LOADING = 2; -// const unsigned short NETWORK_NO_SOURCE = 3; -// readonly attribute unsigned short networkState; -// attribute DOMString preload; -// readonly attribute TimeRanges buffered; -// void load(); -// CanPlayTypeEnum canPlayType(DOMString type); -// -// // ready state -// const unsigned short HAVE_NOTHING = 0; -// const unsigned short HAVE_METADATA = 1; -// const unsigned short HAVE_CURRENT_DATA = 2; -// const unsigned short HAVE_FUTURE_DATA = 3; -// const unsigned short HAVE_ENOUGH_DATA = 4; -// readonly attribute unsigned short readyState; -// readonly attribute boolean seeking; -// -// // playback state -// attribute double currentTime; -// readonly attribute unrestricted double duration; -// Date getStartDate(); -// readonly attribute boolean paused; -// attribute double defaultPlaybackRate; -// attribute double playbackRate; -// readonly attribute TimeRanges played; -// readonly attribute TimeRanges seekable; -// readonly attribute boolean ended; -// attribute boolean autoplay; -// attribute boolean loop; -// void play(); -// void pause(); -// -// // media controller -// attribute DOMString mediaGroup; -// attribute MediaController? controller; -// -// // controls -// attribute boolean controls; -// attribute double volume; -// attribute boolean muted; -// attribute boolean defaultMuted; -// -// // tracks -// readonly attribute AudioTrackList audioTracks; -// readonly attribute VideoTrackList videoTracks; -// readonly attribute TextTrackList textTracks; -// TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = ""); -// }; -// -// interface HTMLVideoElement : HTMLMediaElement { -// attribute unsigned long width; -// attribute unsigned long height; -// readonly attribute unsigned long videoWidth; -// readonly attribute unsigned long videoHeight; -// attribute DOMString poster; -// }; - -/** @constructor */ -function TTYPlayerInternalState(ttyPlayer) { - this.ttyPlayer = ttyPlayer; -} - -var ISP = TTYPlayerInternalState.prototype; - -ISP.setUp = function() { - var self = this; - var ttyPlayer = self.ttyPlayer; - self.titleElement = document.createElement("div"); - self.titleElement.className = "title"; - ttyPlayer.appendChild(self.titleElement); - - self.terminal = new Terminal({"useFocus": false}); - /*self.terminal.on("title", function(newTitle) { - ttyPlayer["title"] = newTitle; - });*/ - - self.terminal.open(ttyPlayer); - - if (FANCY_TECHNICAL_ERROR_EXPLANATIONS) { - ttyPlayer.addEventListener("error", function() { - var details = ERROR_DETAILS[self.error.code]; - self.terminal.reset(); - self.terminal.write( - "\x1b]2;Error :-(\x07" + - "\r\n\x1b[1mMediaError.\x1b[31m" + details[0] + "\x1b[m " + - "(numeric value " + self.error.code + ")\r\n\r\n" + - " " + details[1] + "\r\n\r\n(Sorry ’bout that.)"); - }); - } - - var rows = +ttyPlayer.getAttribute("rows"); - var cols = +ttyPlayer.getAttribute("cols"); - ttyPlayer["resize"](cols > 0 ? cols : ttyPlayer["cols"], - rows > 0 ? rows : ttyPlayer["rows"]); - - // XXX: properties with names used in the DOM don’t get shrunk by Closure - // Compiler’s advanced optimizations, for safety. We could get size down a - // smidgeon more by renaming them all, but that’d be uglier. - // Candidates: defaultPlaybackRate, playbackRate, currentSrc, readyState, networkState, paused, duration. - - self.defaultPlaybackRate = self.playbackRate = 4; - self.defaultPlaybackStartPosition = 0; - self.currentSrc = ""; - self.readyState = HAVE_NOTHING; - self.networkState = NETWORK_EMPTY; - self.paused = true; - self.duration = NaN; - self.defaultTitle = ttyPlayer.getAttribute("window-title") || ""; - self.posterOverlay = document.createElement("tty-player-poster"); - self.posterOverlay.onclick = function() { - ttyPlayer["play"](); - }; - - self.terminal.on("resize", function() { - // ttyPlayer.rows and ttyPlayer.cols have changed, fire an appropriate event - self.fireSimpleEvent("resize"); - }); - - self.menu = makeMenu(ttyPlayer); - if (self.menu) { - ttyPlayer.appendChild(self.menu); - ttyPlayer.setAttribute("contextmenu", self.menu.id); - } - - self.controlsElement = document.createElement("tty-player-controls"); - var play = document.createElement("button"); - play.className = "play"; - play.onclick = function() { - if (ttyPlayer["paused"]) { - ttyPlayer["play"](); - } else { - ttyPlayer["pause"](); - } - }; - ttyPlayer.addEventListener("play", function() { - play.className = "pause"; - }); - ttyPlayer.addEventListener("pause", function() { - play.className = "play"; - }); - self.currentTimeElement = document.createElement("span"); - self.currentTimeElement.className = "current-time"; - self.currentTimeElement.textContent = "0:00"; - self.durationElement = document.createElement("span"); - self.durationElement.className = "duration"; - self.durationElement.textContent = "0:00"; - self.progressElement = document.createElement("input"); - self.progressElement.type = "range"; - self.progressElement.value = 0; - self.progressElement.min = 0; - self.progressElement.step = "any"; - var skipChange = false; - self.progressElement.addEventListener("input", function() { - if (!skipChange) { - skipChange = true; - self.semipaused = true; - ttyPlayer["currentTime"] = self.progressElement.value; - self.updateCurrentTimeElement(); - skipChange = false; - } - }); - self.progressElement.addEventListener("change", function() { - if (!skipChange) { - skipChange = true; - self.semipaused = false; - ttyPlayer["currentTime"] = self.progressElement.value; - self.updateCurrentTimeElement(); - skipChange = false; - } - }); - ttyPlayer.addEventListener("durationchange", function() { - self.progressElement.max = self.duration; - self.durationElement.textContent = formatTime(self.duration); - }); - ttyPlayer.addEventListener("timeupdate", function() { - if (!skipChange) { - skipChange = true; - self.progressElement.value = self.currentTime; - self.updateCurrentTimeElement(); - skipChange = false; - } - }); - self.controlsElement.appendChild(play); - self.controlsElement.appendChild(self.currentTimeElement); - self.controlsElement.appendChild(self.progressElement); - self.controlsElement.appendChild(self.durationElement); - ttyPlayer.appendChild(self.posterOverlay); - ttyPlayer.appendChild(self.controlsElement); - self.showPoster = true; -}; - -Object.defineProperties(ISP, { - /** @lends {ISP} */ - showPoster: { - get: function() { - return this._showPoster; - }, - set: function(newValue) { - // TODO: this is problematic because it doesn’t keep track of what - // poster is active, it just uses the current value of poster. We - // should probably store the value of poster and use it for - // removing it. - var self = this; - var oldValue = self._showPoster; - newValue = !!newValue; - - var newPoster = classifyPosterURL(self.ttyPlayer["poster"]); - self._showPoster = !!newValue; - - // We don’t show the overlay if there is an error - var showOverlay = newValue && !self.error; - - self.posterOverlay.style.display = showOverlay ? "" : "none"; - self.controlsElement.classList[showOverlay ? "add" : "remove"]("poster"); - self.progressElement.disabled = newValue; - self.controlsShownOrHidden(); - - if (oldValue === newValue && self.activePoster === newPoster) { - // No change to make - return; - } - - // If we need to do anything special to remove a poster, here’s what we’ll do: - // if (oldValue) { - // switch (self.activePoster.type) { - // case "foo": - // … - // } - // } - - self.activePoster = newPoster; - - if (oldValue || newValue) { - // Yes, we’re missing the optimisation possibility of poster=npt:X - // changing to poster=npt:Y where Y > X. Seriously, adjusting - // poster *at all* is rare enough that I don’t care. - self.resetTerminal(); - } - - if (newValue) { - // Show the new poster - switch (newPoster.type) { - case "npt": - // We have an NPT poster to create. - self.resetTerminal(); - - var realShowPoster = function() { - if (newValue !== self._showPoster) { - // Sorry, you took too long and I don’t want to do anything now; - // something else is doing it. - return; - } - - if (newValue) { - var currentTime = self.currentTime; - var semipaused = self.semipaused; - self.semipaused = true; - self.currentTime = newPoster.time; - self.nextDataIndex = 0; - self.render(); - self.semipaused = semipaused; - self.currentTime = currentTime; - } - }; - - if (self.data) { - realShowPoster(); - } else { - var loaded = function() { - self.ttyPlayer.removeEventListener("canplaythrough", loaded); - realShowPoster(); - }; - self.ttyPlayer.addEventListener("canplaythrough", loaded); - self.loadIfNotLoading(); - } - break; - case "text": - self.resetTerminal(); - self.terminal.write(newPoster.data); - } - } - } - } -}); - -/// Firing a simple event named e means that a trusted event with the name -/// e, which does not bubble (except where otherwise stated) and is not -/// cancelable (except where otherwise stated), and which uses the Event -/// interface, must be created and dispatched at the given target. -/// INCONSISTENCY: isTrusted = false -ISP.fireSimpleEvent = function(name) { - var event = document.createEvent("HTMLEvents"); - event.initEvent(name, false, false); - var f = this.ttyPlayer["on" + name]; - if (typeof f === "function") { - f(event); - } - this.ttyPlayer.dispatchEvent(event); -}; - -ISP.controlsShownOrHidden = function() { - this.updateCurrentTimeElement(); - if (this.menu) { - this.menu.onControlsShownOrHidden(); - } -}; - -ISP.updateCurrentTimeElement = function() { - this.currentTimeElement.textContent = formatTime(this.currentTime); - var left = this.progressElement.offsetLeft - (this.currentTimeElement.offsetWidth / 2); - if (!isNaN(this.duration)) { - left += this.currentTime / this.duration * this.progressElement.offsetWidth; - } - this.currentTimeElement.style.left = left + "px"; -}; - -/** @const */ var TICK = 16; -/** @const */ var TIME_UPDATE_FREQUENCY = 100; -ISP.lastTimeUpdate = 0; - -ISP.render = function() { - // Should the currently rendered frame (next - 1) be drawn? - if (this.nextDataIndex > 0 && this.data[this.nextDataIndex - 1][1] > this.currentTime) { - // No, but undoing isn’t possible, so we must replay from the start. - // This is highly inefficient; for large scripts it’s utterly untenable. - this.resetTerminal(); - this.nextDataIndex = 0; - } - while (this.nextDataIndex < this.data.length && this.data[this.nextDataIndex][1] <= this.currentTime) { - this.terminal.write(this.data[this.nextDataIndex][0]); - this.nextDataIndex++; - } - - if (this.semipaused) { - return; - } - - // Have we reached the end? Let’s stop. - if ((this.currentTime >= this.duration && this.playbackRate > 0) || - (this.currentTime <= 0 && this.playbackRate < 0)) { - if (this.ttyPlayer["loop"]) { - this.ttyPlayer["currentTime"] = this.playbackRate > 0 ? 0 : this.duration; - } else { - this.fireSimpleEvent("timeupdate"); - this.ttyPlayer["pause"](); - this.fireSimpleEvent("ended"); - } - } else { - // Do we need to fire a timeupdate event? We should do them every 66–350ms; Firefox does 250 for video, but because the average length is going to be shorter and because I can, I’m going for 100ms. - var time = +new Date(); - if (time - this.lastTimeUpdate >= TIME_UPDATE_FREQUENCY) { - this.lastTimeUpdate = time; - this.fireSimpleEvent("timeupdate"); - } - } -}; - -ISP.resetTerminal = function() { - this.terminal.reset(); - this.ttyPlayer["title"] = this.defaultTitle; -}; - -ISP.loadIfNotLoading = function() { - if (this.networkState < NETWORK_LOADING) { - this.mediaLoadAlgorithm(); - } -}; - -ISP.mediaLoadAlgorithm = function() { - this.resetTerminal(); - - // > The media load algorithm consists of the following steps. - - // > 1. Abort any already-running instance of the resource selection - // > algorithm for this element. - if (this.resourceFetchXHR) { - this.resourceFetchXHR.abort(); - } - - // > 2. If there are any tasks from the media element's media element - // > event task source in one of the task queues, then remove those - // > tasks. - // > - // > If there are any tasks that were queued by the resource - // > selection algorithm (including the algorithms that it itself - // > invokes) for this same media element from the DOM manipulation - // > task source in one of the task queues, then remove those tasks. - // > - // > Note: Basically, pending events and callbacks for the media - // > element are discarded when the media element starts loading a - // > new resource. - // - // [Nothing to do, we aren’t queuing events.] - - // > 3. If the media element's networkState is set to NETWORK_LOADING - // > or NETWORK_IDLE, queue a task to fire a simple event named - // > abort at the media element. - if (this.networkState === NETWORK_LOADING || - this.networkState === NETWORK_IDLE) { - this.fireSimpleEvent("abort"); - } - - // > 4. If the media element's networkState is not set to - // > NETWORK_EMPTY, then run these substeps: - if (this.networkState !== NETWORK_EMPTY) { - // > 1. Queue a task to fire a simple event named emptied at the - // > media element. - this.fireSimpleEvent("emptied"); - - // > 2. If a fetching process is in progress for the media element, - // > the user agent should stop it. - // TODO. - - // > 3. Forget the media element's media-resource-specific tracks. - // [Not applicable.] - - // > 4. If readyState is not set to HAVE_NOTHING, then set it to - // > that state. - this.readyState = HAVE_NOTHING; - - // > 5. If the paused attribute is false, then set it to true. - this.paused = true; - clearInterval(this.ticker); - - // > 6. If seeking is true, set it to false. - // [Not applicable.] - - // > 7. Set the current playback position to 0. - // > - // > Set the official playback position to 0. - // > - // > If this changed the official playback position, then queue - // > a task to fire a simple event named timeupdate at the - // > media element. - var oldTime = this.currentTime; - this.currentTime = 0; - this.nextDataIndex = 0; - if (oldTime !== 0) { - this.fireSimpleEvent("timeupdate"); - } - - // > 8. Set the initial playback position to 0. - // Not applicable (TODO? Might be useful?) - - // > 9. Set the timeline offset to Not-a-Number (NaN). - // TODO (haven’t finished supporting timeline offsets) - - // > 10. Update the duration attribute to Not-a-Number (NaN). - // > - // > The user agent will not fire a durationchange event for - // > this particular change of the duration. - this.data = null; - this.duration = NaN; - } - - // > 5. Set the playbackRate attribute to the value of the defaultPlaybackRate attribute. - this.playbackRate = this.defaultPlaybackRate; - - // > 6. Set the error attribute to null and the autoplaying flag to true. - this.error = null; - // TODO. - - // > 7. Invoke the media element's resource selection algorithm. - this.resourceSelectionAlgorithm(); - - // > 8. Note: Playback of any previously playing media resource for this element stops. - // Already done. -}; - -ISP.resourceSelectionAlgorithm = function() { - var self = this; - // We use a simplified version of the resource selection algorithm, - // as we support only one type, don’t use <source> (src only) and - // handle synchronosity differently. - - // > 1. Set the element's networkState attribute to the - // > NETWORK_NO_SOURCE value. - self.networkState = NETWORK_NO_SOURCE; - - // > 2. Set the element's show poster flag to true. - self.showPoster = true; - - // > 3. Set the media element's delaying-the-load-event flag to - // > true (this delays the load event). - // TODO. - - // > 4. Asynchronously await a stable state, allowing the task that - // > invoked this algorithm to continue. The synchronous section - // > consists of all the remaining steps of this algorithm until - // > the algorithm says the synchronous section has ended. - // > (Steps in synchronous sections are marked with ⌛.) - - // > 5. ⌛ If the media element's blocked-on-parser flag is false, - // > then populate the list of pending text tracks. - // [Not applicable.] - - // > 6. ⌛ If the media element has a src attribute, then let mode - // > be attribute. - // > - // > ⌛ Otherwise, if the media element does not have a src - // > attribute but has a source element child, then let mode be - // > children and let candidate be the first such source element - // > child in tree order. - // > - // > ⌛ Otherwise the media element has neither a src attribute - // > nor a source element child: set the networkState to - // > NETWORK_EMPTY, and abort these steps; the synchronous - // > section ends. - // - // We don’t support <source> at present, so this is simpler. - var src = self.ttyPlayer.getAttribute("src"); - if (src === null) { - self.networkState = NETWORK_EMPTY; - return; - } - - // > 7. ⌛ Set the media element's networkState to NETWORK_LOADING. - self.networkState = NETWORK_LOADING; - - // > 8. ⌛ Queue a task to fire a simple event named loadstart at - // > the media element. - self.fireSimpleEvent("loadstart"); - - // > 9. If mode is attribute, then run these substeps: - // [We don’t support <source>, so this is guaranteed.] - - // > 1. ⌛ If the src attribute's value is the empty string, then - // > end the synchronous section, and jump down to the failed - // > with attribute step below. - if (src === "") { - return self.resourceSelectionAlgorithmFailedWithAttribute(); - } - - // > 2. ⌛ Let absolute URL be the absolute URL that would have - // > resulted from resolving the URL specified by the src - // > attribute's value relative to the media element when the - // > src attribute was last changed. - var absoluteURL = new URL(src.trim(), self.ttyPlayer.baseURI); - - // > 3. ⌛ If absolute URL was obtained successfully, set the - // > currentSrc attribute to absolute URL. - self.currentSrc = absoluteURL.toString(); - - // > 4. End the synchronous section, continuing the remaining steps - // > asynchronously. - setTimeout(function() { - - // > 5. If absolute URL was obtained successfully, run the resource - // > fetch algorithm with absolute URL. If that algorithm - // > returns without aborting this one, then the load failed. - // Due to the simpler model used, supporting aborting isn’t necessary. - self.resourceFetchAlgorithm(); - }, 0); -}; - -ISP.resourceSelectionAlgorithmFailedWithAttribute = function() { - // > 6. Failed with attribute: Reaching this step indicates that - // > the media resource failed to load or that the given URL - // > could not be resolved. Queue a task to run the following - // > steps, using the DOM manipulation task source: - - // > 1. Set the error attribute to a new MediaError object whose code attribute is set to MEDIA_ERR_SRC_NOT_SUPPORTED. - this.error = new My.MediaError(MEDIA_ERR_SRC_NOT_SUPPORTED); - - // > 2. Forget the media element's media-resource-specific tracks. - // [Nothing to do.] - - // > 3. Set the element's networkState attribute to the NETWORK_NO_SOURCE value. - this.networkState = NETWORK_NO_SOURCE; - - // > 4. Set the element's show poster flag to true. - this.showPoster = true; - - // > 5. Fire a simple event named error at the media element. - this.fireSimpleEvent("error"); - - // > 6. Set the element's delaying-the-load-event flag to false. This stops delaying the load event. - //this.delayingTheLoadEvent = false; - - // > 7. Wait for the task queued by the previous step to have executed. - // [Not queueing tasks, so nothing to do.] - - // > 8. Abort these steps. Until the load() method is invoked or the src attribute is changed, the element won't attempt to load another resource. -}; - -ISP.resourceFetchAlgorithm = function() { - var self = this; - function finishResourceFetchAlgorithm() { - delete self.resourceFetchXHR; - } - - function continueResourceFetchAlgorithm(data) { - // > Once enough of the media data has been fetched to determine - // > the duration of the media resource, its dimensions, and other - // > metadata: - // > - // > This indicates that the resource is usable. The user agent - // > must follow these substeps: - // > - // > 1. Establish the media timeline for the purposes of the - // > current playback position, the earliest possible position, - // > and the initial playback position, based on the media data. - // [TODO support such things?] - - // > 2. Update the timeline offset to the date and time that - // > corresponds to the zero time in the media timeline - // > established in the previous step, if any. If no explicit - // > time and date is given by the media resource, the timeline - // > offset must be set to Not-a-Number (NaN). - // [Nothing to do.] - - // > 3. Set the current playback position and the official playback - // > position to the earliest possible position. - self.currentTime = 0; - self.nextDataIndex = 0; - - // > 4. Update the duration attribute with the time of the last - // > frame of the resource, if known, on the media timeline - // > established above. If it is not known (e.g. a stream that - // > is in principle infinite), update the duration attribute to - // > the value positive Infinity. - // > - // > Note: The user agent will queue a task to fire a simple - // > event named durationchange at the element at this point. - self.data = data.data; - self.duration = data.data.length === 0 ? 0 : data.data[data.data.length - 1][1]; - self.fireSimpleEvent("durationchange"); - - // > 5. For video elements, set the videoWidth and videoHeight - // > attributes, and queue a task to fire a simple event named - // > resize at the media element. - // > - // > Note: Further resize events will be fired if the dimensions - // > subsequently change. - // TODO: allow this to be written on the HTML - // TODO: modify the file format to track window sizes, then do - // something like this (ttyWidth and ttyHeight, in chars, I - // think). - // These are taken straight from term.js; TODO: modify it to send resize events. - if (data.dimensions) { - self.ttyPlayer["resize"](data.dimensions.cols, data.dimensions.rows); - } - - // XXX: the spec mentions getStartDate(), which data.startDate - // covers, but Firefox and Chrome at least (dunno about others) - // don’t implement that, so I’m not doing anything with it yet. - - // We could render the first frame if we wanted to. Should we? - //self.render(); - - // > 6. Set the readyState attribute to HAVE_METADATA. - // > - // > Note: A loadedmetadata DOM event will be fired as part of - // > setting the readyState attribute to a new value. - self.readyState = HAVE_METADATA; - self.fireSimpleEvent("loadedmetadata"); - - // > 7. Let jumped be false. - var jumped = false; - - // > 8. If the media element's default playback start position is - // > greater than zero, then seek to that time, and let jumped - // > be true. - if (self.defaultPlaybackStartPosition > 0) { - self.currentTime = self.defaultPlaybackStartPosition; - jumped = true; - } - - // > 9. Let the media element's default playback start position be - // > zero. - self.defaultPlaybackStartPosition = 0; - - // > 10. If either the media resource or the address of the current - // > media resource indicate a particular start time, then set - // > the initial playback position to that time and, if jumped - // > is still false, seek to that time and let jumped be true. - // > - // > For example, with media formats that support the Media - // > Fragments URI fragment identifier syntax, the fragment - // > identifier can be used to indicate a start position. - // > [MEDIAFRAG] - // TODO: support Media Fragments, e.g. ?t=a,b#t=c will trim the - // range to [a, b) seconds, starting at c seconds into that range, - // ?t=,b is [0, b); ?t=a is [a, end), it uses NPT. - - // > 11. If either the media resource or the address of the current - // > media resource indicate a particular set of audio or video - // > tracks to enable, or if the user agent has information - // > that would enable it to select specific tracks to improve - // > the user's experience, then the relevant audio tracks must - // > be enabled in the element's audioTracks object, and, of - // > the relevant video tracks, the one that is listed first in - // > the element's videoTracks object must be selected. All - // > other tracks must be disabled. - // > - // > This could again be triggered by Media Fragments URI - // > fragment identifier syntax, but it could also be triggered - // > e.g. by the user agent selecting a 5.1 surround sound - // > audio track over a stereo audio track. [MEDIAFRAG] - // [Not applicable.] - - // > 12. If the media element has a current media controller, then: - // > if jumped is true and the initial playback position, - // > relative to the current media controller's timeline, is - // > greater than the current media controller's media - // > controller position, then seek the media controller to the - // > media element's initial playback position, relative to the - // > current media controller's timeline; otherwise, seek the - // > media element to the media controller position, relative - // > to the media element's timeline. - // [Not applicable.] - - // > Once the readyState attribute reaches HAVE_CURRENT_DATA, after the loadeddata event has been fired, set the element's delaying-the-load-event flag to false. This stops delaying the load event. - // > - // > A user agent that is attempting to reduce network usage while still fetching the metadata for each media resource would also stop buffering at this point, following the rules described previously, which involve the networkState attribute switching to the NETWORK_IDLE value and a suspend event firing. - // > - // > The user agent is required to determine the duration of the media resource and go through this step before playing. - - // > Once the entire media resource has been fetched (but - // > potentially before any of it has been decoded) - // > - // > Fire a simple event named progress at the media element. - self.fireSimpleEvent("progress"); - - // > Set the networkState to NETWORK_IDLE and fire a simple event named suspend at the media element. - self.networkState = NETWORK_IDLE; - self.fireSimpleEvent("suspend"); - - // > If the user agent ever discards any media data and then needs to resume the network activity to obtain it again, then it must queue a task to set the networkState to NETWORK_LOADING. - // [This won’t happen.] - - // > If the user agent can keep the media resource loaded, then the algorithm will continue to its final step below, which aborts the algorithm. - - // The description of when this is supposed to happen is - // surprisingly unclear. Hopefully this will do. - self.readyState = HAVE_ENOUGH_DATA; - self.fireSimpleEvent("loadeddata"); - self.fireSimpleEvent("canplay"); - self.fireSimpleEvent("canplaythrough"); - - finishResourceFetchAlgorithm(); - } - - function handleResponse(xhr, useResponseText) { - if (xhr.status === 200) { - var data; - try { - /** @type {Array<number>|ArrayBuffer} */ - var response; - if (useResponseText) { - var string = xhr.responseText; - response = []; - for (var i = 0; i < string.length; i++) { - response.push(string.charCodeAt(i) & 0xff); - } - } else { - response = xhr.response; - } - - data = parseTTYRec(response); - // TODO: add a bit of validation/sanity checking? - } catch (e) { - // window.console && console.warn && console.warn("parseTTYRec failed: ", e); - // > If the media data can be fetched but is found by - // > inspection to be in an unsupported format, or can - // > otherwise not be rendered at all - // > [Give up and go back to resource selection, which - // > we don’t need to return to due to our design.] - finishResourceFetchAlgorithm(); - self.resourceSelectionAlgorithmFailedWithAttribute(); - return; - } - - // TODO: implement something like this: - // - // > If the media resource is found to have a video track - // > - // > 1. Create a VideoTrack object to represent the - // > video track. - // > - // > 2. Update the media element's videoTracks - // > attribute's VideoTrackList object with the new - // > VideoTrack object. - // > - // > 3. Fire a trusted event with the name addtrack, - // > that does not bubble and is not cancelable, and - // > that uses the TrackEvent interface, with the - // > track attribute initialized to the new - // > VideoTrack object, at this VideoTrackList - // > object. - continueResourceFetchAlgorithm(data); - } else { - // > If the media data cannot be fetched at all, due to - // > network errors, causing the user agent to give up - // > trying to fetch the resource - // > [Give up and go back to resource selection, which - // > we don’t need to return to due to our design.] - finishResourceFetchAlgorithm(); - self.resourceSelectionAlgorithmFailedWithAttribute(); - return; - } - } - - // > 1. Let the current media resource be the resource given by the - // > absolute URL passed to this algorithm. This is now the - // > element's media resource. - // current media resource = self.currentSrc - - // > 2. Remove all media-resource-specific text tracks from the - // > media element's list of pending text tracks, if any. - // [Nothing to do.] - - // > 3. Optionally, run the following substeps. This is the expected - // > behavior if the user agent intends to not attempt to fetch - // > the resource until the user requests it explicitly (e.g. as - // > a way to implement the preload attribute's none keyword). - // [Substeps omitted as I don’t wish to implement no-preload.] - - // > 4. Perform a potentially CORS-enabled fetch of the current - // > media resource's absolute URL, with the mode being the - // > state of the media element's crossorigin content attribute, - // > the origin being the origin of the media element's - // > Document, and the default origin behaviour set to taint. - // > - // - // [Vast swathes of text follow, mostly irrelevant as we load the - // entire resource at once; we don’t need to bother about the - // "stalled" and "suspend" events, and won’t bother for now about - // "progress" every 350±200ms/every byte (whichever is least - // frequent)] - // - // INCORRECTNESS: the window’s origin is used instead of the media - // element’s document’s. Security prevents doing this right. - // Dunno about the taint bit. - - // Past here we go laissez-faire, mostly ignoring the specs. - - var useResponseText; - - // Some browsers (Firefox, Chrome) allow you to use data URIs with - // an XMLHttpRequest, others (IE) don’t. - // To be sure, let’s parse it ourself. (TODO: assess perf.) - var data = parseDataURI(self.currentSrc); - if (data !== null) { - handleResponse({status: 200, responseText: data[1]}, true); - } else { - var xhr = new XMLHttpRequest(); - if (self.ttyPlayer["crossOrigin"] === "use-credentials") { - xhr.withCredentials = true; - } else if (self.ttyPlayer["crossOrigin"] === "anonymous" && "mozAnon" in xhr) { - // INCORRECTNESS: no anonymous support outside Firefox. - // (No one has implemented AnonXMLHttpRequest âą.) - xhr.mozAnon = true; - } - xhr.onabort = finishResourceFetchAlgorithm; - xhr.open("GET", self.currentSrc); - useResponseText = !("responseType" in xhr); - xhr.responseType = "arraybuffer"; - if (xhr.responseType !== "arraybuffer") { - useResponseText = true; - } - if (useResponseText) { - xhr.overrideMimeType("text/plain; charset=x-user-defined"); - xhr.onreadystatechange = function() { - if (xhr.readyState === 4) { - handleResponse(xhr, true); - } - }; - } else { - xhr.onload = xhr.onerror = function() { handleResponse(xhr, false); }; - } - self.resourceFetchXHR = xhr; - try { - xhr.send(); - } catch (e) { - // e.g. relative URL on file: in some browsers. - handleResponse(xhr, undefined); - } - } -}; - -var TTYPlayerPrototype = Object.create(HTMLElement.prototype); - -TTYPlayerPrototype["createdCallback"] = function() { - this["_"] = new TTYPlayerInternalState(this); - this["_"].setUp(); - - // TODO: put no-preload in load(), as defined, rather than here. - // As it stands, changing src will preload even though it need not. - if (this["preload"] !== "none") { - this["load"](); - } - - if (this["autoplay"]) { - this["play"](); - } -}; - -TTYPlayerPrototype["attributeChangedCallback"] = function(name) { - if (name === "src" && this.hasAttribute("src")) { - this["pause"](); - // > If a src attribute of a media element is set or changed, the user - // > agent must invoke the media element's media element load - // > algorithm. (Removing the src attribute does not do this, even if - // > there are source elements present.) - this["load"](); - } else if (name === "controls" && this.hasAttribute("controls")) { - // While the controls are display: none, the position of - // this element is garbage, so we need to fix it now. - this["_"].controlsShownOrHidden(); - } else if (name === "poster") { - // Update the poster if necessary. - // - // > If the specified resource is to be used, then, when the element is - // > created or when the poster attribute is set, changed, or removed, - // > the user agent must run the following steps to determine the - // > element's poster frame (regardless of the value of the element's - // > show poster flag): - // - // Due to the poster=npt:… possibility and how we could otherwise palm - // it off to the browser, we *do* actually regard the show poster flag - // in deciding whether to “run these steps”. - this["_"].showPoster = this["_"].showPoster; - } -}; - -TTYPlayerPrototype["attachedCallback"] = function() { - this["_"].controlsShownOrHidden(); -}; - -Object.defineProperties(TTYPlayerPrototype, { - /** @lends {TTYPlayerPrototype} */ - - /// @idl readonly attribute MediaError? error; - "error": { - get: function() { - return this["_"].error; - } - }, - - /// @idl attribute DOMString src; - "src": { - get: function() { - // It needs to be an absolute URL, and we’re not doing <source> tags, - // so src and currentSrc will actually always be the same. - return this["_"].currentSrc; - }, - set: function(value) { - this.setAttribute("src", value); - } - }, - - /// @idl readonly attribute DOMString currentSrc; - "currentSrc": { - get: function() { - return this["_"].currentSrc; - } - }, - - /// @idl attribute DOMString crossOrigin; - "crossOrigin": { - get: function() { - var value = this.getAttribute("crossorigin"); - if (value === null || value === "anonymous" || value === "use-credentials") { - return value; - } else { - return "anonymous"; - } - }, - set: function(value) { - if (value === null) { - this.removeAttribute("crossorigin"); - } else if (value === "use-credentials") { - this.setAttribute("crossorigin", value); - } else { - // "" == invalid value == "anonymous" - this.setAttribute("crossorigin", "anonymous"); - } - } - }, - - /// @idl const unsigned short NETWORK_EMPTY = 0; - "NETWORK_EMPTY": { value: 0 }, - - /// @idl const unsigned short NETWORK_IDLE = 1; - "NETWORK_IDLE": { value: 1 }, - - /// @idl const unsigned short NETWORK_LOADING = 2; - "NETWORK_LOADING": { value: 2 }, - - /// @idl const unsigned short NETWORK_NO_SOURCE = 3; - "NETWORK_NO_SOURCE": { value: 3 }, - - /// @idl readonly attribute unsigned short networkState; - "networkState": { - get: function() { - return this["_"].networkState; - } - }, - - /// @idl attribute DOMString preload; - "preload": { - get: function() { - var value = this.getAttribute("preload"); - if (value === "none" || value === "metadata" || value === "auto") { - return value; - } else { - // "" == auto, nothing is said about malformed values, and the missing value default is user-agent defined and we have no use for Metadata. - return "auto"; - } - }, - set: function(value) { - if (value === "none" || value === "metadata" || value === "auto") { - this.setAttribute("metadata", value); - } else { - this.removeAttribute("metadata"); - } - } - }, - - /// @idl readonly attribute TimeRanges buffered; - "buffered": { - get: function() { - return this["seekable"]; - } - }, - - // Although they sit here in the IDL, load() and canPlayType() are defined - // later because they’re methods, not properties. - - /// @idl const unsigned short HAVE_NOTHING = 0; - "HAVE_NOTHING": { value: 0 }, - - /// @idl const unsigned short HAVE_METADATA = 1; - "HAVE_METADATA": { value: 1 }, - - /// @idl const unsigned short HAVE_CURRENT_DATA = 2; - "HAVE_CURRENT_DATA": { value: 2 }, - - /// @idl const unsigned short HAVE_FUTURE_DATA = 3; - "HAVE_FUTURE_DATA": { value: 3 }, - - /// @idl const unsigned short HAVE_ENOUGH_DATA = 4; - "HAVE_ENOUGH_DATA": { value: 4 }, - - /// @idl readonly attribute unsigned short readyState; - "readyState": { - get: function() { - return this["_"].readyState; - } - }, - - /// @idl readonly attribute boolean seeking; - // I’m sloppily ignoring the whole seeking thing. Meh, it’s fast, hopefully no one cares about the seeking and seeked events? (TODO evaluate further.) - "seeking": { - value: false - }, - - /// @idl attribute double currentTime; - "currentTime": { - get: function() { - return this["_"].currentTime; - }, - set: function(newTime) { - if (!this["_"].data) { - throw invalidStateError(); - } - this["_"].currentTime = Math.max(0, Math.min(newTime, this["duration"])); - this["_"].render(); - } - }, - - /// @idl readonly attribute unrestricted double duration; - "duration": { - get: function() { - return this["_"].duration; - } - }, - - // @idl Date getStartDate(); - // Firefox and Chrome don’t implement this on HTMLMediaElement, so I’m skipping it for now. - - /// @idl readonly attribute boolean paused - "paused": { - get: function() { - return this["_"].paused; - } - }, - - /// @idl attribute double defaultPlaybackRate; - "defaultPlaybackRate": { - get: function() { - return this["_"].defaultPlaybackRate; - }, - set: function(rate) { - rate = +rate; - var notify = this["_"].defaultPlaybackRate !== rate; - this["_"].defaultPlaybackRate = rate; - if (notify) { - this["_"].fireSimpleEvent("ratechange"); - } - } - }, - - /// @idl attribute double playbackRate; - "playbackRate": { - get: function() { - return this["_"].playbackRate; - }, - set: function(rate) { - rate = +rate; - var notify = this["_"].playbackRate !== rate; - this["_"].playbackRate = rate; - if (notify) { - this["_"].fireSimpleEvent("ratechange"); - } - } - }, - - /// @idl readonly attribute TimeRanges played; - /// @stub Tracking which ranges have been played would take effort! - "played": { - value: EMPTY_TIME_RANGES - }, - - /// @idl readonly attribute TimeRanges seekable; - "seekable": { - get: function() { - if (this["readyState"] === HAVE_ENOUGH_DATA) { - return new My.TimeRanges([0, this["duration"]]); - } else { - return EMPTY_TIME_RANGES; - } - } - }, - - /// @idl readonly attribute boolean ended; - "ended": { - get: function() { - // XXX: I’m guessing these semantics, haven’t checked them. - return this["paused"] && this["currentTime"] === (this["playbackRate"] < 0 ? 0 : this["duration"]); - } - }, - - /// @idl attribute boolean autoplay; - "autoplay": attributeBooleanProperty("autoplay"), - - /// @idl attribute boolean loop; - "loop": attributeBooleanProperty("loop"), - - // play() and pause() are simple properties and so appear later - - // @idl attribute DOMString mediaGroup; - // Firefox and Chrome don’t implement this on HTMLMediaElement, so I’m skipping it for now. - - // @idl attribute MediaController? controller; - // Firefox and Chrome don’t implement this on HTMLMediaElement, so I’m skipping it for now. - - /// @idl attribute boolean controls; - "controls": attributeBooleanProperty("controls"), - - // volume and muted are simple properties and so appear later - - /// @idl attribute boolean defaultMuted; - /// @stub volume is irrelevant - "defaultMuted": attributeBooleanProperty("muted"), - - // @idl readonly attribute AudioTrackList audioTracks; - // Firefox and Chrome don’t implement this on HTMLMediaElement, so I’m skipping it for now. - - // @idl readonly attribute VideoTrackList videoTracks; - // Firefox and Chrome don’t implement this on HTMLMediaElement, so I’m skipping it for now. - - /// @idl readonly attribute TextTrackList textTracks; - /// @stub text tracks aren’t implemented yet—will they be? - "textTracks": { - get: function() { - return document.createElement("video").textTracks; - } - }, - - // addTextTrack() is a simple property and so is added later. - - // The remainder is things that are not part of HTMLMediaElement, as noted earlier. - - /// The window title. - /// - /// @idl attribute DOMString title; - "title": { - get: function() { - return this["_"].titleElement.textContent; - }, - set: function(value) { - this["_"].titleElement.textContent = value; - this["_"].fireSimpleEvent("titlechange"); - } - }, - - /// defaultTitle is to title as defaultRateChange is to rateChange. - /// - /// @idl attribute DOMString defaultTitle; - "defaultTitle": { - get: function() { - return this["_"].defaultTitle; - }, - set: function(value) { - this["_"].defaultTitle = value; - this["_"].fireSimpleEvent("titlechange"); - } - }, - - /// The number of columns in the terminal. - /// This is like HTMLVideoElement.videoWidth but not in pixels. - /// - /// Read-only as it’s rarely altered alone; use this.resize(cols, this.rows) instead. - "cols": { - get: function() { - return this["_"].terminal.cols; - } - }, - - /// The number of rows in the terminal. - /// This is like HTMLVideoElement.videoHeight but not in pixels. - /// - /// Read-only as it’s rarely altered alone; use this.resize(this.cols, rows) instead. - "rows": { - get: function() { - return this["_"].terminal.rows; - } - }, - - // Borrowed from HTMLVideoElement. - /// @idl attribute DOMString poster; - "poster": { - get: function() { - return (this.getAttribute("poster") || "").trim(); - }, - set: function(value) { - this.setAttribute("poster", value); - } - } -}); - -// Here are the simple properties that don’t go in the defineProperties block above. - -/// @idl void load(); -TTYPlayerPrototype["load"] = function() { - this["_"].mediaLoadAlgorithm(); -}; - -/// @idl CanPlayTypeEnum canPlayType(DOMString type); -/// @stub we only support one format at present, anyway. -TTYPlayerPrototype["canPlayType"] = function() { - return "maybe"; -}; - -/// @idl void play(); -TTYPlayerPrototype["play"] = function() { - var self = this; - - function realPlay() { - if (self["ended"]) { - self["currentTime"] = self["playbackRate"] < 0 ? self["duration"] : 0; - } - self["_"].showPoster = false; - self["_"].paused = false; - var lastTime = new Date(); - self["_"].ticker = setInterval(function() { - var newTime = new Date(); - if (!self["_"].semipaused) { - self["currentTime"] += (newTime - lastTime) / 1000 * self["playbackRate"]; - } - lastTime = newTime; - }, TICK); - self["_"].fireSimpleEvent("play"); - } - - function loaded() { - self.removeEventListener("loadeddata", loaded); - realPlay(); - } - - if (this["_"].paused) { - if (this["_"].data) { - realPlay(); - } else { - this.addEventListener("loadeddata", loaded); - this["_"].loadIfNotLoading(); - } - } -}; - -/// @idl void pause(); -TTYPlayerPrototype["pause"] = function() { - if (!this["_"].paused) { - this["_"].paused = true; - clearInterval(this["_"].ticker); - this["_"].fireSimpleEvent("pause"); - } -}; - -/// @idl attribute double volume; -/// @stub volume is irrelevant -TTYPlayerPrototype["volume"] = 1; - -/// @idl attribute boolean muted; -/// @stub volume is irrelevant -TTYPlayerPrototype["muted"] = false; - -/// @idl TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = ""); -/// @stub text tracks aren’t implemented yet—will they be? -TTYPlayerPrototype["addTextTrack"] = function() { - return null; -}; -// This should theoretically go on HTMLElement.prototype. Too bad. -/// @idl attribute EventHandler ontitlechange; -TTYPlayerPrototype["ontitlechange"] = null; - -TTYPlayerPrototype["resize"] = function(x, y) { - this["_"].terminal.resize(x, y); -}; - -TTYPlayerPrototype["pretendToBeAVideo"] = function() { - Object.defineProperties(this, { - /** @lends {TTYPlayerPrototype} */ - - // Let’s pretend (badly) that we’re an HTMLVideoElement! - "tagName": {value: "VIDEO"}, - "width": { - get: function() { - return this.offsetWidth; - }, - set: function(value) { - // TODO this is a little poor as a technique, refine it. - this.style.fontSize = "100%"; - this.style.fontSize = (value / this.offsetWidth * 100) + "%"; - } - }, - "height": { - get: function() { - return this.offsetHeight; - }, - set: function(value) { - // TODO this is a little poor as a technique, refine it. - this.style.fontSize = "100%"; - this.style.fontSize = (value / this.offsetHeight * 100) + "%"; - } - }, - "videoWidth": { - get: function() { - return this["width"]; - } - }, - "videoHeight": { - get: function() { - return this["height"]; - } - } - }); -}; - -document.registerElement("tty-player", {prototype: TTYPlayerPrototype}); -})(); diff --git a/docs.it4i/js/webcomponents-lite.min.js b/docs.it4i/js/webcomponents-lite.min.js deleted file mode 100644 index abb6ff6700e7b1ad880e305f521b53708ff49bff..0000000000000000000000000000000000000000 --- a/docs.it4i/js/webcomponents-lite.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @license - * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */ -// @version 0.7.5 -window.WebComponents=window.WebComponents||{},function(e){var t=e.flags||{},n="webcomponents-lite.js",r=document.querySelector('script[src*="'+n+'"]');if(!t.noOpts){if(location.search.slice(1).split("&").forEach(function(e){var n,r=e.split("=");r[0]&&(n=r[0].match(/wc-(.+)/))&&(t[n[1]]=r[1]||!0)}),r)for(var o,i=0;o=r.attributes[i];i++)"src"!==o.name&&(t[o.name]=o.value||!0);if(t.log){var a=t.log.split(",");t.log={},a.forEach(function(e){t.log[e]=!0})}else t.log={}}t.shadow=t.shadow||t.shadowdom||t.polyfill,t.shadow="native"===t.shadow?!1:t.shadow||!HTMLElement.prototype.createShadowRoot,t.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=t.register),e.flags=t}(window.WebComponents),function(e){"use strict";function t(e){return void 0!==h[e]}function n(){s.call(this),this._isInvalid=!0}function r(e){return""==e&&n.call(this),e.toLowerCase()}function o(e){var t=e.charCodeAt(0);return t>32&&127>t&&-1==[34,35,60,62,63,96].indexOf(t)?e:encodeURIComponent(e)}function i(e){var t=e.charCodeAt(0);return t>32&&127>t&&-1==[34,35,60,62,96].indexOf(t)?e:encodeURIComponent(e)}function a(e,a,s){function c(e){b.push(e)}var d=a||"scheme start",u=0,l="",_=!1,w=!1,b=[];e:for(;(e[u-1]!=f||0==u)&&!this._isInvalid;){var g=e[u];switch(d){case"scheme start":if(!g||!m.test(g)){if(a){c("Invalid scheme.");break e}l="",d="no scheme";continue}l+=g.toLowerCase(),d="scheme";break;case"scheme":if(g&&v.test(g))l+=g.toLowerCase();else{if(":"!=g){if(a){if(f==g)break e;c("Code point not allowed in scheme: "+g);break e}l="",u=0,d="no scheme";continue}if(this._scheme=l,l="",a)break e;t(this._scheme)&&(this._isRelative=!0),d="file"==this._scheme?"relative":this._isRelative&&s&&s._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==g?(this._query="?",d="query"):"#"==g?(this._fragment="#",d="fragment"):f!=g&&" "!=g&&"\n"!=g&&"\r"!=g&&(this._schemeData+=o(g));break;case"no scheme":if(s&&t(s._scheme)){d="relative";continue}c("Missing scheme."),n.call(this);break;case"relative or authority":if("/"!=g||"/"!=e[u+1]){c("Expected /, got: "+g),d="relative";continue}d="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=s._scheme),f==g){this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._username=s._username,this._password=s._password;break e}if("/"==g||"\\"==g)"\\"==g&&c("\\ is an invalid code point."),d="relative slash";else if("?"==g)this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query="?",this._username=s._username,this._password=s._password,d="query";else{if("#"!=g){var y=e[u+1],E=e[u+2];("file"!=this._scheme||!m.test(g)||":"!=y&&"|"!=y||f!=E&&"/"!=E&&"\\"!=E&&"?"!=E&&"#"!=E)&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password,this._path=s._path.slice(),this._path.pop()),d="relative path";continue}this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._fragment="#",this._username=s._username,this._password=s._password,d="fragment"}break;case"relative slash":if("/"!=g&&"\\"!=g){"file"!=this._scheme&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password),d="relative path";continue}"\\"==g&&c("\\ is an invalid code point."),d="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=g){c("Expected '/', got: "+g),d="authority ignore slashes";continue}d="authority second slash";break;case"authority second slash":if(d="authority ignore slashes","/"!=g){c("Expected '/', got: "+g);continue}break;case"authority ignore slashes":if("/"!=g&&"\\"!=g){d="authority";continue}c("Expected authority, got: "+g);break;case"authority":if("@"==g){_&&(c("@ already seen."),l+="%40"),_=!0;for(var L=0;L<l.length;L++){var M=l[L];if(" "!=M&&"\n"!=M&&"\r"!=M)if(":"!=M||null!==this._password){var T=o(M);null!==this._password?this._password+=T:this._username+=T}else this._password="";else c("Invalid whitespace in authority.")}l=""}else{if(f==g||"/"==g||"\\"==g||"?"==g||"#"==g){u-=l.length,l="",d="host";continue}l+=g}break;case"file host":if(f==g||"/"==g||"\\"==g||"?"==g||"#"==g){2!=l.length||!m.test(l[0])||":"!=l[1]&&"|"!=l[1]?0==l.length?d="relative path start":(this._host=r.call(this,l),l="",d="relative path start"):d="relative path";continue}" "==g||"\n"==g||"\r"==g?c("Invalid whitespace in file host."):l+=g;break;case"host":case"hostname":if(":"!=g||w){if(f==g||"/"==g||"\\"==g||"?"==g||"#"==g){if(this._host=r.call(this,l),l="",d="relative path start",a)break e;continue}" "!=g&&"\n"!=g&&"\r"!=g?("["==g?w=!0:"]"==g&&(w=!1),l+=g):c("Invalid code point in host/hostname: "+g)}else if(this._host=r.call(this,l),l="",d="port","hostname"==a)break e;break;case"port":if(/[0-9]/.test(g))l+=g;else{if(f==g||"/"==g||"\\"==g||"?"==g||"#"==g||a){if(""!=l){var N=parseInt(l,10);N!=h[this._scheme]&&(this._port=N+""),l=""}if(a)break e;d="relative path start";continue}" "==g||"\n"==g||"\r"==g?c("Invalid code point in port: "+g):n.call(this)}break;case"relative path start":if("\\"==g&&c("'\\' not allowed in path."),d="relative path","/"!=g&&"\\"!=g)continue;break;case"relative path":if(f!=g&&"/"!=g&&"\\"!=g&&(a||"?"!=g&&"#"!=g))" "!=g&&"\n"!=g&&"\r"!=g&&(l+=o(g));else{"\\"==g&&c("\\ not allowed in relative path.");var O;(O=p[l.toLowerCase()])&&(l=O),".."==l?(this._path.pop(),"/"!=g&&"\\"!=g&&this._path.push("")):"."==l&&"/"!=g&&"\\"!=g?this._path.push(""):"."!=l&&("file"==this._scheme&&0==this._path.length&&2==l.length&&m.test(l[0])&&"|"==l[1]&&(l=l[0]+":"),this._path.push(l)),l="","?"==g?(this._query="?",d="query"):"#"==g&&(this._fragment="#",d="fragment")}break;case"query":a||"#"!=g?f!=g&&" "!=g&&"\n"!=g&&"\r"!=g&&(this._query+=i(g)):(this._fragment="#",d="fragment");break;case"fragment":f!=g&&" "!=g&&"\n"!=g&&"\r"!=g&&(this._fragment+=g)}u++}}function s(){this._scheme="",this._schemeData="",this._username="",this._password=null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}function c(e,t){void 0===t||t instanceof c||(t=new c(String(t))),this._url=e,s.call(this);var n=e.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,"");a.call(this,n,null,t)}var d=!1;if(!e.forceJURL)try{var u=new URL("b","http://a");u.pathname="c%20d",d="http://a/c%20d"===u.href}catch(l){}if(!d){var h=Object.create(null);h.ftp=21,h.file=0,h.gopher=70,h.http=80,h.https=443,h.ws=80,h.wss=443;var p=Object.create(null);p["%2e"]=".",p[".%2e"]="..",p["%2e."]="..",p["%2e%2e"]="..";var f=void 0,m=/[a-zA-Z]/,v=/[a-zA-Z0-9\+\-\.]/;c.prototype={toString:function(){return this.href},get href(){if(this._isInvalid)return this._url;var e="";return(""!=this._username||null!=this._password)&&(e=this._username+(null!=this._password?":"+this._password:"")+"@"),this.protocol+(this._isRelative?"//"+e+this.host:"")+this.pathname+this._query+this._fragment},set href(e){s.call(this),a.call(this,e)},get protocol(){return this._scheme+":"},set protocol(e){this._isInvalid||a.call(this,e+":","scheme start")},get host(){return this._isInvalid?"":this._port?this._host+":"+this._port:this._host},set host(e){!this._isInvalid&&this._isRelative&&a.call(this,e,"host")},get hostname(){return this._host},set hostname(e){!this._isInvalid&&this._isRelative&&a.call(this,e,"hostname")},get port(){return this._port},set port(e){!this._isInvalid&&this._isRelative&&a.call(this,e,"port")},get pathname(){return this._isInvalid?"":this._isRelative?"/"+this._path.join("/"):this._schemeData},set pathname(e){!this._isInvalid&&this._isRelative&&(this._path=[],a.call(this,e,"relative path start"))},get search(){return this._isInvalid||!this._query||"?"==this._query?"":this._query},set search(e){!this._isInvalid&&this._isRelative&&(this._query="?","?"==e[0]&&(e=e.slice(1)),a.call(this,e,"query"))},get hash(){return this._isInvalid||!this._fragment||"#"==this._fragment?"":this._fragment},set hash(e){this._isInvalid||(this._fragment="#","#"==e[0]&&(e=e.slice(1)),a.call(this,e,"fragment"))},get origin(){var e;if(this._isInvalid||!this._scheme)return"";switch(this._scheme){case"data":case"file":case"javascript":case"mailto":return"null"}return e=this.host,e?this._scheme+"://"+e:""}};var _=e.URL;_&&(c.createObjectURL=function(e){return _.createObjectURL.apply(_,arguments)},c.revokeObjectURL=function(e){_.revokeObjectURL(e)}),e.URL=c}}(this),"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]===e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),function(e){function t(e){g.push(e),b||(b=!0,m(r))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function r(){b=!1;var e=g;g=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();o(e),n.length&&(e.callback_(n,e),t=!0)}),t&&r()}function o(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=v.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o],a=i.options;if(n===e||a.subtree){var s=t(a);s&&i.enqueue(s)}}}}function a(e){this.callback_=e,this.nodes_=[],this.records_=[],this.uid_=++y}function s(e,t){this.type=e,this.target=t,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function c(e){var t=new s(e.type,e.target);return t.addedNodes=e.addedNodes.slice(),t.removedNodes=e.removedNodes.slice(),t.previousSibling=e.previousSibling,t.nextSibling=e.nextSibling,t.attributeName=e.attributeName,t.attributeNamespace=e.attributeNamespace,t.oldValue=e.oldValue,t}function d(e,t){return E=new s(e,t)}function u(e){return L?L:(L=c(E),L.oldValue=e,L)}function l(){E=L=void 0}function h(e){return e===L||e===E}function p(e,t){return e===t?e:L&&h(e)?L:null}function f(e,t,n){this.observer=e,this.target=t,this.options=n,this.transientObservedNodes=[]}var m,v=new WeakMap;if(/Trident|Edge/.test(navigator.userAgent))m=setTimeout;else if(window.setImmediate)m=window.setImmediate;else{var _=[],w=String(Math.random());window.addEventListener("message",function(e){if(e.data===w){var t=_;_=[],t.forEach(function(e){e()})}}),m=function(e){_.push(e),window.postMessage(w,"*")}}var b=!1,g=[],y=0;a.prototype={observe:function(e,t){if(e=n(e),!t.childList&&!t.attributes&&!t.characterData||t.attributeOldValue&&!t.attributes||t.attributeFilter&&t.attributeFilter.length&&!t.attributes||t.characterDataOldValue&&!t.characterData)throw new SyntaxError;var r=v.get(e);r||v.set(e,r=[]);for(var o,i=0;i<r.length;i++)if(r[i].observer===this){o=r[i],o.removeListeners(),o.options=t;break}o||(o=new f(this,e,t),r.push(o),this.nodes_.push(e)),o.addListeners()},disconnect:function(){this.nodes_.forEach(function(e){for(var t=v.get(e),n=0;n<t.length;n++){var r=t[n];if(r.observer===this){r.removeListeners(),t.splice(n,1);break}}},this),this.records_=[]},takeRecords:function(){var e=this.records_;return this.records_=[],e}};var E,L;f.prototype={enqueue:function(e){var n=this.observer.records_,r=n.length;if(n.length>0){var o=n[r-1],i=p(o,e);if(i)return void(n[r-1]=i)}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;n<t.length;n++)if(t[n]===this){t.splice(n,1);break}},this)},handleEvent:function(e){switch(e.stopImmediatePropagation(),e.type){case"DOMAttrModified":var t=e.attrName,n=e.relatedNode.namespaceURI,r=e.target,o=new d("attributes",r);o.attributeName=t,o.attributeNamespace=n;var a=e.attrChange===MutationEvent.ADDITION?null:e.prevValue;i(r,function(e){return!e.attributes||e.attributeFilter&&e.attributeFilter.length&&-1===e.attributeFilter.indexOf(t)&&-1===e.attributeFilter.indexOf(n)?void 0:e.attributeOldValue?u(a):o});break;case"DOMCharacterDataModified":var r=e.target,o=d("characterData",r),a=e.prevValue;i(r,function(e){return e.characterData?e.characterDataOldValue?u(a):o:void 0});break;case"DOMNodeRemoved":this.addTransientObserver(e.target);case"DOMNodeInserted":var s,c,h=e.target;"DOMNodeInserted"===e.type?(s=[h],c=[]):(s=[],c=[h]);var p=h.previousSibling,f=h.nextSibling,o=d("childList",e.target.parentNode);o.addedNodes=s,o.removedNodes=c,o.previousSibling=p,o.nextSibling=f,i(e.relatedNode,function(e){return e.childList?o:void 0})}l()}},e.JsMutationObserver=a,e.MutationObserver||(e.MutationObserver=a)}(this),window.HTMLImports=window.HTMLImports||{flags:{}},function(e){function t(e,t){t=t||f,r(function(){i(e,t)},t)}function n(e){return"complete"===e.readyState||e.readyState===_}function r(e,t){if(n(t))e&&e();else{var o=function(){("complete"===t.readyState||t.readyState===_)&&(t.removeEventListener(w,o),r(e,t))};t.addEventListener(w,o)}}function o(e){e.target.__loaded=!0}function i(e,t){function n(){c==d&&e&&e({allImports:s,loadedImports:u,errorImports:l})}function r(e){o(e),u.push(this),c++,n()}function i(e){l.push(this),c++,n()}var s=t.querySelectorAll("link[rel=import]"),c=0,d=s.length,u=[],l=[];if(d)for(var h,p=0;d>p&&(h=s[p]);p++)a(h)?(c++,n()):(h.addEventListener("load",r),h.addEventListener("error",i));else n()}function a(e){return l?e.__loaded||e["import"]&&"loading"!==e["import"].readyState:e.__importParsed}function s(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)c(t)&&d(t)}function c(e){return"link"===e.localName&&"import"===e.rel}function d(e){var t=e["import"];t?o({target:e}):(e.addEventListener("load",o),e.addEventListener("error",o))}var u="import",l=Boolean(u in document.createElement("link")),h=Boolean(window.ShadowDOMPolyfill),p=function(e){return h?window.ShadowDOMPolyfill.wrapIfNeeded(e):e},f=p(document),m={get:function(){var e=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return p(e)},configurable:!0};Object.defineProperty(document,"_currentScript",m),Object.defineProperty(f,"_currentScript",m);var v=/Trident/.test(navigator.userAgent),_=v?"complete":"interactive",w="readystatechange";l&&(new MutationObserver(function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.addedNodes&&s(t.addedNodes)}).observe(document.head,{childList:!0}),function(){if("loading"===document.readyState)for(var e,t=document.querySelectorAll("link[rel=import]"),n=0,r=t.length;r>n&&(e=t[n]);n++)d(e)}()),t(function(e){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var t=f.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),f.dispatchEvent(t)}),e.IMPORT_LINK_TYPE=u,e.useNative=l,e.rootDocument=f,e.whenReady=t,e.isIE=v}(window.HTMLImports),function(e){var t=[],n=function(e){t.push(e)},r=function(){t.forEach(function(t){t(e)})};e.addModule=n,e.initializeModules=r}(window.HTMLImports),window.HTMLImports.addModule(function(e){var t=/(url\()([^)]*)(\))/g,n=/(@import[\s]+(?!url\())([^;]*)(;)/g,r={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument,r=n.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,r),e},resolveUrlsInCssText:function(e,r,o){var i=this.replaceUrls(e,o,r,t);return i=this.replaceUrls(i,o,r,n)},replaceUrls:function(e,t,n,r){return e.replace(r,function(e,r,o,i){var a=o.replace(/["']/g,"");return n&&(a=new URL(a,n).href),t.href=a,a=t.href,r+"'"+a+"'"+i})}};e.path=r}),window.HTMLImports.addModule(function(e){var t={async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(n,r,o){var i=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(n+="?"+Math.random()),i.open("GET",n,t.async),i.addEventListener("readystatechange",function(e){if(4===i.readyState){var n=i.getResponseHeader("Location"),a=null;if(n)var a="/"===n.substr(0,1)?location.origin+n:n;r.call(o,!t.ok(i)&&i,i.response||i.responseText,a)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};e.xhr=t}),window.HTMLImports.addModule(function(e){var t=e.xhr,n=e.flags,r=function(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}};r.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)this.require(t);this.checkDone()},addNode:function(e){this.inflight++,this.require(e),this.checkDone()},require:function(e){var t=e.src||e.href;e.__nodeUrl=t,this.dedupe(t,e)||this.fetch(t,e)},dedupe:function(e,t){if(this.pending[e])return this.pending[e].push(t),!0;return this.cache[e]?(this.onload(e,t,this.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,r){if(n.load&&console.log("fetch",e,r),e)if(e.match(/^data:/)){var o=e.split(","),i=o[0],a=o[1];a=i.indexOf(";base64")>-1?atob(a):decodeURIComponent(a),setTimeout(function(){this.receive(e,r,null,a)}.bind(this),0)}else{var s=function(t,n,o){this.receive(e,r,t,n,o)}.bind(this);t.load(e,s)}else setTimeout(function(){this.receive(e,r,{error:"href must be specified"},null)}.bind(this),0)},receive:function(e,t,n,r,o){this.cache[e]=r;for(var i,a=this.pending[e],s=0,c=a.length;c>s&&(i=a[s]);s++)this.onload(e,i,r,n,o),this.tail();this.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}},e.Loader=r}),window.HTMLImports.addModule(function(e){var t=function(e){this.addCallback=e,this.mo=new MutationObserver(this.handler.bind(this))};t.prototype={handler:function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)"childList"===t.type&&t.addedNodes.length&&this.addedNodes(t.addedNodes)},addedNodes:function(e){this.addCallback&&this.addCallback(e);for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.children&&t.children.length&&this.addedNodes(t.children)},observe:function(e){this.mo.observe(e,{childList:!0,subtree:!0})}},e.Observer=t}),window.HTMLImports.addModule(function(e){function t(e){return"link"===e.localName&&e.rel===u}function n(e){var t=r(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}function r(e){return e.textContent+o(e)}function o(e){var t=e.ownerDocument;t.__importedScripts=t.__importedScripts||0;var n=e.ownerDocument.baseURI,r=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+n+r+".js\n"}function i(e){var t=e.ownerDocument.createElement("style");return t.textContent=e.textContent,a.resolveUrlsInStyle(t),t}var a=e.path,s=e.rootDocument,c=e.flags,d=e.isIE,u=e.IMPORT_LINK_TYPE,l="link[rel="+u+"]",h={documentSelectors:l,importsSelectors:[l,"link[rel=stylesheet]","style","script:not([type])",'script[type="application/javascript"]','script[type="text/javascript"]'].join(","),map:{link:"parseLink",script:"parseScript",style:"parseStyle"},dynamicElements:[],parseNext:function(){var e=this.nextToParse();e&&this.parse(e)},parse:function(e){if(this.isParsed(e))return void(c.parse&&console.log("[%s] is already parsed",e.localName));var t=this[this.map[e.localName]];t&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){c.parse&&console.log("parsing",e),this.parsingElement=e},markParsingComplete:function(e){e.__importParsed=!0,this.markDynamicParsingComplete(e),e.__importElement&&(e.__importElement.__importParsed=!0,this.markDynamicParsingComplete(e.__importElement)),this.parsingElement=null,c.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){var t=this.dynamicElements.indexOf(e);t>=0&&this.dynamicElements.splice(t,1)},parseImport:function(e){if(window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(e),e["import"]&&(e["import"].__importParsed=!0),this.markParsingComplete(e),e.dispatchEvent(e.__resource&&!e.__error?new CustomEvent("load",{bubbles:!1}):new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)t=e.__pending.shift(),t&&t({target:e});this.parseNext()},parseLink:function(e){t(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t=e;e=i(e),t.__appliedElement=e,e.__importElement=t,this.parseGeneric(e)},parseGeneric:function(e){this.trackElement(e),this.addElementToDocument(e)},rootImportForElement:function(e){for(var t=e;t.ownerDocument.__importLink;)t=t.ownerDocument.__importLink;return t},addElementToDocument:function(e){var t=this.rootImportForElement(e.__importElement||e);t.parentNode.insertBefore(e,t)},trackElement:function(e,t){var n=this,r=function(r){t&&t(r),n.markParsingComplete(e),n.parseNext()};if(e.addEventListener("load",r),e.addEventListener("error",r),d&&"style"===e.localName){var o=!1;if(-1==e.textContent.indexOf("@import"))o=!0;else if(e.sheet){o=!0;for(var i,a=e.sheet.cssRules,s=a?a.length:0,c=0;s>c&&(i=a[c]);c++)i.type===CSSRule.IMPORT_RULE&&(o=o&&Boolean(i.styleSheet))}o&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var r=document.createElement("script");r.__importElement=t,r.src=t.src?t.src:n(t),e.currentScript=t,this.trackElement(r,function(t){r.parentNode.removeChild(r),e.currentScript=null}),this.addElementToDocument(r)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(s)||this.nextToParseDynamic())},nextToParseInDoc:function(e,n){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var r,o=e.querySelectorAll(this.parseSelectorsForNode(e)),i=0,a=o.length;a>i&&(r=o[i]);i++)if(!this.isParsed(r))return this.hasResource(r)?t(r)?this.nextToParseInDoc(r["import"],r):r:void 0}return n},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===s?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return this.dynamicElements.indexOf(e)>=0},hasResource:function(e){return t(e)&&void 0===e["import"]?!1:!0}};e.parser=h,e.IMPORT_SELECTOR=l}),window.HTMLImports.addModule(function(e){function t(e){return n(e,a)}function n(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function r(e){return!!Object.getOwnPropertyDescriptor(e,"baseURI")}function o(e,t){var n=document.implementation.createHTMLDocument(a);n._URL=t;var o=n.createElement("base");o.setAttribute("href",t),n.baseURI||r(n)||Object.defineProperty(n,"baseURI",{value:t});var i=n.createElement("meta");return i.setAttribute("charset","utf-8"),n.head.appendChild(i),n.head.appendChild(o),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var i=e.flags,a=e.IMPORT_LINK_TYPE,s=e.IMPORT_SELECTOR,c=e.rootDocument,d=e.Loader,u=e.Observer,l=e.parser,h={documents:{},documentPreloadSelectors:s,importsPreloadSelectors:[s].join(","),loadNode:function(e){p.addNode(e)},loadSubtree:function(e){var t=this.marshalNodes(e);p.addNodes(t)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===c?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,n,r,a,s){if(i.load&&console.log("loaded",e,n),n.__resource=r,n.__error=a,t(n)){var c=this.documents[e];void 0===c&&(c=a?null:o(r,s||e),c&&(c.__importLink=n,this.bootDocument(c)),this.documents[e]=c),n["import"]=c}l.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),l.parseNext()},loadedAll:function(){l.parseNext()}},p=new d(h.loaded.bind(h),h.loadedAll.bind(h));if(h.observer=new u,!document.baseURI){var f={get:function(){var e=document.querySelector("base");return e?e.href:window.location.href},configurable:!0};Object.defineProperty(document,"baseURI",f),Object.defineProperty(c,"baseURI",f)}e.importer=h,e.importLoader=p}),window.HTMLImports.addModule(function(e){var t=e.parser,n=e.importer,r={added:function(e){for(var r,o,i,a,s=0,c=e.length;c>s&&(a=e[s]);s++)r||(r=a.ownerDocument,o=t.isParsed(r)),i=this.shouldLoadNode(a),i&&n.loadNode(a),this.shouldParseNode(a)&&o&&t.parseDynamic(a,i)},shouldLoadNode:function(e){return 1===e.nodeType&&o.call(e,n.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&o.call(e,t.parseSelectorsForNode(e))}};n.observer.addCallback=r.added.bind(r);var o=HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector}),function(e){function t(){window.HTMLImports.importer.bootDocument(o)}var n=e.initializeModules,r=e.isIE;if(!e.useNative){r&&"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,Boolean(t.bubbles),Boolean(t.cancelable),t.detail),n.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})},n},window.CustomEvent.prototype=window.Event.prototype),n();var o=e.rootDocument;"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t)}}(window.HTMLImports),window.CustomElements=window.CustomElements||{flags:{}},function(e){var t=e.flags,n=[],r=function(e){n.push(e)},o=function(){n.forEach(function(t){t(e)})};e.addModule=r,e.initializeModules=o,e.hasNative=Boolean(document.registerElement),e.useNative=!t.register&&e.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(e){function t(e,t){n(e,function(e){return t(e)?!0:void r(e,t)}),r(e,t)}function n(e,t,r){var o=e.firstElementChild;if(!o)for(o=e.firstChild;o&&o.nodeType!==Node.ELEMENT_NODE;)o=o.nextSibling;for(;o;)t(o,r)!==!0&&n(o,t,r),o=o.nextElementSibling;return null}function r(e,n){for(var r=e.shadowRoot;r;)t(r,n),r=r.olderShadowRoot}function o(e,t){i(e,t,[])}function i(e,t,n){if(e=window.wrap(e),!(n.indexOf(e)>=0)){n.push(e);for(var r,o=e.querySelectorAll("link[rel="+a+"]"),s=0,c=o.length;c>s&&(r=o[s]);s++)r["import"]&&i(r["import"],t,n);t(e)}}var a=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=o,e.forSubtree=t}),window.CustomElements.addModule(function(e){function t(e){return n(e)||r(e)}function n(t){return e.upgrade(t)?!0:void s(t)}function r(e){g(e,function(e){return n(e)?!0:void 0})}function o(e){s(e),h(e)&&g(e,function(e){s(e)})}function i(e){M.push(e),L||(L=!0,setTimeout(a))}function a(){L=!1;for(var e,t=M,n=0,r=t.length;r>n&&(e=t[n]);n++)e();M=[]}function s(e){E?i(function(){c(e)}):c(e)}function c(e){e.__upgraded__&&(e.attachedCallback||e.detachedCallback)&&!e.__attached&&h(e)&&(e.__attached=!0,e.attachedCallback&&e.attachedCallback())}function d(e){u(e),g(e,function(e){u(e)})}function u(e){E?i(function(){l(e)}):l(e)}function l(e){e.__upgraded__&&(e.attachedCallback||e.detachedCallback)&&e.__attached&&!h(e)&&(e.__attached=!1,e.detachedCallback&&e.detachedCallback())}function h(e){for(var t=e,n=wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}function p(e){if(e.shadowRoot&&!e.shadowRoot.__watched){b.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)v(t),t=t.olderShadowRoot}}function f(e){if(b.dom){var n=e[0];if(n&&"childList"===n.type&&n.addedNodes&&n.addedNodes){for(var r=n.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var o=r&&(r.URL||r._URL||r.host&&r.host.localName)||"";o=o.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,o||"")}e.forEach(function(e){"childList"===e.type&&(T(e.addedNodes,function(e){e.localName&&t(e)}),T(e.removedNodes,function(e){e.localName&&d(e)}))}),b.dom&&console.groupEnd()}function m(e){for(e=window.wrap(e),e||(e=window.wrap(document));e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(f(t.takeRecords()),a())}function v(e){if(!e.__observer){var t=new MutationObserver(f);t.observe(e,{childList:!0,subtree:!0}),e.__observer=t}}function _(e){e=window.wrap(e),b.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop()),t(e),v(e),b.dom&&console.groupEnd()}function w(e){y(e,_)}var b=e.flags,g=e.forSubtree,y=e.forDocumentTree,E=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;e.hasPolyfillMutations=E;var L=!1,M=[],T=Array.prototype.forEach.call.bind(Array.prototype.forEach),N=Element.prototype.createShadowRoot;N&&(Element.prototype.createShadowRoot=function(){var e=N.call(this);return window.CustomElements.watchShadow(this),e}),e.watchShadow=p,e.upgradeDocumentTree=w,e.upgradeSubtree=r,e.upgradeAll=t,e.attachedNode=o,e.takeRecords=m}),window.CustomElements.addModule(function(e){function t(t){if(!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var r=t.getAttribute("is"),o=e.getRegisteredDefinition(r||t.localName);if(o){if(r&&o.tag==t.localName)return n(t,o);if(!r&&!o["extends"])return n(t,o)}}}function n(t,n){return a.upgrade&&console.group("upgrade:",t.localName),n.is&&t.setAttribute("is",n.is),r(t,n),t.__upgraded__=!0,i(t),e.attachedNode(t),e.upgradeSubtree(t),a.upgrade&&console.groupEnd(),t}function r(e,t){Object.__proto__?e.__proto__=t.prototype:(o(e,t.prototype,t["native"]),e.__proto__=t.prototype)}function o(e,t,n){for(var r={},o=t;o!==n&&o!==HTMLElement.prototype;){for(var i,a=Object.getOwnPropertyNames(o),s=0;i=a[s];s++)r[i]||(Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(o,i)),r[i]=1);o=Object.getPrototypeOf(o)}}function i(e){e.createdCallback&&e.createdCallback()}var a=e.flags;e.upgrade=t,e.upgradeWithDefinition=n,e.implementPrototype=r}),window.CustomElements.addModule(function(e){function t(t,r){var c=r||{};if(!t)throw new Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(t)+"'.");if(o(t))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(t)+"'. The type name is invalid.");if(d(t))throw new Error("DuplicateDefinitionError: a type with name '"+String(t)+"' is already registered");return c.prototype||(c.prototype=Object.create(HTMLElement.prototype)),c.__name=t.toLowerCase(),c.lifecycle=c.lifecycle||{},c.ancestry=i(c["extends"]),a(c),s(c),n(c.prototype),u(c.__name,c),c.ctor=l(c),c.ctor.prototype=c.prototype,c.prototype.constructor=c.ctor,e.ready&&_(document),c.ctor}function n(e){if(!e.setAttribute._polyfilled){var t=e.setAttribute;e.setAttribute=function(e,n){r.call(this,e,n,t)};var n=e.removeAttribute;e.removeAttribute=function(e){r.call(this,e,null,n); - -},e.setAttribute._polyfilled=!0}}function r(e,t,n){e=e.toLowerCase();var r=this.getAttribute(e);n.apply(this,arguments);var o=this.getAttribute(e);this.attributeChangedCallback&&o!==r&&this.attributeChangedCallback(e,r,o)}function o(e){for(var t=0;t<E.length;t++)if(e===E[t])return!0}function i(e){var t=d(e);return t?i(t["extends"]).concat([t]):[]}function a(e){for(var t,n=e["extends"],r=0;t=e.ancestry[r];r++)n=t.is&&t.tag;e.tag=n||e.__name,n&&(e.is=e.__name)}function s(e){if(!Object.__proto__){var t=HTMLElement.prototype;if(e.is){var n=document.createElement(e.tag),r=Object.getPrototypeOf(n);r===e.prototype&&(t=r)}for(var o,i=e.prototype;i&&i!==t;)o=Object.getPrototypeOf(i),i.__proto__=o,i=o;e["native"]=t}}function c(e){return b(T(e.tag),e)}function d(e){return e?L[e.toLowerCase()]:void 0}function u(e,t){L[e]=t}function l(e){return function(){return c(e)}}function h(e,t,n){return e===M?p(t,n):N(e,t)}function p(e,t){e&&(e=e.toLowerCase()),t&&(t=t.toLowerCase());var n=d(t||e);if(n){if(e==n.tag&&t==n.is)return new n.ctor;if(!t&&!n.is)return new n.ctor}var r;return t?(r=p(e),r.setAttribute("is",t),r):(r=T(e),e.indexOf("-")>=0&&g(r,HTMLElement),r)}function f(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return w(e),e}}var m,v=e.isIE11OrOlder,_=e.upgradeDocumentTree,w=e.upgradeAll,b=e.upgradeWithDefinition,g=e.implementPrototype,y=e.useNative,E=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],L={},M="http://www.w3.org/1999/xhtml",T=document.createElement.bind(document),N=document.createElementNS.bind(document);m=Object.__proto__||y?function(e,t){return e instanceof t}:function(e,t){for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1},f(Node.prototype,"cloneNode"),f(document,"importNode"),v&&!function(){var e=document.importNode;document.importNode=function(){var t=e.apply(document,arguments);if(t.nodeType==t.DOCUMENT_FRAGMENT_NODE){var n=document.createDocumentFragment();return n.appendChild(t),n}return t}}(),document.registerElement=t,document.createElement=p,document.createElementNS=h,e.registry=L,e["instanceof"]=m,e.reservedTagList=E,e.getRegisteredDefinition=d,document.register=document.registerElement}),function(e){function t(){a(window.wrap(document)),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){a(wrap(e["import"]))}),window.CustomElements.ready=!0,setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}var n=e.useNative,r=e.initializeModules,o=/Trident/.test(navigator.userAgent);if(n){var i=function(){};e.watchShadow=i,e.upgrade=i,e.upgradeAll=i,e.upgradeDocumentTree=i,e.upgradeSubtree=i,e.takeRecords=i,e["instanceof"]=function(e,t){return e instanceof t}}else r();var a=e.upgradeDocumentTree;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),o&&"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,Boolean(t.bubbles),Boolean(t.cancelable),t.detail),n.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})},n},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||e.flags.eager)t();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var s=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(s,t)}else t();e.isIE11OrOlder=o}(window.CustomElements),"undefined"==typeof HTMLTemplateElement&&!function(){var e="template";HTMLTemplateElement=function(){},HTMLTemplateElement.prototype=Object.create(HTMLElement.prototype),HTMLTemplateElement.decorate=function(e){e.content||(e.content=e.ownerDocument.createDocumentFragment());for(var t;t=e.firstChild;)e.content.appendChild(t)},HTMLTemplateElement.bootstrap=function(t){for(var n,r=t.querySelectorAll(e),o=0,i=r.length;i>o&&(n=r[o]);o++)HTMLTemplateElement.decorate(n)},window.addEventListener("DOMContentLoaded",function(){HTMLTemplateElement.bootstrap(document)});var t=document.createElement;document.createElement=function(){"use strict";var e=t.apply(document,arguments);return"template"==e.localName&&HTMLTemplateElement.decorate(e),e}}(),function(e){var t=document.createElement("style");t.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var n=document.querySelector("head");n.insertBefore(t,n.firstChild)}(window.WebComponents); \ No newline at end of file diff --git a/docs.it4i/new.md b/docs.it4i/new.md deleted file mode 100644 index 7a394418ea59ca6c0506e156accc887c3769039c..0000000000000000000000000000000000000000 --- a/docs.it4i/new.md +++ /dev/null @@ -1,24 +0,0 @@ -|Date and time|Title and description| -|---|---| -| 13.07.2016 15:40|[MATLAB 2015b](https://docs.it4i.cz/whats-new/news-feed/matlab-2015b "MATLAB 2015b")| -| 08.07.2016 00:00|[Vampir installed](https://docs.it4i.cz/whats-new/news-feed/vampir-installed "Vampir installed")| -| 30.06.2016 00:00|[Allinea Tools updated to 6.0.6](https://docs.it4i.cz/whats-new/news-feed/allinea-tools-updated-to-6-0.6 "Allinea Tools updated to 6.0.6")| -| 30.06.2016 00:00|[Intel VTune Amplifier support for Xeon Phi on Salomon](https://docs.it4i.cz/whats-new/news-feed/intel-vtune-amplifier-support-for-xeon-phi-on-salomon "Intel VTune Amplifier support for Xeon Phi on Salomon")| -| 23.06.2016 00:00|[New method to execute parallel MATLAB jobs](https://docs.it4i.cz/whats-new/news-feed/new-method-to-execute-parallel-matlab-jobs "New method to execute parallel MATLAB jobs")| -| 08.06.2016 00:00|[New versions of Allinea Forge and Performance Reports](https://docs.it4i.cz/whats-new/news-feed/new-versions-of-allinea-forge-and-performance-version "New versions of Allinea Forge and Performance Reports")| -| 06.06.2016 00:00|[Intel VTune is working](https://docs.it4i.cz/whats-new/news-feed/intel-vtune-is-working "Intel VTune is working")| -| 31.05.2016 14:00|[Intel Parallel Studio 2016 update 3](https://docs.it4i.cz/whats-new/news-feed/intel-parallel-studio-2016-update-3 "Intel Parallel Studio 2016 update 3")| -| 05.05.2016 15:58|[ANSYS 17.0 Installed](https://docs.it4i.cz/whats-new/news-feed/ansys-17-0-installed "ANSYS 17.0 Installed")| -| 29.04.2016 14:25|[Allinea Forge 6.0](https://docs.it4i.cz/whats-new/news-feed/allinea-forge-6.0 "Allinea Forge 6.0")| -| 29.04.2016 14:23|[Issue with Intel MPI 4.1.1 on Salomon](https://docs.it4i.cz/whats-new/news-feed/issue-with-intel-mpi-4-1-1-on-salomon "Issue with Intel MPI 4.1.1 on Salomon")| -| 22.04.2016 14:35|[New modules for Parallel programming in modern Fortran course](https://docs.it4i.cz/whats-new/news-feed/new-modules-for-parallel-programming-in-modern-fortran-course "New modules for Parallel programming in modern Fortran course")| -| 13.04.2016 14:20|[Octave updated to 4.0.1 on Anselm](https://docs.it4i.cz/whats-new/news-feed/octave-updated-to-4-0-1-on-anselm "Octave updated to 4.0.1 on Anselm")| -| 01.04.2016 00:00|[Allinea Forge 5.1 installed on Anselm](https://docs.it4i.cz/whats-new/news-feed/allinea-forge-5-1-installed-on-anselm "Allinea Forge 5.1 installed on Anselm")| -| 07.03.2016 00:00|[Cuda 7.5 is now installed on Anselm](https://docs.it4i.cz/whats-new/news-feed/cuda-7-5-is-now-installed-on-anselm "Cuda 7.5 is now installed on Anselm")| -| 24.02.2016 00:00|[Added basic documentation for Intel Advisor and Intel Inspector](https://docs.it4i.cz/whats-new/news-feed/added-basic-documentation-for-intel-advisor-and-intel-inspector "Added basic documentation for Intel Advisor and Intel Inspector")| -| 24.02.2016 00:00|[Anselm downtime has been extended to Feb 26th.](https://docs.it4i.cz/whats-new/news-feed/anselm-downtime-has-been-extended-to-feb-26th "Anselm downtime has been extended to Feb 26th.")| -| 11.02.2016 00:00|[Allinea Forge documentation updated](https://docs.it4i.cz/whats-new/news-feed/allinea-forge-documentation-updated "Allinea Forge documentation updated")| -| 09.02.2016 00:00|[New bioinformatic tools installed: FastQC/0.11.3, GATK/3.5-Java-1.7.0\_79, picard/2.1.0, SAMtools/1.3-foss-2015g, SnpEff/4.1\_G, Trimmomatic/0.35-Java-1.7.0\_79](https://docs.it4i.cz/whats-new/news-feed/new-bioinformatic-tools-installed-fastqc-0-11-3-gatk-3-5-java-1-7-0_79-picard-2-1-0-samtools-1-3-foss-2015g-snpeff-4-1_g-trimmomatic-0-35-java-1-7.0_79 "New bioinformatic tools installed: FastQC/0.11.3, GATK/3.5-Java-1.7.0_79, picard/2.1.0, SAMtools/1.3-foss-2015g, SnpEff/4.1_G, Trimmomatic/0.35-Java-1.7.0_79") -| 26.01.2016 00:00|[Salomon PBS changes](https://docs.it4i.cz/whats-new/news-feed/salomon-pbs-changes "Salomon PBS changes")| -| 15.01.2016 00:00|[Capacity computing updated for Salomon](https://docs.it4i.cz/whats-new/news-feed/capacity-computing-updated-for-salomon "Capacity computing updated for Salomon")| -| 13.01.2016 00:00|[Mono 4.2.2 and MPI.NET 1.2 on Salomon](https://docs.it4i.cz/whats-new/news-feed/mono-4-2-2-and-mpi-net-1-2-on-salomon "Mono 4.2.2 and MPI.NET 1.2 on Salomon")| diff --git a/docs.it4i/src/anselm/login_anselm.screen b/docs.it4i/src/anselm/login_anselm.screen deleted file mode 100644 index 1955f8ebd9dbf591c67729b0ffeef5a722b16ea4..0000000000000000000000000000000000000000 --- a/docs.it4i/src/anselm/login_anselm.screen +++ /dev/null @@ -1,15 +0,0 @@ -$ termrec login_anselm.ttyrec - -# login to Anselm cluster from local linux machine - -ssh -i /home/local/.ssh/id_rsa rus016@login1.anselm.it4i.cz - -# Welcome to Anselm supercomputer cluster - -# run htop command - -htop - -# logout from the cluster - -logout diff --git a/docs.it4i/src/anselm/login_anselm.ttyrec b/docs.it4i/src/anselm/login_anselm.ttyrec deleted file mode 100644 index 8f1d27930f4b929074bf2a13673da1306b1216e8..0000000000000000000000000000000000000000 Binary files a/docs.it4i/src/anselm/login_anselm.ttyrec and /dev/null differ diff --git a/docs.it4i/src/anselm/login_anselm.ttyrec~ b/docs.it4i/src/anselm/login_anselm.ttyrec~ deleted file mode 100644 index 8f1d27930f4b929074bf2a13673da1306b1216e8..0000000000000000000000000000000000000000 Binary files a/docs.it4i/src/anselm/login_anselm.ttyrec~ and /dev/null differ diff --git a/docs.it4i/src/anselm/modules_anselm.screen b/docs.it4i/src/anselm/modules_anselm.screen deleted file mode 100644 index f1144e193bc8c86a24288e63ffcd50b29e83e3b2..0000000000000000000000000000000000000000 --- a/docs.it4i/src/anselm/modules_anselm.screen +++ /dev/null @@ -1,33 +0,0 @@ -termrec -e 'ssh -i /home/local/.ssh/id_rsa rus016@anselm.it4i.cz' modules_anselm.ttyrec - -# Working with modules - -# get the current version of Python -$ python --version - -# run Python -python - -# right now is version 2.6.6 - -# search all available Python's modules -module avail |& grep Python/ - -# for example let's choose a new module Python 3.5.1 -$ module load Python/3.5.1-intel-2016.01 - -# and now get the current version of Python -$ python --version - -# run Python -python - -# that's correct, version 3.5.1 - -# now turn back to old version you have to unload module -$ module unload Python/3.5.1-intel-2016.01 - -$ python --version - -# Python version 2.6.6 is ready to use now - diff --git a/docs.it4i/src/anselm/modules_anselm.ttyrec b/docs.it4i/src/anselm/modules_anselm.ttyrec deleted file mode 100644 index 8699b15867c0aa34d6807d43026ab9caecc5245e..0000000000000000000000000000000000000000 Binary files a/docs.it4i/src/anselm/modules_anselm.ttyrec and /dev/null differ diff --git a/docs.it4i/src/anselm/transfer_scp_anselm.screen b/docs.it4i/src/anselm/transfer_scp_anselm.screen deleted file mode 100644 index 075b12a99a6dfd2382b19acd7e5070683bb27ed9..0000000000000000000000000000000000000000 --- a/docs.it4i/src/anselm/transfer_scp_anselm.screen +++ /dev/null @@ -1,30 +0,0 @@ -$ termrec transfer_scp_anselm.ttyrec - -# File transfer from local machine to Anselm cluster - -# create local directory with files -$ mkdir folder -$ cd folder -$ touch test_file.scp - -$ mkdir local_dir -$ touch local_dir/file.txt - -# using scp command to transfer a file to the cluster -$ scp test_file.scp rus016@anselm.it4i.cz:/home/rus016/test_file.scp - -# successfully uploaded to the cluster - -# using scp command to transfer a directory to the cluster -$ scp -r local_dir rus016@anselm.it4i.cz:/home/rus016/local_dir - -# successfully uploaded to the cluster - -# login to Anselm cluster and check all transfered files -ssh -i /home/local/.ssh/id_rsa rus016@anselm.it4i.cz - -$ls -l - -# yes, all files and directory are stored in home directory on the cluster - - diff --git a/docs.it4i/src/anselm/transfer_scp_anselm.ttyrec b/docs.it4i/src/anselm/transfer_scp_anselm.ttyrec deleted file mode 100644 index 6a55e3289e0ebb1b5824acb59c088466b90f7df8..0000000000000000000000000000000000000000 Binary files a/docs.it4i/src/anselm/transfer_scp_anselm.ttyrec and /dev/null differ diff --git a/docs.it4i/src/anselm/transfer_sftp_anselm.screen b/docs.it4i/src/anselm/transfer_sftp_anselm.screen deleted file mode 100644 index 44c474762aea349fff8b6614ebff5db0caf6de35..0000000000000000000000000000000000000000 --- a/docs.it4i/src/anselm/transfer_sftp_anselm.screen +++ /dev/null @@ -1,48 +0,0 @@ -$ termrec transfer_sftp_anselm.ttyrec - -# File transfer from local machine to Anselm cluster - -# using sftp command -$ touch test_file.sftp -$ sftp -o IdentityFile=/home/local/.ssh/id_rsa rus016@anselm.it4i.cz - -# list of all commands - help or ? -sftp> help - -# display remote working directory on Anselm cluster -sftp> pwd -# display remote directory listing on Anselm cluster -sftp> ls -la -# display statistics for remote directory -sftp> df -h - -# display local working directory on local linux machine -sftp> lpwd -# display local directory listing on local linux machine -sftp> lls -la - -# now we can upload a file from linux machine to Anselm cluster -sftp> put test_file.sftp - -# and then check if successfully uploaded -sftp> ls -l - -# of course we can download a file from the cluster -sftp> get demo.tar.gz - -# and check in local directory -sftp> lls -l - -# delete local file from sftp -sftp>!rm demo.tar.gz - -# quit sftp -sftp> exit - -# login to Anselm cluster and check all transfered files -ssh -i /home/local/.ssh/id_rsa rus016@anselm.it4i.cz - -$ls -l - -# yes, all files are stored in home directory on the cluster - diff --git a/docs.it4i/src/anselm/transfer_sftp_anselm.ttyrec b/docs.it4i/src/anselm/transfer_sftp_anselm.ttyrec deleted file mode 100644 index c01a1c1ba4b8b7e6c5a289eb46865c371b9c5228..0000000000000000000000000000000000000000 Binary files a/docs.it4i/src/anselm/transfer_sftp_anselm.ttyrec and /dev/null differ diff --git a/docs.it4i/src/login_anselm.ttyrec b/docs.it4i/src/login_anselm.ttyrec deleted file mode 100644 index 8f1d27930f4b929074bf2a13673da1306b1216e8..0000000000000000000000000000000000000000 Binary files a/docs.it4i/src/login_anselm.ttyrec and /dev/null differ diff --git a/docs.it4i/src/salomon/login_salomon.screen b/docs.it4i/src/salomon/login_salomon.screen deleted file mode 100644 index c83b88b7e90381ca417f63d4e9045e3dba503309..0000000000000000000000000000000000000000 --- a/docs.it4i/src/salomon/login_salomon.screen +++ /dev/null @@ -1,16 +0,0 @@ -$ termrec login_salomon.ttyrec - -# login to Salomon cluster from local linux machine - -ssh -i /home/local/.ssh/id_rsa dd-16-12-13@salomon.it4i.cz - -# Welcome to Salomon supercomputer cluster - -# run htop command - -htop - -# logout from the cluster - -logout - diff --git a/docs.it4i/src/salomon/login_salomon.ttyrec b/docs.it4i/src/salomon/login_salomon.ttyrec deleted file mode 100644 index ca658074790615276bdc6c744efa892eae4f6ede..0000000000000000000000000000000000000000 Binary files a/docs.it4i/src/salomon/login_salomon.ttyrec and /dev/null differ diff --git a/docs.it4i/src/salomon/modules_salomon.screen b/docs.it4i/src/salomon/modules_salomon.screen deleted file mode 100644 index b57c1fe6ebb51fccd0ee98549a200de27c8ee701..0000000000000000000000000000000000000000 --- a/docs.it4i/src/salomon/modules_salomon.screen +++ /dev/null @@ -1,33 +0,0 @@ -$ termrec -e 'ssh -i /home/local/.ssh/id_rsa dd-16-12-13@salomon.it4i.cz' modules_salomonn.ttyrec - -# Working with modules - -# get the current version of Python -$ python --version - -# run Python -python - -# right now is version 2.6.6 - -# search all available Python's modules -module avail |& grep Python/ - -# for example let's choose a new module Python 3.5.1 -$ module load Python/3.5.1-intel-2016.01 - -# and now get the current version of Python -$ python --version - -# run Python -python - -# that's correct, version 3.5.1 - -# now turn back to old version you have to unload module -$ module unload Python/3.5.1-intel-2016.01 - -$ python --version - -# Python version 2.6.6 is ready to use now - diff --git a/docs.it4i/src/salomon/modules_salomonn.ttyrec b/docs.it4i/src/salomon/modules_salomonn.ttyrec deleted file mode 100644 index 099e39ea84730ead89715fd7ac81050d09f6beaa..0000000000000000000000000000000000000000 Binary files a/docs.it4i/src/salomon/modules_salomonn.ttyrec and /dev/null differ diff --git a/docs.it4i/src/salomon/transfer_scp_salomon.screen b/docs.it4i/src/salomon/transfer_scp_salomon.screen deleted file mode 100644 index f29ba5aec264bfde1862f0e0733cd3b1fbeb8f57..0000000000000000000000000000000000000000 --- a/docs.it4i/src/salomon/transfer_scp_salomon.screen +++ /dev/null @@ -1,30 +0,0 @@ -$ termrec transfer_scp_salomon.ttyrec - -# File transfer from local machine to Salomon cluster - -# create local directory with files -$ mkdir folder -$ cd folder -$ touch test_file.scp - -$ mkdir local_dir -$ touch local_dir/file.txt - -# using scp command to transfer a file to the cluster -$ scp test_file.scp dd-16-12-13@salomon.it4i.cz:/home/trainig/dd-16-12-13/test_file.scp - -# successfully uploaded to the cluster - -# using scp command to transfer a directory to the cluster -$ scp -r local_dir dd-16-12-13@salomon.it4i.cz:/home/training/dd-16-12-13/local_dir - -# successfully uploaded to the cluster - -# login to Salomon cluster and check all transfered files -$ ssh -i /home/local/.ssh/id_rsa dd-16-12-13@salomon.it4i.cz - -$ls -l - -# yes, all files and directory are stored in home directory on the cluster - - diff --git a/docs.it4i/src/salomon/transfer_scp_salomon.ttyrec b/docs.it4i/src/salomon/transfer_scp_salomon.ttyrec deleted file mode 100644 index 6605a91729c54cf0419798f51068bba890ec73a4..0000000000000000000000000000000000000000 Binary files a/docs.it4i/src/salomon/transfer_scp_salomon.ttyrec and /dev/null differ diff --git a/docs.it4i/src/salomon/transfer_sftp_salomon.screen b/docs.it4i/src/salomon/transfer_sftp_salomon.screen deleted file mode 100644 index cc75199060abf5b9ca4da42b1de3681cd15bdcda..0000000000000000000000000000000000000000 --- a/docs.it4i/src/salomon/transfer_sftp_salomon.screen +++ /dev/null @@ -1,49 +0,0 @@ -$ termrec transfer_sftp_salomon.ttyrec - -# File transfer from local machine to Salomon cluster - -# using sftp command -$ touch test_file.sftp -$ sftp -o IdentityFile=/home/local/.ssh/id_rsa dd-16-12-13@salomon.it4i.cz - - -# list of all commands - help or ? -sftp> help - -# display remote working directory on Salomon cluster -sftp> pwd -# display remote directory listing on Salomon cluster -sftp> ls -l -# display statistics for remote directory -sftp> df -h - -# display local working directory on local linux machine -sftp> lpwd -# display local directory listing on local linux machine -sftp> lls -l - -# now we can upload a file from linux machine to Salomon cluster -sftp> put test_file.sftp - -# and then check if successfully uploaded -sftp> ls -l - -# of course we can download a file from the cluster -sftp> get tutorial.tgz - -# and check in local directory -sftp> lls -l - -# delete local file from sftp -sftp>!rm tutorial.tgz - -# quit sftp -sftp> exit - -# login to Salomon cluster and check all transfered files -ssh -i /home/local/.ssh/id_rsa dd-16-12-13@salomon.it4i.cz - -$ls -l - -# yes, all files are stored in home directory on the cluster - diff --git a/docs.it4i/src/salomon/transfer_sftp_salomon.ttyrec b/docs.it4i/src/salomon/transfer_sftp_salomon.ttyrec deleted file mode 100644 index 4dc9ba9149aa8294af55953d37be8048bdd32165..0000000000000000000000000000000000000000 Binary files a/docs.it4i/src/salomon/transfer_sftp_salomon.ttyrec and /dev/null differ diff --git a/mkdocs.yml b/mkdocs.yml index f365f7a275c3c2a577fa229967dc6a4b1a5ba687..574add33c510ef5ee28fb2960dd2961400f5992a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,20 +2,11 @@ site_name: Documentation theme_dir: 'it4i_theme' docs_dir: docs.it4i -extra_css: -- css/tty-player.css - -extra_javascript: -- js/webcomponents-lite.min.js -- js/term.min.js -- js/tty-player.js - # Copyright copyright: Copyright (c) 2016 IT4Innovations pages: - Home: index.md - - What's News: new.md - History of Downtimes: downtimes_history.md - Get Started with IT4Innovations: - Applying for Resources: get-started-with-it4innovations/applying-for-resources.md