From 3d4c7f1159a5b6ca967d70b73cefbbf157567404 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 27 Aug 2012 03:58:09 -0400 Subject: [PATCH] removed packed versions of files, uglifing would be doing on-a-fly --- lib/client/editor.js | 8 ++-- .../codemirror/pack/codemirror.pack.css | 1 - .../editor/codemirror/pack/codemirror.pack.js | 1 - .../editor/codemirror/pack/javascript.pack.js | 1 - .../editor/codemirror/pack/night.pack.css | 1 - lib/client/editor/codemirror/pack/xml.pack.js | 1 - lib/client/viewer.js | 2 +- .../viewer/fancybox/jquery.fancybox.pack.js | 42 ------------------- 8 files changed, 5 insertions(+), 52 deletions(-) delete mode 100644 lib/client/editor/codemirror/pack/codemirror.pack.css delete mode 100644 lib/client/editor/codemirror/pack/codemirror.pack.js delete mode 100644 lib/client/editor/codemirror/pack/javascript.pack.js delete mode 100644 lib/client/editor/codemirror/pack/night.pack.css delete mode 100644 lib/client/editor/codemirror/pack/xml.pack.js delete mode 100644 lib/client/viewer/fancybox/jquery.fancybox.pack.js diff --git a/lib/client/editor.js b/lib/client/editor.js index bc79d9cd..b1dd5968 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -41,8 +41,8 @@ var CloudCommander, CloudFunc, CodeMirror; */ var loadAll = function() { Util.cssLoad([ - { src : 'lib/client/editor/codemirror/pack/codemirror.pack.css'}, - { src : 'lib/client/editor/codemirror/pack/night.pack.css'} + { src : 'lib/client/editor/codemirror/codemirror.css'}, + { src : 'lib/client/editor/codemirror/theme/night.css'} ]); @@ -58,13 +58,13 @@ var CloudCommander, CloudFunc, CodeMirror; }); Util.jsload('lib/client/editor/' + - 'codemirror/pack/javascript.pack.js', + 'codemirror/mode/javascript.js', createEditorDiv); }; /* load CodeMirror main module */ Util.jsload('lib/client/editor/' + - 'codemirror/pack/codemirror.pack.js', loadAll); + 'codemirror/codemirror.js', loadAll); }); /* function shows CodeMirror editor */ diff --git a/lib/client/editor/codemirror/pack/codemirror.pack.css b/lib/client/editor/codemirror/pack/codemirror.pack.css deleted file mode 100644 index 1e26e3e4..00000000 --- a/lib/client/editor/codemirror/pack/codemirror.pack.css +++ /dev/null @@ -1 +0,0 @@ -.CodeMirror{line-height:1em;font-family:monospace;position:relative;overflow:hidden}.CodeMirror-scroll{overflow-x:auto;overflow-y:hidden;height:300px;position:relative;outline:0}.CodeMirror-scrollbar{float:right;overflow-x:hidden;overflow-y:scroll;margin-left:-1px}.CodeMirror-scrollbar-inner{width:1px}.CodeMirror-scrollbar.cm-sb-overlap{position:absolute;z-index:1;float:none;right:0;min-width:12px}.CodeMirror-scrollbar.cm-sb-nonoverlap{min-width:12px}.CodeMirror-scrollbar.cm-sb-ie7{min-width:18px}.CodeMirror-gutter{position:absolute;left:0;top:0;z-index:10;background-color:#f7f7f7;border-right:1px solid #eee;min-width:2em;height:100%}.CodeMirror-gutter-text{color:#aaa;text-align:right;padding:.4em .2em .4em .4em;white-space:pre!important;cursor:default}.CodeMirror-lines{padding:.4em;white-space:pre;cursor:text}.CodeMirror-lines *{pointer-events:none}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;-o-border-radius:0;border-radius:0;border-width:0;margin:0;padding:0;background:transparent;font-family:inherit;font-size:inherit;padding:0;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror textarea{outline:0!important}.CodeMirror pre.CodeMirror-cursor{z-index:10;position:absolute;visibility:hidden;border-left:1px solid black;border-right:0;width:0}.cm-keymap-fat-cursor pre.CodeMirror-cursor{width:auto;border:0;background:transparent;background:rgba(0,200,0,.4);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800)}.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id){filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite{}.CodeMirror-focused pre.CodeMirror-cursor{visibility:visible}div.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused div.CodeMirror-selected{background:#d7d4f0}.CodeMirror-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-s-default span.cm-keyword{color:#708}.cm-s-default span.cm-atom{color:#219}.cm-s-default span.cm-number{color:#164}.cm-s-default span.cm-def{color:#00f}.cm-s-default span.cm-variable{color:#000}.cm-s-default span.cm-variable-2{color:#05a}.cm-s-default span.cm-variable-3{color:#085}.cm-s-default span.cm-property{color:#000}.cm-s-default span.cm-operator{color:#000}.cm-s-default span.cm-comment{color:#a50}.cm-s-default span.cm-string{color:#a11}.cm-s-default span.cm-string-2{color:#f50}.cm-s-default span.cm-meta{color:#555}.cm-s-default span.cm-error{color:red}.cm-s-default span.cm-qualifier{color:#555}.cm-s-default span.cm-builtin{color:#30a}.cm-s-default span.cm-bracket{color:#cc7}.cm-s-default span.cm-tag{color:#170}.cm-s-default span.cm-attribute{color:#00c}.cm-s-default span.cm-header{color:blue}.cm-s-default span.cm-quote{color:#090}.cm-s-default span.cm-hr{color:#999}.cm-s-default span.cm-link{color:#00c}span.cm-header,span.cm-strong{font-weight:700}span.cm-em{font-style:italic}span.cm-emstrong{font-style:italic;font-weight:700}span.cm-link{text-decoration:underline}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22} \ No newline at end of file diff --git a/lib/client/editor/codemirror/pack/codemirror.pack.js b/lib/client/editor/codemirror/pack/codemirror.pack.js deleted file mode 100644 index bf8f4763..00000000 --- a/lib/client/editor/codemirror/pack/codemirror.pack.js +++ /dev/null @@ -1 +0,0 @@ -var CodeMirror=function(){function CodeMirror(place,givenOptions){function isLine(l){return l>=0&&l=visible.to||cur.linenow-400&&posEq(lastDoubleClick.pos,start))type="triple",e_preventDefault(e),setTimeout(focusInput,20),selectLine(start.line);else if(lastClick&&lastClick.time>now-400&&posEq(lastClick.pos,start)){type="double",lastDoubleClick={time:now,pos:start},e_preventDefault(e);var word=findWordAt(start);setSelectionUser(word.from,word.to)}else lastClick={time:now,pos:start};var last=start,going;if(options.dragDrop&&dragAndDrop&&!options.readOnly&&!posEq(sel.from,sel.to)&&!posLess(start,sel.from)&&!posLess(sel.to,start)&&type=="single"){webkit&&(scroller.draggable=!0);function dragEnd(e2){webkit&&(scroller.draggable=!1),draggingText=!1,up(),drop(),Math.abs(e.clientX-e2.clientX)+Math.abs(e.clientY-e2.clientY)<10&&(e_preventDefault(e2),setCursor(start.line,start.ch,!0),focusInput())}var up=connect(document,"mouseup",operation(dragEnd),!0),drop=connect(scroller,"drop",operation(dragEnd),!0);draggingText=!0,scroller.dragDrop&&scroller.dragDrop();return}e_preventDefault(e),type=="single"&&setCursor(start.line,start.ch,!0);var startstart=sel.from,startend=sel.to,move=connect(document,"mousemove",operation(function(e){clearTimeout(going),e_preventDefault(e),!ie&&!e_button(e)?done(e):extend(e)}),!0),up=connect(document,"mouseup",operation(done),!0)}function onDoubleClick(e){for(var n=e_target(e);n!=wrapper;n=n.parentNode)if(n.parentNode==gutterText)return e_preventDefault(e);e_preventDefault(e)}function onDrop(e){if(options.onDragEvent&&options.onDragEvent(instance,addStop(e)))return;e.preventDefault();var pos=posFromMouse(e,!0),files=e.dataTransfer.files;if(!pos||options.readOnly)return;if(files&&files.length&&window.FileReader&&window.File){function loadFile(file,i){var reader=new FileReader;reader.onload=function(){text[i]=reader.result,++read==n&&(pos=clipPos(pos),operation(function(){var end=replaceRange(text.join(""),pos,pos);setSelectionUser(pos,end)})())},reader.readAsText(file)}var n=files.length,text=Array(n),read=0;for(var i=0;i-1&&setTimeout(operation(function(){indentLine(sel.to.line,"smart")}),75);if(handleCharBinding(e,ch))return;fastPoll()}function onKeyUp(e){if(options.onKeyEvent&&options.onKeyEvent(instance,addStop(e)))return;e_prop(e,"keyCode")==16&&(shiftSelecting=null)}function onFocus(){if(options.readOnly=="nocursor")return;focused||(options.onFocus&&options.onFocus(instance),focused=!0,scroller.className.search(/\bCodeMirror-focused\b/)==-1&&(scroller.className+=" CodeMirror-focused"),leaveInputAlone||resetInput(!0)),slowPoll(),restartBlink()}function onBlur(){focused&&(options.onBlur&&options.onBlur(instance),focused=!1,bracketHighlighted&&operation(function(){bracketHighlighted&&(bracketHighlighted(),bracketHighlighted=null)})(),scroller.className=scroller.className.replace(" CodeMirror-focused","")),clearInterval(blinker),setTimeout(function(){focused||(shiftSelecting=null)},150)}function chopDelta(delta){return delta>0&&delta<1?1:delta>-1&&delta<0?-1:Math.round(delta)}function onMouseWheel(e){var deltaX=0,deltaY=0;if(e.type=="DOMMouseScroll"){var delta=-e.detail*8;e.axis==e.HORIZONTAL_AXIS?deltaX=delta:e.axis==e.VERTICAL_AXIS&&(deltaY=delta)}else e.wheelDeltaX!==undefined&&e.wheelDeltaY!==undefined?(deltaX=e.wheelDeltaX/3,deltaY=e.wheelDeltaY/3):e.wheelDelta!==undefined&&(deltaY=e.wheelDelta/3);var scrolled=!1;deltaX=chopDelta(deltaX),deltaY=chopDelta(deltaY);if(deltaX>0&&scroller.scrollLeft>0||deltaX<0&&scroller.scrollLeft+scroller.clientWidth0&&scrollbar.scrollTop>0||deltaY<0&&scrollbar.scrollTop+scrollbar.clientHeightoptions.undoDepth)history.done.shift()}updateLinesNoUndo(from,to,newText,selFrom,selTo)}function unredoHelper(from,to){if(!from.length)return;var set=from.pop(),out=[];for(var i=set.length-1;i>=0;i-=1){var change=set[i],replaced=[],end=change.start+change.added;doc.iter(change.start,end,function(line){replaced.push(line.text)}),out.push({start:change.start,added:change.old.length,old:replaced});var pos={line:change.start+change.old.length-1,ch:editEnd(replaced[replaced.length-1],change.old[change.old.length-1])};updateLinesNoUndo({line:change.start,ch:0},{line:end-1,ch:getLine(end-1).text.length},change.old,pos,pos)}updateInput=!0,to.push(out)}function undo(){unredoHelper(history.done,history.undone)}function redo(){unredoHelper(history.undone,history.done)}function updateLinesNoUndo(from,to,newText,selFrom,selTo){function updateLine(n){return n<=Math.min(to.line,to.line+lendiff)?n:n+lendiff}if(suppressEdits)return;var recomputeMaxLength=!1,maxLineLength=maxLine.length;options.lineWrapping||doc.iter(from.line,to.line+1,function(line){if(!line.hidden&&line.text.length==maxLineLength)return recomputeMaxLength=!0,!0});if(from.line!=to.line||newText.length>1)gutterDirty=!0;var nlines=to.line-from.line,firstLine=getLine(from.line),lastLine=getLine(to.line);if(from.ch==0&&to.ch==0&&newText[newText.length-1]==""){var added=[],prevLine=null;from.line?(prevLine=getLine(from.line-1),prevLine.fixMarkEnds(lastLine)):lastLine.fixMarkStarts();for(var i=0,e=newText.length-1;i1&&doc.remove(from.line+1,nlines-1,callbacks),doc.insert(from.line+1,added)}if(options.lineWrapping){var perLine=Math.max(5,scroller.clientWidth/charWidth()-3);doc.iter(from.line,from.line+newText.length,function(line){if(line.hidden)return;var guess=Math.ceil(line.text.length/perLine)||1;guess!=line.height&&updateLineHeight(line,guess)})}else doc.iter(from.line,from.line+newText.length,function(line){var l=line.text;!line.hidden&&l.length>maxLineLength&&(maxLine=l,maxLineLength=l.length,maxLineChanged=!0,recomputeMaxLength=!1)}),recomputeMaxLength&&(updateMaxLine=!0);var newWork=[],lendiff=newText.length-nlines-1;for(var i=0,l=work.length;ito.line&&newWork.push(task+lendiff)}var hlEnd=from.line+Math.min(newText.length,500);highlightLines(from.line,hlEnd),newWork.push(hlEnd),work=newWork,startWorker(100),changes.push({from:from.line,to:to.line+1,diff:lendiff});var changeObj={from:from,to:to,text:newText};if(textChanged){for(var cur=textChanged;cur.next;cur=cur.next);cur.next=changeObj}else textChanged=changeObj;setSelection(clipPos(selFrom),clipPos(selTo),updateLine(sel.from.line),updateLine(sel.to.line))}function needsScrollbar(){var realHeight=doc.height*textHeight()+2*paddingTop();return realHeight-1>scroller.offsetHeight?realHeight:!1}function updateVerticalScroll(scrollTop){var scrollHeight=needsScrollbar();scrollbar.style.display=scrollHeight?"block":"none",scrollHeight&&(scrollbarInner.style.height=scrollHeight+"px",scrollbar.style.height=scroller.offsetHeight+"px",scrollTop!=null&&(scrollbar.scrollTop=scrollTop)),mover.style.top=displayOffset*textHeight()-scrollbar.scrollTop+"px"}function overlapScrollbars(){var tmpSb=document.createElement("div"),tmpSbInner=document.createElement("div");tmpSb.className="CodeMirror-scrollbar",tmpSb.style.cssText="position: absolute; left: -9999px; height: 100px;",tmpSbInner.className="CodeMirror-scrollbar-inner",tmpSbInner.style.height="200px",tmpSb.appendChild(tmpSbInner),document.body.appendChild(tmpSb);var result=tmpSb.offsetWidth<=1;return document.body.removeChild(tmpSb),result}function computeMaxLength(){var maxLineLength=0;maxLine="",maxLineChanged=!0,doc.iter(0,doc.size,function(line){var l=line.text;!line.hidden&&l.length>maxLineLength&&(maxLineLength=l.length,maxLine=l)}),updateMaxLine=!1}function replaceRange(code,from,to){function adjustPos(pos){if(posLess(pos,from))return pos;if(!posLess(to,pos))return end;var line=pos.line+code.length-(to.line-from.line)-1,ch=pos.ch;return pos.line==to.line&&(ch+=code[code.length-1].length-(to.ch-(to.line==from.line?from.ch:0))),{line:line,ch:ch}}from=clipPos(from),to?to=clipPos(to):to=from,code=splitLines(code);var end;return replaceRange1(code,from,to,function(end1){return end=end1,{from:adjustPos(sel.from),to:adjustPos(sel.to)}}),end}function replaceSelection(code,collapse){replaceRange1(splitLines(code),sel.from,sel.to,function(end){return collapse=="end"?{from:end,to:end}:collapse=="start"?{from:sel.from,to:sel.from}:{from:sel.from,to:end}})}function replaceRange1(code,from,to,computeSel){var endch=code.length==1?code[0].length+from.ch:code[code.length-1].length,newSel=computeSel({line:from.line+code.length-1,ch:endch});updateLines(from,to,code,newSel.from,newSel.to)}function getRange(from,to,lineSep){var l1=from.line,l2=to.line;if(l1==l2)return getLine(l1).text.slice(from.ch,to.ch);var code=[getLine(l1).text.slice(from.ch)];return doc.iter(l1+1,l2,function(line){code.push(line.text)}),code.push(getLine(l2).text.slice(0,to.ch)),code.join(lineSep||"\n")}function getSelection(lineSep){return getRange(sel.from,sel.to,lineSep)}function slowPoll(){if(pollingFast)return;poll.set(options.pollInterval,function(){startOperation(),readInput(),focused&&slowPoll(),endOperation()})}function fastPoll(){function p(){startOperation();var changed=readInput();!changed&&!missed?(missed=!0,poll.set(60,p)):(pollingFast=!1,slowPoll()),endOperation()}var missed=!1;pollingFast=!0,poll.set(20,p)}function readInput(){if(leaveInputAlone||!focused||hasSelection(input)||options.readOnly)return!1;var text=input.value;if(text==prevInput)return!1;shiftSelecting=null;var same=0,l=Math.min(prevInput.length,text.length);while(same1e3?input.value=prevInput="":prevInput=text,!0}function resetInput(user){posEq(sel.from,sel.to)?user&&(prevInput=input.value=""):(prevInput="",input.value=getSelection(),selectInput(input))}function focusInput(){options.readOnly!="nocursor"&&input.focus()}function scrollEditorIntoView(){var rect=cursor.getBoundingClientRect();if(ie&&rect.top==rect.bottom)return;var winH=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(rect.top<0||rect.bottom>winH)&&scrollCursorIntoView()}function scrollCursorIntoView(){var coords=calculateCursorCoords();return scrollIntoView(coords.x,coords.y,coords.x,coords.yBot)}function calculateCursorCoords(){var cursor=localCoords(sel.inverted?sel.from:sel.to),x=options.lineWrapping?Math.min(cursor.x,lineSpace.offsetWidth):cursor.x;return{x:x,y:cursor.y,yBot:cursor.yBot}}function scrollIntoView(x1,y1,x2,y2){var scrollPos=calculateScrollPos(x1,y1,x2,y2),scrolled=!1;scrollPos.scrollLeft!=null&&(scroller.scrollLeft=scrollPos.scrollLeft,scrolled=!0),scrollPos.scrollTop!=null&&(scrollbar.scrollTop=scrollPos.scrollTop,scrolled=!0),scrolled&&options.onScroll&&options.onScroll(instance)}function calculateScrollPos(x1,y1,x2,y2){var pl=paddingLeft(),pt=paddingTop();y1+=pt,y2+=pt,x1+=pl,x2+=pl;var screen=scroller.clientHeight,screentop=scrollbar.scrollTop,result={},docBottom=scroller.scrollHeight,atTop=y1docBottom-10;y1screentop+screen&&(result.scrollTop=(atBottom?docBottom:y2)-screen);var screenw=scroller.clientWidth,screenleft=scroller.scrollLeft,gutterw=options.fixedGutter?gutter.clientWidth:0,atLeft=x1screenw+screenleft-3&&(result.scrollLeft=x2+10-screenw),result}function visibleLines(scrollTop){var lh=textHeight(),top=(scrollTop!=null?scrollTop:scrollbar.scrollTop)-paddingTop(),fromHeight=Math.max(0,Math.floor(top/lh)),toHeight=Math.ceil((top+scroller.clientHeight)/lh);return{from:lineAtHeight(doc,fromHeight),to:lineAtHeight(doc,toHeight)}}function updateDisplay(changes,suppressCallback,scrollTop){function checkHeights(){var curNode=lineDiv.firstChild,heightChanged=!1;return doc.iter(showingFrom,showingTo,function(line){if(!line.hidden){var height=Math.round(curNode.offsetHeight/th)||1;line.height!=height&&(updateLineHeight(line,height),gutterDirty=heightChanged=!0)}curNode=curNode.nextSibling}),heightChanged}if(!scroller.clientWidth){showingFrom=showingTo=displayOffset=0;return}var visible=visibleLines(scrollTop);if(changes!==!0&&changes.length==0&&visible.from>showingFrom&&visible.toto&&showingTo-to<20&&(to=Math.min(doc.size,showingTo));var intact=changes===!0?[]:computeIntact([{from:showingFrom,to:showingTo,domStart:0}],changes),intactLines=0;for(var i=0;ito&&(range.to=to),range.from>=range.to?intact.splice(i--,1):intactLines+=range.to-range.from}if(intactLines==to-from&&from==showingFrom&&to==showingTo){updateVerticalScroll(scrollTop);return}intact.sort(function(a,b){return a.domStart-b.domStart});var th=textHeight(),gutterDisplay=gutter.style.display;lineDiv.style.display="none",patchDisplay(from,to,intact),lineDiv.style.display=gutter.style.display="";var different=from!=showingFrom||to!=showingTo||lastSizeC!=scroller.clientHeight+th;different&&(lastSizeC=scroller.clientHeight+th),showingFrom=from,showingTo=to,displayOffset=heightAtLine(doc,from);if(lineDiv.childNodes.length!=showingTo-showingFrom)throw new Error("BAD PATCH! "+JSON.stringify(intact)+" size="+(showingTo-showingFrom)+" nodes="+lineDiv.childNodes.length);if(options.lineWrapping){checkHeights();var scrollHeight=needsScrollbar(),shouldHaveScrollbar=scrollHeight?"block":"none";scrollbar.style.display!=shouldHaveScrollbar&&(scrollbar.style.display=shouldHaveScrollbar,scrollHeight&&(scrollbarInner.style.height=scrollHeight+"px"),checkHeights())}return gutter.style.display=gutterDisplay,(different||gutterDirty)&&updateGutter()&&options.lineWrapping&&checkHeights()&&updateGutter(),updateVerticalScroll(scrollTop),updateSelection(),!suppressCallback&&options.onUpdate&&options.onUpdate(instance),!0}function computeIntact(intact,changes){for(var i=0,l=changes.length||0;i=range.to?intact2.push(range):(change.from>range.from&&intact2.push({from:range.from,to:change.from,domStart:range.domStart}),change.todomPos)curNode=killNode(curNode),domPos++;for(var j=0,e=cur.to-cur.from;jj){if(line.hidden)var html=scratch.innerHTML="
";else{var html=""+line.getHTML(makeTab)+"";line.bgClassName&&(html='
 
'+html+"
")}scratch.innerHTML=html,lineDiv.insertBefore(scratch.firstChild,curNode)}else curNode=curNode.nextSibling;++j})}function updateGutter(){if(!options.gutter&&!options.lineNumbers)return;var hText=mover.offsetHeight,hEditor=scroller.clientHeight;gutter.style.height=(hText-hEditor<2?hEditor:hText)+"px";var html=[],i=showingFrom,normalNode;doc.iter(showingFrom,Math.max(showingTo,showingFrom+1),function(line){if(line.hidden)html.push("
");else{var marker=line.gutterMarker,text=options.lineNumbers?options.lineNumberFormatter(i+options.firstLineNumber):null;marker&&marker.text?text=marker.text.replace("%N%",text!=null?text:""):text==null&&(text=" "),html.push(marker&&marker.style?'
':"
",text);for(var j=1;j ");html.push("
"),marker||(normalNode=i)}++i}),gutter.style.display="none",gutterText.innerHTML=html.join("");if(normalNode!=null&&options.lineNumbers){var node=gutterText.childNodes[normalNode-showingFrom],minwidth=String(doc.size).length,val=eltText(node.firstChild),pad="";while(val.length+pad.length2;return lineSpace.style.marginLeft=gutter.offsetWidth+"px",gutterDirty=!1,resized}function updateSelection(){var collapsed=posEq(sel.from,sel.to),fromPos=localCoords(sel.from,!0),toPos=collapsed?fromPos:localCoords(sel.to,!0),headPos=sel.inverted?fromPos:toPos,th=textHeight(),wrapOff=eltOffset(wrapper),lineOff=eltOffset(lineDiv);inputDiv.style.top=Math.max(0,Math.min(scroller.offsetHeight,headPos.y+lineOff.top-wrapOff.top))+"px",inputDiv.style.left=Math.max(0,Math.min(scroller.offsetWidth,headPos.x+lineOff.left-wrapOff.left))+"px";if(collapsed)cursor.style.top=headPos.y+"px",cursor.style.left=(options.lineWrapping?Math.min(headPos.x,lineSpace.offsetWidth):headPos.x)+"px",cursor.style.display="",selectionDiv.style.display="none";else{var sameLine=fromPos.y==toPos.y,html="",clientWidth=lineSpace.clientWidth||lineSpace.offsetWidth,clientHeight=lineSpace.clientHeight||lineSpace.offsetHeight;function add(left,top,right,height){var rstyle=quirksMode?"width: "+(right?clientWidth-right-left:clientWidth)+"px":"right: "+right+"px";html+='
'}if(sel.from.ch&&fromPos.y>=0){var right=sameLine?clientWidth-toPos.x:0;add(fromPos.x,fromPos.y,right,th)}var middleStart=Math.max(0,fromPos.y+(sel.from.ch?th:0)),middleHeight=Math.min(toPos.y,clientHeight)-middleStart;middleHeight>.2*th&&add(0,middleStart,0,middleHeight),(!sameLine||!sel.from.ch)&&toPos.yoldCh||ch>line.text.length)ch=line.text.length;return{line:lNo,ch:ch}}lNo+=dir}}var line=getLine(pos.line),toEnd=pos.ch==line.text.length&&pos.ch!=oldCh;return line.hidden?pos.line>=oldLine?getNonHidden(1)||getNonHidden(-1):getNonHidden(-1)||getNonHidden(1):pos}function setCursor(line,ch,user){var pos=clipPos({line:line,ch:ch||0});(user?setSelectionUser:setSelection)(pos,pos)}function clipLine(n){return Math.max(0,Math.min(n,doc.size-1))}function clipPos(pos){if(pos.line<0)return{line:0,ch:0};if(pos.line>=doc.size)return{line:doc.size-1,ch:getLine(doc.size-1).text.length};var ch=pos.ch,linelen=getLine(pos.line).text.length;return ch==null||ch>linelen?{line:pos.line,ch:linelen}:ch<0?{line:pos.line,ch:0}:pos}function findPosH(dir,unit){function findNextLine(){for(var l=line+dir,e=dir<0?-1:doc.size;l!=e;l+=dir){var lo=getLine(l);if(!lo.hidden)return line=l,lineObj=lo,!0}}function moveOnce(boundToLine){if(ch==(dir<0?0:lineObj.text.length)){if(!!boundToLine||!findNextLine())return!1;ch=dir<0?lineObj.text.length:0}else ch+=dir;return!0}var end=sel.inverted?sel.from:sel.to,line=end.line,ch=end.ch,lineObj=getLine(line);if(unit=="char")moveOnce();else if(unit=="column")moveOnce(!0);else if(unit=="word"){var sawWord=!1;for(;;){if(dir<0&&!moveOnce())break;if(isWordChar(lineObj.text.charAt(ch)))sawWord=!0;else if(sawWord){dir<0&&(dir=1,moveOnce());break}if(dir>0&&!moveOnce())break}}return{line:line,ch:ch}}function moveH(dir,unit){var pos=dir<0?sel.from:sel.to;if(shiftSelecting||posEq(sel.from,sel.to))pos=findPosH(dir,unit);setCursor(pos.line,pos.ch,!0)}function deleteH(dir,unit){posEq(sel.from,sel.to)?dir<0?replaceRange("",findPosH(dir,unit),sel.to):replaceRange("",sel.from,findPosH(dir,unit)):replaceRange("",sel.from,sel.to),userSelChange=!0}function moveV(dir,unit){var dist=0,pos=localCoords(sel.inverted?sel.from:sel.to,!0);goalColumn!=null&&(pos.x=goalColumn),unit=="page"?dist=Math.min(scroller.clientHeight,window.innerHeight||document.documentElement.clientHeight):unit=="line"&&(dist=textHeight());var target=coordsChar(pos.x,pos.y+dist*dir+2);unit=="page"&&(scrollbar.scrollTop+=localCoords(target,!0).y-pos.y),setCursor(target.line,target.ch,!0),goalColumn=pos.x}function findWordAt(pos){var line=getLine(pos.line).text,start=pos.ch,end=pos.ch,check=isWordChar(line.charAt(start0&&check(line.charAt(start-1)))--start;while(endmaxLine.length&&(maxLine=line.text)});changes.push({from:0,to:doc.size})}function makeTab(col){var w=options.tabSize-col%options.tabSize,cached=tabCache[w];if(cached)return cached;for(var str='',i=0;i",width:w}}function themeChanged(){scroller.className=scroller.className.replace(/\s*cm-s-\S+/g,"")+options.theme.replace(/(^|\s)\s*/g," cm-s-")}function keyMapChanged(){var style=keyMap[options.keyMap].style;wrapper.className=wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(style?" cm-keymap-"+style:"")}function TextMarker(){this.set=[]}function markText(from,to,className){function add(line,from,to,className){getLine(line).addMark(new MarkedText(from,to,className,tm))}from=clipPos(from),to=clipPos(to);var tm=new TextMarker;if(!posLess(from,to))return tm;if(from.line==to.line)add(from.line,from.ch,to.ch,className);else{add(from.line,from.ch,null,className);for(var i=from.line+1,e=to.line;i=pos.ch)&&markers.push(m.marker||m)}return markers}function addGutterMarker(line,text,className){return typeof line=="number"&&(line=getLine(clipLine(line))),line.gutterMarker={text:text,style:className},gutterDirty=!0,line}function removeGutterMarker(line){typeof line=="number"&&(line=getLine(clipLine(line))),line.gutterMarker=null,gutterDirty=!0}function changeLine(handle,op){var no=handle,line=handle;return typeof handle=="number"?line=getLine(clipLine(handle)):no=lineNo(handle),no==null?null:op(line,no)?(changes.push({from:no,to:no+1}),line):null}function setLineClass(handle,className,bgClassName){return changeLine(handle,function(line){if(line.className!=className||line.bgClassName!=bgClassName)return line.className=className,line.bgClassName=bgClassName,!0})}function setLineHidden(handle,hidden){return changeLine(handle,function(line,no){if(line.hidden!=hidden){line.hidden=hidden;if(!options.lineWrapping){var l=line.text;hidden&&l.length==maxLine.length?updateMaxLine=!0:!hidden&&l.length>maxLine.length&&(maxLine=l,updateMaxLine=!1)}updateLineHeight(line,hidden?0:1);var fline=sel.from.line,tline=sel.to.line;if(hidden&&(fline==no||tline==no)){var from=fline==no?skipHidden({line:fline,ch:0},fline,0):sel.from,to=tline==no?skipHidden({line:tline,ch:0},tline,0):sel.to;if(!to)return;setSelection(from,to)}return gutterDirty=!0}})}function lineInfo(line){if(typeof line=="number"){if(!isLine(line))return null;var n=line;line=getLine(line);if(!line)return null}else{var n=lineNo(line);if(n==null)return null}var marker=line.gutterMarker;return{line:n,handle:line,text:line.text,markerText:marker&&marker.text,markerClass:marker&&marker.style,lineClass:line.className,bgClass:line.bgClassName}}function stringWidth(str){return measure.innerHTML="
x
",measure.firstChild.firstChild.firstChild.nodeValue=str,measure.firstChild.firstChild.offsetWidth||10}function charFromX(line,x){function getX(len){return measureLine(lineObj,len).left}if(x<=0)return 0;var lineObj=getLine(line),text=lineObj.text,from=0,fromX=0,to=text.length,toX,estimated=Math.min(to,Math.ceil(x/charWidth()));for(;;){var estX=getX(estimated);if(!(estX<=x&&estimatedtoX)return to;estimated=Math.floor(to*.8),estX=getX(estimated),estXx-fromX?from:to;var middle=Math.ceil((from+to)/2),middleX=getX(middle);middleX>x?(to=middle,toX=middleX):(from=middle,fromX=middleX)}}function measureLine(line,ch){if(ch==0)return{top:0,left:0};var wbr=options.lineWrapping&&ch"+line.getHTML(makeTab,ch,tempId,wbr)+"
";var elt=document.getElementById(tempId),top=elt.offsetTop,left=elt.offsetLeft;if(ie&&top==0&&left==0){var backup=document.createElement("span");backup.innerHTML="x",elt.parentNode.insertBefore(backup,elt.nextSibling),top=backup.offsetTop}return{top:top,left:left}}function localCoords(pos,inLineWrap){var x,lh=textHeight(),y=lh*(heightAtLine(doc,pos.line)-(inLineWrap?displayOffset:0));if(pos.ch==0)x=0;else{var sp=measureLine(getLine(pos.line),pos.ch);x=sp.left,options.lineWrapping&&(y+=Math.max(0,sp.top))}return{x:x,y:y,yBot:y+lh}}function coordsChar(x,y){function getX(len){var sp=measureLine(lineObj,len);if(tw){var off=Math.round(sp.top/th);return Math.max(0,sp.left+(off-innerOff)*scroller.clientWidth)}return sp.left}y<0&&(y=0);var th=textHeight(),cw=charWidth(),heightPos=displayOffset+Math.floor(y/th),lineNo=lineAtHeight(doc,heightPos);if(lineNo>=doc.size)return{line:doc.size-1,ch:getLine(doc.size-1).text.length};var lineObj=getLine(lineNo),text=lineObj.text,tw=options.lineWrapping,innerOff=tw?heightPos-heightAtLine(doc,lineNo):0;if(x<=0&&innerOff==0)return{line:lineNo,ch:0};var from=0,fromX=0,to=text.length,toX,estimated=Math.min(to,Math.ceil((x+innerOff*scroller.clientWidth*.9)/cw));for(;;){var estX=getX(estimated);if(!(estX<=x&&estimatedtoX)return{line:lineNo,ch:to};estimated=Math.floor(to*.8),estX=getX(estimated),estXx-fromX?from:to};var middle=Math.ceil((from+to)/2),middleX=getX(middle);middleX>x?(to=middle,toX=middleX):(from=middle,fromX=middleX)}}function pageCoords(pos){var local=localCoords(pos,!0),off=eltOffset(lineSpace);return{x:off.left+local.x,y:off.top+local.y,yBot:off.top+local.yBot}}function textHeight(){if(measureText==null){measureText="
";for(var i=0;i<49;++i)measureText+="x
";measureText+="x
"}var offsetHeight=lineDiv.clientHeight;return offsetHeight==cachedHeightFor?cachedHeight:(cachedHeightFor=offsetHeight,measure.innerHTML=measureText,cachedHeight=measure.firstChild.offsetHeight/50||1,measure.innerHTML="",cachedHeight)}function charWidth(){return scroller.clientWidth==cachedWidthFor?cachedWidth:(cachedWidthFor=scroller.clientWidth,cachedWidth=stringWidth("x"))}function paddingTop(){return lineSpace.offsetTop}function paddingLeft(){return lineSpace.offsetLeft}function posFromMouse(e,liberal){var offW=eltOffset(scroller,!0),x,y;try{x=e.clientX,y=e.clientY}catch(e){return null}if(!liberal&&(x-offW.left>scroller.clientWidth||y-offW.top>scroller.clientHeight))return null;var offL=eltOffset(lineSpace,!0);return coordsChar(x-offL.left,y-offL.top)}function onContextMenu(e){function rehide(){var newVal=splitLines(input.value).join("\n");newVal!=val&&!options.readOnly&&operation(replaceSelection)(newVal,"end"),inputDiv.style.position="relative",input.style.cssText=oldCSS,ie_lt9&&(scrollbar.scrollTop=scrollPos),leaveInputAlone=!1,resetInput(!0),slowPoll()}var pos=posFromMouse(e),scrollPos=scrollbar.scrollTop;if(!pos||opera)return;(posEq(sel.from,sel.to)||posLess(pos,sel.from)||!posLess(pos,sel.to))&&operation(setCursor)(pos.line,pos.ch);var oldCSS=input.style.cssText;inputDiv.style.position="absolute",input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",leaveInputAlone=!0;var val=input.value=getSelection();focusInput(),selectInput(input);if(gecko){e_stop(e);var mouseup=connect(window,"mouseup",function(){mouseup(),setTimeout(rehide,20)},!0)}else setTimeout(rehide,50)}function restartBlink(){clearInterval(blinker);var on=!0;cursor.style.visibility="",blinker=setInterval(function(){cursor.style.visibility=(on=!on)?"":"hidden"},650)}function matchBrackets(autoclear){function scan(line,from,to){if(!line.text)return;var st=line.styles,pos=forward?0:line.text.length-1,cur;for(var i=forward?0:st.length-2,e=forward?st.length:-2;i!=e;i+=2*d){var text=st[i];if(st[i+1]!=style){pos+=d*text.length;continue}for(var j=forward?0:text.length-1,te=forward?text.length:-1;j!=te;j+=d,pos+=d)if(pos>=from&&pos"==forward)stack.push(cur);else{if(stack.pop()!=match.charAt(0))return{pos:pos,match:!1};if(!stack.length)return{pos:pos,match:!0}}}}}var head=sel.inverted?sel.from:sel.to,line=getLine(head.line),pos=head.ch-1,match=pos>=0&&matching[line.text.charAt(pos)]||matching[line.text.charAt(++pos)];if(!match)return;var ch=match.charAt(0),forward=match.charAt(1)==">",d=forward?1:-1,st=line.styles;for(var off=pos+1,i=0,e=st.length;ilim;--search){if(search==0)return 0;var line=getLine(search-1);if(line.stateAfter)return search;var indented=line.indentation(options.tabSize);if(minline==null||minindent>indented)minline=search-1,minindent=indented}return minline}function getStateBefore(n){var start=findStartLine(n),state=start&&getLine(start-1).stateAfter;return state?state=copyState(mode,state):state=startState(mode),doc.iter(start,n,function(line){line.highlight(mode,state,options.tabSize),line.stateAfter=copyState(mode,state)}),start=doc.size)continue;var start=findStartLine(task),state=start&&getLine(start-1).stateAfter;state?state=copyState(mode,state):state=startState(mode);var unchanged=0,compare=mode.compareStates,realChange=!1,i=start,bail=!1;doc.iter(i,doc.size,function(line){var hadState=line.stateAfter;if(+(new Date)>end)return work.push(i),startWorker(options.workDelay),realChange&&changes.push({from:task,to:i+1}),bail=!0;var changed=line.highlight(mode,state,options.tabSize);changed&&(realChange=!0),line.stateAfter=copyState(mode,state);var done=null;if(compare){var same=hadState&&compare(hadState,state);same!=Pass&&(done=!!same)}done==null&&(changed!==!1||!hadState?unchanged=0:++unchanged>3&&(!mode.indent||mode.indent(hadState,"")==mode.indent(state,""))&&(done=!0));if(done)return!0;++i});if(bail)return;realChange&&changes.push({from:task,to:i+1})}foundWork&&options.onHighlightComplete&&options.onHighlightComplete(instance)}function startWorker(time){if(!work.length)return;highlight.set(time,operation(highlightWorker))}function startOperation(){updateInput=userSelChange=textChanged=null,changes=[],selectionChanged=!1,callbacks=[]}function endOperation(){updateMaxLine&&computeMaxLength();if(maxLineChanged&&!options.lineWrapping){var cursorWidth=widthForcer.offsetWidth,left=stringWidth(maxLine);widthForcer.style.left=left+"px",lineSpace.style.minWidth=left+cursorWidth+"px",maxLineChanged=!1}var newScrollPos,updated;if(selectionChanged){var coords=calculateCursorCoords();newScrollPos=calculateScrollPos(coords.x,coords.y,coords.x,coords.yBot)}changes.length?updated=updateDisplay(changes,!0,newScrollPos?newScrollPos.scrollTop:null):(selectionChanged&&updateSelection(),gutterDirty&&updateGutter()),newScrollPos&&scrollCursorIntoView(),selectionChanged&&(scrollEditorIntoView(),restartBlink()),focused&&!leaveInputAlone&&(updateInput===!0||updateInput!==!1&&selectionChanged)&&resetInput(userSelChange),selectionChanged&&options.matchBrackets&&setTimeout(operation(function(){bracketHighlighted&&(bracketHighlighted(),bracketHighlighted=null),posEq(sel.from,sel.to)&&matchBrackets(!1)}),20);var sc=selectionChanged,cbs=callbacks;textChanged&&options.onChange&&instance&&options.onChange(instance,textChanged),sc&&options.onCursorActivity&&options.onCursorActivity(instance);for(var i=0;ivspace&&pos.y>node.offsetHeight&&(top=pos.y-node.offsetHeight),left+node.offsetWidth>hspace&&(left=hspace-node.offsetWidth)}node.style.top=top+paddingTop()+"px",node.style.left=node.style.right="",horiz=="right"?(left=code.clientWidth-node.offsetWidth,node.style.right="0px"):(horiz=="left"?left=0:horiz=="middle"&&(left=(code.clientWidth-node.offsetWidth)/2),node.style.left=left+paddingLeft()+"px"),scroll&&scrollIntoView(left,top,left+node.offsetWidth,top+node.offsetHeight)},lineCount:function(){return doc.size},clipPos:clipPos,getCursor:function(start){return start==null&&(start=sel.inverted),copyPos(start?sel.from:sel.to)},somethingSelected:function(){return!posEq(sel.from,sel.to)},setCursor:operation(function(line,ch,user){ch==null&&typeof line.line=="number"?setCursor(line.line,line.ch,user):setCursor(line,ch,user)}),setSelection:operation(function(from,to,user){(user?setSelectionUser:setSelection)(clipPos(from),clipPos(to||from))}),getLine:function(line){if(isLine(line))return getLine(line).text},getLineHandle:function(line){if(isLine(line))return getLine(line)},setLine:operation(function(line,text){isLine(line)&&replaceRange(text,{line:line,ch:0},{line:line,ch:getLine(line).text.length})}),removeLine:operation(function(line){isLine(line)&&replaceRange("",{line:line,ch:0},clipPos({line:line+1,ch:0}))}),replaceRange:operation(replaceRange),getRange:function(from,to,lineSep){return getRange(clipPos(from),clipPos(to),lineSep)},triggerOnKeyDown:operation(onKeyDown),execCommand:function(cmd){return commands[cmd](instance)},moveH:operation(moveH),deleteH:operation(deleteH),moveV:operation(moveV),toggleOverwrite:function(){overwrite?(overwrite=!1,cursor.className=cursor.className.replace(" CodeMirror-overwrite","")):(overwrite=!0,cursor.className+=" CodeMirror-overwrite")},posFromIndex:function(off){var lineNo=0,ch;return doc.iter(0,doc.size,function(line){var sz=line.text.length+1;if(sz>off)return ch=off,!0;off-=sz,++lineNo}),clipPos({line:lineNo,ch:ch})},indexFromPos:function(coords){if(coords.line<0||coords.ch<0)return 0;var index=coords.ch;return doc.iter(0,coords.line,function(line){index+=line.text.length+1}),index},scrollTo:function(x,y){x!=null&&(scroller.scrollLeft=x),y!=null&&(scrollbar.scrollTop=y),updateDisplay([])},getScrollInfo:function(){return{x:scroller.scrollLeft,y:scrollbar.scrollTop,height:scrollbar.scrollHeight,width:scroller.scrollWidth}},setSize:function(width,height){function interpret(val){return val=String(val),/^\d+$/.test(val)?val+"px":val}width!=null&&(wrapper.style.width=interpret(width)),height!=null&&(scroller.style.height=interpret(height))},operation:function(f){return operation(f)()},compoundChange:function(f){return compoundChange(f)},refresh:function(){updateDisplay(!0,null,lastScrollTop),scrollbar.scrollHeight>lastScrollTop&&(scrollbar.scrollTop=lastScrollTop)},getInputField:function(){return input},getWrapperElement:function(){return wrapper},getScrollerElement:function(){return scroller},getGutterElement:function(){return gutter}},lastStoppedKey=null,maybeTransition,pollingFast=!1,prevInput="",goalColumn=null;TextMarker.prototype.clear=operation(function(){var min=Infinity,max=-Infinity;for(var i=0,e=this.set.length;i",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},nestedOperation=0;for(var ext in extensions)extensions.propertyIsEnumerable(ext)&&!instance.propertyIsEnumerable(ext)&&(instance[ext]=extensions[ext]);return instance}function getKeyMap(val){return typeof val=="string"?keyMap[val]:val}function lookupKey(name,extraMap,map,handle,stop){function lookup(map){map=getKeyMap(map);var found=map[name];if(found!=null&&handle(found))return!0;if(map.nofallthrough)return stop&&stop(),!0;var fallthrough=map.fallthrough;if(fallthrough==null)return!1;if(Object.prototype.toString.call(fallthrough)!="[object Array]")return lookup(fallthrough);for(var i=0,e=fallthrough.length;ifrom&&dest.push(part.slice(from-pos,Math.min(part.length,to-pos)),source[i+1]),end>=from&&(state=1)):state==1&&(end>to?dest.push(part.slice(0,to-pos),source[i+1]):dest.push(part,source[i+1])),pos=end}}function LeafChunk(lines){this.lines=lines,this.parent=null;for(var i=0,e=lines.length,height=0;i=0&&j>=0;--i,--j)if(from.charAt(i)!=to.charAt(j))break;return j+1}function indexOf(collection,elt){if(collection.indexOf)return collection.indexOf(elt);for(var i=0,e=collection.length;i2){mode.dependencies=[];for(var i=2;i0&&cur.ch=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.posstart},eatSpace:function(){var start=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>start},skipToEnd:function(){this.pos=this.string.length},skipTo:function(ch){var found=this.string.indexOf(ch,this.pos);if(found>-1)return this.pos=found,!0},backUp:function(n){this.pos-=n},column:function(){return countColumn(this.string,this.start,this.tabSize)},indentation:function(){return countColumn(this.string,null,this.tabSize)},match:function(pattern,consume,caseInsensitive){if(typeof pattern!="string"){var match=this.string.slice(this.pos).match(pattern);return match&&consume!==!1&&(this.pos+=match[0].length),match}function cased(str){return caseInsensitive?str.toLowerCase():str}if(cased(this.string).indexOf(cased(pattern),this.pos)==this.pos)return consume!==!1&&(this.pos+=pattern.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},CodeMirror.StringStream=StringStream,MarkedText.prototype={attach:function(line){this.marker.set.push(line)},detach:function(line){var ix=indexOf(this.marker.set,line);ix>-1&&this.marker.set.splice(ix,1)},split:function(pos,lenBefore){if(this.to<=pos&&this.to!=null)return null;var from=this.fromthis.from&&(to=from&&(this.from=Math.max(to,this.from)+diff),toOpen&&(fromthis.from||this.from==null)?this.to=null:this.to!=null&&this.to>from&&(this.to=to=this.to},sameSet:function(x){return this.marker==x.marker}},Bookmark.prototype={attach:function(line){this.line=line},detach:function(line){this.line==line&&(this.line=null)},split:function(pos,lenBefore){if(posthis.to},clipTo:function(fromOpen,from,toOpen,to,diff){(fromOpen||fromthis.to)?(this.from=0,this.to=-1):this.from>from&&(this.from=this.to=Math.max(to,this.from)+diff)},sameSet:function(x){return!1},find:function(){return!this.line||!this.line.parent?null:{line:lineNo(this.line),ch:this.from}},clear:function(){if(this.line){var found=indexOf(this.line.marked,this);found!=-1&&this.line.marked.splice(found,1),this.line=null}}},Line.inheritMarks=function(text,orig){var ln=new Line(text),mk=orig&&orig.marked;if(mk)for(var i=0;i5e3){st[pos++]=this.text.slice(stream.pos),st[pos++]=null;break}}return st.length!=pos&&(st.length=pos,changed=!0),pos&&st[pos-2]!=prevWord&&(changed=!0),changed||(st.length<5&&this.text.length<10?null:!1)},getTokenAt:function(mode,state,ch){var txt=this.text,stream=new StringStream(txt);while(stream.pos',escaped,""):html.push(escaped)}function styleToClass(style){return style?"cm-"+style.replace(/ +/g," cm-"):null}var html=[],first=!0,col=0,span=span_;if(wrapAt!=null){var outPos=0,open='';span=function(text,style){var l=text.length;if(wrapAt>=outPos&&wrapAtoutPos&&(span_(text.slice(0,wrapAt-outPos),style),wrapWBR&&html.push("")),html.push(open);var cut=wrapAt-outPos;span_(opera?text.slice(cut,cut+1):text.slice(cut),style),html.push(""),opera&&span_(text.slice(cut+1),style),wrapAt--,outPos+=l}else outPos+=l,span_(text,style),outPos==wrapAt&&outPos==len?html.push(open+(gecko||ie&&!ie_lt8?"​":" ")+""):outPos>wrapAt+10&&/\s/.test(text)&&(span=function(){})}}var st=this.styles,allText=this.text,marked=this.marked,len=allText.length;if(!allText&&wrapAt==null)span(" ");else if(!marked||!marked.length)for(var i=0,ch=0;chlen&&(str=str.slice(0,len-ch)),ch+=l,span(str,styleToClass(style))}else{var pos=0,i=0,text="",style,sg=0,nextChange=marked[0].from||0,marks=[],markpos=0;function advanceMarks(){var m;while(markposupto?text.slice(0,upto-pos):text,appliedStyle);if(end>=upto){text=text.slice(upto-pos),pos=upto;break}pos=end}text=st[i++],style=styleToClass(st[i++])}}}return html.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var i=0,e=this.marked.length;i50){while(child.lines.length>50){var spilled=child.lines.splice(child.lines.length-25,25),newleaf=new LeafChunk(spilled);child.height-=newleaf.height,this.children.splice(i+1,0,newleaf),newleaf.parent=this}this.maybeSpill()}break}at-=sz}},maybeSpill:function(){if(this.children.length<=10)return;var me=this;do{var spilled=me.children.splice(me.children.length-5,5),sibling=new BranchChunk(spilled);if(!me.parent){var copy=new BranchChunk(me.children);copy.parent=me,me.children=[copy,sibling],me=copy}else{me.size-=sibling.size,me.height-=sibling.height;var myIndex=indexOf(me.parent.children,me);me.parent.children.splice(myIndex+1,0,sibling)}sibling.parent=me.parent}while(me.children.length>10);me.parent.maybeSpill()},iter:function(from,to,op){this.iterN(from,to-from,op)},iterN:function(at,n,op){for(var i=0,e=this.children.length;i400||!last||this.closed||last.start>start+old.length||last.start+last.added0;--i)last.old.unshift(old[i-1]);for(var i=endAfter;i>0;--i)last.old.push(old[old.length-i]);startBefore&&(last.start=start),last.added+=added-(old.length-startBefore-endAfter)}this.time=time},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},CodeMirror.e_stop=e_stop,CodeMirror.e_preventDefault=e_preventDefault,CodeMirror.e_stopPropagation=e_stopPropagation,CodeMirror.connect=connect,Delayed.prototype={set:function(ms,f){clearTimeout(this.id),this.id=setTimeout(f,ms)}};var Pass=CodeMirror.Pass={toString:function(){return"CodeMirror.Pass"}},gecko=/gecko\/\d{7}/i.test(navigator.userAgent),ie=/MSIE \d/.test(navigator.userAgent),ie_lt8=/MSIE [1-7]\b/.test(navigator.userAgent),ie_lt9=/MSIE [1-8]\b/.test(navigator.userAgent),quirksMode=ie&&document.documentMode==5,webkit=/WebKit\//.test(navigator.userAgent),chrome=/Chrome\//.test(navigator.userAgent),opera=/Opera\//.test(navigator.userAgent),safari=/Apple Computer/.test(navigator.vendor),khtml=/KHTML\//.test(navigator.userAgent),mac_geLion=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent),dragAndDrop=function(){if(ie_lt9)return!1;var div=document.createElement("div");return"draggable"in div||"dragDrop"in div}(),lineSep=function(){var te=document.createElement("textarea");return te.value="foo\nbar",te.value.indexOf("\r")>-1?"\r\n":"\n"}(),spanAffectsWrapping=/^$/;gecko?spanAffectsWrapping=/$'/:safari?spanAffectsWrapping=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:chrome&&(spanAffectsWrapping=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var escapeElement=document.createElement("pre");htmlEscape("a")=="\na"?htmlEscape=function(str){return escapeElement.textContent=str,escapeElement.innerHTML.slice(1)}:htmlEscape(" ")!=" "&&(htmlEscape=function(str){return escapeElement.innerHTML="",escapeElement.appendChild(document.createTextNode(str)),escapeElement.innerHTML}),CodeMirror.htmlEscape=htmlEscape;var splitLines="\n\nb".split(/\n/).length!=3?function(string){var pos=0,result=[],l=string.length;while(pos<=l){var nl=string.indexOf("\n",pos);nl==-1&&(nl=string.length);var line=string.slice(pos,string.charAt(nl-1)=="\r"?nl-1:nl),rt=line.indexOf("\r");rt!=-1?(result.push(line.slice(0,rt)),pos+=rt+1):(result.push(line),pos=nl+1)}return result}:function(string){return string.split(/\r\n?|\n/)};CodeMirror.splitLines=splitLines;var hasSelection=window.getSelection?function(te){try{return te.selectionStart!=te.selectionEnd}catch(e){return!1}}:function(te){try{var range=te.ownerDocument.selection.createRange()}catch(e){}return!range||range.parentElement()!=te?!1:range.compareEndPoints("StartToEnd",range)!=0};CodeMirror.defineMode("null",function(){return{token:function(stream){stream.skipToEnd()}}}),CodeMirror.defineMIME("text/plain","null");var keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return CodeMirror.keyNames=keyNames,function(){for(var i=0;i<10;i++)keyNames[i+48]=String(i);for(var i=65;i<=90;i++)keyNames[i]=String.fromCharCode(i);for(var i=1;i<=12;i++)keyNames[i+111]=keyNames[i+63235]="F"+i}(),CodeMirror}() \ No newline at end of file diff --git a/lib/client/editor/codemirror/pack/javascript.pack.js b/lib/client/editor/codemirror/pack/javascript.pack.js deleted file mode 100644 index e413ff7a..00000000 --- a/lib/client/editor/codemirror/pack/javascript.pack.js +++ /dev/null @@ -1 +0,0 @@ -CodeMirror.defineMode("javascript",function(config,parserConfig){function chain(stream,state,f){return state.tokenize=f,f(stream,state)}function nextUntilUnescaped(stream,end){var escaped=!1,next;while((next=stream.next())!=null){if(next==end&&!escaped)return!1;escaped=!escaped&&next=="\\"}return escaped}function ret(tp,style,cont){return type=tp,content=cont,style}function jsTokenBase(stream,state){var ch=stream.next();if(ch=='"'||ch=="'")return chain(stream,state,jsTokenString(ch));if(/[\[\]{}\(\),;\:\.]/.test(ch))return ret(ch);if(ch=="0"&&stream.eat(/x/i))return stream.eatWhile(/[\da-f]/i),ret("number","number");if(/\d/.test(ch)||ch=="-"&&stream.eat(/\d/))return stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),ret("number","number");if(ch=="/")return stream.eat("*")?chain(stream,state,jsTokenComment):stream.eat("/")?(stream.skipToEnd(),ret("comment","comment")):state.reAllowed?(nextUntilUnescaped(stream,"/"),stream.eatWhile(/[gimy]/),ret("regexp","string-2")):(stream.eatWhile(isOperatorChar),ret("operator",null,stream.current()));if(ch=="#")return stream.skipToEnd(),ret("error","error");if(isOperatorChar.test(ch))return stream.eatWhile(isOperatorChar),ret("operator",null,stream.current());stream.eatWhile(/[\w\$_]/);var word=stream.current(),known=keywords.propertyIsEnumerable(word)&&keywords[word];return known&&state.kwAllowed?ret(known.type,known.style,word):ret("variable","variable",word)}function jsTokenString(quote){return function(stream,state){return nextUntilUnescaped(stream,quote)||(state.tokenize=jsTokenBase),ret("string","string")}}function jsTokenComment(stream,state){var maybeEnd=!1,ch;while(ch=stream.next()){if(ch=="/"&&maybeEnd){state.tokenize=jsTokenBase;break}maybeEnd=ch=="*"}return ret("comment","comment")}function JSLexical(indented,column,type,align,prev,info){this.indented=indented,this.column=column,this.type=type,this.prev=prev,this.info=info,align!=null&&(this.align=align)}function inScope(state,varname){for(var v=state.localVars;v;v=v.next)if(v.name==varname)return!0}function parseJS(state,style,type,content,stream){var cc=state.cc;cx.state=state,cx.stream=stream,cx.marked=null,cx.cc=cc,state.lexical.hasOwnProperty("align")||(state.lexical.align=!0);for(;;){var combinator=cc.length?cc.pop():jsonMode?expression:statement;if(combinator(type,content)){while(cc.length&&cc[cc.length-1].lex)cc.pop()();return cx.marked?cx.marked:type=="variable"&&inScope(state,content)?"variable-2":style}}}function pass(){for(var i=arguments.length-1;i>=0;i--)cx.cc.push(arguments[i])}function cont(){return pass.apply(null,arguments),!0}function register(varname){var state=cx.state;if(state.context){cx.marked="def";for(var v=state.localVars;v;v=v.next)if(v.name==varname)return;state.localVars={name:varname,next:state.localVars}}}function pushcontext(){cx.state.context||(cx.state.localVars=defaultVars),cx.state.context={prev:cx.state.context,vars:cx.state.localVars}}function popcontext(){cx.state.localVars=cx.state.context.vars,cx.state.context=cx.state.context.prev}function pushlex(type,info){var result=function(){var state=cx.state;state.lexical=new JSLexical(state.indented,cx.stream.column(),type,null,state.lexical,info)};return result.lex=!0,result}function poplex(){var state=cx.state;state.lexical.prev&&(state.lexical.type==")"&&(state.indented=state.lexical.indented),state.lexical=state.lexical.prev)}function expect(wanted){return function(type){return type==wanted?cont():wanted==";"?pass():cont(arguments.callee)}}function statement(type){return type=="var"?cont(pushlex("vardef"),vardef1,expect(";"),poplex):type=="keyword a"?cont(pushlex("form"),expression,statement,poplex):type=="keyword b"?cont(pushlex("form"),statement,poplex):type=="{"?cont(pushlex("}"),block,poplex):type==";"?cont():type=="function"?cont(functiondef):type=="for"?cont(pushlex("form"),expect("("),pushlex(")"),forspec1,expect(")"),poplex,statement,poplex):type=="variable"?cont(pushlex("stat"),maybelabel):type=="switch"?cont(pushlex("form"),expression,pushlex("}","switch"),expect("{"),block,poplex,poplex):type=="case"?cont(expression,expect(":")):type=="default"?cont(expect(":")):type=="catch"?cont(pushlex("form"),pushcontext,expect("("),funarg,expect(")"),statement,poplex,popcontext):pass(pushlex("stat"),expression,expect(";"),poplex)}function expression(type){return atomicTypes.hasOwnProperty(type)?cont(maybeoperator):type=="function"?cont(functiondef):type=="keyword c"?cont(maybeexpression):type=="("?cont(pushlex(")"),maybeexpression,expect(")"),poplex,maybeoperator):type=="operator"?cont(expression):type=="["?cont(pushlex("]"),commasep(expression,"]"),poplex,maybeoperator):type=="{"?cont(pushlex("}"),commasep(objprop,"}"),poplex,maybeoperator):cont()}function maybeexpression(type){return type.match(/[;\}\)\],]/)?pass():pass(expression)}function maybeoperator(type,value){if(type=="operator"&&/\+\+|--/.test(value))return cont(maybeoperator);if(type=="operator"||type==":")return cont(expression);if(type==";")return;if(type=="(")return cont(pushlex(")"),commasep(expression,")"),poplex,maybeoperator);if(type==".")return cont(property,maybeoperator);if(type=="[")return cont(pushlex("]"),expression,expect("]"),poplex,maybeoperator)}function maybelabel(type){return type==":"?cont(poplex,statement):pass(maybeoperator,expect(";"),poplex)}function property(type){if(type=="variable")return cx.marked="property",cont()}function objprop(type){type=="variable"&&(cx.marked="property");if(atomicTypes.hasOwnProperty(type))return cont(expect(":"),expression)}function commasep(what,end){function proceed(type){return type==","?cont(what,proceed):type==end?cont():cont(expect(end))}return function(type){return type==end?cont():pass(what,proceed)}}function block(type){return type=="}"?cont():pass(statement,block)}function vardef1(type,value){return type=="variable"?(register(value),cont(vardef2)):cont()}function vardef2(type,value){if(value=="=")return cont(expression,vardef2);if(type==",")return cont(vardef1)}function forspec1(type){return type=="var"?cont(vardef1,forspec2):type==";"?pass(forspec2):type=="variable"?cont(formaybein):pass(forspec2)}function formaybein(type,value){return value=="in"?cont(expression):cont(maybeoperator,forspec2)}function forspec2(type,value){return type==";"?cont(forspec3):value=="in"?cont(expression):cont(expression,expect(";"),forspec3)}function forspec3(type){type!=")"&&cont(expression)}function functiondef(type,value){if(type=="variable")return register(value),cont(functiondef);if(type=="(")return cont(pushlex(")"),pushcontext,commasep(funarg,")"),poplex,statement,popcontext)}function funarg(type,value){if(type=="variable")return register(value),cont()}var indentUnit=config.indentUnit,jsonMode=parserConfig.json,keywords=function(){function kw(type){return{type:type,style:"keyword"}}var A=kw("keyword a"),B=kw("keyword b"),C=kw("keyword c"),operator=kw("operator"),atom={type:"atom",style:"atom"};return{"if":A,"while":A,"with":A,"else":B,"do":B,"try":B,"finally":B,"return":C,"break":C,"continue":C,"new":C,"delete":C,"throw":C,"var":kw("var"),"const":kw("var"),let:kw("var"),"function":kw("function"),"catch":kw("catch"),"for":kw("for"),"switch":kw("switch"),"case":kw("case"),"default":kw("default"),"in":operator,"typeof":operator,"instanceof":operator,"true":atom,"false":atom,"null":atom,"undefined":atom,NaN:atom,Infinity:atom}}(),isOperatorChar=/[+\-*&%=<>!?|]/,type,content,atomicTypes={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},cx={state:null,column:null,marked:null,cc:null},defaultVars={name:"this",next:{name:"arguments"}};return poplex.lex=!0,{startState:function(basecolumn){return{tokenize:jsTokenBase,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new JSLexical((basecolumn||0)-indentUnit,0,"block",!1),localVars:parserConfig.localVars,context:parserConfig.localVars&&{vars:parserConfig.localVars},indented:0}},token:function(stream,state){stream.sol()&&(state.lexical.hasOwnProperty("align")||(state.lexical.align=!1),state.indented=stream.indentation());if(stream.eatSpace())return null;var style=state.tokenize(stream,state);return type=="comment"?style:(state.reAllowed=type=="operator"||type=="keyword c"||!!type.match(/^[\[{}\(,;:]$/),state.kwAllowed=type!=".",parseJS(state,style,type,content,stream))},indent:function(state,textAfter){if(state.tokenize!=jsTokenBase)return 0;var firstChar=textAfter&&textAfter.charAt(0),lexical=state.lexical;lexical.type=="stat"&&firstChar=="}"&&(lexical=lexical.prev);var type=lexical.type,closing=firstChar==type;return type=="vardef"?lexical.indented+4:type=="form"&&firstChar=="{"?lexical.indented:type=="stat"||type=="form"?lexical.indented+indentUnit:lexical.info=="switch"&&!closing?lexical.indented+(/^(?:case|default)\b/.test(textAfter)?indentUnit:2*indentUnit):lexical.align?lexical.column+(closing?0:1):lexical.indented+(closing?0:indentUnit)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}) \ No newline at end of file diff --git a/lib/client/editor/codemirror/pack/night.pack.css b/lib/client/editor/codemirror/pack/night.pack.css deleted file mode 100644 index 43cbf85a..00000000 --- a/lib/client/editor/codemirror/pack/night.pack.css +++ /dev/null @@ -1 +0,0 @@ -.cm-s-night{background:#0a001f;color:#f8f8f8}.cm-s-night div.CodeMirror-selected{background:#447!important}.cm-s-night .CodeMirror-gutter{background:#0a001f;border-right:1px solid #aaa}.cm-s-night .CodeMirror-gutter-text{color:#f8f8f8}.cm-s-night .CodeMirror-cursor{border-left:1px solid white!important}.cm-s-night span.cm-comment{color:#6900a1}.cm-s-night span.cm-atom{color:#845dc4}.cm-s-night span.cm-number,.cm-s-night span.cm-attribute{color:#ffd500}.cm-s-night span.cm-keyword{color:#599eff}.cm-s-night span.cm-string{color:#37f14a}.cm-s-night span.cm-meta{color:#7678e2}.cm-s-night span.cm-variable-2,.cm-s-night span.cm-tag{color:#99b2ff}.cm-s-night span.cm-variable-3,.cm-s-night span.cm-def{color:#fff}.cm-s-night span.cm-error{color:#9d1e15}.cm-s-night span.cm-bracket{color:#8da6ce}.cm-s-night span.cm-comment{color:#6900a1}.cm-s-night span.cm-builtin,.cm-s-night span.cm-special{color:#ff9e59}.cm-s-night span.cm-link{color:#845dc4} \ No newline at end of file diff --git a/lib/client/editor/codemirror/pack/xml.pack.js b/lib/client/editor/codemirror/pack/xml.pack.js deleted file mode 100644 index 08e1ea97..00000000 --- a/lib/client/editor/codemirror/pack/xml.pack.js +++ /dev/null @@ -1 +0,0 @@ -CodeMirror.defineMode("xml",function(config,parserConfig){function inText(stream,state){function chain(parser){return state.tokenize=parser,parser(stream,state)}var ch=stream.next();if(ch=="<"){if(stream.eat("!"))return stream.eat("[")?stream.match("CDATA[")?chain(inBlock("atom","]]>")):null:stream.match("--")?chain(inBlock("comment","-->")):stream.match("DOCTYPE",!0,!0)?(stream.eatWhile(/[\w\._\-]/),chain(doctype(1))):null;if(stream.eat("?"))return stream.eatWhile(/[\w\._\-]/),state.tokenize=inBlock("meta","?>"),"meta";type=stream.eat("/")?"closeTag":"openTag",stream.eatSpace(),tagName="";var c;while(c=stream.eat(/[^\s\u00a0=<>\"\'\/?]/))tagName+=c;return state.tokenize=inTag,"tag"}if(ch=="&"){var ok;return stream.eat("#")?stream.eat("x")?ok=stream.eatWhile(/[a-fA-F\d]/)&&stream.eat(";"):ok=stream.eatWhile(/[\d]/)&&stream.eat(";"):ok=stream.eatWhile(/[\w\.\-:]/)&&stream.eat(";"),ok?"atom":"error"}return stream.eatWhile(/[^&<]/),null}function inTag(stream,state){var ch=stream.next();return ch==">"||ch=="/"&&stream.eat(">")?(state.tokenize=inText,type=ch==">"?"endTag":"selfcloseTag","tag"):ch=="="?(type="equals",null):/[\'\"]/.test(ch)?(state.tokenize=inAttribute(ch),state.tokenize(stream,state)):(stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function inAttribute(quote){return function(stream,state){while(!stream.eol())if(stream.next()==quote){state.tokenize=inTag;break}return"string"}}function inBlock(style,terminator){return function(stream,state){while(!stream.eol()){if(stream.match(terminator)){state.tokenize=inText;break}stream.next()}return style}}function doctype(depth){return function(stream,state){var ch;while((ch=stream.next())!=null){if(ch=="<")return state.tokenize=doctype(depth+1),state.tokenize(stream,state);if(ch==">"){if(depth==1){state.tokenize=inText;break}return state.tokenize=doctype(depth-1),state.tokenize(stream,state)}}return"meta"}}function pass(){for(var i=arguments.length-1;i>=0;i--)curState.cc.push(arguments[i])}function cont(){return pass.apply(null,arguments),!0}function pushContext(tagName,startOfLine){var noIndent=Kludges.doNotIndent.hasOwnProperty(tagName)||curState.context&&curState.context.noIndent;curState.context={prev:curState.context,tagName:tagName,indent:curState.indented,startOfLine:startOfLine,noIndent:noIndent}}function popContext(){curState.context&&(curState.context=curState.context.prev)}function element(type){if(type=="openTag")return curState.tagName=tagName,cont(attributes,endtag(curState.startOfLine));if(type=="closeTag"){var err=!1;return curState.context?curState.context.tagName!=tagName&&(Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())&&popContext(),err=!curState.context||curState.context.tagName!=tagName):err=!0,err&&(setStyle="error"),cont(endclosetag(err))}return cont()}function endtag(startOfLine){return function(type){return type=="selfcloseTag"||type=="endTag"&&Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase())?(maybePopContext(curState.tagName.toLowerCase()),cont()):type=="endTag"?(maybePopContext(curState.tagName.toLowerCase()),pushContext(curState.tagName,startOfLine),cont()):cont()}}function endclosetag(err){return function(type){return err&&(setStyle="error"),type=="endTag"?(popContext(),cont()):(setStyle="error",cont(arguments.callee))}}function maybePopContext(nextTagName){var parentTagName;for(;;){if(!curState.context)return;parentTagName=curState.context.tagName.toLowerCase();if(!Kludges.contextGrabbers.hasOwnProperty(parentTagName)||!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName))return;popContext()}}function attributes(type){return type=="word"?(setStyle="attribute",cont(attribute,attributes)):type=="endTag"||type=="selfcloseTag"?pass():(setStyle="error",cont(attributes))}function attribute(type){return type=="equals"?cont(attvalue,attributes):(Kludges.allowMissing||(setStyle="error"),type=="endTag"||type=="selfcloseTag"?pass():cont())}function attvalue(type){return type=="string"?cont(attvaluemaybe):type=="word"&&Kludges.allowUnquoted?(setStyle="string",cont()):(setStyle="error",type=="endTag"||type=="selfCloseTag"?pass():cont())}function attvaluemaybe(type){return type=="string"?cont(attvaluemaybe):pass()}var indentUnit=config.indentUnit,Kludges=parserConfig.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!1}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},alignCDATA=parserConfig.alignCDATA,tagName,type,curState,setStyle;return{startState:function(){return{tokenize:inText,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(stream,state){stream.sol()&&(state.startOfLine=!0,state.indented=stream.indentation());if(stream.eatSpace())return null;setStyle=type=tagName=null;var style=state.tokenize(stream,state);state.type=type;if((style||type)&&style!="comment"){curState=state;for(;;){var comb=state.cc.pop()||element;if(comb(type||style))break}}return state.startOfLine=!1,setStyle||style},indent:function(state,textAfter,fullLine){var context=state.context;if(state.tokenize!=inTag&&state.tokenize!=inText||context&&context.noIndent)return fullLine?fullLine.match(/^(\s*)/)[0].length:0;if(alignCDATA&&/
',image:'',iframe:'",error:'

The requested content cannot be loaded.
Please try again later.

',closeBtn:'
',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250, -closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:{speedIn:0,speedOut:250,opacity:0.8,css:{cursor:"pointer"},closeClick:!0},title:{type:"float"}},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null, -current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,c){if(a)return c=f.isPlainObject(c)?c:{},b.close(!0),f.isArray(a)||(a=F(a)?f(a).get():[a]),f.each(a,function(e,d){var j={},h,g,i,k,l;"object"===f.type(d)&&(d.nodeType&&(d=f(d)),F(d)?(j={href:d.attr("href"),title:d.attr("title"),isDom:!0,element:d},f.metadata&&f.extend(!0,j,d.metadata())):j=d);h=c.href||j.href|| -(o(d)?d:null);g=c.title!==s?c.title:j.title||"";k=(i=c.content||j.content)?"html":c.type||j.type;!k&&j.isDom&&(k=d.data("fancybox-type"),k||(k=(k=d.prop("class").match(/fancybox\.(\w+)/))?k[1]:null));if(o(h)&&(k||(b.isImage(h)?k="image":b.isSWF(h)?k="swf":"#"===h.charAt(0)?k="inline":o(d)&&(k="html",i=d)),"ajax"===k))l=h.split(/\s+/,2),h=l.shift(),l=l.shift();i||("inline"===k?h?i=f(o(h)?h.replace(/.*(?=#[^\s]+$)/,""):h):j.isDom&&(i=d):"html"===k?i=h:!k&&(!h&&j.isDom)&&(k="inline",i=d));f.extend(j, -{href:h,type:k,content:i,title:g,selector:l});a[e]=j}),b.opts=f.extend(!0,{},b.defaults,c),c.keys!==s&&(b.opts.keys=c.keys?f.extend({},b.defaults.keys,c.keys):!1),b.group=a,b._start(b.opts.index||0)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),a.wrap&&a.wrap.stop().trigger("onReset").remove(),b.coming=null,b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null))},close:function(a){b.cancel();b.current&&!1!== -b.trigger("beforeClose")&&(b.unbindEvents(),!b.isOpen||!0===a?(f(".fancybox-wrap").stop().trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0).removeClass("fancybox-opened"),"fixed"===b.wrap.css("position")&&b.wrap.css(b._getPosition(!0)),b.transitions[b.current.closeMethod]()))},play:function(a){var c=function(){clearTimeout(b.player.timer)},e=function(){c();b.current&&b.player.isActive&&(b.player.timer= -setTimeout(b.next,b.current.playSpeed))},d=function(){c();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.indexd.index?"right":"left"),b.router=e||"jumpto",d.loop&&(0>a&&(a=d.group.length+a%d.group.length),a%=d.group.length),d.group[a]!==s))b.cancel(),b._start(a)},reposition:function(a,c){var e;b.isOpen&&(e=b._getPosition(c),a&&"scroll"===a.type?(delete e.position,b.wrap.stop(!0,!0).animate(e,200)):b.wrap.css(e))},update:function(a){var c= -!a||a&&"orientationchange"===a.type,e=a&&"scroll"===a.type;c&&(clearTimeout(v),v=null);b.isOpen&&!v&&(c&&q&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),v=setTimeout(function(){var d=b.current;v=null;if(d){b.wrap.removeClass("fancybox-tmp");if(d.autoResize&&!e||c){b._setDimension();b.trigger("onUpdate")}(d.autoCenter&&(!e||!d.canShrink)||c)&&b.reposition(a);b.trigger("onUpdate")}},c?20:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a: -!b.current.fitToView,b.update())},hideLoading:function(){n.unbind("keypress.fb");f("#fancybox-loading").remove()},showLoading:function(){var a,c;b.hideLoading();n.bind("keypress.fb",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});a=f('
').click(b.cancel).appendTo("body");b.coming&&!b.coming.fixed&&(c=b.getViewport(),a.css({position:"absolute",top:0.5*c.h+c.y,left:0.5*c.w+c.x}))},getViewport:function(){return{x:p.scrollLeft(),y:p.scrollTop(), -w:q&&z.innerWidth?z.innerWidth:p.width(),h:q&&z.innerHeight?z.innerHeight:p.height()}},unbindEvents:function(){b.wrap&&F(b.wrap)&&b.wrap.unbind(".fb");n.unbind(".fb");p.unbind(".fb")},bindEvents:function(){var a=b.current,c;a&&(p.bind("resize.fb orientationchange.fb"+(a.autoCenter&&!a.fixed?" scroll.fb":""),b.update),(c=a.keys)&&n.bind("keydown.fb",function(e){var d=e.which||e.keyCode,j=e.target||e.srcElement;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!j||!j.type&&!f(j).is("[contenteditable]")))&& -f.each(c,function(c,g){if(1g[0].clientWidth||g[0].clientHeight&&g[0].scrollHeight>g[0].clientHeight), -g=f(g).parent();if(0!==d&&!i)if(1h||0>j)b.next(0>h?"down":"right");c.preventDefault()}else"fixed"===b.wrap.css("position")&&c.preventDefault()}))},trigger:function(a,c){var e,d=c||b[-1").html(e).find(a.selector):F(e)&&(e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(".fancybox-inner").children().appendTo(a.parent).hide()}));break;case "image":e=a.tpl.image.replace("{href}",h);break;case "swf":e='',g="",f.each(a.swf,function(a,b){e=e+('');g=g+(" "+a+'="'+b+'"')}),e+='"}"iframe"===a.type&&a.iframe.preload||a.inner.append(e);b.trigger("beforeShow");b._setDimension();a.wrap.removeClass("fancybox-tmp");a.inner.css("overflow","yes"===j?"scroll":"no"===j?"hidden":j);a.pos=f.extend({},a.dim,b._getPosition(!0));b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(c.prevMethod)b.transitions[c.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop().trigger("onReset").remove(); -b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),c=0,e=!1,d=!1,e=b.wrap,j=b.skin,h=b.inner,g=b.current,d=g.width,i=g.height,k=g.minWidth,l=g.minHeight,t=g.maxWidth,u=g.maxHeight,q=g.scrolling,o=g.scrollOutside,x=g.margin,n=x[1]+x[3],p=x[0]+x[2],y,r,s,B,A,E,z,C,v;e.add(j).add(h).width("auto").height("auto");x=j.outerWidth(!0)-j.width();y=j.outerHeight(!0)-j.height();r=n+x;s=p+y;B=D(d)?(a.w-r)*parseFloat(d)/100:d;A=D(i)?(a.h-s)* -parseFloat(i)/100:i;if("iframe"===g.type){if(v=g.content,g.autoHeight&&1===v.data("ready"))try{v[0].contentWindow.document.location&&(h.width(B).height(9999),E=v.contents().find("body"),o&&E.css("overflow-x","hidden"),A=E.height())}catch(F){}}else if(g.autoWidth||g.autoHeight)h.addClass("fancybox-tmp"),g.autoWidth&&(B=h.width()),g.autoHeight&&(A=h.height()),h.removeClass("fancybox-tmp");d=m(B);i=m(A);C=B/A;k=m(D(k)?m(k,"w")-r:k);t=m(D(t)?m(t,"w")-r:t);l=m(D(l)?m(l,"h")-s:l);u=m(D(u)?m(u,"h")-s:u); -E=t;z=u;n=a.w-n;p=a.h-p;if(g.aspectRatio){if(d>t&&(d=t,i=d/C),i>u&&(i=u,d=i*C),dn||r>p)&&(d>k&&i>l)&&!(19t&&(d=t,i=d/C),h.width(m(d)).height(m(i)),e.width(m(d+x)),a=e.width(),r=e.height();else d=Math.max(k, -Math.min(d,d-(a-n))),i=Math.max(l,Math.min(i,i-(r-p)));o&&("auto"===q&&in||r>p)&&d>k&&i>l;d=g.aspectRatio?dl&&i').css(a.css).appendTo("body").bind("mousewheel",function(a){(!b.wrap||"fixed"===b.wrap.css("position")||b.wrap.is(":animated"))&&a.preventDefault()}),a.closeClick&&c.bind("click.fb",b.close),b.defaults.fixed&&!q?c.addClass("overlay-fixed"):(this.update(),this.onUpdate=function(){this.update()}), -c.fadeTo(a.speedIn,a.opacity))},afterClose:function(a){this.overlay&&this.overlay.fadeOut(a.speedOut||0,function(){f(this).remove()});this.overlay=null}};b.helpers.title={beforeShow:function(a){var c=b.current.title,e=a.type;if(o(c)&&""!==f.trim(c)){c=f('
'+c+"
");switch(e){case "inside":e=b.skin;break;case "outside":e=b.wrap;break;case "over":e=b.inner;break;default:e=b.skin,c.appendTo("body").width(c.width()).wrapInner(''), -b.current.margin[2]+=Math.abs(parseInt(c.css("margin-bottom"),10))}"top"===a.position?c.prependTo(e):c.appendTo(e)}}};f.fn.fancybox=function(a){var c,e=f(this),d=this.selector||"",j=function(h){var g=this,i=c,j,l;!h.ctrlKey&&(!h.altKey&&!h.shiftKey&&!h.metaKey)&&!f(g).is(".fancybox-wrap")&&(j=a.groupAttr||"data-fancybox-group",l=f(g).attr(j),l||(j="rel",l=g[j]),l&&(""!==l&&"nofollow"!==l)&&(g=d.length?f(d):e,g=g.filter("["+j+'="'+l+'"]'),i=g.index(this)),a.index=i,!1!==b.open(g,a)&&h.preventDefault())}, -a=a||{};c=a.index||0;!d||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",j):n.undelegate(d,"click.fb-start").delegate(d+":not('.fancybox-item, .fancybox-nav')","click.fb-start",j);return this};f.scrollbarWidth||(f.scrollbarWidth=function(){var a,b;a=f('
').appendTo("body");b=a.children();b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});n.ready(function(){f.extend(b.defaults,{scrollOutside:f.scrollbarWidth(), -fixed:f.support.fixedPosition||!(f.browser.msie&&f.browser.version<=6||q),parent:f("body")})})})(window,document,jQuery); \ No newline at end of file