WordPress.org

Plugin Directory

Changeset 607623


Ignore:
Timestamp:
10/03/12 19:31:58 (19 months ago)
Author:
TobiasBg
Message:

Update to a new beta version 0.6-beta. Use at your own risk!

Location:
tablepress/trunk
Files:
3 deleted
37 edited

Legend:

Unmodified
Added
Removed
  • tablepress/trunk/admin/codemirror.css

    r598765 r607623  
    146146.cm-s-default span.cm-qualifier {color: #555;} 
    147147.cm-s-default span.cm-builtin {color: #30a;} 
    148 .cm-s-default span.cm-bracket {color: #cc7;} 
     148.cm-s-default span.cm-bracket {color: #997;} 
    149149.cm-s-default span.cm-tag {color: #170;} 
    150150.cm-s-default span.cm-attribute {color: #00c;} 
     
    197197    height: 100px; 
    198198    margin: 1px; 
     199    resize: vertical; /* currently not always working if scrolling is necessary */ 
    199200} 
    200201#tablepress-page .CodeMirror-lines { 
  • tablepress/trunk/admin/codemirror.min.css

    r598765 r607623  
    1 .CodeMirror{line-height:1em;font-family:monospace;position:relative;overflow:hidden}.CodeMirror-scroll{overflow:auto;height:300px;position:relative;outline:0}.CodeMirror-scrollbar{position:absolute;right:0;top:0;overflow-x:hidden;overflow-y:scroll;z-index:5}.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 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:none!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-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:black}.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:black}.cm-s-default span.cm-operator{color:black}.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:#f00}.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:bold}span.cm-em{font-style:italic}span.cm-emstrong{font-style:italic;font-weight:bold}span.cm-link{text-decoration:underline}span.cm-invalidchar{color:#f00}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}@media print{.CodeMirror pre.CodeMirror-cursor{visibility:hidden}}#option-custom-css,#tablepress-page .CodeMirror{font-family:Consolas,Monaco,monospace;font-size:12px;line-height:inherit;margin-bottom:6px}#option-custom-css{width:98%;height:102px;margin:1px}#tablepress-page .CodeMirror-scroll{background-color:#fff;border-color:#dfdfdf;-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;cursor:text;width:98%;height:100px;margin:1px}#tablepress-page .CodeMirror-lines{padding:3px}#tablepress-page .CodeMirror-scroll.disabled{background-color:#eee;height:100px!important}#option-custom-css:focus,#tablepress-page .CodeMirror-focused{border-color:#a1a1a1;-webkit-box-shadow:1px 1px 2px rgba(0,0,0,0.1);box-shadow:1px 1px 2px rgba(0,0,0,0.1)}#tablepress-page .large .CodeMirror-scroll{height:300px} 
     1.CodeMirror{line-height:1em;font-family:monospace;position:relative;overflow:hidden}.CodeMirror-scroll{overflow:auto;height:300px;position:relative;outline:0}.CodeMirror-scrollbar{position:absolute;right:0;top:0;overflow-x:hidden;overflow-y:scroll;z-index:5}.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 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:none!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-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:black}.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:black}.cm-s-default span.cm-operator{color:black}.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:#f00}.cm-s-default span.cm-qualifier{color:#555}.cm-s-default span.cm-builtin{color:#30a}.cm-s-default span.cm-bracket{color:#997}.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:bold}span.cm-em{font-style:italic}span.cm-emstrong{font-style:italic;font-weight:bold}span.cm-link{text-decoration:underline}span.cm-invalidchar{color:#f00}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}@media print{.CodeMirror pre.CodeMirror-cursor{visibility:hidden}}#option-custom-css,#tablepress-page .CodeMirror{font-family:Consolas,Monaco,monospace;font-size:12px;line-height:inherit;margin-bottom:6px}#option-custom-css{width:98%;height:102px;margin:1px}#tablepress-page .CodeMirror-scroll{background-color:#fff;border-color:#dfdfdf;-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;cursor:text;width:98%;height:100px;margin:1px;resize:vertical}#tablepress-page .CodeMirror-lines{padding:3px}#tablepress-page .CodeMirror-scroll.disabled{background-color:#eee;height:100px!important}#option-custom-css:focus,#tablepress-page .CodeMirror-focused{border-color:#a1a1a1;-webkit-box-shadow:1px 1px 2px rgba(0,0,0,0.1);box-shadow:1px 1px 2px rgba(0,0,0,0.1)}#tablepress-page .large .CodeMirror-scroll{height:300px} 
  • tablepress/trunk/admin/codemirror.min.js

    r589540 r607623  
    1 window.CodeMirror=function(){function k(a,b){function c(e){(!j.onDragEvent||!j.onDragEvent(z,Sa(e)))&&db(e)}function d(e){return 0<=e&&e<o.size}function f(e){for(var a=o;!a.lines;)for(var n=0;;++n){var b=a.children[n],c=b.chunkSize();if(e<c){a=b;break}e-=c}return a.lines[e]}function h(e,a){ha=!0;for(var n=a-e.height,b=e;b;b=b.parent)b.height+=n}function g(e){var a={line:0,ch:0};L(a,{line:o.size-1,ch:f(o.size-1).text.length},Ta(e),a,a);pa=!0}function p(e){if(!j.onDragEvent||!j.onDragEvent(z,Sa(e))){D(e); 
    2 var a=Ua(e,!0),n=e.dataTransfer.files;if(a&&!j.readOnly)if(n&&n.length&&window.FileReader&&window.File)for(var b=n.length,c=Array(b),Va=0,e=function(e,n){var f=new FileReader;f.onload=function(){c[n]=f.result;++Va==b&&(a=v(a),l(function(){var e=I(c.join(""),a,a);ca(a,e)})())};f.readAsText(e)},f=0;f<b;++f)e(n[f],f);else if(!eb||A(a,i.from)||A(i.to,a))try{(c=e.dataTransfer.getData("Text"))&&lc(function(){var e=i.from,n=i.to;ca(a,a);eb&&I("",e,n);aa(c);V()})}catch(d){}}}function Mc(e){var a=fb();e.dataTransfer.setData("Text", 
    3 a);if(Ea||mc||qa)a=s("img"),a.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",e.dataTransfer.setDragImage(a,0,0)}function Fa(e,a){if("string"==typeof e&&(e=nc[e],!e))return!1;var n=da;try{j.readOnly&&(gb=!0),a&&(da=null),e(z)}catch(b){if(b!=Kb)throw b;return!1}finally{da=n,gb=!1}return!0}function B(e){function a(){d=!0}var n=Lb(j.keyMap),b=n.auto;clearTimeout(oc);var c;if(c=b)c=xa[F(e,"keyCode")],c=!("Ctrl"==c||"Alt"==c||"Shift"==c||"Mod"==c);c&&(oc=setTimeout(function(){Lb(j.keyMap)== 
    4 n&&(j.keyMap=b.call?b.call(null,z):b)},50));c=xa[F(e,"keyCode")];var f=!1;if(null==c||e.altGraphKey)return!1;F(e,"altKey")&&(c="Alt-"+c);F(e,"ctrlKey")&&(c="Ctrl-"+c);F(e,"metaKey")&&(c="Cmd-"+c);var d=!1,f=F(e,"shiftKey")?hb("Shift-"+c,j.extraKeys,j.keyMap,function(e){return Fa(e,!0)},a)||hb(c,j.extraKeys,j.keyMap,function(e){if("string"==typeof e&&/^go[A-Z]/.test(e))return Fa(e)},a):hb(c,j.extraKeys,j.keyMap,Fa,a);d&&(f=!1);f&&(D(e),ib(),ya&&(e.oldKeyCode=e.keyCode,e.keyCode=0));return f}function pc(e){R|| 
    5 Ga();ya&&27==e.keyCode&&(e.returnValue=!1);Ha&&ea()&&(Ha=!1);if(!j.onKeyEvent||!j.onKeyEvent(z,Sa(e))){var a=F(e,"keyCode");Da(16==a||F(e,"shiftKey"));var n=B(e);qa&&(Mb=n?a:null,!n&&(88==a&&F(e,Nb?"metaKey":"ctrlKey"))&&aa(""))}}function Ga(){if("nocursor"!=j.readOnly){if(!R){if(j.onFocus)j.onFocus(z);R=!0;-1==m.className.search(/\bCodeMirror-focused\b/)&&(m.className+=" CodeMirror-focused");Wa||jb(!0)}kb();ib()}}function Ob(){if(R){if(j.onBlur)j.onBlur(z);R=!1;ra&&l(function(){ra&&(ra(),ra=null)})(); 
    6 m.className=m.className.replace(" CodeMirror-focused","")}clearInterval(Pb);setTimeout(function(){R||(da=null)},150)}function L(e,a,n,b,c){if(!gb){if(G){var f=[];o.iter(e.line,a.line+1,function(e){f.push(e.text)});for(G.addChange(e.line,n.length,f);G.done.length>j.undoDepth;)G.done.shift()}J(e,a,n,b,c)}}function qc(e,a){if(e.length){for(var n=e.pop(),b=[],c=n.length-1;0<=c;c-=1){var d=n[c],O=[],j=d.start+d.added;o.iter(d.start,j,function(e){O.push(e.text)});b.push({start:d.start,added:d.old.length, 
    7 old:O});var i=d.start+d.old.length-1,h;h=O[O.length-1];var g=d.old[d.old.length-1];if(g)if(h){for(var m=h.length,l=g.length;0<=m&&0<=l&&h.charAt(m)==g.charAt(l);--m,--l);h=l+1}else h=g.length;else h=0;i={line:i,ch:h};J({line:d.start,ch:0},{line:j-1,ch:f(j-1).text.length},d.old,i,i)}pa=!0;a.push(b)}}function J(e,a,n,b,c){if(!gb){var d=!1,O=ia.text.length;j.lineWrapping||o.iter(e.line,a.line+1,function(e){if(!e.hidden&&e.text.length==O)return d=!0});if(e.line!=a.line||1<n.length)ha=!0;var W=a.line- 
    8 e.line,g=f(e.line),x=f(a.line);if(0==e.ch&&0==a.ch&&""==n[n.length-1]){var y=[],g=null;e.line?(g=f(e.line-1),g.fixMarkEnds(x)):x.fixMarkStarts();for(var l=0,S=n.length-1;l<S;++l)y.push(ba.inheritMarks(n[l],g));W&&o.remove(e.line,W,Xa);y.length&&o.insert(e.line,y)}else if(g==x)if(1==n.length)g.replace(e.ch,a.ch,n[0]);else{x=g.split(a.ch,n[n.length-1]);g.replace(e.ch,null,n[0]);g.fixMarkEnds(x);y=[];l=1;for(S=n.length-1;l<S;++l)y.push(ba.inheritMarks(n[l],g));y.push(x);o.insert(e.line+1,y)}else if(1== 
    9 n.length)g.replace(e.ch,null,n[0]),x.replace(null,a.ch,""),g.append(x),o.remove(e.line+1,W,Xa);else{y=[];g.replace(e.ch,null,n[0]);x.replace(null,a.ch,n[n.length-1]);g.fixMarkEnds(x);l=1;for(S=n.length-1;l<S;++l)y.push(ba.inheritMarks(n[l],g));1<W&&o.remove(e.line+1,W-1,Xa);o.insert(e.line+1,y)}if(j.lineWrapping){var p=Math.max(5,m.clientWidth/lb()-3);o.iter(e.line,e.line+n.length,function(e){if(!e.hidden){var a=Math.ceil(e.text.length/p)||1;a!=e.height&&h(e,a)}})}else o.iter(e.line,e.line+n.length, 
    10 function(e){var a=e.text;!e.hidden&&a.length>O&&(ia=e,O=a.length,mb=!0,d=!1)}),d&&(Ya=!0);x=[];W=n.length-W-1;l=0;for(y=ja.length;l<y;++l)S=ja[l],S<e.line?x.push(S):S>a.line&&x.push(S+W);var l=e.line+Math.min(n.length,500),y=e.line,s=nb(y);o.iter(y,l,function(e){e.highlight(E,s,j.tabSize);e.stateAfter=Ia(E,s)});x.push(l);ja=x;Qb(100);fa.push({from:e.line,to:a.line+1,diff:W});e={from:e,to:a,text:n};if(Ja){for(n=Ja;n.next;n=n.next);n.next=e}else Ja=e;Za(v(b),v(c),i.from.line<=Math.min(a.line,a.line+ 
    11 W)?i.from.line:i.from.line+W,i.to.line<=Math.min(a.line,a.line+W)?i.to.line:i.to.line+W)}}function U(){var e=o.height*ka()+2*w.offsetTop;return 0.99*e>m.offsetHeight?e:!1}function T(e){var a=U();r.style.display=a?"block":"none";a?(rc.style.height=la.style.minHeight=a+"px",r.style.height=m.clientHeight+"px",null!=e&&(r.scrollTop=m.scrollTop=e,ob&&setTimeout(function(){r.scrollTop==e&&(r.scrollTop=e+(e?-1:1),r.scrollTop=e)},0))):la.style.minHeight="";pb.style.top=Ka*ka()+"px"}function X(){ia=f(0);mb= 
    12 !0;var e=ia.text.length;o.iter(1,o.size,function(a){var n=a.text;!a.hidden&&n.length>e&&(e=n.length,ia=a)});Ya=!1}function I(e,a,n){function b(f){if(A(f,a))return f;if(!A(n,f))return c;var d=f.line+e.length-(n.line-a.line)-1,Jb=f.ch;f.line==n.line&&(Jb+=e[e.length-1].length-(n.ch-(n.line==a.line?a.ch:0)));return{line:d,ch:Jb}}var a=v(a),n=n?v(n):a,e=Ta(e),c;Y(e,a,n,function(e){c=e;return{from:b(i.from),to:b(i.to)}});return c}function aa(e,a){Y(Ta(e),i.from,i.to,function(e){return"end"==a?{from:e, 
    13 to:e}:"start"==a?{from:i.from,to:i.from}:{from:i.from,to:e}})}function Y(e,a,n,b){b=b({line:a.line+e.length-1,ch:1==e.length?e[0].length+a.ch:e[e.length-1].length});L(a,n,e,b.from,b.to)}function ga(e,a,b){var c=e.line,d=a.line;if(c==d)return f(c).text.slice(e.ch,a.ch);var Va=[f(c).text.slice(e.ch)];o.iter(c+1,d,function(e){Va.push(e.text)});Va.push(f(d).text.slice(0,a.ch));return Va.join(b||"\n")}function fb(e){return ga(i.from,i.to,e)}function kb(){Ha||Rb.set(j.pollInterval,function(){Sb();ea(); 
    14 R&&kb();Tb()})}function $a(){function e(){Sb();!ea()&&!a?(a=!0,Rb.set(60,e)):(Ha=!1,kb());Tb()}var a=!1;Ha=!0;Rb.set(20,e)}function ea(){if(Wa||!R||Nc(t)||j.readOnly)return!1;var e=t.value;if(e==ma)return!1;da=null;for(var a=0,b=Math.min(ma.length,e.length);a<b&&ma[a]==e[a];)++a;a<ma.length?i.from={line:i.from.line,ch:i.from.ch-(ma.length-a)}:qb&&u(i.from,i.to)&&(i.to={line:i.to.line,ch:Math.min(f(i.to.line).text.length,i.to.ch+(e.length-a))});aa(e.slice(a),"end");1E3<e.length?t.value=ma="":ma=e; 
    15 return!0}function jb(e){u(i.from,i.to)?e&&(ma=t.value=""):(ma="",t.value=fb(),R&&sc(t))}function V(){"nocursor"!=j.readOnly&&t.focus()}function tc(){var e=na(i.inverted?i.from:i.to);return{x:j.lineWrapping?Math.min(e.x,w.offsetWidth):e.x,y:e.y,yBot:e.yBot}}function uc(e,a,b,c){e=vc(e,a,b,c);null!=e.scrollLeft&&(m.scrollLeft=e.scrollLeft);null!=e.scrollTop&&(r.scrollTop=m.scrollTop=e.scrollTop)}function vc(e,a,b,c){var f=w.offsetLeft,d=w.offsetTop,a=a+d,c=c+d,e=e+f,b=b+f,O=m.clientHeight,i=r.scrollTop, 
    16 h={},g=U()||Infinity,l=a<d+10,d=c+d>g-10;a<i?h.scrollTop=l?0:Math.max(0,a):c>i+O&&(h.scrollTop=(d?g:c)-O);a=m.clientWidth;c=m.scrollLeft;O=j.fixedGutter?P.clientWidth:0;f=e<O+f+10;e<c+O||f?(f&&(e=0),h.scrollLeft=Math.max(0,e-10-O)):b>a+c-3&&(h.scrollLeft=b+10-a);return h}function wa(e){var a=ka(),b=(null!=e?e:r.scrollTop)-w.offsetTop,e=Math.max(0,Math.floor(b/a)),a=Math.ceil((b+m.clientHeight)/a);return{from:Ub(o,e),to:Ub(o,a)}}function sa(e,a,b){function c(){var e=Z.firstChild,a=!1;o.iter(C,Q,function(b){if(e){if(!b.hidden){var n= 
    17 Math.round(e.offsetHeight/q)||1;b.height!=n&&(h(b,n),ha=a=!0)}e=e.nextSibling}});return a}if(m.clientWidth){var f=wa(b);if(!0!==e&&0==e.length&&f.from>C&&f.to<Q)T(b);else{var d=Math.max(f.from-100,0),i=Math.min(o.size,f.to+100);C<d&&20>d-C&&(d=C);Q>i&&20>Q-i&&(i=Math.min(o.size,Q));if(!0===e)e=[];else{for(var f=[{from:C,to:Q,domStart:0}],g=0,l=e.length||0;g<l;++g){for(var x=e[g],y=[],p=x.diff||0,S=0,k=f.length;S<k;++S){var t=f[S];x.to<=t.from&&x.diff?y.push({from:t.from+p,to:t.to+p,domStart:t.domStart}): 
    18 x.to<=t.from||x.from>=t.to?y.push(t):(x.from>t.from&&y.push({from:t.from,to:x.from,domStart:t.domStart}),x.to<t.to&&y.push({from:x.to+p,to:t.to+p,domStart:t.domStart+(x.to-t.from)}))}f=y}e=f}for(var M=e,f=e=0;f<M.length;++f)g=M[f],g.from<d&&(g.domStart+=d-g.from,g.from=d),g.to>i&&(g.to=i),g.from>=g.to?M.splice(f--,1):e+=g.to-g.from;if(e==i-d&&d==C&&i==Q)T(b);else{M.sort(function(e,a){return e.domStart-a.domStart});var q=ka(),e=P.style.display;Z.style.display="none";f=d;g=i;l=function(e){var a=e.nextSibling; 
    19 e.parentNode.removeChild(e);return a};if(M.length){for(var x=0,r=Z.firstChild,y=0;y<M.length;++y){for(p=M[y];p.domStart>x;)r=l(r),x++;for(var v=0,p=p.to-p.from;v<p;++v)r=r.nextSibling,x++}for(;r;)r=l(r)}else za(Z);var w=M.shift(),r=Z.firstChild,v=f;o.iter(f,g,function(e){w&&w.to==v&&(w=M.shift());if(!w||w.from>v){if(e.hidden)var a=s("pre");else if(a=e.getElement(wc),e.className&&(a.className=e.className),e.bgClassName)e=s("pre","\u00a0",e.bgClassName,"position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2"), 
    20 a=s("div",[e,a],null,"position: relative");Z.insertBefore(a,r)}else r=r.nextSibling;++v});Z.style.display=P.style.display="";(f=d!=C||i!=Q||xc!=m.clientHeight+q)&&(xc=m.clientHeight+q);(d!=C||i!=Q&&j.onViewportChange)&&setTimeout(function(){if(j.onViewportChange)j.onViewportChange(z,d,i)});C=d;Q=i;Ka=Vb(o,d);if(Z.childNodes.length!=Q-C)throw Error("BAD PATCH! "+JSON.stringify(M)+" size="+(Q-C)+" nodes="+Z.childNodes.length);j.lineWrapping&&c();P.style.display=e;(f||ha)&&va()&&j.lineWrapping&&c()&& 
    21 va();T(b);Ba();if(!a&&j.onUpdate)j.onUpdate(z);return!0}}}else C=Q=Ka=0}function va(){if(j.gutter||j.lineNumbers){var e=pb.offsetHeight,a=m.clientHeight;P.style.height=(2>e-a?a:e)+"px";var b=document.createDocumentFragment(),c=C,f;o.iter(C,Math.max(Q,C+1),function(e){if(e.hidden)b.appendChild(s("pre"));else{var a=e.gutterMarker,H=j.lineNumbers?j.lineNumberFormatter(c+j.firstLineNumber):null;a&&a.text?H=a.text.replace("%N%",null!=H?H:""):null==H&&(H="\u00a0");var d=b.appendChild(s("pre",null,a&&a.style)); 
    22 d.innerHTML=H;for(H=1;H<e.height;++H)d.appendChild(s("br")),d.appendChild(document.createTextNode("\u00a0"));a||(f=c)}++c});P.style.display="none";za(La).appendChild(b);if(null!=f&&j.lineNumbers){for(var e=La.childNodes[f-C],a=String(o.size).length,d=e.firstChild.textContent||e.firstChild.innerText||e.firstChild.nodeValue||"",i="";d.length+i.length<a;)i+="\u00a0";i&&e.insertBefore(document.createTextNode(i),e.firstChild)}P.style.display="";e=2<Math.abs((parseInt(w.style.marginLeft)||0)-P.offsetWidth); 
    23 w.style.marginLeft=P.offsetWidth+"px";ha=!1;return e}}function Ba(){var e=u(i.from,i.to),a=na(i.from,!0),b=e?a:na(i.to,!0),c=i.inverted?a:b,f=ka(),d=Ma(N),g=Ma(Z);Aa.style.top=Math.max(0,Math.min(m.offsetHeight,c.y+g.top-d.top))+"px";Aa.style.left=Math.max(0,Math.min(m.offsetWidth,c.x+g.left-d.left))+"px";if(e)K.style.top=c.y+"px",K.style.left=(j.lineWrapping?Math.min(c.x,w.offsetWidth):c.x)+"px",K.style.display="",rb.style.display="none";else{var e=a.y==b.y,h=document.createDocumentFragment(),l= 
    24 w.clientWidth||w.offsetWidth,c=w.clientHeight||w.offsetHeight,d=function(e,a,b,n){h.appendChild(s("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+a+"px; "+(Oc?"width: "+(!b?l:l-b-e)+"px":"right: "+b+"px")+"; height: "+n+"px"))};i.from.ch&&0<=a.y&&d(a.x,a.y,e?l-b.x:0,f);a=Math.max(0,a.y+(i.from.ch?f:0));g=Math.min(b.y,c)-a;g>0.2*f&&d(0,a,0,g);(!e||!i.from.ch)&&b.y<c-0.5*f&&d(0,b.y,l-b.x,f);za(rb).appendChild(h);K.style.display="none";rb.style.display=""}}function Da(e){da= 
    25 e?da||(i.inverted?i.to:i.from):null}function ca(e,a){var b=da&&v(da);b&&(A(b,e)?e=b:A(a,b)&&(a=b));Za(e,a);sb=!0}function Za(e,a,b,c){tb=null;null==b&&(b=i.from.line,c=i.to.line);if(!u(i.from,e)||!u(i.to,a)){if(A(a,e))var d=a,a=e,e=d;e.line!=b&&((b=ub(e,b,i.from.ch))?e=b:Wb(e.line,!1));a.line!=c&&(a=ub(a,c,i.to.ch));u(e,a)?i.inverted=!1:u(e,i.to)?i.inverted=!1:u(a,i.from)&&(i.inverted=!0);if(j.autoClearEmptyLines&&u(i.from,i.to)&&(i.inverted?e:a).line!=i.from.line&&i.from.line<o.size){var g=f(i.from.line); 
    26 /^\s+$/.test(g.text)&&setTimeout(l(function(){if(g.parent&&/^\s+$/.test(g.text)){var e=Na(g);I("",{line:e,ch:0},{line:e,ch:g.text.length})}},10))}i.from=e;i.to=a;ta=!0}}function ub(e,a,b){function c(a){for(var H=e.line+a,d=1==a?o.size:-1;H!=d;){var i=f(H);if(!i.hidden){a=e.ch;if(g||a>b||a>i.text.length)a=i.text.length;return{line:H,ch:a}}H+=a}}var d=f(e.line),g=e.ch==d.text.length&&e.ch!=b;return!d.hidden?e:e.line>=a?c(1)||c(-1):c(-1)||c(1)}function ua(a,b,c){a=v({line:a,ch:b||0});(c?ca:Za)(a,a)} 
    27 function vb(a){return Math.max(0,Math.min(a,o.size-1))}function v(a){if(0>a.line)return{line:0,ch:0};if(a.line>=o.size)return{line:o.size-1,ch:f(o.size-1).text.length};var b=a.ch,c=f(a.line).text.length;return null==b||b>c?{line:a.line,ch:c}:0>b?{line:a.line,ch:0}:a}function Ca(a,b){function c(b){if(h==(0>a?0:j.text.length)){if(b=!b)a:{for(var b=g+a,n=0>a?-1:o.size;b!=n;b+=a){var d=f(b);if(!d.hidden){g=b;j=d;b=!0;break a}}b=void 0}if(b)h=0>a?j.text.length:0;else return!1}else h+=a;return!0}var d= 
    28 i.inverted?i.from:i.to,g=d.line,h=d.ch,j=f(g);if("char"==b)c();else if("column"==b)c(!0);else if("word"==b)for(d=!1;!(0>a)||c();){if(wb(j.text.charAt(h)))d=!0;else if(d){0>a&&(a=1,c());break}if(0<a&&!c())break}return{line:g,ch:h}}function Qa(a){var b=f(a.line).text,c=a.ch,d=a.ch;if(b){!1===a.after||d==b.length?--c:++d;for(var g=b.charAt(c),g=wb(g)?wb:/\s/.test(g)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!wb(a)};0<c&&g(b.charAt(c-1));)--c;for(;d<b.length&&g(b.charAt(d));)++d}return{from:{line:a.line, 
    29 ch:c},to:{line:a.line,ch:d}}}function xb(a,b){b||(b="add");if("smart"==b)if(E.indent)var c=nb(a);else b="prev";var d=f(a),g=d.indentation(j.tabSize),i=d.text.match(/^\s*/)[0],h;"smart"==b&&(h=E.indent(c,d.text.slice(i.length),d.text),h==Kb&&(b="prev"));"prev"==b?h=a?f(a-1).indentation(j.tabSize):0:"add"==b?h=g+j.indentUnit:"subtract"==b&&(h=g-j.indentUnit);h=Math.max(0,h);c="";d=0;if(j.indentWithTabs)for(g=Math.floor(h/j.tabSize);g;--g)d+=j.tabSize,c+="\t";for(;d<h;)++d,c+=" ";c!=i&&I(c,{line:a,ch:0}, 
    30 {line:a,ch:i.length})}function Ra(){E=k.getMode(j,j.mode);o.iter(0,o.size,function(a){a.stateAfter=null});ja=[0];Qb()}function Ib(){if(j.lineWrapping){N.className+=" CodeMirror-wrap";var a=m.clientWidth/lb()-3;o.iter(0,o.size,function(b){if(!b.hidden){var c=Math.ceil(b.text.length/a)||1;1!=c&&h(b,c)}});w.style.minWidth=yb.style.left=""}else N.className=N.className.replace(" CodeMirror-wrap",""),X(),o.iter(0,o.size,function(a){1!=a.height&&!a.hidden&&h(a,1)});fa.push({from:0,to:o.size})}function wc(a){var a= 
    31 j.tabSize-a%j.tabSize,b=yc[a];if(b)return b;for(var b="",c=0;c<a;++c)b+=" ";b=s("span",b,"cm-tab");return yc[a]={element:b,width:a}}function zc(){m.className=m.className.replace(/\s*cm-s-\S+/g,"")+j.theme.replace(/(^|\s)\s*/g," cm-s-")}function Ac(){var a=$[j.keyMap].style;N.className=N.className.replace(/\s*cm-keymap-\S+/g,"")+(a?" cm-keymap-"+a:"")}function Xb(){this.set=[]}function Yb(a,b,c){function d(a,e,b,c){f(a).addMark(new zb(e,b,c,g))}var a=v(a),b=v(b),g=new Xb;if(!A(a,b))return g;if(a.line== 
    32 b.line)d(a.line,a.ch,b.ch,c);else{d(a.line,a.ch,null,c);for(var i=a.line+1,h=b.line;i<h;++i)d(i,null,null,c);d(b.line,null,b.ch,c)}fa.push({from:a.line,to:b.line+1});return g}function Bc(a,b){var c=a,d=a;"number"==typeof a?d=f(vb(a)):c=Na(a);if(null!=c&&b(d,c))fa.push({from:c,to:c+1});else return null;return d}function Wb(a,b){return Bc(a,function(a,e){if(a.hidden!=b){a.hidden=b;j.lineWrapping||(b&&a.text.length==ia.text.length?Ya=!0:!b&&a.text.length>ia.text.length&&(ia=a,Ya=!1));h(a,b?0:1);var c= 
    33 i.from.line,d=i.to.line;if(b&&(c==e||d==e)){c=c==e?ub({line:c,ch:0},c,0):i.from;d=d==e?ub({line:d,ch:0},d,0):i.to;if(!d)return;Za(c,d)}return ha=!0}})}function Zb(a,b){if(0==b)return{top:0,left:0};var c=j.lineWrapping&&b<a.text.length&&Ab.test(a.text.slice(b-1,b+1)),c=a.getElement(wc,b,c);za(Oa).appendChild(c);var c=c.anchor,d=c.offsetTop,f=c.offsetLeft;ya&&(0==d&&0==f)&&(d=s("span","x"),c.parentNode.insertBefore(d,c.nextSibling),d=d.offsetTop);return{top:d,left:f}}function na(a,b){var c,d=ka(),g= 
    34 d*(Vb(o,a.line)-(b?Ka:0));if(0==a.ch)c=0;else{var i=Zb(f(a.line),a.ch);c=i.left;j.lineWrapping&&(g+=Math.max(0,i.top))}return{x:c,y:g,yBot:g+d}}function Bb(a,b){function c(a){a=Zb(l,a);if(t){var e=Math.round(a.top/d);s=e!=y;return Math.max(0,a.left+(e-y)*m.clientWidth)}return a.left}var d=ka(),g=lb(),i=Ka+Math.floor(b/d);if(0>i)return{line:0,ch:0};var h=Ub(o,i);if(h>=o.size)return{line:o.size-1,ch:f(o.size-1).text.length};var l=f(h),p=l.text,t=j.lineWrapping,y=t?i-Vb(o,h):0;if(0>=a&&0==y)return{line:h, 
    35 ch:0};for(var s=!1,r=i=0,p=p.length,k,g=Math.min(p,Math.ceil((a+0.9*y*m.clientWidth)/g));;){var q=c(g);if(q<=a&&g<p)g=Math.min(p,Math.ceil(1.2*g));else{k=q;p=g;break}}if(a>k)return{line:h,ch:p};g=Math.floor(0.8*p);q=c(g);q<a&&(i=g,r=q);for(;;){if(1>=p-i)return k=a-r<k-a,{line:h,ch:k?i:p,after:k};g=Math.ceil((i+p)/2);q=c(g);q>a?(p=g,k=q,s&&(k+=1E3)):(i=g,r=q)}}function ka(){if(null==Pa){Pa=s("pre");for(var a=0;49>a;++a)Pa.appendChild(document.createTextNode("x")),Pa.appendChild(s("br"));Pa.appendChild(document.createTextNode("x"))}a= 
    36 Z.clientHeight;if(a==Cc)return $b;Cc=a;a=Pa.cloneNode(!0);za(Oa).appendChild(a);$b=Oa.firstChild.offsetHeight/50||1;za(Oa);return $b}function lb(){if(m.clientWidth==Dc)return Ec;Dc=m.clientWidth;var a=s("span","x"),b=s("pre",[a]);za(Oa).appendChild(b);return Ec=a.offsetWidth||10}function Ua(a,b){var c=Ma(m,!0),d,f;try{d=a.clientX,f=a.clientY}catch(g){return null}if(!b&&(d-c.left>m.clientWidth||f-c.top>m.clientHeight))return null;c=Ma(w,!0);return Bb(d-c.left,f-c.top)}function Fc(a){function b(){var a= 
    37 Ta(t.value).join("\n");a!=g&&!j.readOnly&&l(aa)(a,"end");Aa.style.position="relative";t.style.cssText=f;ac&&(r.scrollTop=d);Wa=!1;jb(!0);kb()}var c=Ua(a),d=r.scrollTop;if(c&&!qa){(u(i.from,i.to)||A(c,i.from)||!A(c,i.to))&&l(ua)(c.line,c.ch);var f=t.style.cssText;Aa.style.position="absolute";t.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: white; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; 
    38 Wa=!0;var g=t.value=fb();V();sc(t);if(Ea){db(a);var h=q(window,"mouseup",function(){h();setTimeout(b,20)},!0)}else setTimeout(b,50)}}function ib(){clearInterval(Pb);var a=!0;K.style.visibility="";Pb=setInterval(function(){K.style.visibility=(a=!a)?"":"hidden"},j.cursorBlinkRate)}function Gc(a){var b=i.inverted?i.from:i.to,c=f(b.line),d=b.ch-1,g=0<=d&&bc[c.text.charAt(d)]||bc[c.text.charAt(++d)];if(g){g.charAt(0);for(var h=(g=">"==g.charAt(1))?1:-1,j=c.styles,p=d+1,m=0,t=j.length;m<t;m+=2)if(0>=(p-= 
    39 j[m].length)){var k=j[m+1];break}j=[c.text.charAt(d)];p=/[(){}[\]]/;m=b.line;for(t=g?Math.min(m+100,o.size):Math.max(-1,m-100);m!=t;m+=h){var c=f(m),s=m==b.line,r;a:{r=s&&g?d+1:0;s=s&&!g?d:c.text.length;if(c.text)for(var q=c.styles,c=g?0:c.text.length-1,v=void 0,M=g?0:q.length-2,w=g?q.length:-2;M!=w;M+=2*h){var z=q[M];if(q[M+1]!=k)c+=h*z.length;else for(var ea=g?0:z.length-1,V=g?z.length:-1;ea!=V;ea+=h,c+=h)if(c>=r&&c<s&&p.test(v=z.charAt(ea))){var C=bc[v];if(">"==C.charAt(1)==g)j.push(v);else if(j.pop()!= 
    40 C.charAt(0)){r={pos:c,match:!1};break a}else if(!j.length){r={pos:c,match:!0};break a}}}r=void 0}if(r)break}r||(r={pos:null,match:!1});var k=r.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",E=Yb({line:b.line,ch:d},{line:b.line,ch:d+1},k),u=null!=r.pos&&Yb({line:m,ch:r.pos},{line:m,ch:r.pos+1},k),b=l(function(){E.clear();u&&u.clear()});a?setTimeout(b,800):ra=b}}function Hc(a){for(var b,c,d=a,a=a-40;d>a;--d){if(0==d)return 0;var g=f(d-1);if(g.stateAfter)return d;g=g.indentation(j.tabSize); 
    41 if(null==c||b>g)c=d-1,b=g}return c}function nb(a){var b=Hc(a),c=b&&f(b-1).stateAfter,c=c?Ia(E,c):cc(E);o.iter(b,a,function(a){a.highlight(E,c,j.tabSize);a.stateAfter=Ia(E,c)});b<a&&fa.push({from:b,to:a});a<o.size&&!f(a).stateAfter&&ja.push(a);return c}function kc(){for(var a=+new Date+j.workTime,b=ja.length;ja.length;){var c=f(C).stateAfter?ja.pop():C;if(!(c>=o.size)){var d=Hc(c),g=d&&f(d-1).stateAfter,g=g?Ia(E,g):cc(E),i=0,h=E.compareStates,l=!1,m=d,p=!1;o.iter(m,o.size,function(b){var d=b.stateAfter; 
    42 if(+new Date>a)return ja.push(m),Qb(j.workDelay),l&&fa.push({from:c,to:m+1}),p=!0;var f=b.highlight(E,g,j.tabSize);f&&(l=!0);b.stateAfter=Ia(E,g);b=null;if(h){var H=d&&h(d,g);H!=Kb&&(b=!!H)}if(null==b)if(!1!==f||!d)i=0;else if(3<++i&&(!E.indent||E.indent(d,"")==E.indent(g,"")))b=!0;if(b)return!0;++m});if(p)return;l&&fa.push({from:c,to:m+1})}}if(b&&j.onHighlightComplete)j.onHighlightComplete(z)}function Qb(a){ja.length&&Pc.set(a,l(kc))}function Sb(){pa=sb=Ja=null;fa=[];ta=!1;Xa=[]}function Tb(){Ya&& 
    43 X();if(mb&&!j.lineWrapping){var a=yb.offsetWidth,b=Zb(ia,ia.text.length).left;dc||(yb.style.left=b+"px",w.style.minWidth=b+a+"px");mb=!1}var c,d;ta&&(a=tc(),c=vc(a.x,a.y,a.x,a.yBot));if(fa.length||c&&null!=c.scrollTop)d=sa(fa,!0,c&&c.scrollTop);d||(ta&&Ba(),ha&&va());if(c&&(a=tc(),uc(a.x,a.y,a.x,a.yBot),R)){c=la.getBoundingClientRect();b=null;if(0>a.y+c.top)b=!0;else if(a.y+c.top+ka()>(window.innerHeight||document.documentElement.clientHeight))b=!1;if(null!=b){if(c="none"==K.style.display)K.style.display= 
    44 "",K.style.left=a.x+"px",K.style.top=a.y-Ka+"px";K.scrollIntoView(b);c&&(K.style.display="none")}}ta&&ib();R&&(!Wa&&(!0===pa||!1!==pa&&ta))&&jb(sb);ta&&j.matchBrackets&&setTimeout(l(function(){if(ra){ra();ra=null}u(i.from,i.to)&&Gc(false)}),20);b=ta;a=Xa;if(Ja&&j.onChange&&z)j.onChange(z,Ja);if(b&&j.onCursorActivity)j.onCursorActivity(z);for(b=0;b<a.length;++b)a[b](z);if(d&&j.onUpdate)j.onUpdate(z)}function l(a){return function(){Ic++||Sb();try{var b=a.apply(this,arguments)}finally{--Ic||Tb()}return b}} 
    45 function lc(a){G.startCompound();try{return a()}finally{G.endCompound()}}var j={},ec=k.defaults,ab;for(ab in ec)ec.hasOwnProperty(ab)&&(j[ab]=(b&&b.hasOwnProperty(ab)?b:ec)[ab]);var t=s("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em");t.setAttribute("wrap","off");t.setAttribute("autocorrect","off");t.setAttribute("autocapitalize","off");var Aa=s("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),rc=s("div",null,"CodeMirror-scrollbar-inner"), 
    46 r=s("div",[rc],"CodeMirror-scrollbar"),Z=s("div"),rb=s("div",null,null,"position: relative; z-index: -1"),K=s("pre","\u00a0","CodeMirror-cursor"),yb=s("pre","\u00a0","CodeMirror-cursor","visibility: hidden"),Oa=s("div",null,null,"position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;"),w=s("div",[Oa,K,yb,rb,Z],null,"position: relative; z-index: 0"),La=s("div",null,"CodeMirror-gutter-text"),P=s("div",[La],"CodeMirror-gutter"),pb=s("div",[P,s("div",[w],"CodeMirror-lines")], 
    47 null,"position: relative"),la=s("div",[pb],null,"position: relative"),m=s("div",[la],"CodeMirror-scroll");m.setAttribute("tabIndex","-1");var N=s("div",[Aa,r,m],"CodeMirror"+(j.lineWrapping?" CodeMirror-wrap":""));a.appendChild?a.appendChild(N):a(N);zc();Ac();fc&&(t.style.width="0px");ob||(m.draggable=!0);w.style.outline="none";null!=j.tabindex&&(t.tabIndex=j.tabindex);j.autofocus&&V();!j.gutter&&!j.lineNumbers&&(P.style.display="none");gc&&(Aa.style.height="1px",Aa.style.position="absolute");Qc? 
    48 (r.style.zIndex=-2,r.style.visibility="hidden"):dc&&(r.style.minWidth="18px");try{lb()}catch(hc){throw hc.message.match(/runtime/i)&&(hc=Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),hc;}var Rb=new ic,Pc=new ic,Pb,E,o=new Cb([new Db([new ba("")])]),ja,R;Ra();var i={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},da,Eb,Fb,oa=0,eb,qb=!1,gb=!1,pa,sb,fa,Ja,ta,Wa,ha,Xa,Ka=0,C=0,Q=0,xc=0,ra,ia=f(0),Ya=!1,mb=!0,yc={},Ha=!1,tb=null;l(function(){g(j.value|| 
    49 "");pa=false})();var G=new Gb;q(m,"mousedown",l(function(a){function b(c){if(ob)m.draggable=false;eb=false;t();k();if(Math.abs(a.clientX-c.clientX)+Math.abs(a.clientY-c.clientY)<10){D(c);ua(h.line,h.ch,true);V()}}function c(a){if(p=="single")ca(h,a);else if(p=="double"){var b=Qa(a);A(a,s)?ca(b.from,w):ca(s,b.to)}else p=="triple"&&(A(a,s)?ca(w,v({line:a.line,ch:0})):ca(s,v({line:a.line+1,ch:0})))}function d(a){var b=Ua(a,true);if(b&&!u(b,o)){R||Ga();o=b;c(b);pa=false;var e=wa();if(b.line>=e.to||b.line< 
    50 e.from)r=setTimeout(l(function(){d(a)}),150)}}function f(a){clearTimeout(r);var b=Ua(a);b&&c(b);D(a);V();pa=true;ea();t()}Da(F(a,"shiftKey"));for(var g=a.target||a.srcElement;g!=N;g=g.parentNode)if(g.parentNode==la&&g!=pb)return;for(g=a.target||a.srcElement;g!=N;g=g.parentNode)if(g.parentNode==La){if(j.onGutterClick)j.onGutterClick(z,bb(La.childNodes,g)+C,a);return D(a)}var h=Ua(a);switch(Jc(a)){case 3:Ea&&Fc(a);return;case 2:h&&ua(h.line,h.ch,true);setTimeout(V,20);D(a);return}if(h){R||Ga();var g= 
    51 +new Date,p="single";if(Fb&&Fb.time>g-400&&u(Fb.pos,h)){p="triple";D(a);setTimeout(V,20);g=h.line;ca({line:g,ch:0},v({line:g+1,ch:0}))}else if(Eb&&Eb.time>g-400&&u(Eb.pos,h)){p="double";Fb={time:g,pos:h};D(a);g=Qa(h);ca(g.from,g.to)}else Eb={time:g,pos:h};var o=h,r;if(j.dragDrop&&jc&&!j.readOnly&&!u(i.from,i.to)&&!A(h,i.from)&&!A(i.to,h)&&p=="single"){if(ob)m.draggable=true;var t=q(document,"mouseup",l(b),true),k=q(m,"drop",l(b),true);eb=true;m.dragDrop&&m.dragDrop()}else{D(a);p=="single"&&ua(h.line, 
    52 h.ch,true);var s=i.from,w=i.to,ea=q(document,"mousemove",l(function(a){clearTimeout(r);D(a);!ya&&!Jc(a)?f(a):d(a)}),true),t=q(document,"mouseup",l(f),true)}}else(a.target||a.srcElement)==m&&D(a)}));q(m,"dblclick",l(function(a){for(var b=a.target||a.srcElement;b!=N;b=b.parentNode)if(b.parentNode==La)return D(a);D(a)}));q(w,"selectstart",D);Ea||q(m,"contextmenu",Fc);q(m,"scroll",function(){if(j.fixedGutter&&P.style.left!=m.scrollLeft+"px")P.style.left=m.scrollLeft+"px";if(m.scrollTop!=oa){oa=m.scrollTop; 
    53 if(r.scrollTop!=oa)r.scrollTop=oa;sa([])}if(j.onScroll)j.onScroll(z)});q(r,"scroll",function(){if(r.scrollTop!=oa){oa=m.scrollTop=r.scrollTop;sa([])}});q(r,"mousedown",function(){R&&setTimeout(V,0)});var Rc=q(window,"resize",function(){N.parentNode?sa(true):Rc()},!0);q(t,"keyup",l(function(a){if(!j.onKeyEvent||!j.onKeyEvent(z,Sa(a)))F(a,"keyCode")==16&&(da=null)}));q(t,"input",$a);q(t,"keydown",l(pc));q(t,"keypress",l(function(a){Ha&&ea();if(!j.onKeyEvent||!j.onKeyEvent(z,Sa(a))){var b=F(a,"keyCode"), 
    54 c=F(a,"charCode");if(qa&&b==Mb){Mb=null;D(a)}else if(!(qa&&(!a.which||a.which<10)||gc)||!B(a)){b=String.fromCharCode(c==null?b:c);j.electricChars&&E.electricChars&&j.smartIndent&&!j.readOnly&&E.electricChars.indexOf(b)>-1&&setTimeout(l(function(){xb(i.to.line,"smart")}),75);if(b=hb("'"+b+"'",j.extraKeys,j.keyMap,function(a){return Fa(a,true)})){D(a);ib()}b||$a()}}}));q(t,"focus",Ga);q(t,"blur",Ob);j.dragDrop&&(q(m,"dragstart",Mc),q(m,"dragenter",c),q(m,"dragover",c),q(m,"drop",l(p)));q(m,"paste", 
    55 function(){V();$a()});q(t,"paste",$a);q(t,"cut",l(function(){j.readOnly||aa("")}));gc&&q(la,"mouseup",function(){document.activeElement==t&&t.blur();V()});var Kc;try{Kc=document.activeElement==t}catch(Sc){}Kc||j.autofocus?setTimeout(Ga,20):Ob();var z=N.CodeMirror={getValue:function(a){var b=[];o.iter(0,o.size,function(a){b.push(a.text)});return b.join(a||"\n")},setValue:l(g),getSelection:fb,replaceSelection:l(aa),focus:function(){window.focus();V();Ga();$a()},setOption:function(a,b){var c=j[a];j[a]= 
    56 b;if(a=="mode"||a=="indentUnit")Ra();else if(a=="readOnly"&&b=="nocursor"){Ob();t.blur()}else a=="readOnly"&&!b?jb(true):a=="theme"?zc():a=="lineWrapping"&&c!=b?l(Ib)():a=="tabSize"?sa(true):a=="keyMap"&&Ac();if(a=="lineNumbers"||a=="gutter"||a=="firstLineNumber"||a=="theme"||a=="lineNumberFormatter"){c=j.gutter||j.lineNumbers;P.style.display=c?"":"none";c?ha=true:Z.parentNode.style.marginLeft=0;sa(true)}},getOption:function(a){return j[a]},undo:l(function(){qc(G.done,G.undone)}),redo:l(function(){qc(G.undone, 
    57 G.done)}),indentLine:l(function(a,b){typeof b!="string"&&(b=b==null?j.smartIndent?"smart":"prev":b?"add":"subtract");d(a)&&xb(a,b)}),indentSelection:l(function(a){if(u(i.from,i.to))return xb(i.from.line,a);for(var b=i.to.line-(i.to.ch?0:1),c=i.from.line;c<=b;++c)xb(c,a)}),historySize:function(){return{undo:G.done.length,redo:G.undone.length}},clearHistory:function(){G=new Gb},setHistory:function(a){G=new Gb;G.done=a.done;G.undone=a.undone},getHistory:function(){G.time=0;return{done:G.done.concat([]), 
    58 undone:G.undone.concat([])}},matchBrackets:l(function(){Gc(true)}),getTokenAt:l(function(a){a=v(a);return f(a.line).getTokenAt(E,nb(a.line),j.tabSize,a.ch)}),getStateAfter:function(a){a=vb(a==null?o.size-1:a);return nb(a+1)},cursorCoords:function(a,b){if(a==null)a=i.inverted;return this.charCoords(a?i.from:i.to,b)},charCoords:function(a,b){a=v(a);if(b=="local")return na(a,false);if(b=="div")return na(a,true);var c=na(a,true),d=Ma(w);return{x:d.left+c.x,y:d.top+c.y,yBot:d.top+c.yBot}},coordsChar:function(a){var b= 
    59 Ma(w);return Bb(a.x-b.left,a.y-b.top)},markText:l(Yb),setBookmark:function(a){var a=v(a),b=new Lc(a.ch);f(a.line).addMark(b);return b},findMarksAt:function(a){var a=v(a),b=[],c=f(a.line).marked;if(!c)return b;for(var d=0,g=c.length;d<g;++d){var h=c[d];if((h.from==null||h.from<=a.ch)&&(h.to==null||h.to>=a.ch))b.push(h.marker||h)}return b},setMarker:l(function(a,b,c){typeof a=="number"&&(a=f(vb(a)));a.gutterMarker={text:b,style:c};ha=true;return a}),clearMarker:l(function(a){typeof a=="number"&&(a= 
    60 f(vb(a)));a.gutterMarker=null;ha=true}),setLineClass:l(function(a,b,c){return Bc(a,function(a){if(a.className!=b||a.bgClassName!=c){a.className=b;a.bgClassName=c;return true}})}),hideLine:l(function(a){return Wb(a,true)}),showLine:l(function(a){return Wb(a,false)}),onDeleteLine:function(a,b){if(typeof a=="number"){if(!d(a))return null;a=f(a)}(a.handlers||(a.handlers=[])).push(b);return a},lineInfo:function(a){if(typeof a=="number"){if(!d(a))return null;var b=a,a=f(a);if(!a)return null}else{b=Na(a); 
    61 if(b==null)return null}var c=a.gutterMarker;return{line:b,handle:a,text:a.text,markerText:c&&c.text,markerClass:c&&c.style,lineClass:a.className,bgClass:a.bgClassName}},getViewport:function(){return{from:C,to:Q}},addWidget:function(a,b,c,d,f){var a=na(v(a)),g=a.yBot,h=a.x;b.style.position="absolute";la.appendChild(b);if(d=="over")g=a.y;else if(d=="near"){var d=Math.max(m.offsetHeight,o.height*ka()),i=Math.max(la.clientWidth,w.clientWidth)-w.offsetLeft;a.yBot+b.offsetHeight>d&&a.y>b.offsetHeight&& 
    62 (g=a.y-b.offsetHeight);h+b.offsetWidth>i&&(h=i-b.offsetWidth)}b.style.top=g+w.offsetTop+"px";b.style.left=b.style.right="";if(f=="right"){h=la.clientWidth-b.offsetWidth;b.style.right="0px"}else{f=="left"?h=0:f=="middle"&&(h=(la.clientWidth-b.offsetWidth)/2);b.style.left=h+w.offsetLeft+"px"}c&&uc(h,g,h+b.offsetWidth,g+b.offsetHeight)},lineCount:function(){return o.size},clipPos:v,getCursor:function(a){if(a==null)a=i.inverted;return{line:(a?i.from:i.to).line,ch:(a?i.from:i.to).ch}},somethingSelected:function(){return!u(i.from, 
    63 i.to)},setCursor:l(function(a,b,c){b==null&&typeof a.line=="number"?ua(a.line,a.ch,c):ua(a,b,c)}),setSelection:l(function(a,b,c){(c?ca:Za)(v(a),v(b||a))}),getLine:function(a){if(d(a))return f(a).text},getLineHandle:function(a){if(d(a))return f(a)},setLine:l(function(a,b){d(a)&&I(b,{line:a,ch:0},{line:a,ch:f(a).text.length})}),removeLine:l(function(a){d(a)&&I("",{line:a,ch:0},v({line:a+1,ch:0}))}),replaceRange:l(I),getRange:function(a,b,c){return ga(v(a),v(b),c)},triggerOnKeyDown:l(pc),execCommand:function(a){return nc[a](z)}, 
    64 moveH:l(function(a,b){var c=a<0?i.from:i.to;if(da||u(i.from,i.to))c=Ca(a,b);ua(c.line,c.ch,true)}),deleteH:l(function(a,b){u(i.from,i.to)?a<0?I("",Ca(a,b),i.to):I("",i.from,Ca(a,b)):I("",i.from,i.to);sb=true}),moveV:l(function(a,b){var c=na(i.inverted?i.from:i.to,true);if(tb!=null)c.x=tb;if(b=="page")var d=Math.min(m.clientHeight,window.innerHeight||document.documentElement.clientHeight),d=Bb(c.x,c.y+d*a);else if(b=="line"){d=ka();d=Bb(c.x,c.y+0.5*d+a*d)}if(b=="page")r.scrollTop=r.scrollTop+(na(d, 
    65 true).y-c.y);ua(d.line,d.ch,true);tb=c.x}),toggleOverwrite:function(){if(qb){qb=false;K.className=K.className.replace(" CodeMirror-overwrite","")}else{qb=true;K.className=K.className+" CodeMirror-overwrite"}},posFromIndex:function(a){var b=0,c;o.iter(0,o.size,function(d){d=d.text.length+1;if(d>a){c=a;return true}a=a-d;++b});return v({line:b,ch:c})},indexFromPos:function(a){if(a.line<0||a.ch<0)return 0;var b=a.ch;o.iter(0,a.line,function(a){b=b+(a.text.length+1)});return b},scrollTo:function(a,b){if(a!= 
    66 null)m.scrollLeft=a;if(b!=null)r.scrollTop=m.scrollTop=b;sa([])},getScrollInfo:function(){return{x:m.scrollLeft,y:r.scrollTop,height:r.scrollHeight,width:m.scrollWidth}},setSize:function(a,b){function c(a){a=String(a);return/^\d+$/.test(a)?a+"px":a}if(a!=null)N.style.width=c(a);if(b!=null)m.style.height=c(b);z.refresh()},operation:function(a){return l(a)()},compoundChange:function(a){return lc(a)},refresh:function(){sa(true,null,oa);if(r.scrollHeight>oa)r.scrollTop=oa},getInputField:function(){return t}, 
    67 getWrapperElement:function(){return N},getScrollerElement:function(){return m},getGutterElement:function(){return P}},oc,Mb=null,ma="";Xb.prototype.clear=l(function(){for(var a=Infinity,b=-Infinity,c=0,d=this.set.length;c<d;++c){var f=this.set[c],g=f.marked;if(g&&f.parent){f=Na(f);a=Math.min(a,f);b=Math.max(b,f);for(f=0;f<g.length;++f)g[f].marker==this&&g.splice(f--,1)}}a!=Infinity&&fa.push({from:a,to:b+1})});Xb.prototype.find=function(){for(var a,b,c=0,d=this.set.length;c<d;++c)for(var f=this.set[c], 
    68 g=f.marked,h=0;h<g.length;++h){var i=g[h];if(i.marker==this&&(i.from!=null||i.to!=null)){var j=Na(f);if(j!=null){i.from!=null&&(a={line:j,ch:i.from});i.to!=null&&(b={line:j,ch:i.to})}}}return{from:a,to:b}};var $b,Cc,Pa,Ec,Dc=0,bc={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},Ic=0,cb;for(cb in Hb)Hb.propertyIsEnumerable(cb)&&!z.propertyIsEnumerable(cb)&&(z[cb]=Hb[cb]);return z}function Lb(a){return"string"==typeof a?$[a]:a}function hb(a,b,c,d,f){function h(b){var b=Lb(b),c=b[a];if(!1===c)return f&& 
    69 f(),!0;if(null!=c&&d(c))return!0;if(b.nofallthrough)return f&&f(),!0;b=b.fallthrough;if(null==b)return!1;if("[object Array]"!=Object.prototype.toString.call(b))return h(b);for(var c=0,k=b.length;c<k;++c)if(h(b[c]))return!0;return!1}return b&&h(b)?!0:h(c)}function Ia(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var f=b[d];f instanceof Array&&(f=f.concat([]));c[d]=f}return c}function cc(a,b,c){return a.startState?a.startState(b,c):!0}function va(a,b){this.pos= 
    70 this.start=0;this.string=a;this.tabSize=b||8}function zb(a,b,c,d){this.from=a;this.to=b;this.style=c;this.marker=d}function Lc(a){this.to=this.from=a;this.line=null}function ba(a,b){this.styles=b||[a,null];this.text=a;this.height=1}function Ba(a,b,c,d){for(var f=0,h=0,g=0;h<b;f+=2){var p=c[f],k=h+p.length;0==g?(k>a&&d.push(p.slice(a-h,Math.min(p.length,b-h)),c[f+1]),k>=a&&(g=1)):1==g&&(k>b?d.push(p.slice(0,b-h),c[f+1]):d.push(p,c[f+1]));h=k}}function Db(a){this.lines=a;this.parent=null;for(var b= 
    71 0,c=a.length,d=0;b<c;++b)a[b].parent=this,d+=a[b].height;this.height=d}function Cb(a){this.children=a;for(var b=0,c=0,d=0,f=a.length;d<f;++d){var h=a[d],b=b+h.chunkSize(),c=c+h.height;h.parent=this}this.size=b;this.height=c;this.parent=null}function Na(a){if(null==a.parent)return null;for(var b=a.parent,a=bb(b.lines,a),c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a}function Ub(a,b){var c=0;a:do{for(var d=0,f=a.children.length;d<f;++d){var h=a.children[d], 
    72 g=h.height;if(b<g){a=h;continue a}b-=g;c+=h.chunkSize()}return c}while(!a.lines);d=0;for(f=a.lines.length;d<f;++d){h=a.lines[d].height;if(b<h)break;b-=h}return c+d}function Vb(a,b){var c=0;a:do{for(var d=0,f=a.children.length;d<f;++d){var h=a.children[d],g=h.chunkSize();if(b<g){a=h;continue a}b-=g;c+=h.height}return c}while(!a.lines);for(d=0;d<b;++d)c+=a.lines[d].height;return c}function Gb(){this.time=0;this.done=[];this.undone=[];this.compound=0;this.closed=!1}function kc(){db(this)}function Sa(a){a.stop|| 
    73 (a.stop=kc);return a}function D(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Ib(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function db(a){D(a);Ib(a)}function Jc(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));Nb&&(a.ctrlKey&&1==b)&&(b=3);return b}function F(a,b){return a.override&&a.override.hasOwnProperty(b)?a.override[b]:a[b]}function q(a,b,c,d){if("function"==typeof a.addEventListener){if(a.addEventListener(b,c,!1),d)return function(){a.removeEventListener(b, 
    74 c,!1)}}else{var f=function(a){c(a||window.event)};a.attachEvent("on"+b,f);if(d)return function(){a.detachEvent("on"+b,f)}}}function ic(){this.id=null}function Ca(a,b,c){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var d=0,f=0;d<b;++d)"\t"==a.charAt(d)?f+=c-f%c:++f;return f}function Ma(a,b){try{var c=a.getBoundingClientRect(),c={top:c.top,left:c.left}}catch(d){c={top:0,left:0}}if(!b)if(null==window.pageYOffset){var f=document.documentElement||document.body.parentNode;null==f.scrollTop&& 
    75 (f=document.body);c.top+=f.scrollTop;c.left+=f.scrollLeft}else c.top+=window.pageYOffset,c.left+=window.pageXOffset;return c}function sc(a){fc?(a.selectionStart=0,a.selectionEnd=a.value.length):a.select()}function u(a,b){return a.line==b.line&&a.ch==b.ch}function A(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function s(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)Qa(a,b);else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a} 
    76 function za(a){a.innerHTML="";return a}function Qa(a,b){ac?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function bb(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function wb(a){return/\w/.test(a)||a.toUpperCase()!=a.toLowerCase()}k.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null, 
    77 onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onViewportChange:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,cursorBlinkRate:530,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null,lineNumberFormatter:function(a){return a}};var fc=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent), 
    78 Nb=fc||/Mac/.test(navigator.platform);/Win/.test(navigator.platform);var Da=k.modes={},U=k.mimeModes={};k.defineMode=function(a,b){!k.defaults.mode&&"null"!=a&&(k.defaults.mode=a);if(2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}Da[a]=b};k.defineMIME=function(a,b){U[a]=b};k.resolveMode=function(a){if("string"==typeof a&&U.hasOwnProperty(a))a=U[a];else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return k.resolveMode("application/xml"); 
    79 return"string"==typeof a?{name:a}:a||{name:"null"}};k.getMode=function(a,b){var b=k.resolveMode(b),c=Da[b.name];return!c?k.getMode(a,"text/plain"):c(a,b)};k.listModes=function(){var a=[],b;for(b in Da)Da.propertyIsEnumerable(b)&&a.push(b);return a};k.listMIMEs=function(){var a=[],b;for(b in U)U.propertyIsEnumerable(b)&&a.push({mime:b,mode:U[b]});return a};var Hb=k.extensions={};k.defineExtension=function(a,b){Hb[a]=b};var nc=k.commands={selectAll:function(a){a.setSelection({line:0,ch:0},{line:a.lineCount()- 
    80 1})},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!u(b,c);!d&&a.getLine(b.line).length==b.ch?a.replaceRange("",b,{line:b.line+1,ch:0}):a.replaceRange("",b,d?c:{line:b.line})},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",{line:b,ch:0},{line:b})},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.setCursor(0,0,!0)},goDocEnd:function(a){a.setSelection({line:a.lineCount()-1},null,!0)},goLineStart:function(a){a.setCursor(a.getCursor().line, 
    81 0,!0)},goLineStartSmart:function(a){var b=a.getCursor(),c=a.getLine(b.line),c=Math.max(0,c.search(/\S/));a.setCursor(b.line,b.ch<=c&&b.ch?0:c,!0)},goLineEnd:function(a){a.setSelection({line:a.getCursor().line},null,!0)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1, 
    82 "column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goWordRight:function(a){a.moveH(1,"word")},delCharLeft:function(a){a.deleteH(-1,"char")},delCharRight:function(a){a.deleteH(1,"char")},delWordLeft:function(a){a.deleteH(-1,"word")},delWordRight:function(a){a.deleteH(1,"word")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t", 
    83 "end")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection("\t","end")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);0<b.ch&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),{line:b.line,ch:b.ch-1},{line:b.line,ch:b.ch+1})},newlineAndIndent:function(a){a.replaceSelection("\n","end");a.indentLine(a.getCursor().line)},toggleOverwrite:function(a){a.toggleOverwrite()}},$=k.keyMap={};$.basic={Left:"goCharLeft",Right:"goCharRight", 
    84 Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};$.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight", 
    85 "Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"};$.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight", 
    86 "Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]};$["default"]=Nb?$.macDefault:$.pcDefault;$.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight", 
    87 "Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};k.fromTextArea=function(a,b){function c(){a.value=p.getValue()}b||(b={});b.value=a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);if(null==b.autofocus){var d=document.body;try{d=document.activeElement}catch(f){}b.autofocus=d==a||null!= 
    88 a.getAttribute("autofocus")&&d==document.body}if(a.form){var h=q(a.form,"submit",c,!0);if("function"==typeof a.form.submit){var g=a.form.submit;a.form.submit=function Fa(){c();a.form.submit=g;a.form.submit();a.form.submit=Fa}}}a.style.display="none";var p=k(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);p.save=c;p.getTextArea=function(){return a};p.toTextArea=function(){c();a.parentNode.removeChild(p.getWrapperElement());a.style.display="";if(a.form){h();if(typeof a.form.submit=="function")a.form.submit= 
    89 g}};return p};var Ea=/gecko\/\d{7}/i.test(navigator.userAgent),ya=/MSIE \d/.test(navigator.userAgent),dc=/MSIE [1-7]\b/.test(navigator.userAgent),ac=/MSIE [1-8]\b/.test(navigator.userAgent),Oc=ya&&5==document.documentMode,ob=/WebKit\//.test(navigator.userAgent),mc=/Chrome\//.test(navigator.userAgent),qa=/Opera\//.test(navigator.userAgent),B=/Apple Computer/.test(navigator.vendor),gc=/KHTML\//.test(navigator.userAgent),Qc=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent);k.copyState=Ia;k.startState= 
    90 cc;va.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos; 
    91 return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){return Ca(this.string,this.start,this.tabSize)},indentation:function(){return Ca(this.string,null,this.tabSize)},match:function(a,b,c){if("string"==typeof a){if((c?this.string.toLowerCase():this.string).indexOf(c?a.toLowerCase():a,this.pos)==this.pos)return!1!==b&&(this.pos+=a.length),!0}else{if((a= 
    92 this.string.slice(this.pos).match(a))&&!1!==b)this.pos+=a[0].length;return a}},current:function(){return this.string.slice(this.start,this.pos)}};k.StringStream=va;zb.prototype={attach:function(a){this.marker.set.push(a)},detach:function(a){a=bb(this.marker.set,a);-1<a&&this.marker.set.splice(a,1)},split:function(a,b){return this.to<=a&&null!=this.to?null:new zb(this.from<a||null==this.from?null:this.from-a+b,null==this.to?null:this.to-a+b,this.style,this.marker)},dup:function(){return new zb(null, 
    93 null,this.style,this.marker)},clipTo:function(a,b,c,d,f){a&&d>this.from&&(d<this.to||null==this.to)?this.from=null:null!=this.from&&this.from>=b&&(this.from=Math.max(d,this.from)+f);c&&(b<this.to||null==this.to)&&(b>this.from||null==this.from)?this.to=null:null!=this.to&&this.to>b&&(this.to=d<this.to?this.to+f:b)},isDead:function(){return null!=this.from&&null!=this.to&&this.from>=this.to},sameSet:function(a){return this.marker==a.marker}};Lc.prototype={attach:function(a){this.line=a},detach:function(a){this.line== 
    94 a&&(this.line=null)},split:function(a,b){if(a<this.from)return this.from=this.to=this.from-a+b,this},isDead:function(){return this.from>this.to},clipTo:function(a,b,c,d,f){(a||b<this.from)&&(c||d>this.to)?(this.from=0,this.to=-1):this.from>b&&(this.from=this.to=Math.max(d,this.from)+f)},sameSet:function(){return!1},find:function(){return!this.line||!this.line.parent?null:{line:Na(this.line),ch:this.from}},clear:function(){if(this.line){var a=bb(this.line.marked,this);-1!=a&&this.line.marked.splice(a, 
    95 1);this.line=null}}};var Ra=" ";Ea||ya&&!dc?Ra="\u200b":qa&&(Ra="");ba.inheritMarks=function(a,b){var c=new ba(a),d=b&&b.marked;if(d)for(var f=0;f<d.length;++f)if(null==d[f].to&&d[f].style){var h=c.marked||(c.marked=[]),g=d[f].dup();h.push(g);g.attach(c)}return c};ba.prototype={replace:function(a,b,c){var d=[],f=this.marked,h=null==b?this.text.length:b;Ba(0,a,this.styles,d);c&&d.push(c,null);Ba(h,this.text.length,this.styles,d);this.styles=d;this.text=this.text.slice(0,a)+c+this.text.slice(h);this.stateAfter= 
    96 null;if(f){c=c.length-(h-a);for(d=0;d<f.length;++d){var g=f[d];g.clipTo(null==a,a||0,null==b,h,c);g.isDead()&&(g.detach(this),f.splice(d--,1))}}},split:function(a,b){var c=[b,null],d=this.marked;Ba(a,this.text.length,this.styles,c);c=new ba(b+this.text.slice(a),c);if(d)for(var f=0;f<d.length;++f){var h=d[f],g=h.split(a,b.length);g&&(c.marked||(c.marked=[]),c.marked.push(g),g.attach(c),g==h&&d.splice(f--,1))}return c},append:function(a){var b=this.text.length,c=a.marked,d=this.marked;this.text+=a.text; 
    97 Ba(0,a.text.length,a.styles,this.styles);if(d)for(a=0;a<d.length;++a)null==d[a].to&&(d[a].to=b);if(c&&c.length){d||(this.marked=d=[]);a=0;a:for(;a<c.length;++a){var f=c[a];if(!f.from)for(var h=0;h<d.length;++h){var g=d[h];if(g.to==b&&g.sameSet(f)){g.to=null==f.to?null:f.to+b;g.isDead()&&(g.detach(this),c.splice(a--,1));continue a}}d.push(f);f.attach(this);f.from+=b;null!=f.to&&(f.to+=b)}}},fixMarkEnds:function(a){var b=this.marked,a=a.marked;if(b){var c=0;a:for(;c<b.length;++c){var d=b[c],f=null== 
    98 d.to;if(f&&a)for(var h=0;h<a.length;++h){var g=a[h];if(g.sameSet(d)&&null==g.from)if(d.from==this.text.length&&0==g.to){a.splice(h,1);b.splice(c--,1);continue a}else{f=!1;break}}f&&(d.to=this.text.length)}}},fixMarkStarts:function(){var a=this.marked;if(a)for(var b=0;b<a.length;++b)null==a[b].from&&(a[b].from=0)},addMark:function(a){a.attach(this);null==this.marked&&(this.marked=[]);this.marked.push(a);this.marked.sort(function(a,c){return(a.from||0)-(c.from||0)})},highlight:function(a,b,c){var c= 
    99 new va(this.text,c),d=this.styles,f=0,h=!1,g=d[0],p;for(""==this.text&&a.blankLine&&a.blankLine(b);!c.eol();){var k=a.token(c,b),s=this.text.slice(c.start,c.pos);c.start=c.pos;if(f&&d[f-1]==k)d[f-2]+=s;else if(s){if(!h&&(d[f+1]!=k||f&&d[f-2]!=p))h=!0;d[f++]=s;d[f++]=k;p=g;g=d[f]}if(5E3<c.pos){d[f++]=this.text.slice(c.pos);d[f++]=null;break}}d.length!=f&&(d.length=f,h=!0);f&&d[f-2]!=p&&(h=!0);return h||(5>d.length&&10>this.text.length?null:!1)},getTokenAt:function(a,b,c,d){for(c=new va(this.text,c);c.pos< 
    100 d&&!c.eol();){c.start=c.pos;var f=a.token(c,b)}return{start:c.start,end:c.pos,string:c.current(),className:f||null,state:b}},indentation:function(a){return Ca(this.text,null,a)},getElement:function(a,b,c){function d(b,c,d){if(c){h&&(ya&&" "==c.charAt(0))&&(c="\u00a0"+c.slice(1));h=!1;if(p.test(c))for(var f=document.createDocumentFragment(),k=0;;){p.lastIndex=k;var q=p.exec(c),u=q?q.index-k:c.length-k;u&&(f.appendChild(document.createTextNode(c.slice(k,k+u))),g+=u);if(!q)break;k+=u+1;"\t"==q[0]?(q= 
    101 a(g),f.appendChild(q.element.cloneNode(!0)),g+=q.width):(u=s("span","\u2022","cm-invalidchar"),u.title="\\u"+q[0].charCodeAt(0).toString(16),f.appendChild(u),g+=1)}else{g+=c.length;var f=document.createTextNode(c)}d?b.appendChild(s("span",[f],d)):b.appendChild(f)}}function f(a){return!a?null:"cm-"+a.replace(/ +/g," cm-")}var h=!0,g=0,p=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g,k=s("pre"),q=d;if(null!=b)var u=0,B=k.anchor=s("span"),q=function(a,f,g){var h=f.length;if(b>=u&&b<u+h){b>u&&(d(a,f.slice(0, 
    102 b-u),g),c&&a.appendChild(s("wbr")));a.appendChild(B);var k=b-u;d(B,qa?f.slice(k,k+1):f.slice(k),g);qa&&d(a,f.slice(k+1),g);b--;u+=h}else u+=h,d(a,f,g),u==b&&u==F?(Qa(B,Ra),a.appendChild(B)):u>b+10&&/\s/.test(f)&&(q=function(){})};var D=this.styles,A=this.text,L=this.marked,F=A.length;if(!A&&null==b)q(k," ");else if(!L||!L.length)for(L=A=0;L<F;A+=2){var J=D[A],$=D[A+1],T=J.length;L+T>F&&(J=J.slice(0,F-L));L+=T;q(k,J,f($))}else for(var A=J=0,T="",X=L[0].from||0,I=[],aa=0;J<F;){if(X==J){for(X=void 0;aa< 
    103 L.length&&((X=L[aa]).from==J||null==X.from);)null!=X.style&&I.push(X),++aa;for(var X=aa<L.length?L[aa].from:Infinity,Y=0;Y<I.length;++Y){var ga=I[Y].to;null==ga&&(ga=Infinity);ga==J?I.splice(Y--,1):X=Math.min(ga,X)}}for(Y=Math.min(F,X);;){if(T){for(var ga=J+T.length,U=$,ba=0;ba<I.length;++ba)U=(U?U+" ":"")+I[ba].style;q(k,ga>Y?T.slice(0,Y-J):T,U);if(ga>=Y){T=T.slice(Y-J);J=Y;break}J=ga}T=D[A++];$=f(D[A++])}}return k},cleanUp:function(){this.parent=null;if(this.marked)for(var a=0,b=this.marked.length;a< 
    104 b;++a)this.marked[a].detach(this)}};Db.prototype={chunkSize:function(){return this.lines.length},remove:function(a,b,c){for(var d=a,f=a+b;d<f;++d){var h=this.lines[d];this.height-=h.height;h.cleanUp();if(h.handlers)for(var g=0;g<h.handlers.length;++g)c.push(h.handlers[g])}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertHeight:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));a=0;for(c=b.length;a< 
    105 c;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};Cb.prototype={chunkSize:function(){return this.size},remove:function(a,b,c){this.size-=b;for(var d=0;d<this.children.length;++d){var f=this.children[d],h=f.chunkSize();if(a<h){var g=Math.min(b,h-a),k=f.height;f.remove(a,g,c);this.height-=k-f.height;h==g&&(this.children.splice(d--,1),f.parent=null);if(0==(b-=g))break;a=0}else a-=h}25>this.size-b&&(a=[],this.collapse(a),this.children=[new Db(a)],this.children[0].parent= 
    106 this)},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insert:function(a,b){for(var c=0,d=0,f=b.length;d<f;++d)c+=b[d].height;this.insertHeight(a,b,c)},insertHeight:function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0,f=this.children.length;d<f;++d){var h=this.children[d],g=h.chunkSize();if(a<=g){h.insertHeight(a,b,c);if(h.lines&&50<h.lines.length){for(;50<h.lines.length;)a=h.lines.splice(h.lines.length-25,25),a=new Db(a),h.height-=a.height, 
    107 this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new Cb(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=bb(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new Cb(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iter:function(a,b,c){this.iterN(a,b-a,c)},iterN:function(a,b, 
    108 c){for(var d=0,f=this.children.length;d<f;++d){var h=this.children[d],g=h.chunkSize();if(a<g){g=Math.min(b,g-a);if(h.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=g}}};Gb.prototype={addChange:function(a,b,c){this.undone.length=0;var d=+new Date,f=this.done[this.done.length-1],h=f&&f[f.length-1],g=d-this.time;if(this.compound&&f&&!this.closed)f.push({start:a,added:b,old:c});else if(400<g||!h||this.closed||h.start>a+c.length||h.start+h.added<a)this.done.push([{start:a,added:b,old:c}]),this.closed= 
    109 !1;else{for(var f=Math.max(0,h.start-a),g=Math.max(0,a+c.length-(h.start+h.added)),k=f;0<k;--k)h.old.unshift(c[k-1]);for(k=g;0<k;--k)h.old.push(c[c.length-k]);f&&(h.start=a);h.added+=b-(c.length-f-g)}this.time=d},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}};k.e_stop=db;k.e_preventDefault=D;k.e_stopPropagation=Ib;k.connect=q;ic.prototype={set:function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)}};var Kb=k.Pass={toString:function(){return"CodeMirror.Pass"}}, 
    110 jc;if(ac)jc=!1;else{var wa=s("div");jc="draggable"in wa||"dragDrop"in wa}wa=s("textarea");wa.value="foo\nbar";wa.value.indexOf("\r");var Ab=/^$/;Ea?Ab=/$'/:B?Ab=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:mc&&(Ab=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);k.setTextContent=Qa;var Ta=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var f=a.indexOf("\n",b);-1==f&&(f=a.length);var h=a.slice(b,"\r"==a.charAt(f-1)?f-1:f),g=h.indexOf("\r");-1!= 
    111 g?(c.push(h.slice(0,g)),b+=g+1):(c.push(h),b=f+1)}return c}:function(a){return a.split(/\r\n?|\n/)};k.splitLines=Ta;var Nc=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return!b||b.parentElement()!=a?!1:0!=b.compareEndPoints("StartToEnd",b)};k.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});k.defineMIME("text/plain","null");var xa={3:"Enter",8:"Backspace", 
    112 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"}; 
    113 k.keyNames=xa;for(B=0;10>B;B++)xa[B+48]=String(B);for(B=65;90>=B;B++)xa[B]=String.fromCharCode(B);for(B=1;12>=B;B++)xa[B+111]=xa[B+63235]="F"+B;return k}(); 
     1// CodeMirror version 2.34 
     2window.CodeMirror=function(){function n(a,b){function c(d){(!h.onDragEvent||!h.onDragEvent(C,Wa(d)))&&jb(d)}function e(d){return 0<=d&&d<s.size}function g(d){for(var a=s;!a.lines;)for(var k=0;;++k){var b=a.children[k],D=b.chunkSize();if(d<D){a=b;break}d-=D}return a.lines[d]}function i(d,a){na=!0;for(var k=a-d.height,b=d;b;b=b.parent)b.height+=k}function l(d,a){d.styles||d.highlight(Q,d.stateAfter=Xa(La(d)),h.tabSize);return d.getContent(h.tabSize,a,h.lineWrapping)}function A(d){var a={line:0,ch:0}; 
     3pc(a,{line:s.size-1,ch:g(s.size-1).text.length},kb(d),a,a);xa=!0}function w(d){if(!h.onDragEvent||!h.onDragEvent(C,Wa(d))){G(d);var a=Ya(d,!0),k=d.dataTransfer.files;if(a&&!h.readOnly)if(k&&k.length&&window.FileReader&&window.File)for(var b=k.length,D=Array(b),c=0,d=function(d,k){var j=new FileReader;j.onload=function(){D[k]=j.result;++c==b&&(a=z(a),m(function(){var d=V(D.join(""),a,a);ka(a,d)})())};j.readAsText(d)},j=0;j<b;++j)d(k[j],j);else if(!lb||M(a,f.from)||M(f.to,a))try{(D=d.dataTransfer.getData("Text"))&& 
     4qc(function(){var d=f.from,k=f.to;ka(a,a);lb&&V("",d,k);R(D);$()})}catch(g){}}}function Rb(d){var a=Sb();d.dataTransfer.setData("Text",a);d.dataTransfer.setDragImage&&d.dataTransfer.setDragImage(r("img"),0,0)}function mb(d,a){if("string"==typeof d&&(d=Tb[d],!d))return!1;var k=la;try{h.readOnly&&(nb=!0),a&&(la=null),d(C)}catch(b){if(b!=rc)throw b;return!1}finally{la=k,nb=!1}return!0}function sc(d){function a(){j=!0}var k=Ub(h.keyMap),b=k.auto;clearTimeout(tc);var D;if(D=b)D=Fa[I(d,"keyCode")],D=!("Ctrl"== 
     5D||"Alt"==D||"Shift"==D||"Mod"==D);D&&(tc=setTimeout(function(){Ub(h.keyMap)==k&&(h.keyMap=b.call?b.call(null,C):b)},50));D=Fa[I(d,"keyCode")];var c=!1,c=ya&&ob;if(null==D||d.altGraphKey)return!1;I(d,"altKey")&&(D="Alt-"+D);if(I(d,c?"metaKey":"ctrlKey"))D="Ctrl-"+D;if(I(d,c?"ctrlKey":"metaKey"))D="Cmd-"+D;var j=!1,c=I(d,"shiftKey")?pb("Shift-"+D,h.extraKeys,h.keyMap,function(d){return mb(d,!0)},a)||pb(D,h.extraKeys,h.keyMap,function(d){if("string"==typeof d&&/^go[A-Z]/.test(d))return mb(d)},a):pb(D, 
     6h.extraKeys,h.keyMap,mb,a);j&&(c=!1);c&&(G(d),qb(),Ga&&(d.oldKeyCode=d.keyCode,d.keyCode=0));return c}function uc(d){aa||S();Ga&&27==d.keyCode&&(d.returnValue=!1);Ma&&W()&&(Ma=!1);if(!h.onKeyEvent||!h.onKeyEvent(C,Wa(d))){var a=I(d,"keyCode");Ka(16==a||I(d,"shiftKey"));var k=sc(d);ya&&(Vb=k?a:null,!k&&(88==a&&I(d,ob?"metaKey":"ctrlKey"))&&R(""))}}function S(){if("nocursor"!=h.readOnly){if(!aa){if(h.onFocus)h.onFocus(C);aa=!0;-1==p.className.search(/\bCodeMirror-focused\b/)&&(p.className+=" CodeMirror-focused")}ga(); 
     7qb()}}function N(){if(aa){if(h.onBlur)h.onBlur(C);aa=!1;za&&m(function(){za&&(za(),za=null)})();p.className=p.className.replace(" CodeMirror-focused","")}clearInterval(Wb);setTimeout(function(){aa||(la=null)},150)}function pc(d,a,k,b,c){if(!nb){var F=[];s.iter(d.line,a.line+1,function(d){F.push(Za(d.text,d.markedSpans))});if(O)for(O.addChange(d.line,k.length,F);O.done.length>h.undoDepth;)O.done.shift();var j=K(F[0]),g=K(J(F)),e=d.ch,f=a.ch;if(j||g){if(j)for(var i=0,t;i<j.length;++i){var q=j[i],l= 
     8q.marker;if(null==q.from||(l.inclusiveLeft?q.from<=e:q.from<e)||"bookmark"==l.type&&q.from==e&&void 0!=q.from){var p=null==q.to||(l.inclusiveRight?q.to>=e:q.to>e);(t||(t=[])).push({from:q.from,to:p?null:q.to,marker:l})}}j=t;if(g)for(var i=0,B;i<g.length;++i)if(t=g[i],q=t.marker,null==t.to||(q.inclusiveRight?t.to>=f:t.to>f)||"bookmark"==q.type&&t.from==f)l=null==t.from||(q.inclusiveLeft?t.from<=f:t.from<f),(B||(B=[])).push({from:l?null:t.from-f,to:null==t.to?null:t.to-f,marker:q});g=B;B=1==k.length; 
     9i=J(k).length+(B?e:0);if(j)for(f=0;f<j.length;++f)t=j[f],null==t.to&&((q=rb(g,t.marker))?B&&(t.to=null==q.to?null:q.to+i):t.to=e);if(g)for(f=0;f<g.length;++f)t=g[f],null!=t.to&&(t.to+=i),null==t.from?(q=rb(j,t.marker),q||(t.from=i,B&&(j||(j=[])).push(t))):(t.from+=i,B&&(j||(j=[])).push(t));e=[Za(k[0],j)];if(!B){B=k.length-2;var m;if(0<B&&j)for(f=0;f<j.length;++f)null==j[f].to&&(m||(m=[])).push({from:null,to:null,marker:j[f].marker});for(f=0;f<B;++f)e.push(Za(k[f+1],m));e.push(Za(J(k),g))}k=e}va(d, 
     10a,k,b,c)}}function P(d,a){if(d.length){for(var k=d.pop(),b=[],c=k.length-1;0<=c;c-=1){var F=k[c],j=[],f=F.start+F.added;s.iter(F.start,f,function(d){j.push(Za(d.text,d.markedSpans))});b.push({start:F.start,added:F.old.length,old:j});var e=F.start+F.old.length-1,h;h=T(J(j));var i=T(J(F.old));if(i)if(h){for(var l=h.length,q=i.length;0<=l&&0<=q&&h.charAt(l)==i.charAt(q);--l,--q);h=q+1}else h=i.length;else h=0;e={line:e,ch:h};va({line:F.start,ch:0},{line:f-1,ch:g(f-1).text.length},F.old,e,e)}xa=!0;a.push(b)}} 
     11function va(d,a,k,b,c){if(!nb){var F=!1,j=oa.text.length;h.lineWrapping||s.iter(d.line,a.line+1,function(d){if(!d.hidden&&d.text.length==j)return F=!0});if(d.line!=a.line||1<k.length)na=!0;var e=a.line-d.line,ja=g(d.line),l=g(a.line),m=J(k);if(0==d.ch&&0==a.ch&&""==T(m)){for(var t=[],q=0,n=k.length-1;q<n;++q)t.push(new Na(T(k[q]),K(k[q])));l.update(l.text,K(m));e&&s.remove(d.line,e,$a);t.length&&s.insert(d.line,t)}else if(ja==l)if(1==k.length)ja.update(ja.text.slice(0,d.ch)+T(k[0])+ja.text.slice(a.ch), 
     12K(k[0]));else{t=[];q=1;for(n=k.length-1;q<n;++q)t.push(new Na(T(k[q]),K(k[q])));t.push(new Na(T(m)+ja.text.slice(a.ch),K(m)));ja.update(ja.text.slice(0,d.ch)+T(k[0]),K(k[0]));s.insert(d.line+1,t)}else if(1==k.length)ja.update(ja.text.slice(0,d.ch)+T(k[0])+l.text.slice(a.ch),K(k[0])),s.remove(d.line+1,e,$a);else{t=[];ja.update(ja.text.slice(0,d.ch)+T(k[0]),K(k[0]));l.update(T(m)+l.text.slice(a.ch),K(m));q=1;for(n=k.length-1;q<n;++q)t.push(new Na(T(k[q]),K(k[q])));1<e&&s.remove(d.line+1,e-1,$a);s.insert(d.line+ 
     131,t)}if(h.lineWrapping){var r=Math.max(5,p.clientWidth/Xb()-3);s.iter(d.line,d.line+k.length,function(d){if(!d.hidden){var a=Math.ceil(d.text.length/r)||1;a!=d.height&&i(d,a)}})}else s.iter(d.line,d.line+k.length,function(d){var a=d.text;!d.hidden&&a.length>j&&(oa=d,j=a.length,sb=!0,F=!1)}),F&&(ab=!0);ca=Math.min(ca,d.line);tb(400);e=k.length-e-1;ra.push({from:d.line,to:a.line+1,diff:e});if(h.onChange){for(q=0;q<k.length;++q)"string"!=typeof k[q]&&(k[q]=k[q].text);d={from:d,to:a,text:k};if(Oa){for(k= 
     14Oa;k.next;k=k.next);k.next=d}else Oa=d}bb(z(b),z(c),f.from.line<=Math.min(a.line,a.line+e)?f.from.line:f.from.line+e,f.to.line<=Math.min(a.line,a.line+e)?f.to.line:f.to.line+e)}}function da(){var d=s.height*pa()+2*E.offsetTop;return 0.99*d>p.offsetHeight?d:!1}function ba(d){var a=da();u.style.display=a?"block":"none";a?(vc.style.height=qa.style.minHeight=a+"px",u.style.height=p.clientHeight+"px",null!=d&&(u.scrollTop=p.scrollTop=d,ub&&setTimeout(function(){u.scrollTop==d&&(u.scrollTop=d+(d?-1:1), 
     15u.scrollTop=d)},0))):qa.style.minHeight="";vb.style.top=Pa*pa()+"px"}function wc(){oa=g(0);sb=!0;var d=oa.text.length;s.iter(1,s.size,function(a){var k=a.text;!a.hidden&&k.length>d&&(d=k.length,oa=a)});ab=!1}function V(d,a,k){function b(ma){if(M(ma,a))return ma;if(!M(k,ma))return c;var j=ma.line+d.length-(k.line-a.line)-1,e=ma.ch;ma.line==k.line&&(e+=J(d).length-(k.ch-(k.line==a.line?a.ch:0)));return{line:j,ch:e}}var a=z(a),k=k?z(k):a,d=kb(d),c;ha(d,a,k,function(d){c=d;return{from:b(f.from),to:b(f.to)}}); 
     16return c}function R(d,a){ha(kb(d),f.from,f.to,function(d){return"end"==a?{from:d,to:d}:"start"==a?{from:f.from,to:f.from}:{from:f.from,to:d}})}function ha(d,a,k,b){var c=1==d.length?d[0].length+a.ch:J(d).length,b=b({line:a.line+d.length-1,ch:c});pc(a,k,d,b.from,b.to)}function xc(d,a,k){var b=d.line,c=a.line;if(b==c)return g(b).text.slice(d.ch,a.ch);var e=[g(b).text.slice(d.ch)];s.iter(b+1,c,function(d){e.push(d.text)});e.push(g(c).text.slice(0,a.ch));return e.join(k||"\n")}function Sb(d){return xc(f.from, 
     17f.to,d)}function ga(){Ma||Yb.set(h.pollInterval,function(){W();aa&&ga()})}function cb(){function d(){!W()&&!a?(a=!0,Yb.set(60,d)):(Ma=!1,ga())}var a=!1;Ma=!0;Yb.set(20,d)}function W(){if(!aa||Pc(x)||h.readOnly)return!1;var d=x.value;if(d==ia)return!1;wb||yc();la=null;for(var a=0,k=Math.min(ia.length,d.length);a<k&&ia[a]==d[a];)++a;a<ia.length?f.from={line:f.from.line,ch:f.from.ch-(ia.length-a)}:xb&&y(f.from,f.to)&&(f.to={line:f.to.line,ch:Math.min(g(f.to.line).text.length,f.to.ch+(d.length-a))}); 
     18R(d.slice(a),"end");1E3<d.length?x.value=ia="":ia=d;wb||zc();return!0}function yb(d){y(f.from,f.to)?d&&(ia=x.value=""):(ia="",x.value=Sb(),aa&&(d=x,Zb?(d.selectionStart=0,d.selectionEnd=d.value.length):d.select()))}function $(){"nocursor"!=h.readOnly&&x.focus()}function Ac(){var d=sa(f.inverted?f.from:f.to);return{x:h.lineWrapping?Math.min(d.x,E.offsetWidth):d.x,y:d.y,yBot:d.yBot}}function Bc(d,a,k,b){d=Cc(d,a,k,b);null!=d.scrollLeft&&(p.scrollLeft=d.scrollLeft);null!=d.scrollTop&&(u.scrollTop=p.scrollTop= 
     19d.scrollTop)}function Cc(d,a,k,b){var c=E.offsetLeft,e=E.offsetTop,a=a+e,b=b+e,d=d+c,k=k+c,j=p.clientHeight,f=u.scrollTop,g={},i=da()||Infinity,l=a<e+10,e=b+e>i-10;a<f?g.scrollTop=l?0:Math.max(0,a):b>f+j&&(g.scrollTop=(e?i:b)-j);a=p.clientWidth;b=p.scrollLeft;j=h.fixedGutter?Z.clientWidth:0;c=d<j+c+10;d<b+j||c?(c&&(d=0),g.scrollLeft=Math.max(0,d-10-j)):k>a+b-3&&(g.scrollLeft=k+10-a);return g}function Da(d){var a=pa(),k=(null!=d?d:u.scrollTop)-E.offsetTop,d=Math.max(0,Math.floor(k/a)),a=Math.ceil((k+ 
     20p.clientHeight)/a);return{from:$b(s,d),to:$b(s,a)}}function Aa(d,a,k){function b(){var d=ea.firstChild,a=!1;s.iter(H,L,function(k){if(d){if(!k.hidden){var b=Math.round(d.offsetHeight/v)||1;k.height!=b&&(i(k,b),na=a=!0)}d=d.nextSibling}});return a}if(p.clientWidth){var c=Da(k);if(!0!==d&&0==d.length&&c.from>H&&c.to<L)ba(k);else{var e=Math.max(c.from-100,0),j=Math.min(s.size,c.to+100);H<e&&20>e-H&&(e=H);L>j&&20>L-j&&(j=Math.min(s.size,L));if(!0===d)d=[];else{for(var c=[{from:H,to:L,domStart:0}],f=0, 
     21g=d.length||0;f<g;++f){for(var m=d[f],n=[],t=m.diff||0,q=0,x=c.length;q<x;++q){var A=c[q];m.to<=A.from&&m.diff?n.push({from:A.from+t,to:A.to+t,domStart:A.domStart}):m.to<=A.from||m.from>=A.to?n.push(A):(m.from>A.from&&n.push({from:A.from,to:m.from,domStart:A.domStart}),m.to<A.to&&n.push({from:m.to+t,to:A.to+t,domStart:A.domStart+(m.to-A.from)}))}c=n}d=c}for(var B=d,c=d=0;c<B.length;++c)f=B[c],f.from<e&&(f.domStart+=e-f.from,f.from=e),f.to>j&&(f.to=j),f.from>=f.to?B.splice(c--,1):d+=f.to-f.from;if(d== 
     22j-e&&e==H&&j==L)ba(k);else{B.sort(function(d,a){return d.domStart-a.domStart});var v=pa(),d=Z.style.display;ea.style.display="none";c=e;f=j;g=function(d){var a=d.nextSibling;d.parentNode.removeChild(d);return a};if(B.length){for(var m=0,u=ea.firstChild,n=0;n<B.length;++n){for(t=B[n];t.domStart>m;)u=g(u),m++;for(var W=0,t=t.to-t.from;W<t;++W)u=u.nextSibling,m++}for(;u;)u=g(u)}else Ha(ea);var z=B.shift(),u=ea.firstChild,W=c;s.iter(c,f,function(d){z&&z.to==W&&(z=B.shift());if(!z||z.from>W){if(d.hidden)var a= 
     23r("pre");else a=l(d),d.className&&(a.className=d.className),d.bgClassName&&(d=r("pre","\u00a0",d.bgClassName,"position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2"),a=r("div",[d,a],null,"position: relative"));ea.insertBefore(a,u)}else u=u.nextSibling;++W});ea.style.display=Z.style.display="";(c=e!=H||j!=L||Dc!=p.clientHeight+v)&&(Dc=p.clientHeight+v);(e!=H||j!=L&&h.onViewportChange)&&setTimeout(function(){if(h.onViewportChange)h.onViewportChange(C,e,j)});H=e;L=j;Pa=ac(s,e);tb(100); 
     24if(ea.childNodes.length!=L-H)throw Error("BAD PATCH! "+JSON.stringify(B)+" size="+(L-H)+" nodes="+ea.childNodes.length);h.lineWrapping&&b();Z.style.display=d;(c||na)&&wa()&&h.lineWrapping&&b()&&wa();ba(k);Ea();if(!a&&h.onUpdate)h.onUpdate(C);return!0}}}else H=L=Pa=0}function wa(){if(h.gutter||h.lineNumbers){var d=vb.offsetHeight,a=p.clientHeight;Z.style.height=(2>d-a?a:d)+"px";var k=document.createDocumentFragment(),b=H,c;s.iter(H,Math.max(L,H+1),function(d){if(d.hidden)k.appendChild(r("pre"));else{var a= 
     25d.gutterMarker,Y=h.lineNumbers?h.lineNumberFormatter(b+h.firstLineNumber):null;a&&a.text?Y=a.text.replace("%N%",null!=Y?Y:""):null==Y&&(Y="\u00a0");var e=k.appendChild(r("pre",null,a&&a.style));e.innerHTML=Y;for(Y=1;Y<d.height;++Y)e.appendChild(r("br")),e.appendChild(document.createTextNode("\u00a0"));a||(c=b)}++b});Z.style.display="none";Ha(Qa).appendChild(k);if(null!=c&&h.lineNumbers){for(var d=Qa.childNodes[c-H],a=String(s.size).length,e=d.firstChild.textContent||d.firstChild.innerText||d.firstChild.nodeValue|| 
     26"",f="";e.length+f.length<a;)f+="\u00a0";f&&d.insertBefore(document.createTextNode(f),d.firstChild)}Z.style.display="";d=2<Math.abs((parseInt(E.style.marginLeft)||0)-Z.offsetWidth);E.style.marginLeft=Z.offsetWidth+"px";na=!1;return d}}function Ea(){var d=y(f.from,f.to),a=sa(f.from,!0),b=d?a:sa(f.to,!0),c=f.inverted?a:b,e=pa(),g=Ra(X),j=Ra(ea);Ia.style.top=Math.max(0,Math.min(p.offsetHeight,c.y+j.top-g.top))+"px";Ia.style.left=Math.max(0,Math.min(p.offsetWidth,c.x+j.left-g.left))+"px";if(d)U.style.top= 
     27c.y+"px",U.style.left=(h.lineWrapping?Math.min(c.x,E.offsetWidth):c.x)+"px",U.style.display="",zb.style.display="none";else{var d=a.y==b.y,i=document.createDocumentFragment(),l=E.clientWidth||E.offsetWidth,c=E.clientHeight||E.offsetHeight,g=function(d,a,b,k){i.appendChild(r("div",null,"CodeMirror-selected","position: absolute; left: "+d+"px; top: "+a+"px; "+(Qc?"width: "+(!b?l:l-b-d)+"px":"right: "+b+"px")+"; height: "+k+"px"))};f.from.ch&&0<=a.y&&g(a.x,a.y,d?l-b.x:0,e);a=Math.max(0,a.y+(f.from.ch? 
     28e:0));j=Math.min(b.y,c)-a;j>0.2*e&&g(0,a,0,j);(!d||!f.from.ch)&&b.y<c-0.5*e&&g(0,b.y,l-b.x,e);Ha(zb).appendChild(i);U.style.display="none";zb.style.display=""}}function Ka(d){la=d?la||(f.inverted?f.to:f.from):null}function ka(d,a){var b=la&&z(la);b&&(M(b,d)?d=b:M(a,b)&&(a=b));bb(d,a);Ab=!0}function bb(d,a,b,c){Bb=null;null==b&&(b=f.from.line,c=f.to.line);if(!y(f.from,d)||!y(f.to,a)){if(M(a,d))var e=a,a=d,d=e;d.line!=b&&((b=ua(d,b,f.from.ch))?d=b:bc(d.line,!1));a.line!=c&&(a=ua(a,c,f.to.ch));y(d,a)? 
     29f.inverted=!1:y(d,f.to)?f.inverted=!1:y(a,f.from)&&(f.inverted=!0);if(h.autoClearEmptyLines&&y(f.from,f.to)&&(f.inverted?d:a).line!=f.from.line&&f.from.line<s.size){var F=g(f.from.line);/^\s+$/.test(F.text)&&setTimeout(m(function(){if(F.parent&&/^\s+$/.test(F.text)){var d=La(F);V("",{line:d,ch:0},{line:d,ch:F.text.length})}},10))}f.from=d;f.to=a;Ba=!0}}function ua(d,a,b){function c(a){for(var Y=d.line+a,e=1==a?s.size:-1;Y!=e;){var ma=g(Y);if(!ma.hidden){a=d.ch;if(f||a>b||a>ma.text.length)a=ma.text.length; 
     30return{line:Y,ch:a}}Y+=a}}var e=g(d.line),f=d.ch==e.text.length&&d.ch!=b;return!e.hidden?d:d.line>=a?c(1)||c(-1):c(-1)||c(1)}function Ca(d,a,b){d=z({line:d,ch:a||0});(b?ka:bb)(d,d)}function Cb(d){return Math.max(0,Math.min(d,s.size-1))}function z(d){if(0>d.line)return{line:0,ch:0};if(d.line>=s.size)return{line:s.size-1,ch:g(s.size-1).text.length};var a=d.ch,b=g(d.line).text.length;return null==a||a>b?{line:d.line,ch:b}:0>a?{line:d.line,ch:0}:d}function Ja(d,a){function b(a){if(h==(0>d?0:j.text.length)){if(a= 
     31!a)a:{for(var a=e+d,k=0>d?-1:s.size;a!=k;a+=d){var c=g(a);if(!c.hidden){e=a;j=c;a=!0;break a}}a=void 0}if(a)h=0>d?j.text.length:0;else return!1}else h+=d;return!0}var c=f.inverted?f.from:f.to,e=c.line,h=c.ch,j=g(e);if("char"==a)b();else if("column"==a)b(!0);else if("word"==a)for(c=!1;!(0>d)||b();){if(Db(j.text.charAt(h)))c=!0;else if(c){0>d&&(d=1,b());break}if(0<d&&!b())break}return{line:e,ch:h}}function Va(d){var a=g(d.line).text,b=d.ch,c=d.ch;if(a){!1===d.after||c==a.length?--b:++c;for(var e=a.charAt(b), 
     32e=Db(e)?Db:/\s/.test(e)?function(d){return/\s/.test(d)}:function(d){return!/\s/.test(d)&&!Db(d)};0<b&&e(a.charAt(b-1));)--b;for(;c<a.length&&e(a.charAt(c));)++c}return{from:{line:d.line,ch:b},to:{line:d.line,ch:c}}}function Eb(d,a){a||(a="add");if("smart"==a)if(Q.indent)var b=Xa(d);else a="prev";var c=g(d),e=c.indentation(h.tabSize),f=c.text.match(/^\s*/)[0],j;"smart"==a&&(j=Q.indent(b,c.text.slice(f.length),c.text),j==rc&&(a="prev"));"prev"==a?j=d?g(d-1).indentation(h.tabSize):0:"add"==a?j=e+h.indentUnit: 
     33"subtract"==a&&(j=e-h.indentUnit);j=Math.max(0,j);b="";c=0;if(h.indentWithTabs)for(e=Math.floor(j/h.tabSize);e;--e)c+=h.tabSize,b+="\t";c<j&&(b+=Ec(j-c));b!=f&&V(b,{line:d,ch:0},{line:d,ch:f.length})}function gb(){Q=n.getMode(h,h.mode);s.iter(0,s.size,function(d){d.stateAfter=null});ca=0;tb(100)}function Qb(){if(h.lineWrapping){X.className+=" CodeMirror-wrap";var d=p.clientWidth/Xb()-3;s.iter(0,s.size,function(a){if(!a.hidden){var b=Math.ceil(a.text.length/d)||1;1!=b&&i(a,b)}});E.style.minWidth=Fb.style.left= 
     34""}else X.className=X.className.replace(" CodeMirror-wrap",""),wc(),s.iter(0,s.size,function(d){1!=d.height&&!d.hidden&&i(d,1)});ra.push({from:0,to:s.size})}function hb(){p.className=p.className.replace(/\s*cm-s-\S+/g,"")+h.theme.replace(/(^|\s)\s*/g," cm-s-")}function ib(){var d=fa[h.keyMap].style;X.className=X.className.replace(/\s*cm-keymap-\S+/g,"")+(d?" cm-keymap-"+d:"")}function Gb(d,a){this.lines=[];this.type=d;a&&(this.style=a)}function cc(d,a,b,c){var d=z(d),a=z(a),e=new Gb("range",b);if(c)for(var f in c)c.hasOwnProperty(f)&& 
     35(e[f]=c[f]);var g=d.line;s.iter(g,a.line+1,function(b){var c={from:g==d.line?d.ch:null,to:g==a.line?a.ch:null,marker:e};(b.markedSpans||(b.markedSpans=[])).push(c);e.lines.push(b);++g});ra.push({from:d.line,to:a.line+1});return e}function Fc(a,b){var c=a,e=a;"number"==typeof a?e=g(Cb(a)):c=La(a);if(null!=c&&b(e,c))ra.push({from:c,to:c+1});else return null;return e}function bc(a,b){return Fc(a,function(a,d){if(a.hidden!=b){a.hidden=b;h.lineWrapping||(b&&a.text.length==oa.text.length?ab=!0:!b&&a.text.length> 
     36oa.text.length&&(oa=a,ab=!1));i(a,b?0:1);var c=f.from.line,e=f.to.line;if(b&&(c==d||e==d)){c=c==d?ua({line:c,ch:0},c,0):f.from;e=e==d?ua({line:e,ch:0},e,0):f.to;if(!e)return;bb(c,e)}return na=!0}})}function dc(a,b){if(0==b)return{top:0,left:0};h.lineWrapping&&b<a.text.length&&Hb.test(a.text.slice(b-1,b+1));var c=l(a,b);Ha(Sa).appendChild(c);var c=c.anchor,e=c.offsetTop,f=c.offsetLeft;Ga&&(0==e&&0==f)&&(e=r("span","x"),c.parentNode.insertBefore(e,c.nextSibling),e=e.offsetTop);return{top:e,left:f}} 
     37function sa(a,b){var c,e=pa(),f=e*(ac(s,a.line)-(b?Pa:0));if(0==a.ch)c=0;else{var i=dc(g(a.line),a.ch);c=i.left;h.lineWrapping&&(f+=Math.max(0,i.top))}return{x:c,y:f,yBot:f+e}}function Ib(a,b){function c(a){a=dc(l,a);if(n){var d=Math.round(a.top/e);t=d!=A;return Math.max(0,a.left+(d-A)*p.clientWidth)}return a.left}var e=pa(),f=Xb(),i=Pa+Math.floor(b/e);if(0>i)return{line:0,ch:0};var j=$b(s,i);if(j>=s.size)return{line:s.size-1,ch:g(s.size-1).text.length};var l=g(j),m=l.text,n=h.lineWrapping,A=n?i- 
     38ac(s,j):0;if(0>=a&&0==A)return{line:j,ch:0};for(var t=!1,q=i=0,m=m.length,r,f=Math.min(m,Math.ceil((a+0.9*A*p.clientWidth)/f));;){var u=c(f);if(u<=a&&f<m)f=Math.min(m,Math.ceil(1.2*f));else{r=u;m=f;break}}if(a>r)return{line:j,ch:m};f=Math.floor(0.8*m);u=c(f);u<a&&(i=f,q=u);for(;;){if(1>=m-i)return r=a-q<r-a,{line:j,ch:r?i:m,after:r};f=Math.ceil((i+m)/2);u=c(f);u>a?(m=f,r=u,t&&(r+=1E3)):(i=f,q=u)}}function pa(){if(null==Ta){Ta=r("pre");for(var a=0;49>a;++a)Ta.appendChild(document.createTextNode("x")), 
     39Ta.appendChild(r("br"));Ta.appendChild(document.createTextNode("x"))}a=ea.clientHeight;if(a==Gc)return ec;Gc=a;a=Ta.cloneNode(!0);Ha(Sa).appendChild(a);ec=Sa.firstChild.offsetHeight/50||1;Ha(Sa);return ec}function Xb(){if(p.clientWidth==Hc)return Ic;Hc=p.clientWidth;var a=r("span","x"),b=r("pre",[a]);Ha(Sa).appendChild(b);return Ic=a.offsetWidth||10}function Ya(a,b){var c=Ra(p,!0),e,f;try{e=a.clientX,f=a.clientY}catch(g){return null}if(!b&&(e-c.left>p.clientWidth||f-c.top>p.clientHeight))return null; 
     40c=Ra(E,!0);return Ib(e-c.left,f-c.top)}function Jc(a){function b(){Ia.style.position="relative";x.style.cssText=g;fc&&(u.scrollTop=e);ga();if(null!=x.selectionStart){clearTimeout(gc);var a=x.value=" "+(y(f.from,f.to)?"":x.value),d=0;ia=" ";x.selectionStart=1;x.selectionEnd=a.length;gc=setTimeout(function Oc(){" "==ia&&0==x.selectionStart?m(Tb.selectAll)(C):10>d++?gc=setTimeout(Oc,500):yb()},200)}}var c=Ya(a),e=u.scrollTop;if(c&&!ya){(y(f.from,f.to)||M(c,f.from)||!M(c,f.to))&&m(Ca)(c.line,c.ch);var g= 
     41x.style.cssText;Ia.style.position="absolute";x.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: white; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";$();yb(!0);y(f.from,f.to)&&(x.value=ia=" ");if(db){jb(a);var h=v(window,"mouseup",function(){h();setTimeout(b,20)},!0)}else setTimeout(b,50)}}function qb(){clearInterval(Wb);var a=!0;U.style.visibility="";Wb=setInterval(function(){U.style.visibility= 
     42(a=!a)?"":"hidden"},h.cursorBlinkRate)}function Kc(a){var b=f.inverted?f.from:f.to,c=g(b.line),e=b.ch-1,h=0<=e&&hc[c.text.charAt(e)]||hc[c.text.charAt(++e)];if(h){h.charAt(0);for(var i=(h=">"==h.charAt(1))?1:-1,j=c.styles,l=e+1,p=0,n=j.length;p<n;p+=2)if(0>=(l-=j[p].length)){var A=j[p+1];break}j=[c.text.charAt(e)];l=/[(){}[\]]/;p=b.line;for(n=h?Math.min(p+100,s.size):Math.max(-1,p-100);p!=n;p+=i){var c=g(p),t=p==b.line,q;a:{q=t&&h?e+1:0;t=t&&!h?e:c.text.length;if(c.text)for(var r=c.styles,c=h?0:c.text.length- 
     431,u=void 0,B=h?0:r.length-2,x=h?r.length:-2;B!=x;B+=2*i){var v=r[B];if(r[B+1]!=A)c+=i*v.length;else for(var W=h?0:v.length-1,z=h?v.length:-1;W!=z;W+=i,c+=i)if(c>=q&&c<t&&l.test(u=v.charAt(W))){var C=hc[u];if(">"==C.charAt(1)==h)j.push(u);else if(j.pop()!=C.charAt(0)){q={pos:c,match:!1};break a}else if(!j.length){q={pos:c,match:!0};break a}}}q=void 0}if(q)break}q||(q={pos:null,match:!1});var A=q.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",E=cc({line:b.line,ch:e},{line:b.line, 
     44ch:e+1},A),$=null!=q.pos&&cc({line:p,ch:q.pos},{line:p,ch:q.pos+1},A),b=m(function(){E.clear();$&&$.clear()});a?setTimeout(b,800):za=b}}function Xa(a){var b;a:{for(var c,e,f=a,i=a-40;f>i;--f){if(0==f){b=0;break a}var j=g(f-1);if(j.stateAfter){b=f;break a}j=j.indentation(h.tabSize);if(null==e||c>j)e=f-1,c=j}b=e}var l=b&&g(b-1).stateAfter,l=l?Ua(Q,l):Lc(Q);s.iter(b,a,function(c){c.process(Q,l,h.tabSize);c.stateAfter=b==a-1||0==b%5?Ua(Q,l):null});return l}function nc(){if(!(ca>=L)){var a=+new Date+h.workTime, 
     45b=Ua(Q,Xa(ca)),c=ca;s.iter(ca,L,function(c){ca>=H?(c.highlight(Q,b,h.tabSize),c.stateAfter=Ua(Q,b)):(c.process(Q,b,h.tabSize),c.stateAfter=0==ca%5?Ua(Q,b):null);++ca;if(+new Date>a)return tb(h.workDelay),!0});L>c&&ca>=H&&m(function(){ra.push({from:c,to:ca})})()}}function tb(a){ca<L&&oc.set(a,nc)}function yc(){xa=Ab=Oa=null;ra=[];Ba=!1;$a=[]}function zc(){ab&&wc();if(sb&&!h.lineWrapping){var a=Fb.offsetWidth,b=dc(oa,oa.text.length).left;ic||(Fb.style.left=b+"px",E.style.minWidth=b+a+"px");sb=!1}var c, 
     46e;Ba&&(a=Ac(),c=Cc(a.x,a.y,a.x,a.yBot));if(ra.length||c&&null!=c.scrollTop)e=Aa(ra,!0,c&&c.scrollTop);e||(Ba&&Ea(),na&&wa());if(c&&(a=Ac(),Bc(a.x,a.y,a.x,a.yBot),aa)){c=qa.getBoundingClientRect();b=null;if(0>a.y+c.top)b=!0;else if(a.y+c.top+pa()>(window.innerHeight||document.documentElement.clientHeight))b=!1;if(null!=b){if(c="none"==U.style.display)U.style.display="",U.style.left=a.x+"px",U.style.top=a.y-Pa+"px";U.scrollIntoView(b);c&&(U.style.display="none")}}Ba&&qb();aa&&(!0===xa||!1!==xa&&Ba)&& 
     47yb(Ab);Ba&&h.matchBrackets&&setTimeout(m(function(){za&&(za(),za=null);y(f.from,f.to)&&Kc(!1)}),20);b=Ba;a=$a;if(Oa&&h.onChange&&C)h.onChange(C,Oa);if(b&&h.onCursorActivity)h.onCursorActivity(C);for(b=0;b<a.length;++b)a[b](C);if(e&&h.onUpdate)h.onUpdate(C)}function m(a){return function(){wb++||yc();try{var b=a.apply(this,arguments)}finally{--wb||zc()}return b}}function qc(a){O.startCompound();try{return a()}finally{O.endCompound()}}var h={},jc=n.defaults,eb;for(eb in jc)jc.hasOwnProperty(eb)&&(h[eb]= 
     48(b&&b.hasOwnProperty(eb)?b:jc)[eb]);var x=r("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em");x.setAttribute("wrap","off");x.setAttribute("autocorrect","off");x.setAttribute("autocapitalize","off");var Ia=r("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),vc=r("div",null,"CodeMirror-scrollbar-inner"),u=r("div",[vc],"CodeMirror-scrollbar"),ea=r("div"),zb=r("div",null,null,"position: relative; z-index: -1"),U=r("pre","\u00a0","CodeMirror-cursor"), 
     49Fb=r("pre","\u00a0","CodeMirror-cursor","visibility: hidden"),Sa=r("div",null,null,"position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;"),E=r("div",[Sa,U,Fb,zb,ea],null,"position: relative; z-index: 0"),Qa=r("div",null,"CodeMirror-gutter-text"),Z=r("div",[Qa],"CodeMirror-gutter"),vb=r("div",[Z,r("div",[E],"CodeMirror-lines")],null,"position: relative"),qa=r("div",[vb],null,"position: relative"),p=r("div",[qa],"CodeMirror-scroll");p.setAttribute("tabIndex","-1");var X= 
     50r("div",[Ia,u,p],"CodeMirror"+(h.lineWrapping?" CodeMirror-wrap":""));a.appendChild?a.appendChild(X):a(X);hb();ib();Zb&&(x.style.width="0px");ub||(p.draggable=!0);E.style.outline="none";null!=h.tabindex&&(x.tabIndex=h.tabindex);h.autofocus&&$();!h.gutter&&!h.lineNumbers&&(Z.style.display="none");kc&&(Ia.style.height="1px",Ia.style.position="absolute");Rc?(u.style.zIndex=-2,u.style.visibility="hidden"):ic&&(u.style.minWidth="18px");var Yb=new lc,oc=new lc,Wb,Q,s=new Jb([new Kb([new Na("")])]),ca=0, 
     51aa;gb();var f={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},la,Lb,Mb,ta=0,lb,xb=!1,nb=!1,xa,Ab,ra,Oa,Ba,na,$a,Pa=0,H=0,L=0,Dc=0,za,oa=g(0),ab=!1,sb=!0,Ma=!1,Bb=null;m(function(){A(h.value||"");xa=!1})();var O=new Nb;v(p,"mousedown",m(function(a){function b(c){ub&&(p.draggable=!1);lb=!1;A();t();10>Math.abs(a.clientX-c.clientX)+Math.abs(a.clientY-c.clientY)&&(G(c),Ca(j.line,j.ch,!0),$())}function c(a){if("single"==l)ka(j,a);else if("double"==l){var d=Va(a);M(a,q)?ka(d.from,r):ka(q,d.to)}else"triple"== 
     52l&&(M(a,q)?ka(r,z({line:a.line,ch:0})):ka(q,z({line:a.line+1,ch:0})))}function e(a){var d=Ya(a,!0);if(d&&!y(d,n)){aa||S();n=d;c(d);xa=!1;var b=Da();if(d.line>=b.to||d.line<b.from)s=setTimeout(m(function(){e(a)}),150)}}function g(a){clearTimeout(s);var d=Ya(a);d&&c(d);G(a);$();xa=!0;u();A()}Ka(I(a,"shiftKey"));for(var i=a.target||a.srcElement;i!=X;i=i.parentNode)if(i.parentNode==qa&&i!=vb)return;for(i=a.target||a.srcElement;i!=X;i=i.parentNode)if(i.parentNode==Qa){if(h.onGutterClick)h.onGutterClick(C, 
     53Ob(Qa.childNodes,i)+H,a);return G(a)}var j=Ya(a);switch(Mc(a)){case 3:db&&Jc(a);return;case 2:j&&Ca(j.line,j.ch,!0);setTimeout($,20);G(a);return}if(j){aa||S();var i=+new Date,l="single";Mb&&Mb.time>i-400&&y(Mb.pos,j)?(l="triple",G(a),setTimeout($,20),i=j.line,ka({line:i,ch:0},z({line:i+1,ch:0}))):Lb&&Lb.time>i-400&&y(Lb.pos,j)?(l="double",Mb={time:i,pos:j},G(a),i=Va(j),ka(i.from,i.to)):Lb={time:i,pos:j};var n=j,s;if(h.dragDrop&&mc&&!h.readOnly&&!y(f.from,f.to)&&!M(j,f.from)&&!M(f.to,j)&&"single"== 
     54l){ub&&(p.draggable=!0);var A=v(document,"mouseup",m(b),!0),t=v(p,"drop",m(b),!0);lb=!0;p.dragDrop&&p.dragDrop()}else{G(a);"single"==l&&Ca(j.line,j.ch,!0);var q=f.from,r=f.to,u=v(document,"mousemove",m(function(a){clearTimeout(s);G(a);!Ga&&!Mc(a)?g(a):e(a)}),!0),A=v(document,"mouseup",m(g),!0)}}else(a.target||a.srcElement)==p&&G(a)}));v(p,"dblclick",m(function(a){for(var b=a.target||a.srcElement;b!=X;b=b.parentNode)if(b.parentNode==Qa)return G(a);G(a)}));v(E,"selectstart",G);db||v(p,"contextmenu", 
     55Jc);v(p,"scroll",function(){h.fixedGutter&&Z.style.left!=p.scrollLeft+"px"&&(Z.style.left=p.scrollLeft+"px");p.scrollTop!=ta&&(ta=p.scrollTop,u.scrollTop!=ta&&(u.scrollTop=ta),Aa([]));if(h.onScroll)h.onScroll(C)});v(u,"scroll",function(){u.scrollTop!=ta&&(ta=p.scrollTop=u.scrollTop,Aa([]))});v(u,"mousedown",function(){aa&&setTimeout($,0)});var Sc=v(window,"resize",function(){X.parentNode?Aa(!0):Sc()},!0);v(x,"keyup",m(function(a){if(!h.onKeyEvent||!h.onKeyEvent(C,Wa(a)))16==I(a,"keyCode")&&(la=null)})); 
     56v(x,"input",cb);v(x,"keydown",m(uc));v(x,"keypress",m(function(a){Ma&&W();if(!h.onKeyEvent||!h.onKeyEvent(C,Wa(a))){var b=I(a,"keyCode"),c=I(a,"charCode");if(ya&&b==Vb)Vb=null,G(a);else if(!(ya&&(!a.which||10>a.which)||kc)||!sc(a)){b=String.fromCharCode(null==c?b:c);h.electricChars&&Q.electricChars&&h.smartIndent&&!h.readOnly&&-1<Q.electricChars.indexOf(b)&&setTimeout(m(function(){Eb(f.to.line,"smart")}),75);if(b=pb("'"+b+"'",h.extraKeys,h.keyMap,function(a){return mb(a,!0)}))G(a),qb();b||cb()}}})); 
     57v(x,"focus",S);v(x,"blur",N);h.dragDrop&&(v(p,"dragstart",Rb),v(p,"dragenter",c),v(p,"dragover",c),v(p,"drop",m(w)));v(p,"paste",function(){$();cb()});v(x,"paste",cb);v(x,"cut",m(function(){h.readOnly||R("")}));kc&&v(qa,"mouseup",function(){document.activeElement==x&&x.blur();$()});var Nc;try{Nc=document.activeElement==x}catch(Tc){}Nc||h.autofocus?setTimeout(S,20):N();var C=X.CodeMirror={getValue:function(a){var b=[];s.iter(0,s.size,function(a){b.push(a.text)});return b.join(a||"\n")},setValue:m(A), 
     58getSelection:Sb,replaceSelection:m(R),focus:function(){window.focus();$();S();cb()},setOption:function(a,b){var c=h[a];h[a]=b;"mode"==a||"indentUnit"==a?gb():"readOnly"==a&&"nocursor"==b?(N(),x.blur()):"readOnly"==a&&!b?yb(!0):"theme"==a?hb():"lineWrapping"==a&&c!=b?m(Qb)():"tabSize"==a?Aa(!0):"keyMap"==a&&ib();if("lineNumbers"==a||"gutter"==a||"firstLineNumber"==a||"theme"==a||"lineNumberFormatter"==a)c=h.gutter||h.lineNumbers,Z.style.display=c?"":"none",c?na=!0:ea.parentNode.style.marginLeft=0, 
     59Aa(!0)},getOption:function(a){return h[a]},getMode:function(){return Q},undo:m(function(){P(O.done,O.undone)}),redo:m(function(){P(O.undone,O.done)}),indentLine:m(function(a,b){"string"!=typeof b&&(b=null==b?h.smartIndent?"smart":"prev":b?"add":"subtract");e(a)&&Eb(a,b)}),indentSelection:m(function(a){if(y(f.from,f.to))return Eb(f.from.line,a);for(var b=f.to.line-(f.to.ch?0:1),c=f.from.line;c<=b;++c)Eb(c,a)}),historySize:function(){return{undo:O.done.length,redo:O.undone.length}},clearHistory:function(){O= 
     60new Nb},setHistory:function(a){O=new Nb;O.done=a.done;O.undone=a.undone},getHistory:function(){function a(d){for(var b=0,c=[],e;b<d.length;++b){c.push(e=[]);for(var f=0,g=d[b];f<g.length;++f){var h=[],i=g[f];e.push({start:i.start,added:i.added,old:h});for(var l=0;l<i.old.length;++l)h.push(T(i.old[l]))}}return c}return{done:a(O.done),undone:a(O.undone)}},matchBrackets:m(function(){Kc(!0)}),getTokenAt:m(function(a){a=z(a);return g(a.line).getTokenAt(Q,Xa(a.line),h.tabSize,a.ch)}),getStateAfter:function(a){a= 
     61Cb(null==a?s.size-1:a);return Xa(a+1)},cursorCoords:function(a,b){null==a&&(a=f.inverted);return this.charCoords(a?f.from:f.to,b)},charCoords:function(a,b){a=z(a);if("local"==b)return sa(a,!1);if("div"==b)return sa(a,!0);var c=sa(a,!0),e=Ra(E);return{x:e.left+c.x,y:e.top+c.y,yBot:e.top+c.yBot}},coordsChar:function(a){var b=Ra(E);return Ib(a.x-b.left,a.y-b.top)},markText:m(cc),setBookmark:function(a){var a=z(a),b=new Gb("bookmark"),c=g(a.line),a={from:a.ch,to:a.ch,marker:b};(c.markedSpans||(c.markedSpans= 
     62[])).push(a);b.lines.push(c);return b},findMarksAt:function(a){var a=z(a),b=[],c=g(a.line).markedSpans;if(c)for(var e=0;e<c.length;++e){var f=c[e];(null==f.from||f.from<=a.ch)&&(null==f.to||f.to>=a.ch)&&b.push(f.marker)}return b},setMarker:m(function(a,b,c){"number"==typeof a&&(a=g(Cb(a)));a.gutterMarker={text:b,style:c};na=!0;return a}),clearMarker:m(function(a){"number"==typeof a&&(a=g(Cb(a)));a.gutterMarker=null;na=!0}),setLineClass:m(function(a,b,c){return Fc(a,function(a){if(a.className!=b|| 
     63a.bgClassName!=c)return a.className=b,a.bgClassName=c,!0})}),hideLine:m(function(a){return bc(a,!0)}),showLine:m(function(a){return bc(a,!1)}),onDeleteLine:function(a,b){if("number"==typeof a){if(!e(a))return null;a=g(a)}(a.handlers||(a.handlers=[])).push(b);return a},lineInfo:function(a){if("number"==typeof a){if(!e(a))return null;var b=a,a=g(a);if(!a)return null}else if(b=La(a),null==b)return null;var c=a.gutterMarker;return{line:b,handle:a,text:a.text,markerText:c&&c.text,markerClass:c&&c.style, 
     64lineClass:a.className,bgClass:a.bgClassName}},getViewport:function(){return{from:H,to:L}},addWidget:function(a,b,c,e,f){var a=sa(z(a)),g=a.yBot,h=a.x;b.style.position="absolute";qa.appendChild(b);if("over"==e)g=a.y;else if("near"==e){var e=Math.max(p.offsetHeight,s.height*pa()),i=Math.max(qa.clientWidth,E.clientWidth)-E.offsetLeft;a.yBot+b.offsetHeight>e&&a.y>b.offsetHeight&&(g=a.y-b.offsetHeight);h+b.offsetWidth>i&&(h=i-b.offsetWidth)}b.style.top=g+E.offsetTop+"px";b.style.left=b.style.right=""; 
     65"right"==f?(h=qa.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==f?h=0:"middle"==f&&(h=(qa.clientWidth-b.offsetWidth)/2),b.style.left=h+E.offsetLeft+"px");c&&Bc(h,g,h+b.offsetWidth,g+b.offsetHeight)},lineCount:function(){return s.size},clipPos:z,getCursor:function(a){null==a&&(a=f.inverted);return{line:(a?f.from:f.to).line,ch:(a?f.from:f.to).ch}},somethingSelected:function(){return!y(f.from,f.to)},setCursor:m(function(a,b,c){null==b&&"number"==typeof a.line?Ca(a.line,a.ch,c):Ca(a,b,c)}),setSelection:m(function(a, 
     66b,c){(c?ka:bb)(z(a),z(b||a))}),getLine:function(a){if(e(a))return g(a).text},getLineHandle:function(a){if(e(a))return g(a)},setLine:m(function(a,b){e(a)&&V(b,{line:a,ch:0},{line:a,ch:g(a).text.length})}),removeLine:m(function(a){e(a)&&V("",{line:a,ch:0},z({line:a+1,ch:0}))}),replaceRange:m(V),getRange:function(a,b,c){return xc(z(a),z(b),c)},triggerOnKeyDown:m(uc),execCommand:function(a){return Tb[a](C)},moveH:m(function(a,b){var c=0>a?f.from:f.to;if(la||y(f.from,f.to))c=Ja(a,b);Ca(c.line,c.ch,!0)}), 
     67deleteH:m(function(a,b){y(f.from,f.to)?0>a?V("",Ja(a,b),f.to):V("",f.from,Ja(a,b)):V("",f.from,f.to);Ab=!0}),moveV:m(function(a,b){var c=sa(f.inverted?f.from:f.to,!0);null!=Bb&&(c.x=Bb);if("page"==b)var e=Math.min(p.clientHeight,window.innerHeight||document.documentElement.clientHeight),e=Ib(c.x,c.y+e*a);else"line"==b&&(e=pa(),e=Ib(c.x,c.y+0.5*e+a*e));"page"==b&&(u.scrollTop+=sa(e,!0).y-c.y);Ca(e.line,e.ch,!0);Bb=c.x}),toggleOverwrite:function(){xb?(xb=!1,U.className=U.className.replace(" CodeMirror-overwrite", 
     68"")):(xb=!0,U.className+=" CodeMirror-overwrite")},posFromIndex:function(a){var b=0,c;s.iter(0,s.size,function(e){e=e.text.length+1;if(e>a)return c=a,!0;a-=e;++b});return z({line:b,ch:c})},indexFromPos:function(a){if(0>a.line||0>a.ch)return 0;var b=a.ch;s.iter(0,a.line,function(a){b+=a.text.length+1});return b},scrollTo:function(a,b){null!=a&&(p.scrollLeft=a);null!=b&&(u.scrollTop=p.scrollTop=b);Aa([])},getScrollInfo:function(){return{x:p.scrollLeft,y:u.scrollTop,height:u.scrollHeight,width:p.scrollWidth}}, 
     69setSize:function(a,b){function c(a){a=String(a);return/^\d+$/.test(a)?a+"px":a}null!=a&&(X.style.width=c(a));null!=b&&(p.style.height=c(b));C.refresh()},operation:function(a){return m(a)()},compoundChange:function(a){return qc(a)},refresh:function(){Aa(!0,null,ta);u.scrollHeight>ta&&(u.scrollTop=ta)},getInputField:function(){return x},getWrapperElement:function(){return X},getScrollerElement:function(){return p},getGutterElement:function(){return Z}},tc,Vb=null,ia="";Gb.prototype.clear=m(function(){for(var a= 
     70Infinity,b=-Infinity,c=0;c<this.lines.length;++c){var e=this.lines[c],f=rb(e.markedSpans,this,!0);if(null!=f.from||null!=f.to)e=La(e),a=Math.min(a,e),b=Math.max(b,e)}Infinity!=a&&ra.push({from:a,to:b+1});this.lines.length=0});Gb.prototype.find=function(){for(var a,b,c=0;c<this.lines.length;++c){var e=this.lines[c],f=rb(e.markedSpans,this);if(null!=f.from||null!=f.to)e=La(e),null!=f.from&&(a={line:e,ch:f.from}),null!=f.to&&(b={line:e,ch:f.to})}return"bookmark"==this.type?a:a&&{from:a,to:b}};var ec, 
     71Gc,Ta,Ic,Hc=0,gc,hc={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},wb=0,fb;for(fb in Pb)Pb.propertyIsEnumerable(fb)&&!C.propertyIsEnumerable(fb)&&(C[fb]=Pb[fb]);return C}function Ub(a){return"string"==typeof a?fa[a]:a}function pb(a,b,c,e,g){function i(b){var b=Ub(b),c=b[a];if(!1===c)return g&&g(),!0;if(null!=c&&e(c))return!0;if(b.nofallthrough)return g&&g(),!0;b=b.fallthrough;if(null==b)return!1;if("[object Array]"!=Object.prototype.toString.call(b))return i(b);for(var c=0,n=b.length;c<n;++c)if(i(b[c]))return!0; 
     72return!1}return b&&i(b)?!0:i(c)}function Ua(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},e;for(e in b){var g=b[e];g instanceof Array&&(g=g.concat([]));c[e]=g}return c}function Lc(a,b,c){return a.startState?a.startState(b,c):!0}function Da(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8}function rb(a,b,c){if(a)for(var e=0;e<a.length;++e){var g=a[e];if(g.marker==b)return c&&a.splice(e,1),g}}function T(a){return"string"==typeof a?a:a.text}function K(a){return"string"== 
     73typeof a?null:a.markedSpans}function Za(a,b){return b?{text:a,markedSpans:b}:a}function gb(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c){var e=b[c].marker.lines,g=Ob(e,a);e.splice(g,1)}a.markedSpans=null}}function Qb(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.lines.push(a);a.markedSpans=b}}function Na(a,b){this.text=a;this.height=1;Qb(this,b)}function Kb(a){this.lines=a;this.parent=null;for(var b=0,c=a.length,e=0;b<c;++b)a[b].parent=this,e+=a[b].height;this.height=e}function Jb(a){this.children= 
     74a;for(var b=0,c=0,e=0,g=a.length;e<g;++e){var i=a[e],b=b+i.chunkSize(),c=c+i.height;i.parent=this}this.size=b;this.height=c;this.parent=null}function La(a){if(null==a.parent)return null;for(var b=a.parent,a=Ob(b.lines,a),c=b.parent;c;b=c,c=c.parent)for(var e=0;c.children[e]!=b;++e)a+=c.children[e].chunkSize();return a}function $b(a,b){var c=0;a:do{for(var e=0,g=a.children.length;e<g;++e){var i=a.children[e],l=i.height;if(b<l){a=i;continue a}b-=l;c+=i.chunkSize()}return c}while(!a.lines);e=0;for(g= 
     75a.lines.length;e<g;++e){i=a.lines[e].height;if(b<i)break;b-=i}return c+e}function ac(a,b){var c=0;a:do{for(var e=0,g=a.children.length;e<g;++e){var i=a.children[e],l=i.chunkSize();if(b<l){a=i;continue a}b-=l;c+=i.height}return c}while(!a.lines);for(e=0;e<b;++e)c+=a.lines[e].height;return c}function Nb(){this.time=0;this.done=[];this.undone=[];this.compound=0;this.closed=!1}function nc(){jb(this)}function Wa(a){a.stop||(a.stop=nc);return a}function G(a){a.preventDefault?a.preventDefault():a.returnValue= 
     76!1}function hb(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function jb(a){G(a);hb(a)}function Mc(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));ob&&(a.ctrlKey&&1==b)&&(b=3);return b}function I(a,b){return a.override&&a.override.hasOwnProperty(b)?a.override[b]:a[b]}function v(a,b,c,e){if("function"==typeof a.addEventListener){if(a.addEventListener(b,c,!1),e)return function(){a.removeEventListener(b,c,!1)}}else{var g=function(a){c(a||window.event)};a.attachEvent("on"+ 
     77b,g);if(e)return function(){a.detachEvent("on"+b,g)}}}function lc(){this.id=null}function Ja(a,b,c){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var e=0,g=0;e<b;++e)"\t"==a.charAt(e)?g+=c-g%c:++g;return g}function Ra(a,b){try{var c=a.getBoundingClientRect(),c={top:c.top,left:c.left}}catch(e){c={top:0,left:0}}if(!b)if(null==window.pageYOffset){var g=document.documentElement||document.body.parentNode;null==g.scrollTop&&(g=document.body);c.top+=g.scrollTop;c.left+=g.scrollLeft}else c.top+= 
     78window.pageYOffset,c.left+=window.pageXOffset;return c}function Ec(a){for(;Ka.length<=a;)Ka.push(J(Ka)+" ");return Ka[a]}function J(a){return a[a.length-1]}function y(a,b){return a.line==b.line&&a.ch==b.ch}function M(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function r(a,b,c,e){a=document.createElement(a);c&&(a.className=c);e&&(a.style.cssText=e);if("string"==typeof b)ib(a,b);else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function Ha(a){a.innerHTML="";return a}function ib(a, 
     79b){fc?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function Ob(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,e=a.length;c<e;++c)if(a[c]==b)return c;return-1}function Db(a){return/\w/.test(a)||a.toUpperCase()!=a.toLowerCase()}n.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1, 
     80fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onViewportChange:null,onGutterClick:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,cursorBlinkRate:530,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null,lineNumberFormatter:function(a){return a}};var Zb=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),ob=Zb||/Mac/.test(navigator.platform);/Win/.test(navigator.platform); 
     81var ua=n.modes={},va=n.mimeModes={};n.defineMode=function(a,b){!n.defaults.mode&&"null"!=a&&(n.defaults.mode=a);if(2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}ua[a]=b};n.defineMIME=function(a,b){va[a]=b};n.resolveMode=function(a){if("string"==typeof a&&va.hasOwnProperty(a))a=va[a];else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return n.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}};n.getMode= 
     82function(a,b){var b=n.resolveMode(b),c=ua[b.name];if(!c)return n.getMode(a,"text/plain");c=c(a,b);if(wa.hasOwnProperty(b.name)){var e=wa[b.name],g;for(g in e)e.hasOwnProperty(g)&&(c[g]=e[g])}c.name=b.name;return c};n.listModes=function(){var a=[],b;for(b in ua)ua.propertyIsEnumerable(b)&&a.push(b);return a};n.listMIMEs=function(){var a=[],b;for(b in va)va.propertyIsEnumerable(b)&&a.push({mime:b,mode:va[b]});return a};var Pb=n.extensions={};n.defineExtension=function(a,b){Pb[a]=b};var wa=n.modeExtensions= 
     83{};n.extendMode=function(a,b){var c=wa.hasOwnProperty(a)?wa[a]:wa[a]={},e;for(e in b)b.hasOwnProperty(e)&&(c[e]=b[e])};var Tb=n.commands={selectAll:function(a){a.setSelection({line:0,ch:0},{line:a.lineCount()-1})},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),e=!y(b,c);!e&&a.getLine(b.line).length==b.ch?a.replaceRange("",b,{line:b.line+1,ch:0}):a.replaceRange("",b,e?c:{line:b.line})},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",{line:b,ch:0},{line:b})},undo:function(a){a.undo()}, 
     84redo:function(a){a.redo()},goDocStart:function(a){a.setCursor(0,0,!0)},goDocEnd:function(a){a.setSelection({line:a.lineCount()-1},null,!0)},goLineStart:function(a){a.setCursor(a.getCursor().line,0,!0)},goLineStartSmart:function(a){var b=a.getCursor(),c=a.getLine(b.line),c=Math.max(0,c.search(/\S/));a.setCursor(b.line,b.ch<=c&&b.ch?0:c,!0)},goLineEnd:function(a){a.setSelection({line:a.getCursor().line},null,!0)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1, 
     85"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goWordRight:function(a){a.moveH(1,"word")},delCharLeft:function(a){a.deleteH(-1,"char")},delCharRight:function(a){a.deleteH(1,"char")},delWordLeft:function(a){a.deleteH(-1,"word")},delWordRight:function(a){a.deleteH(1,"word")}, 
     86indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t","end")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection("\t","end")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);0<b.ch&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),{line:b.line,ch:b.ch-1},{line:b.line,ch:b.ch+1})},newlineAndIndent:function(a){a.replaceSelection("\n", 
     87"end");a.indentLine(a.getCursor().line)},toggleOverwrite:function(a){a.toggleOverwrite()}},fa=n.keyMap={};fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo", 
     88"Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"};fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine", 
     89"Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]}; 
     90fa["default"]=ob?fa.macDefault:fa.pcDefault;fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};n.fromTextArea=function(a,b){function c(){a.value=r.getValue()}b||(b={});b.value= 
     91a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);if(null==b.autofocus){var e=document.body;try{e=document.activeElement}catch(g){}b.autofocus=e==a||null!=a.getAttribute("autofocus")&&e==document.body}if(a.form){var i=v(a.form,"submit",c,!0);if("function"==typeof a.form.submit){var l=a.form.submit;a.form.submit=function Rb(){c();a.form.submit=l;a.form.submit();a.form.submit=Rb}}}a.style.display="none";var r=n(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);r.save=c;r.getTextArea= 
     92function(){return a};r.toTextArea=function(){c();a.parentNode.removeChild(r.getWrapperElement());a.style.display="";a.form&&(i(),"function"==typeof a.form.submit&&(a.form.submit=l))};return r};var db=/gecko\/\d{7}/i.test(navigator.userAgent),Ga=/MSIE \d/.test(navigator.userAgent),ic=/MSIE [1-7]\b/.test(navigator.userAgent),fc=/MSIE [1-8]\b/.test(navigator.userAgent),Qc=Ga&&5==document.documentMode,ub=/WebKit\//.test(navigator.userAgent),w=/Chrome\//.test(navigator.userAgent),ya=/Opera\//.test(navigator.userAgent), 
     93oc=/Apple Computer/.test(navigator.vendor),kc=/KHTML\//.test(navigator.userAgent),Rc=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent);n.copyState=Ua;n.startState=Lc;n.innerMode=function(a,b){for(;a.innerMode;)var c=a.innerMode(b),b=c.state,a=c.mode;return c||{mode:a,state:b}};Da.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}, 
     94eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){return Ja(this.string, 
     95this.start,this.tabSize)},indentation:function(){return Ja(this.string,null,this.tabSize)},match:function(a,b,c){if("string"==typeof a){if((c?this.string.toLowerCase():this.string).indexOf(c?a.toLowerCase():a,this.pos)==this.pos)return!1!==b&&(this.pos+=a.length),!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}},current:function(){return this.string.slice(this.start,this.pos)}};n.StringStream=Da;var Va=" ";db||Ga&&!ic?Va="\u200b": 
     96ya&&(Va="");Na.prototype={update:function(a,b){this.text=a;this.stateAfter=this.styles=null;gb(this);Qb(this,b)},highlight:function(a,b,c){var c=new Da(this.text,c),e=this.styles||(this.styles=[]),g=e.length=0;for(""==this.text&&a.blankLine&&a.blankLine(b);!c.eol();){var i=a.token(c,b),l=c.current();c.start=c.pos;g&&e[g-1]==i?e[g-2]+=l:l&&(e[g++]=l,e[g++]=i);if(5E3<c.pos){e[g++]=this.text.slice(c.pos);e[g++]=null;break}}},process:function(a,b,c){c=new Da(this.text,c);for(""==this.text&&a.blankLine&& 
     97a.blankLine(b);!c.eol()&&5E3>=c.pos;)a.token(c,b),c.start=c.pos},getTokenAt:function(a,b,c,e){for(c=new Da(this.text,c);c.pos<e&&!c.eol();){c.start=c.pos;var g=a.token(c,b)}return{start:c.start,end:c.pos,string:c.current(),className:g||null,state:b}},indentation:function(a){return Ja(this.text,null,a)},getContent:function(a,b,c){function e(b,c,e){if(c){i&&(Ga&&" "==c.charAt(0))&&(c="\u00a0"+c.slice(1));i=!1;if(n.test(c))for(var g=document.createDocumentFragment(),v=0;;){n.lastIndex=v;var w=n.exec(c), 
     98y=w?w.index-v:c.length-v;y&&(g.appendChild(document.createTextNode(c.slice(v,v+y))),l+=y);if(!w)break;v+=y+1;"\t"==w[0]?(w=a-l%a,g.appendChild(r("span",Ec(w),"cm-tab")),l+=w):(y=r("span","\u2022","cm-invalidchar"),y.title="\\u"+w[0].charCodeAt(0).toString(16),g.appendChild(y),l+=1)}else{l+=c.length;var g=document.createTextNode(c)}e?b.appendChild(r("span",[g],e)):b.appendChild(g)}}function g(a){return!a?null:"cm-"+a.replace(/ +/g," cm-")}var i=!0,l=0,n=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g, 
     99v=r("pre"),y=e;if(null!=b)var w=0,G=v.anchor=r("span"),y=function(a,g,i){var l=g.length;if(b>=w&&b<w+l){b>w&&(e(a,g.slice(0,b-w),i),c&&a.appendChild(r("wbr")));a.appendChild(G);var n=b-w;e(G,ya?g.slice(n,n+1):g.slice(n),i);ya&&e(a,g.slice(n+1),i);b--;w+=l}else w+=l,e(a,g,i),w==b&&w==I?(ib(G,Va),a.appendChild(G)):w>b+10&&/\s/.test(g)&&(y=function(){})};var M=this.styles,S=this.text,N=this.markedSpans,I=S.length;if(!S&&null==b)y(v," ");else if(!N||!N.length)for(N=S=0;N<I;S+=2){var P=M[S],T=M[S+1],da= 
     100P.length;N+da>I&&(P=P.slice(0,I-N));N+=da;y(v,P,g(T))}else{N.sort(function(a,b){return a.from-b.from});for(var S=P=0,da="",ba=N[0].from||0,K=[],V=0;P<I;){if(ba==P){for(ba=void 0;V<N.length&&((ba=N[V]).from==P||null==ba.from);)"range"==ba.marker.type&&K.push(ba),++V;for(var ba=V<N.length?N[V].from:Infinity,R=0;R<K.length;++R){var ha=K[R].to;null==ha&&(ha=Infinity);ha==P?K.splice(R--,1):ba=Math.min(ha,ba)}}for(R=Math.min(I,ba);;){if(da){for(var ha=P+da.length,J=T,fa=0;fa<K.length;++fa){var ga=K[fa], 
     101J=(J?J+" ":"")+ga.marker.style;ga.marker.endStyle&&ga.to===Math.min(ha,R)&&(J+=" "+ga.marker.endStyle);ga.marker.startStyle&&ga.from===P&&(J+=" "+ga.marker.startStyle)}y(v,ha>R?da.slice(0,R-P):da,J);if(ha>=R){da=da.slice(R-P);P=R;break}P=ha}da=M[S++];T=g(M[S++])}}}return v},cleanUp:function(){this.parent=null;gb(this)}};Kb.prototype={chunkSize:function(){return this.lines.length},remove:function(a,b,c){for(var e=a,g=a+b;e<g;++e){var i=this.lines[e];this.height-=i.height;i.cleanUp();if(i.handlers)for(var l= 
     1020;l<i.handlers.length;++l)c.push(i.handlers[l])}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertHeight:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));a=0;for(c=b.length;a<c;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};Jb.prototype={chunkSize:function(){return this.size},remove:function(a,b,c){this.size-=b;for(var e=0;e<this.children.length;++e){var g= 
     103this.children[e],i=g.chunkSize();if(a<i){var l=Math.min(b,i-a),n=g.height;g.remove(a,l,c);this.height-=n-g.height;i==l&&(this.children.splice(e--,1),g.parent=null);if(0==(b-=l))break;a=0}else a-=i}25>this.size-b&&(a=[],this.collapse(a),this.children=[new Kb(a)],this.children[0].parent=this)},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insert:function(a,b){for(var c=0,e=0,g=b.length;e<g;++e)c+=b[e].height;this.insertHeight(a,b,c)},insertHeight:function(a, 
     104b,c){this.size+=b.length;this.height+=c;for(var e=0,g=this.children.length;e<g;++e){var i=this.children[e],l=i.chunkSize();if(a<=l){i.insertHeight(a,b,c);if(i.lines&&50<i.lines.length){for(;50<i.lines.length;)a=i.lines.splice(i.lines.length-25,25),a=new Kb(a),i.height-=a.height,this.children.splice(e+1,0,a),a.parent=this;this.maybeSpill()}break}a-=l}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new Jb(b);if(a.parent){a.size-= 
     105b.size;a.height-=b.height;var c=Ob(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new Jb(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iter:function(a,b,c){this.iterN(a,b-a,c)},iterN:function(a,b,c){for(var e=0,g=this.children.length;e<g;++e){var i=this.children[e],l=i.chunkSize();if(a<l){l=Math.min(b,l-a);if(i.iterN(a,l,c))return!0;if(0==(b-=l))break;a=0}else a-=l}}};Nb.prototype={addChange:function(a,b,c){this.undone.length= 
     1060;var e=+new Date,g=J(this.done),i=g&&J(g),l=e-this.time;if(this.compound&&g&&!this.closed)g.push({start:a,added:b,old:c});else if(400<l||!i||this.closed||i.start>a+c.length||i.start+i.added<a)this.done.push([{start:a,added:b,old:c}]),this.closed=!1;else{for(var g=Math.max(0,i.start-a),l=Math.max(0,a+c.length-(i.start+i.added)),n=g;0<n;--n)i.old.unshift(c[n-1]);for(n=l;0<n;--n)i.old.push(c[c.length-n]);g&&(i.start=a);i.added+=b-(c.length-g-l)}this.time=e},startCompound:function(){this.compound++|| 
     107(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}};n.e_stop=jb;n.e_preventDefault=G;n.e_stopPropagation=hb;n.connect=v;lc.prototype={set:function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)}};var rc=n.Pass={toString:function(){return"CodeMirror.Pass"}},mc;if(fc)mc=!1;else{var Ea=r("div");mc="draggable"in Ea||"dragDrop"in Ea}Ea=r("textarea");Ea.value="foo\nbar";Ea.value.indexOf("\r");var Hb=/^$/;db?Hb=/$'/:oc?Hb=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:w&&(Hb=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/); 
     108var Ka=[""],kb=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],e=a.length;b<=e;){var g=a.indexOf("\n",b);-1==g&&(g=a.length);var i=a.slice(b,"\r"==a.charAt(g-1)?g-1:g),l=i.indexOf("\r");-1!=l?(c.push(i.slice(0,l)),b+=l+1):(c.push(i),b=g+1)}return c}:function(a){return a.split(/\r\n?|\n/)};n.splitLines=kb;var Pc=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return!b|| 
     109b.parentElement()!=a?!1:0!=b.compareEndPoints("StartToEnd",b)};n.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});n.defineMIME("text/plain","null");var Fa={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:",", 
     110189:"-",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"};n.keyNames=Fa;for(w=0;10>w;w++)Fa[w+48]=String(w);for(w=65;90>=w;w++)Fa[w]=String.fromCharCode(w);for(w=1;12>=w;w++)Fa[w+111]=Fa[w+63235]="F"+w;n.version="2.34";return n}(); 
     111 
     112// CodeMirror CSS mode version 2.34 
     113CodeMirror.defineMode("css",function(m){function g(a){for(var c={},b=0;b<a.length;++b)c[a[b]]=!0;return c}function e(a,c){f=c;return a}function h(a,c){var b=a.next();if("@"==b)return a.eatWhile(/[\w\\\-]/),e("def",a.current());if("/"==b&&a.eat("*"))return c.tokenize=j,j(a,c);if("<"==b&&a.eat("!"))return c.tokenize=k,k(a,c);if("="==b)e(null,"compare");else{if(("~"==b||"|"==b)&&a.eat("="))return e(null,"compare");if('"'==b||"'"==b)return c.tokenize=function(a,c){for(var f=!1,g;null!=(g=a.next())&&(g!= 
     114b||f);)f=!f&&"\\"==g;f||(c.tokenize=h);return e("string","string")},c.tokenize(a,c);if("#"==b)return a.eatWhile(/[\w\\\-]/),e("atom","hash");if("!"==b)return a.match(/^\s*\w*/),e("keyword","important");if(/\d/.test(b))return a.eatWhile(/[\w.%]/),e("number","unit");if("-"===b){if(/\d/.test(a.peek()))return a.eatWhile(/[\w.%]/),e("number","unit");if(a.match(/^[^-]+-/))return e("meta",f)}else{if(/[,+>*\/]/.test(b))return e(null,"select-op");if("."==b&&a.match(/^\w+/))return e("qualifier",f);if(":"== 
     115b)return e("operator",b);if(/[;{}\[\]\(\)]/.test(b))return e(null,b);a.eatWhile(/[\w\\\-]/);return e("property","variable")}}}function j(a,c){for(var b=!1,d;null!=(d=a.next());){if(b&&"/"==d){c.tokenize=h;break}b="*"==d}return e("comment","comment")}function k(a,c){for(var b=0,d;null!=(d=a.next());){if(2<=b&&">"==d){c.tokenize=h;break}b="-"==d?b+1:0}return e("comment","comment")}var n=m.indentUnit,f,i=g("all aural braille handheld print projection screen tty tv embossed".split(" ")),p=g("width min-width max-width height min-height max-height device-width min-device-width max-device-width device-height min-device-height max-device-height aspect-ratio min-aspect-ratio max-aspect-ratio device-aspect-ratio min-device-aspect-ratio max-device-aspect-ratio color min-color max-color color-index min-color-index max-color-index monochrome min-monochrome max-monochrome resolution min-resolution max-resolution scan grid".split(" ")), 
     116l=g("align-content align-items align-self alignment-adjust alignment-baseline anchor-point animation animation-delay animation-direction animation-duration animation-iteration-count animation-name animation-play-state animation-timing-function appearance azimuth backface-visibility background background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip color color-profile column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset crop cue cue-after cue-before cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit fit-position flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float float-offset font font-feature-settings font-family font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid-cell grid-column grid-column-align grid-column-sizing grid-column-span grid-columns grid-flow grid-row grid-row-align grid-row-sizing grid-row-span grid-rows grid-template hanging-punctuation height hyphens icon image-orientation image-rendering image-resolution inline-box-align justify-content left letter-spacing line-break line-height line-stacking line-stacking-ruby line-stacking-shift line-stacking-strategy list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top marker-offset marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up opacity order orphans outline outline-color outline-offset outline-style outline-width overflow overflow-style overflow-wrap overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside page-policy pause pause-after pause-before perspective perspective-origin pitch pitch-range play-during position presentation-level punctuation-trim quotes rendering-intent resize rest rest-after rest-before richness right rotation rotation-point ruby-align ruby-overhang ruby-position ruby-span size speak speak-as speak-header speak-numeral speak-punctuation speech-rate stress string-set tab-size table-layout target target-name target-new target-position text-align text-align-last text-decoration text-decoration-color text-decoration-line text-decoration-skip text-decoration-style text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-height text-indent text-justify text-outline text-shadow text-space-collapse text-transform text-underline-position text-wrap top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-range voice-rate voice-stress voice-volume volume white-space widows width word-break word-spacing word-wrap z-index".split(" ")), 
     117q=g("black silver gray white maroon red purple fuchsia green lime olive yellow navy blue teal aqua".split(" ")),r=g("above absolute activeborder activecaption afar after-white-space ahead alias all all-scroll alternate always amharic amharic-abegede antialiased appworkspace arabic-indic armenian asterisks auto avoid background backwards baseline below bidi-override binary bengali blink block block-axis bold bolder border border-box both bottom break-all break-word button button-bevel buttonface buttonhighlight buttonshadow buttontext cambodian capitalize caps-lock-indicator caption captiontext caret cell center checkbox circle cjk-earthly-branch cjk-heavenly-stem cjk-ideographic clear clip close-quote col-resize collapse compact condensed contain content content-box context-menu continuous copy cover crop cross crosshair currentcolor cursive dashed decimal decimal-leading-zero default default-button destination-atop destination-in destination-out destination-over devanagari disc discard document dot-dash dot-dot-dash dotted double down e-resize ease ease-in ease-in-out ease-out element ellipsis embed end ethiopic ethiopic-abegede ethiopic-abegede-am-et ethiopic-abegede-gez ethiopic-abegede-ti-er ethiopic-abegede-ti-et ethiopic-halehame-aa-er ethiopic-halehame-aa-et ethiopic-halehame-am-et ethiopic-halehame-gez ethiopic-halehame-om-et ethiopic-halehame-sid-et ethiopic-halehame-so-et ethiopic-halehame-ti-er ethiopic-halehame-ti-et ethiopic-halehame-tig ew-resize expanded extra-condensed extra-expanded fantasy fast fill fixed flat footnotes forwards from geometricPrecision georgian graytext groove gujarati gurmukhi hand hangul hangul-consonant hebrew help hidden hide higher highlight highlighttext hiragana hiragana-iroha horizontal hsl hsla icon ignore inactiveborder inactivecaption inactivecaptiontext infinite infobackground infotext inherit initial inline inline-axis inline-block inline-table inset inside intrinsic invert italic justify kannada katakana katakana-iroha khmer landscape lao large larger left level lighter line-through linear lines list-item listbox listitem local logical loud lower lower-alpha lower-armenian lower-greek lower-hexadecimal lower-latin lower-norwegian lower-roman lowercase ltr malayalam match media-controls-background media-current-time-display media-fullscreen-button media-mute-button media-play-button media-return-to-realtime-button media-rewind-button media-seek-back-button media-seek-forward-button media-slider media-sliderthumb media-time-remaining-display media-volume-slider media-volume-slider-container media-volume-sliderthumb medium menu menulist menulist-button menulist-text menulist-textfield menutext message-box middle min-intrinsic mix mongolian monospace move multiple myanmar n-resize narrower navy ne-resize nesw-resize no-close-quote no-drop no-open-quote no-repeat none normal not-allowed nowrap ns-resize nw-resize nwse-resize oblique octal open-quote optimizeLegibility optimizeSpeed oriya oromo outset outside overlay overline padding padding-box painted paused persian plus-darker plus-lighter pointer portrait pre pre-line pre-wrap preserve-3d progress push-button radio read-only read-write read-write-plaintext-only relative repeat repeat-x repeat-y reset reverse rgb rgba ridge right round row-resize rtl run-in running s-resize sans-serif scroll scrollbar se-resize searchfield searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration semi-condensed semi-expanded separate serif show sidama single skip-white-space slide slider-horizontal slider-vertical sliderthumb-horizontal sliderthumb-vertical slow small small-caps small-caption smaller solid somali source-atop source-in source-out source-over space square square-button start static status-bar stretch stroke sub subpixel-antialiased super sw-resize table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group telugu text text-bottom text-top textarea textfield thai thick thin threeddarkshadow threedface threedhighlight threedlightshadow threedshadow tibetan tigre tigrinya-er tigrinya-er-abegede tigrinya-et tigrinya-et-abegede to top transparent ultra-condensed ultra-expanded underline up upper-alpha upper-armenian upper-greek upper-hexadecimal upper-latin upper-norwegian upper-roman uppercase urdu url vertical vertical-text visible visibleFill visiblePainted visibleStroke visual w-resize wait wave white wider window windowframe windowtext x-large x-small xor xx-large xx-small yellow".split(" ")); 
     118return{startState:function(a){return{tokenize:h,baseIndent:a||0,stack:[]}},token:function(a,c){if(a.eatSpace())return null;var b=c.tokenize(a,c),d=c.stack[c.stack.length-1];"property"==b?"propertyValue"==d?b=r[a.current()]?"string-2":q[a.current()]?"keyword":"variable-2":"rule"==d?l[a.current()]||(b+=" error"):!d||"@media{"==d?b="tag":"@media"==d?b=i[a.current()]?"attribute":/^(only|not)$/i.test(a.current())?"keyword":"and"==a.current().toLowerCase()?"error":p[a.current()]?"error":"attribute error": 
     119"@mediaType"==d?i[a.current()]?b="attribute":"and"==a.current().toLowerCase()?b="operator":(/^(only|not)$/i.test(a.current())||a.current(),b="error"):"@mediaType("==d?l[a.current()]||(b=i[a.current()]?"error":"and"==a.current().toLowerCase()?"operator":/^(only|not)$/i.test(a.current())?"error":b+" error"):b="error":"atom"==b?!d||"@media{"==d?b="builtin":"propertyValue"==d?/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(a.current())||(b+=" error"):b="error":"@media"==d&&"{"==f&&(b="error");"{"==f?"@media"== 
     120d||"@mediaType"==d?(c.stack.pop(),c.stack[c.stack.length-1]="@media{"):c.stack.push("rule"):"}"==f?(c.stack.pop(),"propertyValue"==d&&c.stack.pop()):"@media"==f?c.stack.push("@media"):"@media"==d&&/\b(keyword|attribute)\b/.test(b)?c.stack.push("@mediaType"):"@mediaType"==d&&","==a.current()?c.stack.pop():"@mediaType"==d&&"("==f?c.stack.push("@mediaType("):"@mediaType("==d&&")"==f?c.stack.pop():"rule"==d&&":"==f?c.stack.push("propertyValue"):"propertyValue"==d&&";"==f&&c.stack.pop();return b},indent:function(a, 
     121c){var b=a.stack.length;/^\}/.test(c)&&(b-="propertyValue"==a.stack[a.stack.length-1]?2:1);return a.baseIndent+b*n},electricChars:"}"}});CodeMirror.defineMIME("text/css","css"); 
  • tablepress/trunk/admin/common.js

    r598765 r607623  
    1717     */ 
    1818    postboxes.add_postbox_toggles( pagenow ); 
    19  
    20     /** 
    21      * AJAX functionality 
    22      */ 
    23  
    24     /** 
    25      * Process links with a class "ajax-link" with AJAX 
    26      * 
    27      * @since 1.0.0 
    28      */ 
    29     $( '#tablepress-page' ).on( 'click', '.ajax-link', function( /* event */ ) { 
    30         var link = this, 
    31             action = link.className.replace(/^.*ajax-link /, ''); 
    32         $.get( 
    33             ajaxurl, 
    34             link.href.split('?')['1'], /* query string of the link */ 
    35             function( result ) { 
    36                 if ( '1' != result ) 
    37                     return; 
    38  
    39                 switch ( action ) { 
    40                     case 'hide_message': 
    41                         $( link ).closest( 'div' ).remove(); 
    42                         break; 
    43                 } 
    44             } 
    45         ); 
    46         return false; 
    47     } ); 
    4819 
    4920    /** 
  • tablepress/trunk/admin/common.min.js

    r598765 r607623  
    1 jQuery(document).ready(function(a){postboxes.add_postbox_toggles(pagenow);a("#tablepress-page").on("click",".ajax-link",function(){var b=this,c=b.className.replace(/^.*ajax-link /,"");a.get(ajaxurl,b.href.split("?")["1"],function(d){if("1"==d)switch(c){case "hide_message":a(b).closest("div").remove()}});return!1});a("#tablepress-page").on("focus",".placeholder",function(){this.value==this.defaultValue&&(this.value="",a(this).removeClass("placeholder-active"))}).on("blur",".placeholder",function(){""== 
    2 this.value&&(this.value=this.defaultValue,a(this).addClass("placeholder-active"))});a("#tablepress-page").on("blur",".numbers-only, .form-field-numbers-only input",function(){var b=a(this);b.val(b.val().replace(/[^0-9]/g,""))});a("#tablepress-page").on("click",".delete-link",function(){if(!confirm(tablepress_common.ays_delete_single_table))return!1;"undefined"!=typeof tp&&(tp.made_changes=!1)});a("#tablepress-page").on("click",".table-shortcode",function(){a(this).focus().select()})}); 
     1jQuery(document).ready(function(a){postboxes.add_postbox_toggles(pagenow);a("#tablepress-page").on("focus",".placeholder",function(){this.value==this.defaultValue&&(this.value="",a(this).removeClass("placeholder-active"))}).on("blur",".placeholder",function(){""==this.value&&(this.value=this.defaultValue,a(this).addClass("placeholder-active"))});a("#tablepress-page").on("blur",".numbers-only, .form-field-numbers-only input",function(){var b=a(this);b.val(b.val().replace(/[^0-9]/g,""))});a("#tablepress-page").on("click", 
     2".delete-link",function(){if(!confirm(tablepress_common.ays_delete_single_table))return!1;"undefined"!=typeof tp&&(tp.made_changes=!1)});a("#tablepress-page").on("click",".table-shortcode",function(){a(this).focus().select()})}); 
  • tablepress/trunk/admin/edit.css

    r600237 r607623  
    4444    border: none; 
    4545} 
     46/* To account for additional padding of #TB_WindowContent in direct preview */ 
     47#table-preview { 
     48    margin: -2px -15px -15px -15px; 
     49} 
    4650 
    4751/* Content of the Advanced Editor jQueryUI dialog */ 
    4852#advanced-editor { 
    49     padding: 0px 3px 3px; 
     53    padding: 3px; 
    5054} 
    5155#advanced-editor .submitbox { 
     
    5357    font-size: 11px; 
    5458    overflow: auto; 
    55     height: 28px; 
     59    height: 30px; 
    5660} 
    5761#advanced-editor-confirm { 
     
    5963} 
    6064#advanced-editor-cancel { 
    61     line-height: 25px; 
     65    line-height: 30px; 
    6266} 
    6367 
  • tablepress/trunk/admin/edit.js

    r598765 r607623  
    7575                tp.rows.stripe(); 
    7676            }, 
     77            change_print_name_description: function( /* event */ ) { 
     78                $( '#' + this.id + '-position' ).prop( 'disabled', ! $(this).prop( 'checked' ) ); 
     79            }, 
    7780            change_datatables: function() { 
    7881                var $datatables_checkbox = $( '#option-use-datatables' ), 
     
    103106                table_data = JSON.stringify( table_data ); 
    104107 
    105                 // @TODO: evtl. für options-saving: http://stackoverflow.com/questions/1184624/serialize-form-to-json-with-jquery 
    106                 // oder each() durch alle Checkboxes/Textfields/Selects 
     108                // @TODO: maybe for options saving: http://stackoverflow.com/questions/1184624/serialize-form-to-json-with-jquery 
     109                // or each()-loop through all checkboxes/textfields/selects 
    107110                table_options = { 
    108111                    // Table Options 
     
    111114                    alternating_row_colors: $( '#option-alternating-row-colors' ).prop( 'checked' ), 
    112115                    row_hover: $( '#option-row-hover' ).prop( 'checked' ), 
    113                     print_name: $( '#option-print-name' ).val(), 
    114                     print_description: $( '#option-print-description' ).val(), 
     116                    print_name: $( '#option-print-name' ).prop( 'checked' ), 
     117                    print_description: $( '#option-print-description' ).prop( 'checked' ), 
     118                    print_name_position: $( '#option-print-name-position' ).val(), 
     119                    print_description_position: $( '#option-print-description-position' ).val(), 
    115120                    extra_css_classes: $( '#option-extra-css-classes' ).val(), 
    116121                    // DataTables JS features 
     
    776781            span: { 
    777782                add: function( span ) { 
    778                     // todo: Frage entsprechend des span-Typs 
     783                    // @TODO: Ask question according to span type 
    779784                    if ( ! confirm( tablepress_strings.span_add ) ) 
    780785                        return; 
     
    10111016                }, 
    10121017                'change': { 
    1013                     '#option-table-head':       tp.table.change_table_head, 
    1014                     '#option-table-foot':       tp.table.change_table_foot, 
    1015                     '#option-use-datatables':   tp.table.change_datatables, 
     1018                    '#option-table-head':           tp.table.change_table_head, 
     1019                    '#option-table-foot':           tp.table.change_table_foot, 
     1020                    '#option-use-datatables':       tp.table.change_datatables, 
    10161021                    '#option-datatables-paginate':  tp.table.change_datatables_pagination 
    10171022                }, 
     
    10301035            $( window ).on( 'beforeunload', tp.check.changes_saved ); 
    10311036 
    1032             // init changed/disabled states of DataTables JS features checkboxes 
    1033             $( '#option-table-head' ).change(); // do this before the next lines, to not trigger set_table_changed() 
     1037            // do this before the next lines, to not trigger set_table_changed() 
     1038            $( '#option-table-head' ).change(); // init changed/disabled states of DataTables JS features checkboxes 
     1039            $( '#option-print-name' ).change( tp.table.change_print_name_description ).change(); // init dropdowns for name and description position 
     1040            $( '#option-print-description' ).change( tp.table.change_print_name_description ).change(); 
    10341041 
    10351042            // just once is enough, will be reset after saving 
  • tablepress/trunk/admin/edit.min.css

    r600237 r607623  
    1 body.wait *{cursor:wait!important}.hidden-container{display:none}.hidden-help-box-container p{margin:6px}#TB_HideSelect{z-index:301099}#TB_overlay{z-index:301100}#TB_window{z-index:301102}#TB_load{z-index:301103}#table-preview-iframe{width:100%;height:100%;margin:0;border:0}#advanced-editor{padding:0 3px 3px}#advanced-editor .submitbox{padding:6px 6px 0;font-size:11px;overflow:auto;height:28px}#advanced-editor-confirm{float:right}#advanced-editor-cancel{line-height:25px}.animation-saving,.animation-preview{display:inline-block;background:url(../../../../wp-admin/images/wpspin_light.gif);height:16px;width:16px;margin:4px 0 0 5px;vertical-align:top}#tablepress-page div.save-changes-success,#tablepress-page div.save-changes-error,#tablepress-page div.preview-error{margin:0 0 15px}#edit-form-body td{padding:2px 2px 2px 0;height:32px}#edit-form-body .focus td{height:64px}#edit-form-body .odd{background-color:#eee}#edit-form-body textarea{display:block;width:150px;height:100%}#edit-form-body textarea:focus{border-color:#000}#edit-form-body input[type="checkbox"]{margin-right:3px}#edit-form-foot input[type="checkbox"]{margin-top:6px}#edit-form{border-collapse:collapse}#edit-form .move-handle{display:block;margin:auto;width:16px;height:16px;cursor:move;text-align:center;font-weight:bold}.no-js #edit-form .move-handle{cursor:auto}#edit-form-body .move-handle{margin:auto 3px;min-width:16px;width:auto}#edit-form .move-hover{position:absolute;z-index:1000;height:26px}#edit-form .focus .move-hover{height:54px}#edit-form-body .head-row,#edit-form-body .foot-row{background-color:#d9edf7}#edit-form-head th{height:16px;vertical-align:top}#edit-form-head .sort-control{display:none;float:right;width:12px;height:12px;cursor:pointer;margin:2px 3px 0 0}.js #edit-form-head .head:hover .sort-control{display:block}.js #edit-form-head .ui-sortable-helper:hover .sort-control{display:none}#edit-form-head .sort-asc{background:url(img/sort-asc.gif) no-repeat center center}#edit-form-head .sort-desc{background:url(img/sort-desc.gif) no-repeat center center}#edit-form .row-hidden td,#edit-form .row-hidden textarea,#edit-form .column-hidden,#edit-form .column-hidden textarea{background-color:#ffe0e0}#tablepress_edit-table-manipulation td{width:50%} 
     1body.wait *{cursor:wait!important}.hidden-container{display:none}.hidden-help-box-container p{margin:6px}#TB_HideSelect{z-index:301099}#TB_overlay{z-index:301100}#TB_window{z-index:301102}#TB_load{z-index:301103}#table-preview-iframe{width:100%;height:100%;margin:0;border:0}#table-preview{margin:-2px -15px -15px -15px}#advanced-editor{padding:3px}#advanced-editor .submitbox{padding:6px 6px 0;font-size:11px;overflow:auto;height:30px}#advanced-editor-confirm{float:right}#advanced-editor-cancel{line-height:30px}.animation-saving,.animation-preview{display:inline-block;background:url(../../../../wp-admin/images/wpspin_light.gif);height:16px;width:16px;margin:4px 0 0 5px;vertical-align:top}#tablepress-page div.save-changes-success,#tablepress-page div.save-changes-error,#tablepress-page div.preview-error{margin:0 0 15px}#edit-form-body td{padding:2px 2px 2px 0;height:32px}#edit-form-body .focus td{height:64px}#edit-form-body .odd{background-color:#eee}#edit-form-body textarea{display:block;width:150px;height:100%}#edit-form-body textarea:focus{border-color:#000}#edit-form-body input[type="checkbox"]{margin-right:3px}#edit-form-foot input[type="checkbox"]{margin-top:6px}#edit-form{border-collapse:collapse}#edit-form .move-handle{display:block;margin:auto;width:16px;height:16px;cursor:move;text-align:center;font-weight:bold}.no-js #edit-form .move-handle{cursor:auto}#edit-form-body .move-handle{margin:auto 3px;min-width:16px;width:auto}#edit-form .move-hover{position:absolute;z-index:1000;height:26px}#edit-form .focus .move-hover{height:54px}#edit-form-body .head-row,#edit-form-body .foot-row{background-color:#d9edf7}#edit-form-head th{height:16px;vertical-align:top}#edit-form-head .sort-control{display:none;float:right;width:12px;height:12px;cursor:pointer;margin:2px 3px 0 0}.js #edit-form-head .head:hover .sort-control{display:block}.js #edit-form-head .ui-sortable-helper:hover .sort-control{display:none}#edit-form-head .sort-asc{background:url(img/sort-asc.gif) no-repeat center center}#edit-form-head .sort-desc{background:url(img/sort-desc.gif) no-repeat center center}#edit-form .row-hidden td,#edit-form .row-hidden textarea,#edit-form .column-hidden,#edit-form .column-hidden textarea{background-color:#ffe0e0}#tablepress_edit-table-manipulation td{width:50%} 
  • tablepress/trunk/admin/edit.min.js

    r598765 r607623  
    33!0},unset_table_changed:function(){tp.made_changes=!1;a("#edit-form-body").one("change","textarea",tp.table.set_table_changed);a("#tablepress_edit-table-information, #tablepress_edit-table-options, #tablepress_edit-datatables-features").one("change","input, textarea, select",tp.table.set_table_changed)},change_id:function(){""===a.trim(a("#table-new-id").val())?(alert(tablepress_strings.table_id_not_empty),a("#table-new-id").val(tp.table.new_id).focus().select()):"0"===a.trim(a("#table-new-id").val())? 
    44(alert(tablepress_strings.table_id_not_zero),a("#table-new-id").val(tp.table.new_id).focus().select()):this.value!=tp.table.new_id&&(confirm(tablepress_strings.ays_change_table_id)?(tp.table.new_id=this.value,a(".table-shortcode").val("["+tablepress_options.shortcode+" id="+tp.table.new_id+" /]").click(),tp.table.set_table_changed()):a(this).val(tp.table.new_id))},change_table_head:function(){tp.table.head=a(this).prop("checked");a("#option-use-datatables").prop("disabled",!tp.table.head).change(); 
    5 a("#notice-datatables-head-row").toggle(!tp.table.head);tp.rows.stripe()},change_table_foot:function(){tp.table.foot=a(this).prop("checked");tp.rows.stripe()},change_datatables:function(){var b=a("#option-use-datatables"),c=!(b.prop("checked")&&!b.prop("disabled"));b.closest("tbody").find("input").not(b).prop("disabled",c);tp.table.change_datatables_pagination()},change_datatables_pagination:function(){var b=a("#option-datatables-paginate"),b=b.prop("checked")&&!b.prop("disabled");a("#option-datatables-lengthchange").prop("disabled", 
    6 !b);a("#option-datatables-paginate_entries").prop("disabled",!b)},prepare_ajax_request:function(b,c){var d=a("#edit-form-body"),e=[],f,h={rows:tp.table.rows,columns:tp.table.columns,hidden_rows:0,hidden_columns:0},g={rows:[],columns:[]};d.children().each(function(b,c){e[b]=a(c).find("textarea").map(function(){return a(this).val()}).get()});e=JSON.stringify(e);f={table_head:tp.table.head,table_foot:tp.table.foot,alternating_row_colors:a("#option-alternating-row-colors").prop("checked"),row_hover:a("#option-row-hover").prop("checked"), 
    7 print_name:a("#option-print-name").val(),print_description:a("#option-print-description").val(),extra_css_classes:a("#option-extra-css-classes").val(),use_datatables:a("#option-use-datatables").prop("checked"),datatables_sort:a("#option-datatables-sort").prop("checked"),datatables_filter:a("#option-datatables-filter").prop("checked"),datatables_paginate:a("#option-datatables-paginate").prop("checked"),datatables_lengthchange:a("#option-datatables-lengthchange").prop("checked"),datatables_paginate_entries:a("#option-datatables-paginate_entries").val(), 
    8 datatables_info:a("#option-datatables-info").prop("checked"),datatables_scrollX:a("#option-datatables-scrollX").prop("checked"),datatables_custom_commands:a("#option-datatables-custom-commands").val()};f=JSON.stringify(f);g.rows=d.find('input[type="hidden"]').map(function(){if("1"==a(this).val())return 1;h.hidden_rows+=1;return 0}).get();g.columns=a("#edit-form-foot").find('input[type="hidden"]').map(function(){if("1"==a(this).val())return 1;h.hidden_columns+=1;return 0}).get();g=JSON.stringify(g); 
    9 return{action:b,_ajax_nonce:a(c).val(),tablepress:{id:tp.table.id,new_id:tp.table.new_id,name:a("#table-name").val(),description:a("#table-description").val(),number:h,data:e,options:f,visibility:g}}},preview:{trigger:function(){if(!tp.made_changes)return tp.table.preview.show(a(this).attr("href")+"&TB_iframe=true"),!1;a(this).closest("p").append('<span class="animation-preview" title="'+tablepress_strings.preparing_preview+'"/>');a("body").addClass("wait");a("#table-preview").empty();a.post(ajaxurl, 
    10 tp.table.prepare_ajax_request("tablepress_preview_table","#nonce-preview-table"),function(){},"json").success(tp.table.preview.ajax_success).error(tp.table.preview.ajax_error);return!1},ajax_success:function(a,c){"undefined"==typeof c||"success"!=c?tp.table.preview.error("AJAX call successful, but unclear status."):"undefined"==typeof a||null==a||"-1"==a||"undefined"==typeof a.success||!0!==a.success?tp.table.preview.error("AJAX call successful, but unclear data."):tp.table.preview.success(a)},ajax_error:function(a, 
    11 c,d){tp.table.preview.error("AJAX call failed: "+c+" - "+d)},success:function(b){a("#table-preview").empty();a('<iframe id="table-preview-iframe" />').load(function(){var c=a(this).contents();c.find("head").append(b.head_html);c.find("body").append(b.body_html)}).appendTo("#table-preview");a(".animation-preview").remove();a("body").removeClass("wait");tp.table.preview.show("#TB_inline?inlineId=preview-container")},error:function(b){a(".animation-preview").closest("p").after('<div class="preview-error error"><p><strong>'+ 
    12 tablepress_strings.preview_error+": "+b+"</strong></p></div>");a(".animation-preview").remove();a(".preview-error").delay(6E3).fadeOut(2E3,function(){a(this).remove()});a("body").removeClass("wait")},show:function(b){var c=a(window).width()-120,d=a(window).height()-120;a("body.admin-bar").length&&(d-=28);tb_show(a(".show-preview-button").first().text(),b+"&height="+d+"&width="+c,!1)}}},rows:{create:function(b){var c,d,e,f="";for(c=0;c<b;c++){f+=tp.table.body_cells_pre;for(d=0;d<tp.table.columns;d++)f+= 
    13 tp.table.body_cell;f+=tp.table.body_cells_post}e=a("#edit-form-foot").find(".column-hidden").map(function(){return a(this).index()}).get();return a(f).each(function(b,c){a(c).children().filter(function(a){return-1!=jQuery.inArray(a,e)}).addClass("column-hidden")})},append:function(){var b=a("#rows-append-number").val();/^[1-9][0-9]{0,4}$/.test(b)?(a("#edit-form-body").append(tp.rows.create(b)),tp.rows.stripe(),tp.reindex()):(alert(tablepress_strings.append_num_rows_invalid),a("#rows-append-number").focus().select())}, 
    14 insert:function(b){b=a("#edit-form-body").find("input:checked").prop("checked",b.shiftKey).closest("tr");0===b.length?alert(tablepress_strings.no_rows_selected):(b.before(tp.rows.create(1)),tp.rows.stripe(),tp.reindex())},hide:function(b){b=a("#edit-form-body").find("input:checked").prop("checked",b.shiftKey).closest("tr");0===b.length?alert(tablepress_strings.no_rows_selected):(b.addClass("row-hidden").find(".visibility").val("0"),tp.rows.stripe(),tp.table.set_table_changed())},unhide:function(b){b= 
    15 a("#edit-form-body").find("input:checked").prop("checked",b.shiftKey).closest("tr");0===b.length?alert(tablepress_strings.no_rows_selected):(b.removeClass("row-hidden").find(".visibility").val("1"),tp.rows.stripe(),tp.table.set_table_changed())},remove:function(){var b,c=a("#edit-form-body").find("input:checked").closest("tr");0===c.length?alert(tablepress_strings.no_rows_selected):tp.table.rows==c.length?alert(tablepress_strings.no_remove_all_rows):(b=1==c.length?tablepress_strings.ays_remove_rows_singular: 
    16 tablepress_strings.ays_remove_rows_plural,confirm(b)&&(c.remove(),tp.rows.stripe(),tp.reindex()))},move:{start:function(b,c){a(c.placeholder).removeClass("row-hidden").css("visibility","visible").html('<td colspan="'+(tp.table.columns+tp.table.no_data_columns_pre+tp.table.no_data_columns_post)+'"><div/></td>');a(c.helper).removeClass("odd head-row foot-row")},change:function(a,c){tp.rows.stripe(c.helper)},stop:function(){tp.rows.stripe()}},sort:function(){var b=a(this).parent().index(),c=a(this).hasClass("sort-asc")? 
    17 1:-1,d=a("#edit-form-body"),e=d.find(".head-row").prevAll().andSelf(),f=d.find(".foot-row").nextAll().andSelf(),h=d.children().not(e).not(f).get(),g=function(a,b){var c=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,d=/(^[ ]*|[ ]*$)/g,e=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,f=/^0x[0-9a-f]+$/i,h=/^0/,g=a.toString().replace(d,"")||"",i=b.toString().replace(d,"")||"",d=g.replace(c,"\x00$1\x00").replace(/\0$/,"").replace(/^\0/, 
    18 "").split("\x00"),c=i.replace(c,"\x00$1\x00").replace(/\0$/,"").replace(/^\0/,"").split("\x00"),g=parseInt(g.match(f))||1!=d.length&&g.match(e)&&Date.parse(g);if(e=parseInt(i.match(f))||g&&i.match(e)&&Date.parse(i)||null){if(g<e)return-1;if(g>e)return 1}e=0;for(f=Math.max(d.length,c.length);e<f;e++){oFxNcL=!(d[e]||"").match(h)&&parseFloat(d[e])||d[e]||0;oFyNcL=!(c[e]||"").match(h)&&parseFloat(c[e])||c[e]||0;if(isNaN(oFxNcL)!==isNaN(oFyNcL))return isNaN(oFxNcL)?1:-1;typeof oFxNcL!==typeof oFyNcL&& 
    19 (oFxNcL+="",oFyNcL+="");if(oFxNcL<oFyNcL)return-1;if(oFxNcL>oFyNcL)return 1}return 0};a.each(h,function(c,d){d.sort_key=a(d).children().eq(b).find("textarea").val().toUpperCase()});h.sort(function(a,b){return c*g(a.sort_key,b.sort_key)});a.each(h,function(a,b){b.sort_key=null});d.append(e);d.append(h);d.append(f);tp.rows.stripe();tp.reindex()},stripe:function(b){"undefined"==typeof b&&(b=null);var b=a(b),c=a("#edit-form-body").children().removeClass("odd head-row foot-row").not(b);c.filter(":even").addClass("odd"); 
    20 c=c.not(".row-hidden");b.hasClass("row-hidden")&&(c=c.not(".ui-sortable-placeholder"));tp.table.head&&c.first().addClass("head-row");tp.table.foot&&c.last().addClass("foot-row")}},columns:{append:function(){var b,c=a("#columns-append-number").val(),d=new_head_cells=new_foot_cells="";if(/^[1-9][0-9]{0,4}$/.test(c)){for(b=0;b<c;b++)d+=tp.table.body_cell,new_head_cells+=tp.table.head_cell,new_foot_cells+=tp.table.foot_cell;a("#edit-form-body").children().each(function(b,c){a(c).children().slice(-tp.table.no_data_columns_post).before(d)}); 
    21 a("#edit-form-head").children().slice(-tp.table.no_data_columns_post).before(new_head_cells);a("#edit-form-foot").children().slice(-tp.table.no_data_columns_post).before(new_foot_cells);tp.reindex()}else alert(tablepress_strings.append_num_columns_invalid),a("#columns-append-number").focus().select()},insert:function(b){var c,b=a("#edit-form-foot").find("input:checked").prop("checked",b.shiftKey).closest("th");0===b.length?alert(tablepress_strings.no_columns_selected):(c=b.map(function(){return a(this).index()}).get(), 
    22 a("#edit-form-body").children().each(function(b,e){a(e).children().filter(function(a){return-1!=jQuery.inArray(a,c)}).before(tp.table.body_cell)}),a("#edit-form-head").children().filter(function(a){return-1!=jQuery.inArray(a,c)}).before(tp.table.head_cell),b.before(tp.table.foot_cell),tp.reindex())},hide:function(b){var c,b=a("#edit-form-foot").find("input:checked").prop("checked",b.shiftKey).closest("th");0===b.length?alert(tablepress_strings.no_columns_selected):(c=b.map(function(){return a(this).index()}).get(), 
    23 a("#edit-form-body").children().add("#edit-form-head").each(function(b,e){a(e).children().filter(function(a){return-1!=jQuery.inArray(a,c)}).addClass("column-hidden")}),b.addClass("column-hidden").find(".visibility").val("0"),tp.table.set_table_changed())},unhide:function(b){var c,b=a("#edit-form-foot").find("input:checked").prop("checked",b.shiftKey).closest("th");0===b.length?alert(tablepress_strings.no_columns_selected):(c=b.map(function(){return a(this).index()}).get(),a("#edit-form-body").children().add("#edit-form-head").each(function(b, 
    24 e){a(e).children().filter(function(a){return-1!=jQuery.inArray(a,c)}).removeClass("column-hidden")}),b.removeClass("column-hidden").find(".visibility").val("1"),tp.table.set_table_changed())},remove:function(){var b,c,d=a("#edit-form-foot").find("input:checked").closest("th");0===d.length?alert(tablepress_strings.no_columns_selected):tp.table.columns==d.length?alert(tablepress_strings.no_remove_all_columns):(c=1==d.length?tablepress_strings.ays_remove_columns_singular:tablepress_strings.ays_remove_columns_plural, 
    25 confirm(c)&&(b=d.map(function(){return a(this).index()}).get(),a("#edit-form-body").children().add("#edit-form-head").each(function(c,d){a(d).children().filter(function(a){return-1!=jQuery.inArray(a,b)}).remove()}),d.remove(),tp.reindex()))},move:{source_idx:-1,target_idx:-1,$rows:null,$row_children:null,$cell:null,$cells:null,$placeholder:null,$helper:null,start:function(b,c){var d=a(c.item);tp.columns.move.source_idx=d.index();tp.columns.move.$rows=a("#edit-form-body").children().add("#edit-form-foot"); 
    26 tp.columns.move.$cells=tp.columns.move.$rows.find(":nth-child("+(tp.columns.move.source_idx+1)+")").each(function(){tp.columns.move.$cell=a(this);a('<td class="move-placeholder"><div/></td>').insertBefore(tp.columns.move.$cell);tp.columns.move.$cell.insertAfter(tp.columns.move.$cell.nextAll().last()).clone().addClass("move-hover").insertAfter(tp.columns.move.$cell).find("textarea").val(tp.columns.move.$cell.find("textarea").val())}).hide();tp.columns.move.$helper=tp.columns.move.$rows.find(".move-hover"); 
    27 d=tp.columns.move.$helper.eq(1).width();tp.columns.move.$helper.eq(0).width(d);tp.columns.move.$placeholder=tp.columns.move.$rows.find(".move-placeholder");tp.columns.move.$placeholder.find("div").width(d)},change:function(b,c){tp.columns.move.target_idx=a(c.placeholder).index();1==tp.columns.move.target_idx-tp.columns.move.source_idx?tp.columns.move.target_idx+=1:tp.columns.move.target_idx==tp.columns.move.source_idx&&(tp.columns.move.target_idx-=1);tp.columns.move.$placeholder.each(function(){tp.columns.move.$cell= 
    28 a(this);tp.columns.move.$cell.insertBefore(tp.columns.move.$cell.parent().children().eq(tp.columns.move.target_idx))});tp.columns.move.target_idx>tp.columns.move.source_idx&&(tp.columns.move.target_idx-=1);tp.columns.move.source_idx=tp.columns.move.target_idx},sort:function(a,c){tp.columns.move.$helper.css("left",c.position.left)},stop:function(){tp.columns.move.$helper.remove();tp.columns.move.$cells.each(function(){tp.columns.move.$cell=a(this);tp.columns.move.$cell.insertBefore(tp.columns.move.$cell.parent().find(".move-placeholder"))}).show(); 
    29 tp.columns.move.$placeholder.remove();tp.columns.move.source_idx=tp.columns.move.target_idx=-1;tp.columns.move.$rows=tp.columns.move.$row_children=tp.columns.move.$cell=tp.columns.move.$cells=tp.columns.move.$placeholder=tp.columns.move.$helper=null;tp.reindex()}},number_to_letter:function(a){for(var c="";0<a;)c=String.fromCharCode(65+(a-1)%26)+c,a=Math.floor((a-1)/26);return c}},cells:{$focus:a(null),$textarea:null,autogrow:function(){tp.cells.$focus.removeClass("focus");tp.cells.$focus=a(this).closest("tr").addClass("focus")}, 
    30 advanced_editor:{keyopen:function(b){b.shiftKey&&(b=a("#advanced-editor-content"),tp.cells.advanced_editor.thickbox_size(),tp.cells.$textarea=a(this).blur(),b.val(tp.cells.$textarea.val()),a("#advanced-editor").wpdialog("open"),b.get(0).selectionStart=b.get(0).selectionEnd=b.val().length,b.focus())},buttonopen:function(){if(confirm(tablepress_strings.advanced_editor_open))a("#edit-form-body").one("click","textarea",function(){var b=a("#advanced-editor-content");tp.cells.advanced_editor.thickbox_size(); 
    31 tp.cells.$textarea=a(this).blur();b.val(tp.cells.$textarea.val());a("#advanced-editor").wpdialog("open");b.get(0).selectionStart=b.get(0).selectionEnd=b.val().length;b.focus()})},save:function(){var b=a("#advanced-editor-content").blur().val();tp.cells.$textarea.val()!=b&&(tp.cells.$textarea.val(b),tp.cells.$textarea.get(0).selectionStart=tp.cells.$textarea.get(0).selectionEnd=tp.cells.$textarea.val().length,tp.table.set_table_changed());tp.cells.$textarea.focus();tp.cells.advanced_editor.close()}, 
    32 close:function(){a("#advanced-editor").wpdialog("close");return!1},thickbox_size:function(){var b=a("#advanced-editor-content-add_media"),c=b.attr("href"),d=a(window).width(),d=720<d?720:d,e=a(window).height();a("body.admin-bar").length&&(e-=28);c=c.replace(/&width=[0-9]+/g,"").replace(/&height=[0-9]+/g,"");b.attr("href",c+("&width="+(d-80)+"&height="+(e-85)))}},checkboxes:{last_clicked:{"#edit-form-body":!1,"#edit-form-foot":!1},multi_select:function(b){if("undefined"==b.shiftKey)return!0;if(b.shiftKey){if(!tp.cells.checkboxes.last_clicked[b.data.parent])return!0; 
    33 var c=a(b.data.parent).find(":checkbox"),d=c.index(tp.cells.checkboxes.last_clicked[b.data.parent]),e=c.index(this);d!=e&&c.slice(Math.min(d,e),Math.max(d,e)).prop("checked",a(this).prop("checked"))}tp.cells.checkboxes.last_clicked[b.data.parent]=this;return!0}}},content:{link:{add:function(){if(confirm(tablepress_strings.link_add))a("#edit-form-body").one("mousedown","textarea",function(){wpActiveEditor=this.id;a(window).one("mouseup",function(){wpLink.open();tp.table.set_table_changed()})})}},image:{add:function(){if(confirm(tablepress_strings.image_add))a("#edit-form-body").one("click", 
    34 "textarea",function(){wpActiveEditor=this.id;this.selectionStart=this.selectionEnd=this.value.length;var b=a("#image-add"),c=a(window).width(),c=720<c?720:c,d=a(window).height();a("body.admin-bar").length&&(d-=28);tb_show(b.text(),b.attr("href")+"&TB_iframe=true&height="+(d-85)+"&width="+(c-80),!1);a(this).blur()});return!1}},span:{add:function(b){if(confirm(tablepress_strings.span_add))a("#edit-form-body").one("click","textarea",function(){var c=a(this),d=c.parent().index(),e=c.closest("tr").index(); 
    35 if("#rowspan#"==b){if(0==e){alert(tablepress_strings.no_rowspan_first_row);return}if(tp.table.head&&1==e){alert(tablepress_strings.no_rowspan_table_head);return}if(tp.table.foot&&tp.table.rows-1==e){alert(tablepress_strings.no_rowspan_table_foot);return}}else if("#colspan#"==b&&tp.table.no_data_columns_pre==d){alert(tablepress_strings.no_colspan_first_col);return}c.val(b);tp.table.set_table_changed()})}}},check:{table_id:function(b){37==b.which||39==b.which||(b=a(this),b.val(b.val().replace(/[^0-9a-zA-Z-_]/g, 
    36 "")))},changes_saved:function(){if(tp.made_changes)return tablepress_strings.unsaved_changes_unload}},reindex:function(){var b,c=a("#edit-form-body").children(),d,e={};tp.table.rows=c.length;tp.table.columns=0<tp.table.rows?c.first().children().length-tp.table.no_data_columns_pre-tp.table.no_data_columns_post:0;c.each(function(c,h){b=a(h);b.find("textarea").val(function(b,c){return""==c||"="!=c.charAt(0)?c:c.replace(/([A-Z]+[0-9]+)(?::([A-Z]+[0-9]+))?/g,function(b,c,f){e.hasOwnProperty(c)||(d=a("#cell-"+ 
     5a("#notice-datatables-head-row").toggle(!tp.table.head);tp.rows.stripe()},change_table_foot:function(){tp.table.foot=a(this).prop("checked");tp.rows.stripe()},change_print_name_description:function(){a("#"+this.id+"-position").prop("disabled",!a(this).prop("checked"))},change_datatables:function(){var b=a("#option-use-datatables"),c=!(b.prop("checked")&&!b.prop("disabled"));b.closest("tbody").find("input").not(b).prop("disabled",c);tp.table.change_datatables_pagination()},change_datatables_pagination:function(){var b= 
     6a("#option-datatables-paginate"),b=b.prop("checked")&&!b.prop("disabled");a("#option-datatables-lengthchange").prop("disabled",!b);a("#option-datatables-paginate_entries").prop("disabled",!b)},prepare_ajax_request:function(b,c){var d=a("#edit-form-body"),e=[],f,h={rows:tp.table.rows,columns:tp.table.columns,hidden_rows:0,hidden_columns:0},g={rows:[],columns:[]};d.children().each(function(b,c){e[b]=a(c).find("textarea").map(function(){return a(this).val()}).get()});e=JSON.stringify(e);f={table_head:tp.table.head, 
     7table_foot:tp.table.foot,alternating_row_colors:a("#option-alternating-row-colors").prop("checked"),row_hover:a("#option-row-hover").prop("checked"),print_name:a("#option-print-name").prop("checked"),print_description:a("#option-print-description").prop("checked"),print_name_position:a("#option-print-name-position").val(),print_description_position:a("#option-print-description-position").val(),extra_css_classes:a("#option-extra-css-classes").val(),use_datatables:a("#option-use-datatables").prop("checked"), 
     8datatables_sort:a("#option-datatables-sort").prop("checked"),datatables_filter:a("#option-datatables-filter").prop("checked"),datatables_paginate:a("#option-datatables-paginate").prop("checked"),datatables_lengthchange:a("#option-datatables-lengthchange").prop("checked"),datatables_paginate_entries:a("#option-datatables-paginate_entries").val(),datatables_info:a("#option-datatables-info").prop("checked"),datatables_scrollX:a("#option-datatables-scrollX").prop("checked"),datatables_custom_commands:a("#option-datatables-custom-commands").val()}; 
     9f=JSON.stringify(f);g.rows=d.find('input[type="hidden"]').map(function(){if("1"==a(this).val())return 1;h.hidden_rows+=1;return 0}).get();g.columns=a("#edit-form-foot").find('input[type="hidden"]').map(function(){if("1"==a(this).val())return 1;h.hidden_columns+=1;return 0}).get();g=JSON.stringify(g);return{action:b,_ajax_nonce:a(c).val(),tablepress:{id:tp.table.id,new_id:tp.table.new_id,name:a("#table-name").val(),description:a("#table-description").val(),number:h,data:e,options:f,visibility:g}}}, 
     10preview:{trigger:function(){if(!tp.made_changes)return tp.table.preview.show(a(this).attr("href")+"&TB_iframe=true"),!1;a(this).closest("p").append('<span class="animation-preview" title="'+tablepress_strings.preparing_preview+'"/>');a("body").addClass("wait");a("#table-preview").empty();a.post(ajaxurl,tp.table.prepare_ajax_request("tablepress_preview_table","#nonce-preview-table"),function(){},"json").success(tp.table.preview.ajax_success).error(tp.table.preview.ajax_error);return!1},ajax_success:function(a, 
     11c){"undefined"==typeof c||"success"!=c?tp.table.preview.error("AJAX call successful, but unclear status."):"undefined"==typeof a||null==a||"-1"==a||"undefined"==typeof a.success||!0!==a.success?tp.table.preview.error("AJAX call successful, but unclear data."):tp.table.preview.success(a)},ajax_error:function(a,c,d){tp.table.preview.error("AJAX call failed: "+c+" - "+d)},success:function(b){a("#table-preview").empty();a('<iframe id="table-preview-iframe" />').load(function(){var c=a(this).contents(); 
     12c.find("head").append(b.head_html);c.find("body").append(b.body_html)}).appendTo("#table-preview");a(".animation-preview").remove();a("body").removeClass("wait");tp.table.preview.show("#TB_inline?inlineId=preview-container")},error:function(b){a(".animation-preview").closest("p").after('<div class="preview-error error"><p><strong>'+tablepress_strings.preview_error+": "+b+"</strong></p></div>");a(".animation-preview").remove();a(".preview-error").delay(6E3).fadeOut(2E3,function(){a(this).remove()}); 
     13a("body").removeClass("wait")},show:function(b){var c=a(window).width()-120,d=a(window).height()-120;a("body.admin-bar").length&&(d-=28);tb_show(a(".show-preview-button").first().text(),b+"&height="+d+"&width="+c,!1)}}},rows:{create:function(b){var c,d,e,f="";for(c=0;c<b;c++){f+=tp.table.body_cells_pre;for(d=0;d<tp.table.columns;d++)f+=tp.table.body_cell;f+=tp.table.body_cells_post}e=a("#edit-form-foot").find(".column-hidden").map(function(){return a(this).index()}).get();return a(f).each(function(b, 
     14c){a(c).children().filter(function(a){return-1!=jQuery.inArray(a,e)}).addClass("column-hidden")})},append:function(){var b=a("#rows-append-number").val();/^[1-9][0-9]{0,4}$/.test(b)?(a("#edit-form-body").append(tp.rows.create(b)),tp.rows.stripe(),tp.reindex()):(alert(tablepress_strings.append_num_rows_invalid),a("#rows-append-number").focus().select())},insert:function(b){b=a("#edit-form-body").find("input:checked").prop("checked",b.shiftKey).closest("tr");0===b.length?alert(tablepress_strings.no_rows_selected): 
     15(b.before(tp.rows.create(1)),tp.rows.stripe(),tp.reindex())},hide:function(b){b=a("#edit-form-body").find("input:checked").prop("checked",b.shiftKey).closest("tr");0===b.length?alert(tablepress_strings.no_rows_selected):(b.addClass("row-hidden").find(".visibility").val("0"),tp.rows.stripe(),tp.table.set_table_changed())},unhide:function(b){b=a("#edit-form-body").find("input:checked").prop("checked",b.shiftKey).closest("tr");0===b.length?alert(tablepress_strings.no_rows_selected):(b.removeClass("row-hidden").find(".visibility").val("1"), 
     16tp.rows.stripe(),tp.table.set_table_changed())},remove:function(){var b,c=a("#edit-form-body").find("input:checked").closest("tr");0===c.length?alert(tablepress_strings.no_rows_selected):tp.table.rows==c.length?alert(tablepress_strings.no_remove_all_rows):(b=1==c.length?tablepress_strings.ays_remove_rows_singular:tablepress_strings.ays_remove_rows_plural,confirm(b)&&(c.remove(),tp.rows.stripe(),tp.reindex()))},move:{start:function(b,c){a(c.placeholder).removeClass("row-hidden").css("visibility","visible").html('<td colspan="'+ 
     17(tp.table.columns+tp.table.no_data_columns_pre+tp.table.no_data_columns_post)+'"><div/></td>');a(c.helper).removeClass("odd head-row foot-row")},change:function(a,c){tp.rows.stripe(c.helper)},stop:function(){tp.rows.stripe()}},sort:function(){var b=a(this).parent().index(),c=a(this).hasClass("sort-asc")?1:-1,d=a("#edit-form-body"),e=d.find(".head-row").prevAll().andSelf(),f=d.find(".foot-row").nextAll().andSelf(),h=d.children().not(e).not(f).get(),g=function(a,b){var c=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi, 
     18d=/(^[ ]*|[ ]*$)/g,e=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,f=/^0x[0-9a-f]+$/i,h=/^0/,g=a.toString().replace(d,"")||"",i=b.toString().replace(d,"")||"",d=g.replace(c,"\x00$1\x00").replace(/\0$/,"").replace(/^\0/,"").split("\x00"),c=i.replace(c,"\x00$1\x00").replace(/\0$/,"").replace(/^\0/,"").split("\x00"),g=parseInt(g.match(f))||1!=d.length&&g.match(e)&&Date.parse(g);if(e=parseInt(i.match(f))||g&&i.match(e)&&Date.parse(i)|| 
     19null){if(g<e)return-1;if(g>e)return 1}e=0;for(f=Math.max(d.length,c.length);e<f;e++){oFxNcL=!(d[e]||"").match(h)&&parseFloat(d[e])||d[e]||0;oFyNcL=!(c[e]||"").match(h)&&parseFloat(c[e])||c[e]||0;if(isNaN(oFxNcL)!==isNaN(oFyNcL))return isNaN(oFxNcL)?1:-1;typeof oFxNcL!==typeof oFyNcL&&(oFxNcL+="",oFyNcL+="");if(oFxNcL<oFyNcL)return-1;if(oFxNcL>oFyNcL)return 1}return 0};a.each(h,function(c,d){d.sort_key=a(d).children().eq(b).find("textarea").val().toUpperCase()});h.sort(function(a,b){return c*g(a.sort_key, 
     20b.sort_key)});a.each(h,function(a,b){b.sort_key=null});d.append(e);d.append(h);d.append(f);tp.rows.stripe();tp.reindex()},stripe:function(b){"undefined"==typeof b&&(b=null);var b=a(b),c=a("#edit-form-body").children().removeClass("odd head-row foot-row").not(b);c.filter(":even").addClass("odd");c=c.not(".row-hidden");b.hasClass("row-hidden")&&(c=c.not(".ui-sortable-placeholder"));tp.table.head&&c.first().addClass("head-row");tp.table.foot&&c.last().addClass("foot-row")}},columns:{append:function(){var b, 
     21c=a("#columns-append-number").val(),d=new_head_cells=new_foot_cells="";if(/^[1-9][0-9]{0,4}$/.test(c)){for(b=0;b<c;b++)d+=tp.table.body_cell,new_head_cells+=tp.table.head_cell,new_foot_cells+=tp.table.foot_cell;a("#edit-form-body").children().each(function(b,c){a(c).children().slice(-tp.table.no_data_columns_post).before(d)});a("#edit-form-head").children().slice(-tp.table.no_data_columns_post).before(new_head_cells);a("#edit-form-foot").children().slice(-tp.table.no_data_columns_post).before(new_foot_cells); 
     22tp.reindex()}else alert(tablepress_strings.append_num_columns_invalid),a("#columns-append-number").focus().select()},insert:function(b){var c,b=a("#edit-form-foot").find("input:checked").prop("checked",b.shiftKey).closest("th");0===b.length?alert(tablepress_strings.no_columns_selected):(c=b.map(function(){return a(this).index()}).get(),a("#edit-form-body").children().each(function(b,e){a(e).children().filter(function(a){return-1!=jQuery.inArray(a,c)}).before(tp.table.body_cell)}),a("#edit-form-head").children().filter(function(a){return-1!= 
     23jQuery.inArray(a,c)}).before(tp.table.head_cell),b.before(tp.table.foot_cell),tp.reindex())},hide:function(b){var c,b=a("#edit-form-foot").find("input:checked").prop("checked",b.shiftKey).closest("th");0===b.length?alert(tablepress_strings.no_columns_selected):(c=b.map(function(){return a(this).index()}).get(),a("#edit-form-body").children().add("#edit-form-head").each(function(b,e){a(e).children().filter(function(a){return-1!=jQuery.inArray(a,c)}).addClass("column-hidden")}),b.addClass("column-hidden").find(".visibility").val("0"), 
     24tp.table.set_table_changed())},unhide:function(b){var c,b=a("#edit-form-foot").find("input:checked").prop("checked",b.shiftKey).closest("th");0===b.length?alert(tablepress_strings.no_columns_selected):(c=b.map(function(){return a(this).index()}).get(),a("#edit-form-body").children().add("#edit-form-head").each(function(b,e){a(e).children().filter(function(a){return-1!=jQuery.inArray(a,c)}).removeClass("column-hidden")}),b.removeClass("column-hidden").find(".visibility").val("1"),tp.table.set_table_changed())}, 
     25remove:function(){var b,c,d=a("#edit-form-foot").find("input:checked").closest("th");0===d.length?alert(tablepress_strings.no_columns_selected):tp.table.columns==d.length?alert(tablepress_strings.no_remove_all_columns):(c=1==d.length?tablepress_strings.ays_remove_columns_singular:tablepress_strings.ays_remove_columns_plural,confirm(c)&&(b=d.map(function(){return a(this).index()}).get(),a("#edit-form-body").children().add("#edit-form-head").each(function(c,d){a(d).children().filter(function(a){return-1!= 
     26jQuery.inArray(a,b)}).remove()}),d.remove(),tp.reindex()))},move:{source_idx:-1,target_idx:-1,$rows:null,$row_children:null,$cell:null,$cells:null,$placeholder:null,$helper:null,start:function(b,c){var d=a(c.item);tp.columns.move.source_idx=d.index();tp.columns.move.$rows=a("#edit-form-body").children().add("#edit-form-foot");tp.columns.move.$cells=tp.columns.move.$rows.find(":nth-child("+(tp.columns.move.source_idx+1)+")").each(function(){tp.columns.move.$cell=a(this);a('<td class="move-placeholder"><div/></td>').insertBefore(tp.columns.move.$cell); 
     27tp.columns.move.$cell.insertAfter(tp.columns.move.$cell.nextAll().last()).clone().addClass("move-hover").insertAfter(tp.columns.move.$cell).find("textarea").val(tp.columns.move.$cell.find("textarea").val())}).hide();tp.columns.move.$helper=tp.columns.move.$rows.find(".move-hover");d=tp.columns.move.$helper.eq(1).width();tp.columns.move.$helper.eq(0).width(d);tp.columns.move.$placeholder=tp.columns.move.$rows.find(".move-placeholder");tp.columns.move.$placeholder.find("div").width(d)},change:function(b, 
     28c){tp.columns.move.target_idx=a(c.placeholder).index();1==tp.columns.move.target_idx-tp.columns.move.source_idx?tp.columns.move.target_idx+=1:tp.columns.move.target_idx==tp.columns.move.source_idx&&(tp.columns.move.target_idx-=1);tp.columns.move.$placeholder.each(function(){tp.columns.move.$cell=a(this);tp.columns.move.$cell.insertBefore(tp.columns.move.$cell.parent().children().eq(tp.columns.move.target_idx))});tp.columns.move.target_idx>tp.columns.move.source_idx&&(tp.columns.move.target_idx-=1); 
     29tp.columns.move.source_idx=tp.columns.move.target_idx},sort:function(a,c){tp.columns.move.$helper.css("left",c.position.left)},stop:function(){tp.columns.move.$helper.remove();tp.columns.move.$cells.each(function(){tp.columns.move.$cell=a(this);tp.columns.move.$cell.insertBefore(tp.columns.move.$cell.parent().find(".move-placeholder"))}).show();tp.columns.move.$placeholder.remove();tp.columns.move.source_idx=tp.columns.move.target_idx=-1;tp.columns.move.$rows=tp.columns.move.$row_children=tp.columns.move.$cell= 
     30tp.columns.move.$cells=tp.columns.move.$placeholder=tp.columns.move.$helper=null;tp.reindex()}},number_to_letter:function(a){for(var c="";0<a;)c=String.fromCharCode(65+(a-1)%26)+c,a=Math.floor((a-1)/26);return c}},cells:{$focus:a(null),$textarea:null,autogrow:function(){tp.cells.$focus.removeClass("focus");tp.cells.$focus=a(this).closest("tr").addClass("focus")},advanced_editor:{keyopen:function(b){b.shiftKey&&(b=a("#advanced-editor-content"),tp.cells.advanced_editor.thickbox_size(),tp.cells.$textarea= 
     31a(this).blur(),b.val(tp.cells.$textarea.val()),a("#advanced-editor").wpdialog("open"),b.get(0).selectionStart=b.get(0).selectionEnd=b.val().length,b.focus())},buttonopen:function(){if(confirm(tablepress_strings.advanced_editor_open))a("#edit-form-body").one("click","textarea",function(){var b=a("#advanced-editor-content");tp.cells.advanced_editor.thickbox_size();tp.cells.$textarea=a(this).blur();b.val(tp.cells.$textarea.val());a("#advanced-editor").wpdialog("open");b.get(0).selectionStart=b.get(0).selectionEnd= 
     32b.val().length;b.focus()})},save:function(){var b=a("#advanced-editor-content").blur().val();tp.cells.$textarea.val()!=b&&(tp.cells.$textarea.val(b),tp.cells.$textarea.get(0).selectionStart=tp.cells.$textarea.get(0).selectionEnd=tp.cells.$textarea.val().length,tp.table.set_table_changed());tp.cells.$textarea.focus();tp.cells.advanced_editor.close()},close:function(){a("#advanced-editor").wpdialog("close");return!1},thickbox_size:function(){var b=a("#advanced-editor-content-add_media"),c=b.attr("href"), 
     33d=a(window).width(),d=720<d?720:d,e=a(window).height();a("body.admin-bar").length&&(e-=28);c=c.replace(/&width=[0-9]+/g,"").replace(/&height=[0-9]+/g,"");b.attr("href",c+("&width="+(d-80)+"&height="+(e-85)))}},checkboxes:{last_clicked:{"#edit-form-body":!1,"#edit-form-foot":!1},multi_select:function(b){if("undefined"==b.shiftKey)return!0;if(b.shiftKey){if(!tp.cells.checkboxes.last_clicked[b.data.parent])return!0;var c=a(b.data.parent).find(":checkbox"),d=c.index(tp.cells.checkboxes.last_clicked[b.data.parent]), 
     34e=c.index(this);d!=e&&c.slice(Math.min(d,e),Math.max(d,e)).prop("checked",a(this).prop("checked"))}tp.cells.checkboxes.last_clicked[b.data.parent]=this;return!0}}},content:{link:{add:function(){if(confirm(tablepress_strings.link_add))a("#edit-form-body").one("mousedown","textarea",function(){wpActiveEditor=this.id;a(window).one("mouseup",function(){wpLink.open();tp.table.set_table_changed()})})}},image:{add:function(){if(confirm(tablepress_strings.image_add))a("#edit-form-body").one("click","textarea", 
     35function(){wpActiveEditor=this.id;this.selectionStart=this.selectionEnd=this.value.length;var b=a("#image-add"),c=a(window).width(),c=720<c?720:c,d=a(window).height();a("body.admin-bar").length&&(d-=28);tb_show(b.text(),b.attr("href")+"&TB_iframe=true&height="+(d-85)+"&width="+(c-80),!1);a(this).blur()});return!1}},span:{add:function(b){if(confirm(tablepress_strings.span_add))a("#edit-form-body").one("click","textarea",function(){var c=a(this),d=c.parent().index(),e=c.closest("tr").index();if("#rowspan#"== 
     36b){if(0==e){alert(tablepress_strings.no_rowspan_first_row);return}if(tp.table.head&&1==e){alert(tablepress_strings.no_rowspan_table_head);return}if(tp.table.foot&&tp.table.rows-1==e){alert(tablepress_strings.no_rowspan_table_foot);return}}else if("#colspan#"==b&&tp.table.no_data_columns_pre==d){alert(tablepress_strings.no_colspan_first_col);return}c.val(b);tp.table.set_table_changed()})}}},check:{table_id:function(b){37==b.which||39==b.which||(b=a(this),b.val(b.val().replace(/[^0-9a-zA-Z-_]/g,"")))}, 
     37changes_saved:function(){if(tp.made_changes)return tablepress_strings.unsaved_changes_unload}},reindex:function(){var b,c=a("#edit-form-body").children(),d,e={};tp.table.rows=c.length;tp.table.columns=0<tp.table.rows?c.first().children().length-tp.table.no_data_columns_pre-tp.table.no_data_columns_post:0;c.each(function(c,h){b=a(h);b.find("textarea").val(function(b,c){return""==c||"="!=c.charAt(0)?c:c.replace(/([A-Z]+[0-9]+)(?::([A-Z]+[0-9]+))?/g,function(b,c,f){e.hasOwnProperty(c)||(d=a("#cell-"+ 
    3738c),e[c]=d.length?tp.columns.number_to_letter(d.parent().index()-tp.table.no_data_columns_pre+1)+(d.closest("tr").index()+1):c);b=e[c];"undefined"!=typeof f&&(e.hasOwnProperty(f)||(d=a("#cell-"+f),e[f]=d.length?tp.columns.number_to_letter(d.parent().index()-tp.table.no_data_columns_pre+1)+(d.closest("tr").index()+1):f),b+=":"+e[f]);return b})}).attr("name",function(a){return"table[data]["+c+"]["+a+"]"});b.find(".move-handle").html(c+1)}).each(function(b,c){a(c).find("textarea").attr("id",function(a){return"cell-"+ 
    3839tp.columns.number_to_letter(a+1)+(b+1)})});a("#edit-form-head").find(".move-handle").html(function(a){return tp.columns.number_to_letter(a+1)});a("#number-rows").val(tp.table.rows);a("#number-columns").val(tp.table.columns);tp.table.set_table_changed()},save_changes:{trigger:function(b){/[^A-Za-z0-9- _]/.test(a("#option-extra-css-classes").val())?(alert(tablepress_strings.extra_css_classes_invalid),a("#option-extra-css-classes").focus().select()):b.shiftKey?(tp.made_changes=!1,a("#tablepress-page").find("form").submit()): 
     
    4344tablepress_strings["save_changes_"+b]+c+"</strong></p></div>");a(".animation-saving").remove();a(".save-changes-"+b).delay(d).fadeOut(2E3,function(){a(this).remove()});a(".save-changes-button").prop("disabled",!1);a("body").removeClass("wait")}},init:function(){var b={click:{"#rows-insert":tp.rows.insert,"#columns-insert":tp.columns.insert,"#rows-remove":tp.rows.remove,"#columns-remove":tp.columns.remove,"#rows-hide":tp.rows.hide,"#columns-hide":tp.columns.hide,"#rows-unhide":tp.rows.unhide,"#columns-unhide":tp.columns.unhide, 
    4445"#rows-append":tp.rows.append,"#columns-append":tp.columns.append,"#link-add":tp.content.link.add,"#image-add":tp.content.image.add,"#span-add-rowspan":function(){tp.content.span.add("#rowspan#")},"#span-add-colspan":function(){tp.content.span.add("#colspan#")},".show-preview-button":tp.table.preview.trigger,".save-changes-button":tp.save_changes.trigger,".show-help-box":function(){a(this).next().wpdialog({title:a(this).attr("title"),height:400,width:300,modal:!0,dialogClass:"wp-dialog",resizable:!1})}}, 
    45 keyup:{"#table-new-id":tp.check.table_id},change:{"#option-table-head":tp.table.change_table_head,"#option-table-foot":tp.table.change_table_foot,"#option-use-datatables":tp.table.change_datatables,"#option-datatables-paginate":tp.table.change_datatables_pagination},blur:{"#table-new-id":tp.table.change_id}},c=a("#edit-form-body");a.each(b,function(b,c){a.each(c,function(c,e){a(c).on(b,e)})});a(window).on("beforeunload",tp.check.changes_saved);a("#option-table-head").change();c.one("change","textarea", 
    46 tp.table.set_table_changed);a("#tablepress_edit-table-information, #tablepress_edit-table-options, #tablepress_edit-datatables-features").one("change","input, textarea, select",tp.table.set_table_changed);tablepress_options.cells_advanced_editor?(c.on("click","textarea",tp.cells.advanced_editor.keyopen),a("#advanced-editor-open").on("click",tp.cells.advanced_editor.buttonopen),a("#advanced-editor-confirm").on("click",tp.cells.advanced_editor.save),a("#advanced-editor-cancel").on("click",tp.cells.advanced_editor.close), 
    47 a("#advanced-editor").wpdialog({autoOpen:!1,title:a("#advanced-editor-open").val(),width:600,modal:!0,dialogClass:"wp-dialog",resizable:!1})):a("#advanced-editor-open").hide();if(tablepress_options.cells_auto_grow)c.on("focus","textarea",tp.cells.autogrow);a("#edit-form-body").on("click","input:checkbox",{parent:"#edit-form-body"},tp.cells.checkboxes.multi_select);a("#edit-form-foot").on("click","input:checkbox",{parent:"#edit-form-foot"},tp.cells.checkboxes.multi_select);a("#edit-form-head").on("click", 
    48 ".sort-control",tp.rows.sort);a("#tablepress-page").find("form").on("submit",function(){a(this).find(".tablepress-postbox-table").find("input, select").prop("disabled",false)});c.sortable({axis:"y",containment:a("#edit-form"),forceHelperSize:!0,handle:".move-handle",start:tp.rows.move.start,change:tp.rows.move.change,stop:tp.rows.move.stop,update:tp.reindex});a("#edit-form-head").sortable({axis:"x",items:".head",containment:"parent",forceHelperSize:!0,helper:"clone",handle:".move-handle",start:tp.columns.move.start, 
    49 stop:tp.columns.move.stop,change:tp.columns.move.change,sort:tp.columns.move.sort}).disableSelection()}};a("#wpbody-content").css("overflow-x","scroll");tp.init();window.send_to_editor=function(a){"undefined"!=typeof QTags?QTags.insertContent(a):document.getElementById(wpActiveEditor).value+=a;try{tb_remove()}catch(c){}tp.table.set_table_changed()}}); 
     46keyup:{"#table-new-id":tp.check.table_id},change:{"#option-table-head":tp.table.change_table_head,"#option-table-foot":tp.table.change_table_foot,"#option-use-datatables":tp.table.change_datatables,"#option-datatables-paginate":tp.table.change_datatables_pagination},blur:{"#table-new-id":tp.table.change_id}},c=a("#edit-form-body");a.each(b,function(b,c){a.each(c,function(c,e){a(c).on(b,e)})});a(window).on("beforeunload",tp.check.changes_saved);a("#option-table-head").change();a("#option-print-name").change(tp.table.change_print_name_description).change(); 
     47a("#option-print-description").change(tp.table.change_print_name_description).change();c.one("change","textarea",tp.table.set_table_changed);a("#tablepress_edit-table-information, #tablepress_edit-table-options, #tablepress_edit-datatables-features").one("change","input, textarea, select",tp.table.set_table_changed);tablepress_options.cells_advanced_editor?(c.on("click","textarea",tp.cells.advanced_editor.keyopen),a("#advanced-editor-open").on("click",tp.cells.advanced_editor.buttonopen),a("#advanced-editor-confirm").on("click", 
     48tp.cells.advanced_editor.save),a("#advanced-editor-cancel").on("click",tp.cells.advanced_editor.close),a("#advanced-editor").wpdialog({autoOpen:!1,title:a("#advanced-editor-open").val(),width:600,modal:!0,dialogClass:"wp-dialog",resizable:!1})):a("#advanced-editor-open").hide();if(tablepress_options.cells_auto_grow)c.on("focus","textarea",tp.cells.autogrow);a("#edit-form-body").on("click","input:checkbox",{parent:"#edit-form-body"},tp.cells.checkboxes.multi_select);a("#edit-form-foot").on("click", 
     49"input:checkbox",{parent:"#edit-form-foot"},tp.cells.checkboxes.multi_select);a("#edit-form-head").on("click",".sort-control",tp.rows.sort);a("#tablepress-page").find("form").on("submit",function(){a(this).find(".tablepress-postbox-table").find("input, select").prop("disabled",!1)});c.sortable({axis:"y",containment:a("#edit-form"),forceHelperSize:!0,handle:".move-handle",start:tp.rows.move.start,change:tp.rows.move.change,stop:tp.rows.move.stop,update:tp.reindex});a("#edit-form-head").sortable({axis:"x", 
     50items:".head",containment:"parent",forceHelperSize:!0,helper:"clone",handle:".move-handle",start:tp.columns.move.start,stop:tp.columns.move.stop,change:tp.columns.move.change,sort:tp.columns.move.sort}).disableSelection()}};a("#wpbody-content").css("overflow-x","scroll");tp.init();window.send_to_editor=function(a){"undefined"!=typeof QTags?QTags.insertContent(a):document.getElementById(wpActiveEditor).value+=a;try{tb_remove()}catch(c){}tp.table.set_table_changed()}}); 
  • tablepress/trunk/admin/list.js

    r589540 r607623  
    3131            height -= 28; 
    3232        tb_show( $(this).text(), $(this).attr( 'href' ) + 'TB_iframe=true&height=' + height + '&width=' + width, false ); 
     33        return false; 
     34    } ); 
     35 
     36    /** 
     37     * Process links with a class "ajax-link" with AJAX 
     38     * 
     39     * @since 1.0.0 
     40     */ 
     41    $( '#tablepress-page' ).on( 'click', '.ajax-link', function( /* event */ ) { 
     42        var $link = $( this ), 
     43            action = $link.data( 'action' ), 
     44            item = $link.data( 'item' ), 
     45            target = $link.data( 'target' ); 
     46        $.get( 
     47            ajaxurl, 
     48            this.href.split('?')['1'], /* query string of the link */ 
     49            function( result ) { 
     50                if ( '1' != result ) 
     51                    return; 
     52 
     53                switch ( action ) { 
     54                    case 'hide_message': 
     55                        /* Donation message links show new message */ 
     56                        if ( 'donation_nag' == item && '' != target ) { 
     57                            $link.closest( 'div' ).after( '<div class="donation-message-after-click-message updated"><p><strong>' + tablepress_list['donation-message-' + target] + '</strong></p></div>' ); 
     58                            $( '.donation-message-after-click-message' ).delay( 10000 ).fadeOut( 2000, function() { $(this).remove(); } ); 
     59                        } 
     60 
     61                        /* Remove original message */ 
     62                        $link.closest( 'div' ).remove(); 
     63                        break; 
     64                } 
     65            } 
     66        ); 
    3367        return false; 
    3468    } ); 
  • tablepress/trunk/admin/list.min.js

    r589540 r607623  
    1 jQuery(document).ready(function(a){a(".tablepress-all-tables").on("click",".shortcode a",function(){prompt(tablepress_list.shortcode_popup,a(this).attr("title"));return!1});a(".tablepress-all-tables").on("click",".table-preview a",function(){var b=a(window).width()-120,c=a(window).height()-120;a("body.admin-bar").length&&(c-=28);tb_show(a(this).text(),a(this).attr("href")+"TB_iframe=true&height="+c+"&width="+b,!1);return!1});a("#doaction, #doaction2").on("click",function(){var b,c=a(".tablepress-all-tables").find("tbody").find("input:checked").length; 
    2 b="doaction"==this.id?"top":"bottom";if("-1"==a("#bulk-action-"+b).val()||0==c||"delete"==a("#bulk-action-"+b).val()&&(b=1==c?tablepress_common.ays_delete_single_table:tablepress_common.ays_delete_multiple_tables,!confirm(b)))return!1})}); 
     1jQuery(document).ready(function(a){a(".tablepress-all-tables").on("click",".shortcode a",function(){prompt(tablepress_list.shortcode_popup,a(this).attr("title"));return!1});a(".tablepress-all-tables").on("click",".table-preview a",function(){var b=a(window).width()-120,c=a(window).height()-120;a("body.admin-bar").length&&(c-=28);tb_show(a(this).text(),a(this).attr("href")+"TB_iframe=true&height="+c+"&width="+b,!1);return!1});a("#tablepress-page").on("click",".ajax-link",function(){var b=a(this),c= 
     2b.data("action"),e=b.data("item"),d=b.data("target");a.get(ajaxurl,this.href.split("?")["1"],function(f){if("1"==f)switch(c){case "hide_message":"donation_nag"==e&&(""!=d&&"undefined"!=typeof tablepress_list&&"undefined"!=typeof tablepress_list["donation-message-"+d])&&(b.closest("div").after('<div class="donation-message-after-click-message updated"><p><strong>'+tablepress_list["donation-message-"+d]+"</strong></p></div>"),a(".donation-message-after-click-message").delay(1E4).fadeOut(2E3,function(){a(this).remove()})), 
     3b.closest("div").remove()}});return!1});a("#doaction, #doaction2").on("click",function(){var b,c=a(".tablepress-all-tables").find("tbody").find("input:checked").length;b="doaction"==this.id?"top":"bottom";if("-1"==a("#bulk-action-"+b).val()||0==c||"delete"==a("#bulk-action-"+b).val()&&(b=1==c?tablepress_common.ays_delete_single_table:tablepress_common.ays_delete_multiple_tables,!confirm(b)))return!1})}); 
  • tablepress/trunk/classes/class-admin-page-helper.php

    r598765 r607623  
    4343     * @param array $dependencies List of names of JS scripts that this script depends on, and which need to be included before this one 
    4444     * @param bool|array $localize_script (optional) An array with strings that gets transformed into a JS object and is added to the page before the script is included 
     45     * @param bool $force_minified Always load the minified version, regardless of SCRIPT_DEBUG constant value 
    4546     */ 
    46     public function enqueue_script( $name, $dependencies = array(), $localize_script = false ) { 
    47         $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; 
     47    public function enqueue_script( $name, $dependencies = array(), $localize_script = false, $force_minified = false ) { 
     48        $suffix = ( ! $force_minified && defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; 
    4849        $js_file = "admin/{$name}{$suffix}.js"; 
    4950        $js_url = plugins_url( $js_file, TABLEPRESS__FILE__ ); 
  • tablepress/trunk/classes/class-controller.php

    r598765 r607623  
    4646     * @var string 
    4747     */ 
    48     public $parent_page = 'bottom'; 
     48    public $parent_page = 'middle'; 
    4949 
    5050    /** 
     
    110110        if ( $this->model_options->get( 'table_scheme_db_version' ) < TablePress::table_scheme_version ) { 
    111111            $this->model_table->merge_table_options_defaults(); 
     112 
     113            // Merge print_name/print_description changes made for 0.6-beta, @TODO: Remove in 1.0 
     114            if ( $this->model_options->get( 'table_scheme_db_version' ) < 2 ) 
     115                $this->model_table->merge_table_options_tp06(); 
     116 
    112117            $this->model_options->update( array( 
    113118                'table_scheme_db_version' => TablePress::table_scheme_version 
  • tablepress/trunk/classes/class-export.php

    r589540 r607623  
    6363            ';' => __( '; (semicolon)', 'tablepress' ), 
    6464            ',' => __( ', (comma)', 'tablepress' ), 
    65             'tab' => __( '\t (tabulator)', 'tablepress' ), 
    66             ':' => __( ': (colon)', 'tablepress' ), 
    67             '.' => __( '. (dot)', 'tablepress' ), 
    68             '|' => __( '| (pipe)', 'tablepress' ) 
     65            'tab' => __( '\t (tabulator)', 'tablepress' ) 
    6966        ); 
    7067 
     
    8582     */ 
    8683    public function export_table( $table, $export_format, $csv_delimiter ) { 
    87         switch( $export_format ) { 
     84        switch ( $export_format ) { 
    8885            case 'csv': 
    8986                $output = ''; 
  • tablepress/trunk/classes/class-import.php

    r598765 r607623  
    9797     */ 
    9898    function import_table( $format, $data ) { 
    99  
    10099        // check and remove possible UTF-8 Byte-Order Mark (BOM) 
    101100        $bom = pack( 'CCC', 0xef, 0xbb, 0xbf ); 
     
    117116                $this->import_json(); 
    118117                break; 
    119             /*case 'wp_table': 
    120                 $this->import_wp_table(); 
    121                 break;*/ 
    122118            default: 
    123119                return false; 
    124120        } 
    125121 
    126         // only check this, if needed functions are available (needs PHP library "mbstring") 
    127         if ( function_exists( 'mb_detect_encoding' ) && function_exists( 'mb_check_encoding' ) && function_exists( 'utf8_encode' ) 
    128         && false != $this->imported_table ) 
     122        if ( ! empty( $this->imported_table ) ) 
    129123            $this->fix_table_encoding(); 
    130124 
     
    133127 
    134128    /** 
    135      * 
     129     * Import CSV data 
    136130     * 
    137131     * @since 1.0.0 
     
    146140 
    147141    /** 
    148      * 
     142     * Import HTML data 
    149143     * 
    150144     * @since 1.0.0 
     
    213207 
    214208    /** 
    215      * 
    216      * 
    217      * @since 1.0.0 
     209     * Helper for HTML import 
     210     * 
     211     * @since 1.0.0 
     212     * 
     213     * @param string $element XMLElement 
     214     * @return array XMLElement exported to an array 
    218215     */ 
    219216    protected function _import_html_rows( $element ) { 
     
    239236 
    240237    /** 
    241      * 
     238     * Import JSON data 
    242239     * 
    243240     * @since 1.0.0 
     
    252249     * 
    253250     * @since 1.0.0 
     251     * 
     252     * @param array $array Two-dimensional array to be padded 
     253     * @return array Padded array 
    254254     */ 
    255255    protected function pad_array_to_max_cols( $array ) { 
     
    265265 
    266266    /** 
    267      * Get the biggest number of columns in the rows 
    268      * 
    269      * @since 1.0.0 
     267     * Get the highest number of columns in the rows 
     268     * 
     269     * @since 1.0.0 
     270     * 
     271     * @param array $array Two-dimensional array 
     272     * @return int Highest number of columns in the rows of the array 
    270273     */ 
    271274    protected function count_max_columns( $array ) { 
     
    283286    /** 
    284287     * Fixes the encoding to UTF-8 for a cell 
    285      * 
    286      * @TODO: DO WE REALLY WANT THIS? IS THERE A BETTER WAY using iconv()? 
    287      * 
    288      * @since 1.0.0 
     288     * @TODO: Function is not yet implemented 
     289     * 
     290     * @since 1.0.0 
     291     * 
     292     * @param string $string String to be encoded correctly 
     293     * @return string Correctly encoded string 
    289294     */ 
    290295    protected function fix_encoding( $string ) { 
    291         // @TODO: Don't use for now 
    292         // return ( 'UTF-8' == mb_detect_encoding( $string ) && mb_check_encoding( $string, 'UTF-8' ) ) ? $string : utf8_encode( $string ); 
     296        // @TODO: Is this maybe possible with iconv()? 
    293297        return $string; 
    294298    } 
     
    304308 
    305309        foreach ( $this->imported_table as $row_idx => $row ) { 
    306             $this->imported_table[$row_idx] = array_map( array( &$this, 'fix_encoding' ), $row ); 
     310            $this->imported_table[ $row_idx ] = array_map( array( &$this, 'fix_encoding' ), $row ); 
    307311        } 
    308312    } 
  • tablepress/trunk/classes/class-render.php

    r600237 r607623  
    368368        $num_columns = ( $num_rows > 0 ) ? count( $this->table['data'][0] ) : 0; 
    369369 
    370         // check if there are rows and columns in the table (might not be the case after removing to hidden rows/columns!) 
     370        // check if there are rows and columns in the table (might not be the case after removing hidden rows/columns!) 
    371371        if ( 0 === $num_rows || 0 === $num_columns ) { 
    372372            $this->output = sprintf( __( '<!-- The table with the ID %s is empty! -->', 'tablepress' ), $this->table['id'] ); // @TODO: Maybe use a more meaningful output here? 
     
    388388        $output = ''; 
    389389 
    390         if ( 'no' != $this->render_options['print_name'] ) { 
     390        if ( $this->render_options['print_name'] ) { 
    391391            $print_name_html_tag = apply_filters( 'tablepress_print_name_html_tag', 'h2', $this->table['id'] ); 
    392392            $print_name_css_class = apply_filters( 'tablepress_print_name_css_class', "tablepress-table-name tablepress-table-name-id-{$this->table['id']}", $this->table['id'] ); 
    393393            $print_name_html = "<{$print_name_html_tag} class=\"{$print_name_css_class}\">" . $this->safe_output( $this->table['name'] ) . "</{$print_name_html_tag}>\n"; 
    394394        } 
    395         if ( 'no' != $this->render_options['print_description'] ) { 
     395        if ( $this->render_options['print_description'] ) { 
    396396            $print_description_html_tag = apply_filters( 'tablepress_print_description_html_tag', 'span', $this->table['id'] ); 
    397397            $print_description_css_class = apply_filters( 'tablepress_print_description_css_class', "tablepress-table-description tablepress-table-description-id-{$this->table['id']}", $this->table['id'] ); 
     
    399399        } 
    400400 
    401         if ( 'above' == $this->render_options['print_name'] ) 
     401        if ( $this->render_options['print_name'] && 'above' == $this->render_options['print_name_position'] ) 
    402402            $output .= $print_name_html; 
    403         if ( 'above' == $this->render_options['print_description'] ) 
     403        if ( $this->render_options['print_description'] && 'above' == $this->render_options['print_description_position'] ) 
    404404            $output .= $print_description_html; 
    405405 
     
    435435                $caption .= '<br />'; 
    436436            $caption .= "<a href=\"{$this->render_options['edit_table_url']}\" title=\"" . __( 'Edit', 'default' ) . "\">" . __( 'Edit', 'default' ) . "</a>"; 
    437             $caption_style = ' style="caption-side:bottom;text-align:left;border:none;background:none;"'; 
     437            $caption_style = ' style="caption-side:bottom;text-align:left;border:none;background:none;margin:0;"'; 
    438438        } 
    439439        if ( ! empty( $caption ) ) 
     
    480480 
    481481        // name/description below table (HTML already generated above) 
    482         if ( 'below' == $this->render_options['print_name'] ) 
     482        if ( $this->render_options['print_name'] && 'below' == $this->render_options['print_name_position'] ) 
    483483            $output .= $print_name_html; 
    484         if ( 'below' == $this->render_options['print_description'] ) 
     484        if ( $this->render_options['print_description'] && 'below' == $this->render_options['print_description_position'] ) 
    485485            $output .= $print_description_html; 
    486486 
     
    520520                    continue; 
    521521                } 
    522                 // invalid rowspan, so we set cell content from #rowspan# to a space 
    523                 $cell_content = '&nbsp;'; 
     522                // invalid rowspan, so we set cell content from #rowspan# to empty 
     523                $cell_content = ''; 
    524524            } elseif ( $this->span_trigger['colspan'] == $cell_content ) { // there will be a colspan 
    525525                // check for #colspan# in first column, which doesn't make sense 
     
    530530                    continue; 
    531531                } 
    532                 // invalid colspan, so we set cell content from #colspan# to a space 
    533                 $cell_content = '&nbsp;'; 
     532                // invalid colspan, so we set cell content from #colspan# to empty 
     533                $cell_content = ''; 
    534534            } elseif ( $this->span_trigger['span'] == $cell_content ) { // there will be a combined col- and rowspan 
    535535                // check for #span# in first column or first or last row, which is not always possible 
     
    537537                // we are in first, second, or last row or in the first or second column, so more checks are necessary 
    538538                || ( ( 1 == $row_idx && ! $this->render_options['table_head'] ) // no rowspan into table_head 
    539                     && ( 1 == $col_idx && ! $this->render_options['first_column_th'] ) ) // and no colspan into first column head 
     539                    && ( $col_idx > 1 || ( 1 == $col_idx && ! $this->render_options['first_column_th'] ) ) ) // and no colspan into first column head 
    540540                || ( ( $this->last_row_idx == $row_idx && ! $this->render_options['table_foot'] ) // no rowspan out of table_foot 
    541                     && ( 1 == $col_idx && ! $this->render_options['first_column_th'] ) ) ) // and no colspan into first column head 
     541                    && ( $col_idx > 1 || ( 1 == $col_idx && ! $this->render_options['first_column_th'] ) ) ) ) // and no colspan into first column head 
    542542                    continue; 
    543543                // invalid span, so we set cell content from #span# to empty 
     
    546546 
    547547            $span_attr = ''; 
     548            if ( $this->colspan[ $row_idx ] > 1 ) // we have colspaned cells 
     549                $span_attr .= " colspan=\"{$this->colspan[ $row_idx ]}\""; 
     550            if ( $this->rowspan[ $col_idx ] > 1 ) // we have rowspaned cells 
     551                $span_attr .= " rowspan=\"{$this->rowspan[ $col_idx ]}\""; 
    548552            $cell_class = 'column-' . ( $col_idx + 1 ); 
    549             if ( $this->colspan[ $row_idx ] > 1 ) { // we have colspaned cells 
    550                 $span_attr .= " colspan=\"{$this->colspan[ $row_idx ]}\""; 
    551                 $cell_class .= " colspan-{$this->colspan[ $row_idx ]}"; 
    552             } 
    553             if ( $this->rowspan[ $col_idx ] > 1 ) { // we have rowspaned cells 
    554                 $span_attr .= " rowspan=\"{$this->rowspan[ $col_idx ]}\""; 
    555                 $cell_class .= " rowspan-{$this->rowspan[ $col_idx ]}"; 
    556             } 
    557  
    558553            $cell_class = apply_filters( 'tablepress_cell_css_class', $cell_class, $this->table['id'], $cell_content, $row_idx + 1, $col_idx + 1, $this->colspan[ $row_idx ], $this->rowspan[ $col_idx ] ); 
    559554            $class_attr = ( ! empty( $cell_class ) ) ? " class=\"{$cell_class}\"" : ''; 
     
    568563        } 
    569564 
    570         // @TODO: Maybe apply row-$row_idx and alternate colors classes only to body rows? 
    571565        $row_class = 'row-' . ( $row_idx + 1 ) ; 
    572566        if ( $this->render_options['alternating_row_colors'] ) 
     
    593587        // replace any & with &amp; that is not already an encoded entity (from function htmlentities2 in WP 2.8) 
    594588        // complete htmlentities2() or htmlspecialchars() would encode <HTML> tags, which we don't want 
    595         $string = preg_replace( "/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,4};)/", "&amp;", $string ); 
     589        $string = preg_replace( '/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,4};)/', '&amp;', $string ); 
    596590        // substitute line breaks with HTML <br> tags, nl2br can be overwritten to false, if not wanted 
    597591        if ( apply_filters( 'tablepress_apply_nl2br', true, $this->table['id'] ) ) 
     
    617611            'first_column_th' => false, 
    618612            'print_name' => null, 
     613            'print_name_position' => null, 
    619614            'print_description' => null, 
     615            'print_description_position' => null, 
    620616            'cache_table_output' => true, 
    621617            'extra_css_classes' => null, 
     
    651647        return <<<CSS 
    652648<style type="text/css"> 
     649body { 
     650    font-family: sans-serif; 
     651} 
    653652.tablepress { 
    654653    border-collapse: collapse; 
    655     border: 2px solid #000000; 
     654    border: none; 
    656655    margin: 10px auto; 
    657656} 
     
    660659    box-sizing: border-box; 
    661660    width: 200px; 
    662     border: 1px solid #dddddd; 
    663     padding: 3px; 
     661    padding: 8px; 
     662    text-align: left; 
     663} 
     664.tablepress tbody tr, 
     665.tablepress tfoot tr { 
     666    border-top: 1px solid #dddddd; 
     667} 
     668.tablepress tbody tr:first-child { 
     669    border-top: 0; 
     670} 
     671.tablepress thead tr { 
     672    border-bottom: 1px solid #dddddd; 
    664673} 
    665674.tablepress thead tr, 
    666675.tablepress tfoot tr { 
    667     background-color: #e6eeee; 
     676    background-color: #d9edf7; 
    668677} 
    669678.tablepress tbody tr.even { 
     
    671680} 
    672681.tablepress tbody tr.odd { 
    673     background-color: #eeeeee; 
     682    background-color: #f9f9f9; 
    674683} 
    675684.tablepress .row-hover tr:hover { 
    676     background-color: #d0d0d6; 
     685    background-color: #f3f3f3; 
    677686} 
    678687</style> 
  • tablepress/trunk/classes/class-tablepress.php

    r598765 r607623  
    2828     * @const string 
    2929     */ 
    30     const version = '0.5-alpha'; 
     30    const version = '0.6-beta'; 
    3131 
    3232    /** 
     
    3939     * @const int 
    4040     */ 
    41     const db_version = 8; 
     41    const db_version = 9; 
    4242 
    4343    /** 
     
    5151     * @const int 
    5252     */ 
    53     const table_scheme_version = 1; 
     53    const table_scheme_version = 2; 
    5454 
    5555    /** 
  • tablepress/trunk/classes/class-view.php

    r598765 r607623  
    151151 
    152152        // Set page <title> 
    153         $GLOBALS['title'] = sprintf( __( '%s &lsaquo; TablePress', 'tablepress' ), $this->data['view_actions'][ $this->action ]['page_title'] ); 
     153        $GLOBALS['title'] = sprintf( __( '%1$s &lsaquo; %2$s', 'tablepress' ), $this->data['view_actions'][ $this->action ]['page_title'], 'TablePress' ); 
    154154 
    155155        // admin page helpers, like script/style loading, could be moved to view 
     
    166166            ) 
    167167        ) ); 
     168 
    168169        $this->admin_page->add_admin_footer_text(); 
    169170 
     
    397398        $caption = isset( $data['submit_button_caption'] ) ? $data['submit_button_caption'] : __( 'Save Changes', 'tablepress' ); 
    398399        ?> 
    399         <p class="submit"><input type="submit" value="<?php echo esc_attr( $caption ); ?>" class="button button-primary" name="submit" /></p> 
     400        <p class="submit"><input type="submit" value="<?php echo esc_attr( $caption ); ?>" class="button button-primary button-large" name="submit" /></p> 
    400401        <?php 
    401     } 
    402  
    403     /** 
    404      * Create HTML code for an AJAXified link 
    405      * 
    406      * @since 1.0.0 
    407      * 
    408      * @param array $params Parameters for the URL 
    409      * @param string $text Text for the link 
    410      * @return string HTML code for the link 
    411      */ 
    412     protected function ajax_link( $params = array( 'action' => 'list', 'item' => '' ), $text ) { 
    413         $url = TablePress::url( $params, true, 'admin-post.php' ); 
    414         $action = esc_attr( $params['action'] ); 
    415         return "<a class=\"ajax-link {$action}\" href=\"{$url}\">{$text}</a>"; 
    416402    } 
    417403 
  • tablepress/trunk/controllers/controller-admin.php

    r600237 r607623  
    9090        $min_access_cap = apply_filters( 'tablepress_min_access_cap', 'edit_pages' ); // @TODO: Make this a plugin option for usage here, below, and for the frontend edit link! 
    9191        $callback = array( &$this, 'show_admin_page' ); 
     92        $admin_menu_entry_name = apply_filters( 'tablepress_admin_menu_entry_name', 'TablePress' ); 
    9293 
    9394        if ( $this->is_top_level_page ) { 
     
    107108                    break; 
    108109            } 
    109             add_menu_page( 'TablePress', 'TablePress', $min_access_cap, 'tablepress', $callback, $icon_url, $position ); 
     110            add_menu_page( 'TablePress', $admin_menu_entry_name, $min_access_cap, 'tablepress', $callback, $icon_url, $position ); 
    110111            foreach ( $this->view_actions as $action => $entry ) { 
    111112                if ( ! $entry['show_entry'] ) 
     
    114115                if ( 'list' != $action ) 
    115116                    $slug .= '_' . $action; 
    116                 $this->page_hooks[] = add_submenu_page( 'tablepress', sprintf( __( '%s &lsaquo; TablePress', 'tablepress' ), $entry['page_title'] ) , $entry['admin_menu_title'], $entry['min_access_cap'], $slug, $callback ); 
     117                $this->page_hooks[] = add_submenu_page( 'tablepress', sprintf( __( '%1$s &lsaquo; %2$s', 'tablepress' ), $entry['page_title'], 'TablePress' ) , $entry['admin_menu_title'], $entry['min_access_cap'], $slug, $callback ); 
    117118            } 
    118119        } else { 
    119             $this->page_hooks[] = add_submenu_page( $this->parent_page, 'TablePress', 'TablePress', $min_access_cap, 'tablepress', $callback ); 
     120            $this->page_hooks[] = add_submenu_page( $this->parent_page, 'TablePress', $admin_menu_entry_name, $min_access_cap, 'tablepress', $callback ); 
    120121        } 
    121122    } 
     
    185186     */ 
    186187    public function add_tinymce_button( $buttons ) { 
    187         $buttons[] = '|'; 
    188188        $buttons[] = 'tablepress_insert_table'; 
    189189        return $buttons; 
     
    228228    public function plugins_page() { 
    229229        $this->init_i18n_support(); 
    230         // add message to list of plugins, if an update is available 
    231         // add_action( 'in_plugin_update_message-' . TABLEPRESS_BASENAME, array( &$this, 'add_plugin_update_message' ), 10, 2 ); 
    232230        // add additional links on Plugins page 
    233         add_filter( 'plugin_row_meta', array( &$this, 'add_plugin_row_meta' ), 10, 2); 
    234     } 
    235  
    236     /** 
    237      * Add links to the TablePress entry on the Plugins page 
    238      * 
    239      * @since 1.0.0 
    240      * 
    241      * @param array $links List of links to print on the Plugins page 
     231        add_filter( 'plugin_action_links_' . TABLEPRESS_BASENAME, array( &$this, 'add_plugin_action_links' ) ); 
     232        add_filter( 'plugin_row_meta', array( &$this, 'add_plugin_row_meta' ), 10, 2 ); 
     233    } 
     234 
     235    /** 
     236     * Add links to the TablePress entry in the "Plugin" column on the Plugins page 
     237     * 
     238     * @since 1.0.0 
     239     * 
     240     * @param array $links List of links to print in the "Plugin" column on the Plugins page 
     241     * @return array Extended list of links to print in the "Plugin" column on the Plugins page 
     242     */ 
     243    public function add_plugin_action_links( $links ) { 
     244        $links[] = '<a href="' . TablePress::url() . '" title="' . __( 'TablePress Plugin page', 'tablepress' ) . '">' . __( 'Plugin page', 'tablepress' ) . '</a>'; 
     245        return $links; 
     246    } 
     247    /** 
     248     * Add links to the TablePress entry in the "Description" column on the Plugins page 
     249     * 
     250     * @since 1.0.0 
     251     * 
     252     * @param array $links List of links to print in the "Description" column on the Plugins page 
    242253     * @param string $file Name of the plugin 
    243      * @return array Extended list of links to print on the Plugins page 
     254     * @return array Extended list of links to print in the "Description" column on the Plugins page 
    244255     */ 
    245256    public function add_plugin_row_meta( $links, $file ) { 
    246257        if ( TABLEPRESS_BASENAME == $file ) { 
    247             $links[] = '<a href="' . TablePress::url() . '" title="' . __( 'TablePress Plugin Page', 'tablepress' ) . '">' . __( 'Plugin Page', 'tablepress' ) . '</a>'; 
    248258            $links[] = '<a href="http://tablepress.org/faq/" title="' . __( 'Frequently Asked Questions', 'tablepress' ) . '">' . __( 'FAQ', 'tablepress' ) . '</a>'; 
     259            $links[] = '<a href="http://tablepress.org/documentation/" title="' . __( 'Plugin Documentation', 'tablepress' ) . '">' . __( 'Documentation', 'tablepress' ) . '</a>'; 
    249260            $links[] = '<a href="http://tablepress.org/support/" title="' . __( 'Support', 'tablepress' ) . '">' . __( 'Support', 'tablepress' ) . '</a>'; 
    250             $links[] = '<a href="http://tablepress.org/documentation/" title="' . __( 'Plugin Documentation', 'tablepress' ) . '">' . __( 'Documentation', 'tablepress' ) . '</a>'; 
    251261            $links[] = '<a href="http://tablepress.org/donate/" title="' . __( 'Support TablePress with your donation!', 'tablepress' ) . '"><strong>' . __( 'Donate', 'tablepress' ) . '</strong></a>'; 
    252262        } 
     
    300310                $data['plugin_languages'] = $this->get_plugin_languages(); 
    301311                $data['first_activation'] = $this->model_options->get( 'first_activation' ); 
     312                $dummy_exporter = TablePress::load_class( 'TablePress_Export', 'class-export.php', 'classes' ); // just to find out about ZIP support 
     313                $data['zip_support_available'] = $dummy_exporter->zip_support_available; 
     314                unset( $dummy_exporter ); 
    302315                break; 
    303316            case 'options': 
     
    533546    /** 
    534547     * HTTP POST actions 
    535      * 
    536      * @TODO: STILL REQUIRED: 
    537      * caps check with correct user caps, like 
    538      * // if ( ! current_user_can( 'manage_options' ) ) 
    539      * //   wp_die( __('Cheatin&#8217; uh?') ); 
    540548     */ 
    541549 
     
    567575        $no_success = array(); // to store table IDs that failed 
    568576 
    569         switch( $bulk_action ) { 
     577        switch ( $bulk_action ) { 
    570578            case 'copy': 
    571579                foreach ( $tables as $table_id ) { 
     
    628636        // Evaluate options that have a checkbox (only necessary in Admin Controller, where they might not be set (if unchecked)) 
    629637        $checkbox_options = array( 
    630             'table_head', 'table_foot', 'alternating_row_colors', 'row_hover',  // Table Options 
    631             'use_datatables', 'datatables_sort', 'datatables_filter', 'datatables_paginate', 'datatables_lengthchange', 'datatables_info', 'datatables_scrollX' // DataTables JS Features @TODO: THIS NEEDS WORK (e.g. for disabled fields)! 
     638            'table_head', 'table_foot', 'alternating_row_colors', 'row_hover', 'print_name', 'print_description', // Table Options 
     639            'use_datatables', 'datatables_sort', 'datatables_filter', 'datatables_paginate', 'datatables_lengthchange', 'datatables_info', 'datatables_scrollX' // DataTables JS Features 
    632640        ); 
    633641        foreach ( $checkbox_options as $option ) { 
     
    676684 
    677685        // Perform sanity checks of posted data 
    678         // @TODO: maybe redirect to error instead of setting default values for name/description/numbers: 
    679686        $name = ( isset( $add_table['name'] ) ) ? $add_table['name'] : ''; 
    680687        $description = ( isset( $add_table['description'] ) ) ? $add_table['description'] : ''; 
    681         $num_rows = ( isset( $add_table['rows'] ) ) ? absint( $add_table['rows'] ) : 1; 
    682         if ( $num_rows < 1 ) 
    683             $num_rows = 1; 
    684         $num_columns = ( isset( $add_table['columns'] ) ) ? absint( $add_table['columns'] ) : 1; 
    685         if ( $num_columns < 1 ) 
    686             $num_columns = 1; 
     688        if ( ! isset( $add_table['rows'] ) || ! isset( $add_table['columns'] ) ) 
     689            TablePress::redirect( array( 'action' => 'add', 'message' => 'error_add' ) ); 
     690 
     691        $num_rows = absint( $add_table['rows'] ); 
     692        $num_columns = absint( $add_table['columns'] ); 
     693        if ( 0 == $num_rows || 0 == $num_columns ) 
     694            TablePress::redirect( array( 'action' => 'add', 'message' => 'error_add' ) ); 
    687695 
    688696        // Create a new table array with information from the posted data 
     
    874882        // Determine if this is a regular import or an import from WP-Table Reloaded 
    875883        if ( isset( $_POST['submit_wp_table_reloaded_import'] ) && isset( $import['wp_table_reloaded'] ) && isset( $import['wp_table_reloaded']['source'] ) ) { 
     884            // Handle checkbox selections 
     885            $import_tables = ( isset( $import['wp_table_reloaded']['tables'] ) && 'true' === $import['wp_table_reloaded']['tables'] ); 
     886            $import_css = ( isset( $import['wp_table_reloaded']['css'] ) && 'true' === $import['wp_table_reloaded']['css'] ); 
     887            if ( ! $import_tables && ! $import_css ) 
     888                TablePress::redirect( array( 'action' => 'import', 'message' => 'error_wp_table_reloaded_nothing_selected' ) ); 
     889 
    876890            if ( 'db' == $import['wp_table_reloaded']['source'] ) 
    877                 $this->_handle_post_action_import_wp_table_reloaded_db( $import ); 
     891                $this->_import_from_wp_table_reloaded_db( $import_tables, $import_css ); 
    878892            else 
    879                 $this->_handle_post_action_import_wp_table_reloaded_dump_file( $import ); 
     893                $this->_import_from_wp_table_reloaded_dump_file( $import_tables, $import_css ); 
    880894        } else { 
    881             $this->_handle_post_action_import_regular( $import ); 
     895            $this->_import_tablepress_regular( $import ); 
    882896        } 
    883897    } 
     
    890904     * @param array $import Submitted form data 
    891905     */ 
    892     protected function _handle_post_action_import_regular( $import ) { 
     906    protected function _import_tablepress_regular( $import ) { 
    893907        if ( ! isset( $import['add_replace'] ) ) 
    894908            $import['add_replace'] = 'add'; 
     
    904918        $import_error = true; 
    905919        $unlink_file = false; 
    906         switch( $import['source'] ) { 
     920        switch ( $import['source'] ) { 
    907921            case 'file-upload': 
    908922                if ( ! empty( $_FILES['import_file_upload'] ) && UPLOAD_ERR_OK == $_FILES['import_file_upload']['error'] ) { 
     
    970984            $description = $import_data['file_name']; 
    971985            $replace_id = ( 'replace' == $import['add_replace'] && ! empty( $import['replace_table'] ) ) ? $import['replace_table'] : false; 
    972             $table_id = $this->_import_table( $import['format'], $import_data['data'], $name, $description, $replace_id ); 
     986            $table_id = $this->_import_tablepress_table( $import['format'], $import_data['data'], $name, $description, $replace_id ); 
    973987 
    974988            if ( $unlink_file ) 
     
    10021016                $description = $file_name; 
    10031017                $replace_id = ( 'replace' == $import['add_replace'] ) ? false : false; // @TODO: Find a way to extract the replace ID from the filename, maybe? 
    1004                 $table_id = $this->_import_table( $import['format'], $data, $name, $description, $replace_id ); 
     1018                $table_id = $this->_import_tablepress_table( $import['format'], $data, $name, $description, $replace_id ); 
    10051019                if ( false === $table_id ) 
    10061020                    continue; 
     
    10241038 
    10251039    /** 
    1026      * Import data from WP-Table Reloaded from the WordPress database 
    1027      * 
    1028      * @since 1.0.0 
    1029      * 
    1030      * @param array $import Submitted form data 
    1031      */ 
    1032     protected function _handle_post_action_import_wp_table_reloaded_db( $import ) { 
    1033         if ( false === get_option( 'wp_table_reloaded_options', false ) || false === get_option( 'wp_table_reloaded_tables', false ) ) 
    1034             TablePress::redirect( array( 'action' => 'import', 'message' => 'error_wp_table_reloaded_not_installed' ) ); 
    1035  
    1036         // Handle checkbox selections 
    1037         $import_tables = ( isset( $import['wp_table_reloaded']['tables'] ) && 'true' === $import['wp_table_reloaded']['tables'] ); 
    1038         $import_css = ( isset( $import['wp_table_reloaded']['css'] ) && 'true' === $import['wp_table_reloaded']['css'] ); 
    1039  
    1040         if ( ! $import_tables && ! $import_css ) 
    1041             TablePress::redirect( array( 'action' => 'import', 'message' => 'error_wp_table_reloaded_nothing_selected' ) ); 
    1042  
    1043         // Import WP-Table Reloaded tables 
    1044         $imported_tables = $imported_other_id_tables = $not_imported_tables = array(); 
    1045         if ( $import_tables ) { 
    1046             $wp_table_reloaded_tables_list = get_option( 'wp_table_reloaded_tables', false ); 
    1047             foreach ( $wp_table_reloaded_tables_list as $wptr_table_id => $table_option_name ) { 
    1048                 $wptr_table = get_option( $table_option_name, false ); 
    1049                 if ( false === $wptr_table ) { 
    1050                     $not_imported_tables[] = $wptr_table_id; 
    1051                     continue; 
    1052                 } 
    1053                 // Perform sanity checks of imported table 
    1054                 if ( ! isset( $wptr_table['name'] ) 
    1055                     || ! isset( $wptr_table['description'] ) 
    1056                     || empty( $wptr_table['data'] ) 
    1057                     || empty( $wptr_table['options'] ) ) { 
    1058                     $not_imported_tables[] = $wptr_table_id; 
    1059                     continue; 
    1060                 } 
    1061  
    1062                 $wptr_table = stripslashes_deep( $wptr_table ); // slashed in WP-Table Reloaded 
    1063  
    1064                 // Table was loaded, import the data, table options, and visibility 
    1065                 // Create a new table array with information from the imported table 
    1066                 $new_table = array( 
    1067                     'name' => $wptr_table['name'], 
    1068                     'description' => $wptr_table['description'], 
    1069                     'data' => $wptr_table['data'], 
    1070                     'options' => array(), 
    1071                     'visibility' => array( 
    1072                         'rows' => array_fill( 0, count( $wptr_table['data'] ), 1 ), 
    1073                         'columns' => array_fill( 0, count( $wptr_table['data'][0] ), 1 ) 
    1074                     ) 
    1075                 ); 
    1076                 if ( isset( $wptr_table['last_modified'] ) ) 
    1077                     $new_table['last_modified'] = $wptr_table['last_modified']; 
    1078                 if ( isset( $wptr_table['last_editor_id'] ) ) 
    1079                     $new_table['author'] = $wptr_table['last_editor_id']; 
    1080                 if ( isset( $wptr_table['options']['last_editor_id'] ) ) 
    1081                     $new_table['options']['last_editor'] = $wptr_table['last_editor_id']; 
    1082                 if ( isset( $wptr_table['options']['first_row_th'] ) ) 
    1083                     $new_table['options']['table_head'] = $wptr_table['options']['first_row_th']; 
    1084                 if ( isset( $wptr_table['options']['table_footer'] ) ) 
    1085                     $new_table['options']['table_foot'] = $wptr_table['options']['table_footer']; 
    1086                 if ( isset( $wptr_table['options']['print_name'] ) && isset( $wptr_table['options']['print_name_position'] ) ) 
    1087                     $new_table['options']['print_name'] = ( false === $wptr_table['options']['print_name'] ) ? 'no' : $wptr_table['options']['print_name_position']; 
    1088                 if ( isset( $wptr_table['options']['print_description'] ) && isset( $wptr_table['options']['print_description_position'] ) ) 
    1089                     $new_table['options']['print_description'] = ( false === $wptr_table['options']['print_description'] ) ? 'no' : $wptr_table['options']['print_description_position']; 
    1090                 if ( isset( $wptr_table['options']['custom_css_class'] ) ) 
    1091                     $new_table['options']['extra_css_classes'] = $wptr_table['options']['custom_css_class']; 
    1092                 // array key is the same in both plugins for the following options 
    1093                 foreach ( array( 'alternating_row_colors', 'row_hover', 
    1094                     'use_datatables', 'datatables_sort',  'datatables_filter', 'datatables_paginate', 
    1095                     'datatables_lengthchange', 'datatables_paginate_entries', 'datatables_info' 
    1096                     ) as $_option ) { 
    1097                     if ( isset( $wptr_table['options'][ $_option ] ) ) 
    1098                         $new_table['options'][ $_option ] = $wptr_table['options'][ $_option ]; 
    1099                 } 
    1100                 if ( isset( $wptr_table['options']['datatables_customcommands'] ) ) 
    1101                     $new_table['options']['datatables_custom_commands'] = $wptr_table['options']['datatables_customcommands']; 
    1102                 // not imported: $wptr_table['options']['datatables_tabletools'] 
    1103                 // not imported: $wptr_table['options']['cache_table_output'] 
    1104                 // not imported: $wptr_table['custom_fields'] 
    1105  
    1106                 // Fix visibility: WP-Table Reloaded uses 0 and 1 the other way around 
    1107                 foreach ( array_keys( $wptr_table['visibility']['rows'], true ) as $row_idx ) { 
    1108                     $new_table['visibility']['rows'][ $row_idx ] = 0; 
    1109                 } 
    1110                 foreach ( array_keys( $wptr_table['visibility']['columns'], true ) as $column_idx ) { 
    1111                     $new_table['visibility']['columns'][ $column_idx ] = 0; 
    1112                 } 
    1113  
    1114                 // Merge this data into an empty table template 
    1115                 $table = $this->model_table->prepare_table( $this->model_table->get_table_template(), $new_table, false ); 
    1116                 if ( false === $table ) { 
    1117                     $not_imported_tables[] = $wptr_table_id; 
    1118                     continue; 
    1119                 } 
    1120  
    1121                 // Add the new table (and get its first ID) 
    1122                 $tp_table_id = $this->model_table->add( $table ); 
    1123                 if ( false === $tp_table_id ) { 
    1124                     $not_imported_tables[] = $wptr_table_id; 
    1125                     continue; 
    1126                 } 
    1127  
    1128                 // Change table ID to the ID the table had in WP-Table Reloaded (except if that ID is already taken) 
    1129                 $id_changed = $this->model_table->change_table_id( $tp_table_id, $wptr_table_id ); 
    1130                 if ( ! $id_changed ) { 
    1131                     $imported_other_id_tables[] = $wptr_table_id; 
    1132                     continue; 
    1133                 } 
    1134  
    1135                 $imported_tables[] = $wptr_table_id; 
    1136             } 
    1137         } 
    1138  
    1139         // Import WP-Table Reloaded CSS settings 
    1140         $imported_css = false; 
    1141         if ( $import_css ) { 
    1142             $wp_table_reloaded_options = get_option( 'wp_table_reloaded_options', false ); 
    1143             if ( false !== $wp_table_reloaded_options && is_array( $wp_table_reloaded_options ) ) { 
    1144                 $imported_options = array(); 
    1145                 if ( isset( $wp_table_reloaded_options['use_default_css'] ) ) 
    1146                     $imported_options['use_default_css'] = (bool)$wp_table_reloaded_options['use_default_css']; 
    1147                 if ( isset( $wp_table_reloaded_options['use_custom_css'] ) ) 
    1148                     $imported_options['use_custom_css'] = (bool)$wp_table_reloaded_options['use_custom_css']; 
    1149                 if ( isset( $wp_table_reloaded_options['use_custom_css'] ) ) { 
    1150                     $imported_options['custom_css'] = stripslashes( $wp_table_reloaded_options['custom_css'] ); 
    1151                     $imported_options['custom_css'] = str_replace( '#wp-table-reloaded-id-', '#tablepress-', $imported_options['custom_css'] ); 
    1152                     $imported_options['custom_css'] = str_replace( '-no-1', '', $imported_options['custom_css'] ); 
    1153                     $imported_options['custom_css'] = str_replace( '.wp-table-reloaded-id-', '.tablepress-id-', $imported_options['custom_css'] ); 
    1154                     $imported_options['custom_css'] = str_replace( '.wp-table-reloaded', '.tablepress', $imported_options['custom_css'] ); 
    1155                 } 
    1156  
    1157                 /* 
    1158                     // @TODO: 
    1159                     // Maybe save it to file as well 
    1160                     $update_custom_css_file = false; 
    1161                     if ( $this->model_options->get( 'use_custom_css_file' ) 
    1162                     && $imported_options['custom_css'] !== $this->model_options->load_custom_css_from_file() ) { // only write to file, if CSS really changed 
    1163                         $update_custom_css_file = true; 
    1164                         // Set to false again. As it was set here, it will be set true again, if file saving succeeds 
    1165                         $imported_options['use_custom_css_file'] = false; 
    1166                     } 
    1167                 */ 
    1168  
    1169                 // Save gathered imported options 
    1170                 if ( ! empty( $imported_options ) ) 
    1171                     $this->model_options->update( $imported_options ); 
    1172  
    1173                 // @TODO: Necessary if saving to file above is used 
    1174                 // if ( $update_custom_css_file ) 
    1175                 //  TablePress::redirect( array( 'action' => 'options', 'item' => 'save_custom_css' ), true ); 
    1176  
    1177                 $imported_css = true; 
    1178             } 
    1179         } 
    1180  
    1181         // @TODO: Better handling of the different cases of imported/imported-without-ID-change/not-imported tables 
    1182         if ( count( $imported_tables ) > 1 ) 
    1183             TablePress::redirect( array( 'action' => 'list', 'message' => 'success_import_wp_table_reloaded' ) ); 
    1184         elseif ( 1 == count( $imported_tables ) ) 
    1185             TablePress::redirect( array( 'action' => 'edit', 'table_id' => $imported_tables[0], 'message' => 'success_import_wp_table_reloaded' ) ); 
    1186         elseif ( $imported_css ) 
    1187             TablePress::redirect( array( 'action' => 'options', 'message' => 'success_import_wp_table_reloaded' ) ); 
    1188         else 
    1189             TablePress::redirect( array( 'action' => 'import', 'message' => 'error_import_wp_table_reloaded' ) ); 
    1190     } 
    1191  
    1192     /** 
    1193      * Import data from WP-Table Reloaded from a WP-Table Reloaded Dump File 
    1194      * 
    1195      * @since 1.0.0 
    1196      * 
    1197      * @param array $import Submitted form data 
    1198      */ 
    1199     protected function _handle_post_action_import_wp_table_reloaded_dump_file( $import ) { 
    1200         //@TODO: Yet to implement 
    1201         TablePress::redirect( array( 'action' => 'list', 'message' => 'success_import_wp_table_reloaded' ) ); 
    1202     } 
    1203  
    1204     /** 
    12051040     * Import a table by either replacing an existing table or adding it as a new table 
    12061041     * 
     
    12141049     * @param bool|string False on error, table ID on success 
    12151050     */ 
    1216     protected function _import_table( $format, $data, $name, $description, $replace_id ) { 
     1051    protected function _import_tablepress_table( $format, $data, $name, $description, $replace_id ) { 
    12171052        $content = $this->importer->import_table( $format, $data ); 
    12181053        if ( false === $content ) 
     
    12741109 
    12751110    /** 
     1111     * Import data from WP-Table Reloaded from the WordPress database 
     1112     * 
     1113     * @since 1.0.0 
     1114     * 
     1115     * @param bool $import_tables Whether tables shall be imported 
     1116     * @param bool $import_css Whether Plugin Options (only CSS related right now) shall be imported 
     1117     */ 
     1118    protected function _import_from_wp_table_reloaded_db( $import_tables, $import_css ) { 
     1119        if ( false === get_option( 'wp_table_reloaded_options', false ) || false === get_option( 'wp_table_reloaded_tables', false ) ) 
     1120            TablePress::redirect( array( 'action' => 'import', 'message' => 'error_wp_table_reloaded_not_installed' ) ); 
     1121 
     1122        // Import WP-Table Reloaded tables 
     1123        $not_imported_tables = $imported_tables = $imported_other_id_tables = array(); 
     1124        if ( $import_tables ) { 
     1125            $wp_table_reloaded_tables_list = get_option( 'wp_table_reloaded_tables', array() ); 
     1126            foreach ( $wp_table_reloaded_tables_list as $wptr_table_id => $table_option_name ) { 
     1127                $wptr_table = get_option( $table_option_name, false ); 
     1128                $import_status = $this->_import_wp_table_reloaded_table( $wptr_table ); 
     1129                switch ( $import_status ) { 
     1130                    case 0: 
     1131                        $not_imported_tables[] = $wptr_table_id; 
     1132                        break; 
     1133                    case 1: 
     1134                        $imported_tables[] = $wptr_table_id; 
     1135                        break; 
     1136                    case 2: 
     1137                        $imported_other_id_tables[] = $wptr_table_id; 
     1138                        break; 
     1139                } 
     1140            } 
     1141        } 
     1142 
     1143        // Import WP-Table Reloaded Plugin Options (currently only CSS related options) 
     1144        $imported_css = false; 
     1145        if ( $import_css ) { 
     1146            $wp_table_reloaded_options = get_option( 'wp_table_reloaded_options', false ); 
     1147            if ( ! empty( $wp_table_reloaded_options ) ) 
     1148                $imported_css = $this->_import_wp_table_reloaded_plugin_options( $wp_table_reloaded_options ); 
     1149        } 
     1150 
     1151        // @TODO: Better handling of the different cases of imported/imported-without-ID-change/not-imported tables 
     1152        if ( count( $imported_tables ) > 1 ) 
     1153            TablePress::redirect( array( 'action' => 'list', 'message' => 'success_import_wp_table_reloaded' ) ); 
     1154        elseif ( 1 == count( $imported_tables ) ) 
     1155            TablePress::redirect( array( 'action' => 'edit', 'table_id' => $imported_tables[0], 'message' => 'success_import_wp_table_reloaded' ) ); 
     1156        if ( count( $imported_other_id_tables ) > 0 ) 
     1157            TablePress::redirect( array( 'action' => 'list', 'message' => 'success_import_wp_table_reloaded' ) ); 
     1158        elseif ( $imported_css ) 
     1159            TablePress::redirect( array( 'action' => 'options', 'message' => 'success_import_wp_table_reloaded' ) ); 
     1160        else 
     1161            TablePress::redirect( array( 'action' => 'import', 'message' => 'error_import_wp_table_reloaded' ) ); 
     1162    } 
     1163 
     1164    /** 
     1165     * Import data from WP-Table Reloaded from a WP-Table Reloaded Dump File 
     1166     * 
     1167     * @since 1.0.0 
     1168     * 
     1169     * @param bool $import_tables Whether tables shall be imported 
     1170     * @param bool $import_css Whether Plugin Options (only CSS related right now) shall be imported 
     1171     */ 
     1172    protected function _import_from_wp_table_reloaded_dump_file( $import_tables, $import_css ) { 
     1173        if ( empty( $_FILES['import_wp_table_reloaded_file_upload'] ) || empty( $_FILES['import_wp_table_reloaded_file_upload']['tmp_name'] ) || UPLOAD_ERR_OK !== $_FILES['import_wp_table_reloaded_file_upload']['error'] ) 
     1174            TablePress::redirect( array( 'action' => 'import', 'message' => 'error_wp_table_reloaded_dump_file' ) ); 
     1175 
     1176        $dump_file = file_get_contents( $_FILES['import_wp_table_reloaded_file_upload']['tmp_name'] ); 
     1177        $dump_file = unserialize( $dump_file ); 
     1178        if ( empty( $dump_file ) ) { 
     1179            @unlink( $_FILES['import_wp_table_reloaded_file_upload']['tmp_name'] ); 
     1180            TablePress::redirect( array( 'action' => 'import', 'message' => 'error_wp_table_reloaded_dump_file' ) ); 
     1181        } 
     1182 
     1183        // Import WP-Table Reloaded tables 
     1184        $not_imported_tables = $imported_tables = $imported_other_id_tables = array(); 
     1185        if ( $import_tables && ! empty( $dump_file['tables'] ) ) { 
     1186            foreach ( $dump_file['tables'] as $wptr_table_id => $wptr_table ) { 
     1187                $import_status = $this->_import_wp_table_reloaded_table( $wptr_table ); 
     1188                switch ( $import_status ) { 
     1189                    case 0: 
     1190                        $not_imported_tables[] = $wptr_table_id; 
     1191                        break; 
     1192                    case 1: 
     1193                        $imported_tables[] = $wptr_table_id; 
     1194                        break; 
     1195                    case 2: 
     1196                        $imported_other_id_tables[] = $wptr_table_id; 
     1197                        break; 
     1198                } 
     1199            } 
     1200        } 
     1201 
     1202        // Import WP-Table Reloaded Plugin Options (currently only CSS related options) 
     1203        $imported_css = false; 
     1204        if ( $import_css && ! empty( $dump_file['options'] ) ) 
     1205            $imported_css = $this->_import_wp_table_reloaded_plugin_options( $dump_file['options'] ); 
     1206 
     1207        @unlink( $_FILES['import_wp_table_reloaded_file_upload']['tmp_name'] ); 
     1208        // @TODO: Better handling of the different cases of imported/imported-without-ID-change/not-imported tables 
     1209        if ( count( $imported_tables ) > 1 ) 
     1210            TablePress::redirect( array( 'action' => 'list', 'message' => 'success_import_wp_table_reloaded' ) ); 
     1211        elseif ( 1 == count( $imported_tables ) ) 
     1212            TablePress::redirect( array( 'action' => 'edit', 'table_id' => $imported_tables[0], 'message' => 'success_import_wp_table_reloaded' ) ); 
     1213        if ( count( $imported_other_id_tables ) > 0 ) 
     1214            TablePress::redirect( array( 'action' => 'list', 'message' => 'success_import_wp_table_reloaded' ) ); 
     1215        elseif ( $imported_css ) 
     1216            TablePress::redirect( array( 'action' => 'options', 'message' => 'success_import_wp_table_reloaded' ) ); 
     1217        else 
     1218            TablePress::redirect( array( 'action' => 'import', 'message' => 'error_import_wp_table_reloaded' ) ); 
     1219    } 
     1220 
     1221    /** 
     1222     * Import a WP-Table Reloaded table 
     1223     * 
     1224     * @since 1.0.0 
     1225     * 
     1226     * @param array $wptr_table WP-Table Reloaded table 
     1227     * @return int Import status: 0=Import failed; 1=Imported with ID change; 2=Imported without ID change 
     1228     */ 
     1229    protected function _import_wp_table_reloaded_table( $wptr_table ) { 
     1230        if ( empty( $wptr_table ) ) 
     1231            return 0; // Import failed 
     1232 
     1233        // Perform sanity checks of imported table 
     1234        if ( ! isset( $wptr_table['name'] ) 
     1235            || ! isset( $wptr_table['description'] ) 
     1236            || empty( $wptr_table['data'] ) 
     1237            || empty( $wptr_table['options'] ) ) 
     1238            return 0; // Import failed 
     1239 
     1240        $wptr_table = stripslashes_deep( $wptr_table ); // slashed in WP-Table Reloaded 
     1241 
     1242        // Table was loaded, import the data, table options, and visibility 
     1243        // Create a new table array with information from the imported table 
     1244        $new_table = array( 
     1245            'name' => $wptr_table['name'], 
     1246            'description' => $wptr_table['description'], 
     1247            'data' => $wptr_table['data'], 
     1248            'options' => array(), 
     1249            'visibility' => array( 
     1250                'rows' => array_fill( 0, count( $wptr_table['data'] ), 1 ), 
     1251                'columns' => array_fill( 0, count( $wptr_table['data'][0] ), 1 ) 
     1252            ) 
     1253        ); 
     1254        if ( isset( $wptr_table['last_modified'] ) ) 
     1255            $new_table['last_modified'] = $wptr_table['last_modified']; 
     1256        if ( isset( $wptr_table['last_editor_id'] ) ) 
     1257            $new_table['author'] = $wptr_table['last_editor_id']; 
     1258        if ( isset( $wptr_table['options']['last_editor_id'] ) ) 
     1259            $new_table['options']['last_editor'] = $wptr_table['last_editor_id']; 
     1260        if ( isset( $wptr_table['options']['first_row_th'] ) ) 
     1261            $new_table['options']['table_head'] = $wptr_table['options']['first_row_th']; 
     1262        if ( isset( $wptr_table['options']['table_footer'] ) ) 
     1263            $new_table['options']['table_foot'] = $wptr_table['options']['table_footer']; 
     1264        if ( isset( $wptr_table['options']['custom_css_class'] ) ) 
     1265            $new_table['options']['extra_css_classes'] = $wptr_table['options']['custom_css_class']; 
     1266        // array key is the same in both plugins for the following options 
     1267        foreach ( array( 'alternating_row_colors', 'row_hover', 
     1268            'print_name', 'print_name_position', 'print_description', 'print_description_position', 
     1269            'use_datatables', 'datatables_sort',  'datatables_filter', 'datatables_paginate', 
     1270            'datatables_lengthchange', 'datatables_paginate_entries', 'datatables_info' 
     1271            ) as $_option ) { 
     1272            if ( isset( $wptr_table['options'][ $_option ] ) ) 
     1273                $new_table['options'][ $_option ] = $wptr_table['options'][ $_option ]; 
     1274        } 
     1275        if ( isset( $wptr_table['options']['datatables_customcommands'] ) ) 
     1276            $new_table['options']['datatables_custom_commands'] = $wptr_table['options']['datatables_customcommands']; 
     1277        // not imported: $wptr_table['options']['datatables_tabletools'] 
     1278        // not imported: $wptr_table['options']['cache_table_output'] 
     1279        // not imported: $wptr_table['custom_fields'] 
     1280 
     1281        // Fix visibility: WP-Table Reloaded uses 0 and 1 the other way around 
     1282        foreach ( array_keys( $wptr_table['visibility']['rows'], true ) as $row_idx ) { 
     1283            $new_table['visibility']['rows'][ $row_idx ] = 0; 
     1284        } 
     1285        foreach ( array_keys( $wptr_table['visibility']['columns'], true ) as $column_idx ) { 
     1286            $new_table['visibility']['columns'][ $column_idx ] = 0; 
     1287        } 
     1288 
     1289        // Merge this data into an empty table template 
     1290        $table = $this->model_table->prepare_table( $this->model_table->get_table_template(), $new_table, false ); 
     1291        if ( false === $table ) 
     1292            return 0; // Import failed 
     1293 
     1294        // Add the new table (and get its first ID) 
     1295        $tp_table_id = $this->model_table->add( $table ); 
     1296        if ( false === $tp_table_id ) 
     1297            return 0; // Import failed 
     1298 
     1299        // Change table ID to the ID the table had in WP-Table Reloaded (except if that ID is already taken) 
     1300        $id_changed = $this->model_table->change_table_id( $tp_table_id, $wptr_table['id'] ); 
     1301        if ( ! $id_changed ) 
     1302            return 2; // Imported without ID change 
     1303 
     1304        return 1; // Imported with ID change 
     1305    } 
     1306 
     1307    /** 
     1308     * Import WP-Table Reloaded Plugin Options (currently just CSS related options) 
     1309     * 
     1310     * @since 1.0.0 
     1311     * 
     1312     * @param array $wp_table_reloaded_options Plugin Options of WP-Table Reloaded that shall be imported 
     1313     * @return bool Whether the import was successful or not (on at least on option) 
     1314     */ 
     1315    protected function _import_wp_table_reloaded_plugin_options( $wp_table_reloaded_options ) { 
     1316        if ( ! is_array( $wp_table_reloaded_options ) ) 
     1317            return false; 
     1318 
     1319        $imported_options = array(); 
     1320        if ( isset( $wp_table_reloaded_options['use_default_css'] ) ) 
     1321            $imported_options['use_default_css'] = (bool)$wp_table_reloaded_options['use_default_css']; 
     1322        if ( isset( $wp_table_reloaded_options['use_custom_css'] ) ) 
     1323            $imported_options['use_custom_css'] = (bool)$wp_table_reloaded_options['use_custom_css']; 
     1324        if ( isset( $wp_table_reloaded_options['custom_css'] ) ) { 
     1325            $imported_options['custom_css'] = stripslashes( $wp_table_reloaded_options['custom_css'] ); 
     1326            $imported_options['custom_css'] = str_replace( '#wp-table-reloaded-id-', '#tablepress-', $imported_options['custom_css'] ); 
     1327            $imported_options['custom_css'] = str_replace( '-no-1', '', $imported_options['custom_css'] ); 
     1328            $imported_options['custom_css'] = str_replace( '.wp-table-reloaded-id-', '.tablepress-id-', $imported_options['custom_css'] ); 
     1329            $imported_options['custom_css'] = str_replace( '.wp-table-reloaded', '.tablepress', $imported_options['custom_css'] ); 
     1330        } 
     1331 
     1332        /* 
     1333            // @TODO: 
     1334            // Maybe save it to file as well 
     1335            $update_custom_css_file = false; 
     1336            if ( $this->model_options->get( 'use_custom_css_file' ) 
     1337            && $imported_options['custom_css'] !== $this->model_options->load_custom_css_from_file() ) { // only write to file, if CSS really changed 
     1338                $update_custom_css_file = true; 
     1339                // Set to false again. As it was set here, it will be set true again, if file saving succeeds 
     1340                $imported_options['use_custom_css_file'] = false; 
     1341            } 
     1342        */ 
     1343 
     1344        // Save gathered imported options 
     1345        if ( empty( $imported_options ) ) 
     1346            return false; 
     1347 
     1348        $this->model_options->update( $imported_options ); 
     1349 
     1350        // @TODO: Necessary if saving to file above is used 
     1351        // if ( $update_custom_css_file ) 
     1352        //  TablePress::redirect( array( 'action' => 'options', 'item' => 'save_custom_css' ), true ); 
     1353 
     1354        // Plugin Options import successful 
     1355        return true; 
     1356    } 
     1357 
     1358    /** 
    12761359     * Save GET actions 
    1277      * 
    1278      * @TODO: STILL REQUIRED: 
    1279      * caps check with correct user caps, like 
    1280      * // if ( ! current_user_can( 'manage_options' ) ) 
    1281      * //   wp_die( __('Cheatin&#8217; uh?') ); 
    12821360     */ 
    12831361 
     
    14011479            $custom_css = $this->model_options->get( 'custom_css' ); 
    14021480        } 
    1403  
    14041481        if ( ! empty( $custom_css ) ) 
    14051482            $view_data['head_html'] .= "<style type=\"text/css\">\n{$custom_css}\n</style>\n"; 
  • tablepress/trunk/controllers/controller-admin_ajax.php

    r589540 r607623  
    6262 
    6363    /** 
    64      * 
     64     * Save the table after the "Save Changes" button on the "Edit" screen has been clicked 
    6565     * 
    6666     * @since 1.0.0 
     
    145145 
    146146    /** 
    147      * 
     147     * Return the live preview data of table that has non-saved changes 
    148148     * 
    149149     * @since 1.0.0 
     
    197197            $render_options = shortcode_atts( $_render->get_default_render_options(), $table['options'] ); 
    198198            $_render->set_input( $table, $render_options ); 
    199             $head_html = $_render->get_preview_css(); 
    200             $body_html = $_render->get_output(); 
     199            $head_html = '<style type="text/css">body{margin:10px;}</style>'; 
     200            $head_html .= $_render->get_preview_css(); 
     201            // Add "Custom CSS" 
     202            if ( $this->model_options->get( 'use_custom_css_file' ) ) { 
     203                $custom_css = $this->model_options->load_custom_css_from_file(); 
     204                // fall back to "Custom CSS" in options, if it could not be retrieved from file 
     205                if ( false === $custom_css ) 
     206                    $custom_css = $this->model_options->get( 'custom_css' ); 
     207            } else { 
     208                // get "Custom CSS" from options 
     209                $custom_css = $this->model_options->get( 'custom_css' ); 
     210            } 
     211            if ( ! empty( $custom_css ) ) 
     212                $head_html .= "<style type=\"text/css\">\n{$custom_css}\n</style>\n"; 
     213 
     214            $body_html = '<div id="tablepress-page"><p>' 
     215                . __( 'This is a preview of your table.', 'tablepress' ) . ' ' 
     216                . __( 'Because of CSS styling, the table might look different on your page!', 'tablepress' ) . ' ' 
     217                . __( 'The features of the DataTables JavaScript library are also not visible in this preview!', 'tablepress' ) . '<br />' 
     218                . sprintf( __( 'To insert the table into a page, post, or text widget, copy the Shortcode %s and paste it into the editor.', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=' . esc_attr( $table['id'] ) . ' /]" readonly="readonly" />' ) 
     219                . '</p>' . $_render->get_output() . '</div>'; 
    201220        } else { 
    202221            $head_html = ''; 
  • tablepress/trunk/controllers/controller-frontend.php

    r598765 r607623  
    117117                        wp_add_inline_style( 'tablepress-default', $custom_css ); // handle of the file to which the <style> shall be appended 
    118118                    else 
    119                         add_action( 'wp_head', create_function( '$a', 'echo "<style type=\'text/css\'>\n' . $custom_css . '\n</style>\n";' ), 8 ); // priority 8 to hook in right after WP_Styles has been processed 
    120                 } 
    121             } 
    122         } 
     119                        add_action( 'wp_head', array( &$this, '_print_custom_css' ), 8 ); // priority 8 to hook in right after WP_Styles has been processed 
     120                } 
     121            } 
     122        } 
     123    } 
     124 
     125    /** 
     126     * Print "Custom CSS" to "wp_head" inline; Necessary if "Default CSS" is off, and saving "Custom CSS" to a file is not possible 
     127     * 
     128     * @since 1.0.0 
     129     */ 
     130    public function _print_custom_css() { 
     131        $custom_css = trim( $this->model_options->get( 'custom_css' ) ); 
     132        $custom_css = apply_filters( 'tablepress_custom_css', $custom_css ); 
     133        echo "<style type='text/css'>\n{$custom_css}\n</style>\n"; 
    123134    } 
    124135 
     
    523534 
    524535            // add name and description to searched items, if they are displayed with the table 
    525             $table_name = ( 'no' != $table['options']['print_name'] ) ? $table['name'] : ''; 
    526             $table_description = ( 'no' != $table['options']['print_description'] ) ? $table['description'] : ''; 
     536            $table_name = ( $table['options']['print_name'] ) ? $table['name'] : ''; 
     537            $table_description = ( $table['options']['print_description'] ) ? $table['description'] : ''; 
    527538 
    528539            $search_tables[ $table_id ] = array( 
  • tablepress/trunk/js/jquery.datatables.min.js

    r583590 r607623  
    11/* 
    22 * File:        jquery.dataTables.min.js 
    3  * Version:     1.9.3 
     3 * Version:     1.9.4 
    44 * Author:      Allan Jardine (www.sprymedia.co.uk) 
    55 * Info:        www.datatables.net 
     
    1616 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. 
    1717 */ 
    18 (function(i,O,l,n){var j=function(e){function o(a,b){var c=j.defaults.columns,d=a.aoColumns.length,c=i.extend({},j.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:l.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.oDefaults:d});a.aoColumns.push(c);if(a.aoPreSearchCols[d]===n||null===a.aoPreSearchCols[d])a.aoPreSearchCols[d]=i.extend({},j.models.oSearch);else if(c=a.aoPreSearchCols[d], 
    19 c.bRegex===n&&(c.bRegex=!0),c.bSmart===n&&(c.bSmart=!0),c.bCaseInsensitive===n)c.bCaseInsensitive=!0;r(a,d,null)}function r(a,b,c){var d=a.aoColumns[b];c!==n&&null!==c&&(c.mDataProp&&!c.mData&&(c.mData=c.mDataProp),c.sType!==n&&(d.sType=c.sType,d._bAutoType=!1),i.extend(d,c),p(d,c,"sWidth","sWidthOrig"),c.iDataSort!==n&&(d.aDataSort=[c.iDataSort]),p(d,c,"aDataSort"));var h=d.mRender?S(d.mRender):null,f=S(d.mData);d.fnGetData=function(a,b){var c=f(a,b);return d.mRender&&b&&""!==b?h(c,b,a):c};d.fnSetData= 
    20 ta(d.mData);a.oFeatures.bSort||(d.bSortable=!1);!d.bSortable||-1==i.inArray("asc",d.asSorting)&&-1==i.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableNone,d.sSortingClassJUI=""):d.bSortable||-1==i.inArray("asc",d.asSorting)&&-1==i.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortable,d.sSortingClassJUI=a.oClasses.sSortJUI):-1!=i.inArray("asc",d.asSorting)&&-1==i.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableAsc,d.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed): 
    21 -1==i.inArray("asc",d.asSorting)&&-1!=i.inArray("desc",d.asSorting)&&(d.sSortingClass=a.oClasses.sSortableDesc,d.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed)}function k(a){if(!1===a.oFeatures.bAutoWidth)return!1;ca(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function G(a,b){var c=v(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function t(a,b){var c=v(a,"bVisible"),c=i.inArray(b,c);return-1!==c?c:null}function w(a){return v(a,"bVisible").length} 
    22 function v(a,b){var c=[];i.map(a.aoColumns,function(a,h){a[b]&&c.push(h)});return c}function D(a){for(var b=j.ext.aTypes,c=b.length,d=0;d<c;d++){var h=b[d](a);if(null!==h)return h}return"string"}function y(a,b){for(var c=b.split(","),d=[],h=0,f=a.aoColumns.length;h<f;h++)for(var g=0;g<f;g++)if(a.aoColumns[h].sName==c[g]){d.push(g);break}return d}function H(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";return b.length==d?"":b.slice(0,-1)}function ua(a,b,c,d){var h,f, 
    23 g,e,s;if(b)for(h=b.length-1;0<=h;h--){var m=b[h].aTargets;i.isArray(m)||E(a,1,"aTargets must be an array of targets, not a "+typeof m);f=0;for(g=m.length;f<g;f++)if("number"===typeof m[f]&&0<=m[f]){for(;a.aoColumns.length<=m[f];)o(a);d(m[f],b[h])}else if("number"===typeof m[f]&&0>m[f])d(a.aoColumns.length+m[f],b[h]);else if("string"===typeof m[f]){e=0;for(s=a.aoColumns.length;e<s;e++)("_all"==m[f]||i(a.aoColumns[e].nTh).hasClass(m[f]))&&d(e,b[h])}}if(c){h=0;for(a=c.length;h<a;h++)d(h,c[h])}}function J(a, 
    24 b){var c;c=i.isArray(b)?b.slice():i.extend(!0,{},b);var d=a.aoData.length,h=i.extend(!0,{},j.models.oRow);h._aData=c;a.aoData.push(h);for(var f,h=0,g=a.aoColumns.length;h<g;h++)c=a.aoColumns[h],"function"===typeof c.fnRender&&c.bUseRendered&&null!==c.mData?I(a,d,h,T(a,d,h)):I(a,d,h,x(a,d,h)),c._bAutoType&&"string"!=c.sType&&(f=x(a,d,h,"type"),null!==f&&""!==f&&(f=D(f),null===c.sType?c.sType=f:c.sType!=f&&"html"!=c.sType&&(c.sType="string")));a.aiDisplayMaster.push(d);a.oFeatures.bDeferRender||da(a, 
    25 d);return d}function va(a){var b,c,d,h,f,g,e,s,m;if(a.bDeferLoading||null===a.sAjaxSource){e=a.nTBody.childNodes;b=0;for(c=e.length;b<c;b++)if("TR"==e[b].nodeName.toUpperCase()){s=a.aoData.length;e[b]._DT_RowIndex=s;a.aoData.push(i.extend(!0,{},j.models.oRow,{nTr:e[b]}));a.aiDisplayMaster.push(s);g=e[b].childNodes;d=f=0;for(h=g.length;d<h;d++)if(m=g[d].nodeName.toUpperCase(),"TD"==m||"TH"==m)I(a,s,f,i.trim(g[d].innerHTML)),f++}}e=U(a);g=[];b=0;for(c=e.length;b<c;b++){d=0;for(h=e[b].childNodes.length;d< 
    26 h;d++)f=e[b].childNodes[d],m=f.nodeName.toUpperCase(),("TD"==m||"TH"==m)&&g.push(f)}h=0;for(e=a.aoColumns.length;h<e;h++){m=a.aoColumns[h];null===m.sTitle&&(m.sTitle=m.nTh.innerHTML);f=m._bAutoType;s="function"===typeof m.fnRender;var o=null!==m.sClass,k=m.bVisible,r,n;if(f||s||o||!k){b=0;for(c=a.aoData.length;b<c;b++)d=a.aoData[b],r=g[b*e+h],f&&"string"!=m.sType&&(n=x(a,b,h,"type"),""!==n&&(n=D(n),null===m.sType?m.sType=n:m.sType!=n&&"html"!=m.sType&&(m.sType="string"))),"function"===typeof m.mData&& 
    27 (r.innerHTML=x(a,b,h,"display")),s&&(n=T(a,b,h),r.innerHTML=n,m.bUseRendered&&I(a,b,h,n)),o&&(r.className+=" "+m.sClass),k?d._anHidden[h]=null:(d._anHidden[h]=r,r.parentNode.removeChild(r)),m.fnCreatedCell&&m.fnCreatedCell.call(a.oInstance,r,x(a,b,h,"display"),d._aData,b,h)}}if(0!==a.aoRowCreatedCallback.length){b=0;for(c=a.aoData.length;b<c;b++)d=a.aoData[b],C(a,"aoRowCreatedCallback",null,[d.nTr,d._aData,b])}}function K(a,b){return b._DT_RowIndex!==n?b._DT_RowIndex:null}function ea(a,b,c){for(var b= 
    28 L(a,b),d=0,a=a.aoColumns.length;d<a;d++)if(b[d]===c)return d;return-1}function Y(a,b,c,d){for(var h=[],f=0,g=d.length;f<g;f++)h.push(x(a,b,d[f],c));return h}function x(a,b,c,d){var h=a.aoColumns[c];if((c=h.fnGetData(a.aoData[b]._aData,d))===n)return a.iDrawError!=a.iDraw&&null===h.sDefaultContent&&(E(a,0,"Requested unknown parameter "+("function"==typeof h.mData?"{mData function}":"'"+h.mData+"'")+" from the data source for row "+b),a.iDrawError=a.iDraw),h.sDefaultContent;if(null===c&&null!==h.sDefaultContent)c= 
    29 h.sDefaultContent;else if("function"===typeof c)return c();return"display"==d&&null===c?"":c}function I(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function S(a){if(null===a)return function(){return null};if("function"===typeof a)return function(b,d,h){return a(b,d,h)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,h){var f=h.split("."),g;if(""!==h){var e=0;for(g=f.length;e<g;e++){if(h=f[e].match(V)){f[e]=f[e].replace(V,"");""!==f[e]&&(a=a[f[e]]); 
    30 g=[];f.splice(0,e+1);for(var f=f.join("."),e=0,i=a.length;e<i;e++)g.push(b(a[e],d,f));a=h[0].substring(1,h[0].length-1);a=""===a?g:g.join(a);break}if(null===a||a[f[e]]===n)return n;a=a[f[e]]}}return a};return function(c,d){return b(c,d,a)}}return function(b){return b[a]}}function ta(a){if(null===a)return function(){};if("function"===typeof a)return function(b,d){a(b,"set",d)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,h){var h=h.split("."),f,g,e=0;for(g= 
    31 h.length-1;e<g;e++){if(f=h[e].match(V)){h[e]=h[e].replace(V,"");a[h[e]]=[];f=h.slice();f.splice(0,e+1);g=f.join(".");for(var i=0,m=d.length;i<m;i++)f={},b(f,d[i],g),a[h[e]].push(f);return}if(null===a[h[e]]||a[h[e]]===n)a[h[e]]={};a=a[h[e]]}a[h[h.length-1].replace(V,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Z(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function fa(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0, 
    32 a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);A(a)}function ga(a,b){for(var c=-1,d=0,h=a.length;d<h;d++)a[d]==b?c=d:a[d]>b&&a[d]--; -1!=c&&a.splice(c,1)}function T(a,b,c){var d=a.aoColumns[c];return d.fnRender({iDataRow:b,iDataColumn:c,oSettings:a,aData:a.aoData[b]._aData,mDataProp:d.mData},x(a,b,c,"display"))}function da(a,b){var c=a.aoData[b],d;if(null===c.nTr){c.nTr=l.createElement("tr");c.nTr._DT_RowIndex=b;c._aData.DT_RowId&&(c.nTr.id=c._aData.DT_RowId);c._aData.DT_RowClass&& 
    33 i(c.nTr).addClass(c._aData.DT_RowClass);for(var h=0,f=a.aoColumns.length;h<f;h++){var g=a.aoColumns[h];d=l.createElement(g.sCellType);d.innerHTML="function"===typeof g.fnRender&&(!g.bUseRendered||null===g.mData)?T(a,b,h):x(a,b,h,"display");null!==g.sClass&&(d.className=g.sClass);g.bVisible?(c.nTr.appendChild(d),c._anHidden[h]=null):c._anHidden[h]=d;g.fnCreatedCell&&g.fnCreatedCell.call(a.oInstance,d,x(a,b,h,"display"),c._aData,b,h)}C(a,"aoRowCreatedCallback",null,[c.nTr,c._aData,b])}}function wa(a){var b, 
    34 c,d;if(0!==a.nTHead.getElementsByTagName("th").length){b=0;for(d=a.aoColumns.length;b<d;b++)if(c=a.aoColumns[b].nTh,c.setAttribute("role","columnheader"),a.aoColumns[b].bSortable&&(c.setAttribute("tabindex",a.iTabIndex),c.setAttribute("aria-controls",a.sTableId)),null!==a.aoColumns[b].sClass&&i(c).addClass(a.aoColumns[b].sClass),a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}else{var h=l.createElement("tr");b=0;for(d=a.aoColumns.length;b<d;b++)c=a.aoColumns[b].nTh,c.innerHTML= 
    35 a.aoColumns[b].sTitle,c.setAttribute("tabindex","0"),null!==a.aoColumns[b].sClass&&i(c).addClass(a.aoColumns[b].sClass),h.appendChild(c);i(a.nTHead).html("")[0].appendChild(h);W(a.aoHeader,a.nTHead)}i(a.nTHead).children("tr").attr("role","row");if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;h=l.createElement("div");h.className=a.oClasses.sSortJUIWrapper;i(c).contents().appendTo(h);var f=l.createElement("span");f.className=a.oClasses.sSortIcon;h.appendChild(f);c.appendChild(h)}}if(a.oFeatures.bSort)for(b= 
    36 0;b<a.aoColumns.length;b++)!1!==a.aoColumns[b].bSortable?ha(a,a.aoColumns[b].nTh,b):i(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);""!==a.oClasses.sFooterTH&&i(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);if(null!==a.nTFoot){c=P(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)c[b]&&(a.aoColumns[b].nTf=c[b],a.aoColumns[b].sClass&&i(c[b]).addClass(a.aoColumns[b].sClass))}}function X(a,b,c){var d,h,f,g=[],e=[],i=a.aoColumns.length,m;c===n&&(c=!1);d=0;for(h= 
    37 b.length;d<h;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);e.push([])}d=0;for(h=g.length;d<h;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(m=i=1,e[d][f]===n){a.appendChild(g[d][f].cell);for(e[d][f]=1;g[d+i]!==n&&g[d][f].cell==g[d+i][f].cell;)e[d+i][f]=1,i++;for(;g[d][f+m]!==n&&g[d][f].cell==g[d][f+m].cell;){for(c=0;c<i;c++)e[d+c][f+m]=1;m++}g[d][f].cell.rowSpan=i;g[d][f].cell.colSpan=m}}}function z(a){var b= 
    38 C(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==i.inArray(!1,b))F(a,!1);else{var c,d,b=[],h=0,f=a.asStripeClasses.length;c=a.aoOpenRows.length;a.bDrawing=!0;a.iInitDisplayStart!==n&&-1!=a.iInitDisplayStart&&(a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart,a.iInitDisplayStart=-1,A(a));if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++;else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!xa(a))return}else a.iDraw++;if(0!==a.aiDisplay.length){var g= 
    39 a._iDisplayStart;d=a._iDisplayEnd;a.oFeatures.bServerSide&&(g=0,d=a.aoData.length);for(;g<d;g++){var e=a.aoData[a.aiDisplay[g]];null===e.nTr&&da(a,a.aiDisplay[g]);var s=e.nTr;if(0!==f){var m=a.asStripeClasses[h%f];e._sRowStripe!=m&&(i(s).removeClass(e._sRowStripe).addClass(m),e._sRowStripe=m)}C(a,"aoRowCallback",null,[s,a.aoData[a.aiDisplay[g]]._aData,h,g]);b.push(s);h++;if(0!==c)for(e=0;e<c;e++)if(s==a.aoOpenRows[e].nParent){b.push(a.aoOpenRows[e].nTr);break}}}else b[0]=l.createElement("tr"),a.asStripeClasses[0]&& 
    40 (b[0].className=a.asStripeClasses[0]),c=a.oLanguage,f=c.sZeroRecords,1==a.iDraw&&null!==a.sAjaxSource&&!a.oFeatures.bServerSide?f=c.sLoadingRecords:c.sEmptyTable&&0===a.fnRecordsTotal()&&(f=c.sEmptyTable),c=l.createElement("td"),c.setAttribute("valign","top"),c.colSpan=w(a),c.className=a.oClasses.sRowEmpty,c.innerHTML=ia(a,f),b[h].appendChild(c);C(a,"aoHeaderCallback","header",[i(a.nTHead).children("tr")[0],Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);C(a,"aoFooterCallback","footer",[i(a.nTFoot).children("tr")[0], 
    41 Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);h=l.createDocumentFragment();c=l.createDocumentFragment();if(a.nTBody){f=a.nTBody.parentNode;c.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered)for(;c=a.nTBody.firstChild;)a.nTBody.removeChild(c);c=0;for(d=b.length;c<d;c++)h.appendChild(b[c]);a.nTBody.appendChild(h);null!==f&&f.appendChild(a.nTBody)}C(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1;a.oFeatures.bServerSide&&(F(a,!1), 
    42 a._bInitComplete||$(a))}}function aa(a){a.oFeatures.bSort?Q(a,a.oPreviousSearch):a.oFeatures.bFilter?M(a,a.oPreviousSearch):(A(a),z(a))}function ya(a){var b=i("<div></div>")[0];a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=i('<div id="'+a.sTableId+'_wrapper" class="'+a.oClasses.sWrapper+'" role="grid"></div>')[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),h,f,g,e,s,m,o,k=0;k<d.length;k++){f=0;g=d[k];if("<"==g){e=i("<div></div>")[0];s=d[k+ 
    43 1];if("'"==s||'"'==s){m="";for(o=2;d[k+o]!=s;)m+=d[k+o],o++;"H"==m?m=a.oClasses.sJUIHeader:"F"==m&&(m=a.oClasses.sJUIFooter);-1!=m.indexOf(".")?(s=m.split("."),e.id=s[0].substr(1,s[0].length-1),e.className=s[1]):"#"==m.charAt(0)?e.id=m.substr(1,m.length-1):e.className=m;k+=o}c.appendChild(e);c=e}else if(">"==g)c=c.parentNode;else if("l"==g&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange)h=za(a),f=1;else if("f"==g&&a.oFeatures.bFilter)h=Aa(a),f=1;else if("r"==g&&a.oFeatures.bProcessing)h=Ba(a),f= 
    44 1;else if("t"==g)h=Ca(a),f=1;else if("i"==g&&a.oFeatures.bInfo)h=Da(a),f=1;else if("p"==g&&a.oFeatures.bPaginate)h=Ea(a),f=1;else if(0!==j.ext.aoFeatures.length){e=j.ext.aoFeatures;o=0;for(s=e.length;o<s;o++)if(g==e[o].cFeature){(h=e[o].fnInit(a))&&(f=1);break}}1==f&&null!==h&&("object"!==typeof a.aanFeatures[g]&&(a.aanFeatures[g]=[]),a.aanFeatures[g].push(h),c.appendChild(h))}b.parentNode.replaceChild(a.nTableWrapper,b)}function W(a,b){var c=i(b).children("tr"),d,h,f,g,e,s,m,j;a.splice(0,a.length); 
    45 h=0;for(s=c.length;h<s;h++)a.push([]);h=0;for(s=c.length;h<s;h++){f=0;for(m=c[h].childNodes.length;f<m;f++)if(d=c[h].childNodes[f],"TD"==d.nodeName.toUpperCase()||"TH"==d.nodeName.toUpperCase()){var o=1*d.getAttribute("colspan"),k=1*d.getAttribute("rowspan"),o=!o||0===o||1===o?1:o,k=!k||0===k||1===k?1:k;for(g=0;a[h][g];)g++;j=g;for(e=0;e<o;e++)for(g=0;g<k;g++)a[h+g][j+e]={cell:d,unique:1==o?!0:!1},a[h+g].nTr=c[h]}}}function P(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],W(c,b)));for(var b=0,h=c.length;b< 
    46 h;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function xa(a){if(a.bAjaxDataGet){a.iDraw++;F(a,!0);var b=Fa(a);ja(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(b){Ga(a,b)},a);return!1}return!0}function Fa(a){var b=a.aoColumns.length,c=[],d,h,f,g;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:H(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength", 
     18(function(X,l,n){var L=function(h){var j=function(e){function o(a,b){var c=j.defaults.columns,d=a.aoColumns.length,c=h.extend({},j.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:l.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.oDefaults:d});a.aoColumns.push(c);if(a.aoPreSearchCols[d]===n||null===a.aoPreSearchCols[d])a.aoPreSearchCols[d]=h.extend({},j.models.oSearch);else if(c=a.aoPreSearchCols[d], 
     19c.bRegex===n&&(c.bRegex=!0),c.bSmart===n&&(c.bSmart=!0),c.bCaseInsensitive===n)c.bCaseInsensitive=!0;m(a,d,null)}function m(a,b,c){var d=a.aoColumns[b];c!==n&&null!==c&&(c.mDataProp&&!c.mData&&(c.mData=c.mDataProp),c.sType!==n&&(d.sType=c.sType,d._bAutoType=!1),h.extend(d,c),p(d,c,"sWidth","sWidthOrig"),c.iDataSort!==n&&(d.aDataSort=[c.iDataSort]),p(d,c,"aDataSort"));var i=d.mRender?Q(d.mRender):null,f=Q(d.mData);d.fnGetData=function(a,b){var c=f(a,b);return d.mRender&&b&&""!==b?i(c,b,a):c};d.fnSetData= 
     20L(d.mData);a.oFeatures.bSort||(d.bSortable=!1);!d.bSortable||-1==h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableNone,d.sSortingClassJUI=""):-1==h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortable,d.sSortingClassJUI=a.oClasses.sSortJUI):-1!=h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableAsc,d.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed):-1== 
     21h.inArray("asc",d.asSorting)&&-1!=h.inArray("desc",d.asSorting)&&(d.sSortingClass=a.oClasses.sSortableDesc,d.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed)}function k(a){if(!1===a.oFeatures.bAutoWidth)return!1;da(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function G(a,b){var c=r(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function R(a,b){var c=r(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function t(a){return r(a,"bVisible").length} 
     22function r(a,b){var c=[];h.map(a.aoColumns,function(a,i){a[b]&&c.push(i)});return c}function B(a){for(var b=j.ext.aTypes,c=b.length,d=0;d<c;d++){var i=b[d](a);if(null!==i)return i}return"string"}function u(a,b){for(var c=b.split(","),d=[],i=0,f=a.aoColumns.length;i<f;i++)for(var g=0;g<f;g++)if(a.aoColumns[i].sName==c[g]){d.push(g);break}return d}function M(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";return b.length==d?"":b.slice(0,-1)}function ta(a,b,c,d){var i,f, 
     23g,e,w;if(b)for(i=b.length-1;0<=i;i--){var j=b[i].aTargets;h.isArray(j)||D(a,1,"aTargets must be an array of targets, not a "+typeof j);f=0;for(g=j.length;f<g;f++)if("number"===typeof j[f]&&0<=j[f]){for(;a.aoColumns.length<=j[f];)o(a);d(j[f],b[i])}else if("number"===typeof j[f]&&0>j[f])d(a.aoColumns.length+j[f],b[i]);else if("string"===typeof j[f]){e=0;for(w=a.aoColumns.length;e<w;e++)("_all"==j[f]||h(a.aoColumns[e].nTh).hasClass(j[f]))&&d(e,b[i])}}if(c){i=0;for(a=c.length;i<a;i++)d(i,c[i])}}function H(a, 
     24b){var c;c=h.isArray(b)?b.slice():h.extend(!0,{},b);var d=a.aoData.length,i=h.extend(!0,{},j.models.oRow);i._aData=c;a.aoData.push(i);for(var f,i=0,g=a.aoColumns.length;i<g;i++)c=a.aoColumns[i],"function"===typeof c.fnRender&&c.bUseRendered&&null!==c.mData?F(a,d,i,S(a,d,i)):F(a,d,i,v(a,d,i)),c._bAutoType&&"string"!=c.sType&&(f=v(a,d,i,"type"),null!==f&&""!==f&&(f=B(f),null===c.sType?c.sType=f:c.sType!=f&&"html"!=c.sType&&(c.sType="string")));a.aiDisplayMaster.push(d);a.oFeatures.bDeferRender||ea(a, 
     25d);return d}function ua(a){var b,c,d,i,f,g,e;if(a.bDeferLoading||null===a.sAjaxSource)for(b=a.nTBody.firstChild;b;){if("TR"==b.nodeName.toUpperCase()){c=a.aoData.length;b._DT_RowIndex=c;a.aoData.push(h.extend(!0,{},j.models.oRow,{nTr:b}));a.aiDisplayMaster.push(c);f=b.firstChild;for(d=0;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)F(a,c,d,h.trim(f.innerHTML)),d++;f=f.nextSibling}}b=b.nextSibling}i=T(a);d=[];b=0;for(c=i.length;b<c;b++)for(f=i[b].firstChild;f;)g=f.nodeName.toUpperCase(),("TD"== 
     26g||"TH"==g)&&d.push(f),f=f.nextSibling;c=0;for(i=a.aoColumns.length;c<i;c++){e=a.aoColumns[c];null===e.sTitle&&(e.sTitle=e.nTh.innerHTML);var w=e._bAutoType,o="function"===typeof e.fnRender,k=null!==e.sClass,n=e.bVisible,m,p;if(w||o||k||!n){g=0;for(b=a.aoData.length;g<b;g++)f=a.aoData[g],m=d[g*i+c],w&&"string"!=e.sType&&(p=v(a,g,c,"type"),""!==p&&(p=B(p),null===e.sType?e.sType=p:e.sType!=p&&"html"!=e.sType&&(e.sType="string"))),e.mRender?m.innerHTML=v(a,g,c,"display"):e.mData!==c&&(m.innerHTML=v(a, 
     27g,c,"display")),o&&(p=S(a,g,c),m.innerHTML=p,e.bUseRendered&&F(a,g,c,p)),k&&(m.className+=" "+e.sClass),n?f._anHidden[c]=null:(f._anHidden[c]=m,m.parentNode.removeChild(m)),e.fnCreatedCell&&e.fnCreatedCell.call(a.oInstance,m,v(a,g,c,"display"),f._aData,g,c)}}if(0!==a.aoRowCreatedCallback.length){b=0;for(c=a.aoData.length;b<c;b++)f=a.aoData[b],A(a,"aoRowCreatedCallback",null,[f.nTr,f._aData,b])}}function I(a,b){return b._DT_RowIndex!==n?b._DT_RowIndex:null}function fa(a,b,c){for(var b=J(a,b),d=0,a= 
     28a.aoColumns.length;d<a;d++)if(b[d]===c)return d;return-1}function Y(a,b,c,d){for(var i=[],f=0,g=d.length;f<g;f++)i.push(v(a,b,d[f],c));return i}function v(a,b,c,d){var i=a.aoColumns[c];if((c=i.fnGetData(a.aoData[b]._aData,d))===n)return a.iDrawError!=a.iDraw&&null===i.sDefaultContent&&(D(a,0,"Requested unknown parameter "+("function"==typeof i.mData?"{mData function}":"'"+i.mData+"'")+" from the data source for row "+b),a.iDrawError=a.iDraw),i.sDefaultContent;if(null===c&&null!==i.sDefaultContent)c= 
     29i.sDefaultContent;else if("function"===typeof c)return c();return"display"==d&&null===c?"":c}function F(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function Q(a){if(null===a)return function(){return null};if("function"===typeof a)return function(b,d,i){return a(b,d,i)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,i){var f=i.split("."),g;if(""!==i){var e=0;for(g=f.length;e<g;e++){if(i=f[e].match(U)){f[e]=f[e].replace(U,"");""!==f[e]&&(a=a[f[e]]); 
     30g=[];f.splice(0,e+1);for(var f=f.join("."),e=0,h=a.length;e<h;e++)g.push(b(a[e],d,f));a=i[0].substring(1,i[0].length-1);a=""===a?g:g.join(a);break}if(null===a||a[f[e]]===n)return n;a=a[f[e]]}}return a};return function(c,d){return b(c,d,a)}}return function(b){return b[a]}}function L(a){if(null===a)return function(){};if("function"===typeof a)return function(b,d){a(b,"set",d)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,i){var i=i.split("."),f,g,e=0;for(g= 
     31i.length-1;e<g;e++){if(f=i[e].match(U)){i[e]=i[e].replace(U,"");a[i[e]]=[];f=i.slice();f.splice(0,e+1);g=f.join(".");for(var h=0,j=d.length;h<j;h++)f={},b(f,d[h],g),a[i[e]].push(f);return}if(null===a[i[e]]||a[i[e]]===n)a[i[e]]={};a=a[i[e]]}a[i[i.length-1].replace(U,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Z(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function ga(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0, 
     32a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);y(a)}function ha(a,b){for(var c=-1,d=0,i=a.length;d<i;d++)a[d]==b?c=d:a[d]>b&&a[d]--; -1!=c&&a.splice(c,1)}function S(a,b,c){var d=a.aoColumns[c];return d.fnRender({iDataRow:b,iDataColumn:c,oSettings:a,aData:a.aoData[b]._aData,mDataProp:d.mData},v(a,b,c,"display"))}function ea(a,b){var c=a.aoData[b],d;if(null===c.nTr){c.nTr=l.createElement("tr");c.nTr._DT_RowIndex=b;c._aData.DT_RowId&&(c.nTr.id=c._aData.DT_RowId);c._aData.DT_RowClass&& 
     33(c.nTr.className=c._aData.DT_RowClass);for(var i=0,f=a.aoColumns.length;i<f;i++){var g=a.aoColumns[i];d=l.createElement(g.sCellType);d.innerHTML="function"===typeof g.fnRender&&(!g.bUseRendered||null===g.mData)?S(a,b,i):v(a,b,i,"display");null!==g.sClass&&(d.className=g.sClass);g.bVisible?(c.nTr.appendChild(d),c._anHidden[i]=null):c._anHidden[i]=d;g.fnCreatedCell&&g.fnCreatedCell.call(a.oInstance,d,v(a,b,i,"display"),c._aData,b,i)}A(a,"aoRowCreatedCallback",null,[c.nTr,c._aData,b])}}function va(a){var b, 
     34c,d;if(0!==h("th, td",a.nTHead).length){b=0;for(d=a.aoColumns.length;b<d;b++)if(c=a.aoColumns[b].nTh,c.setAttribute("role","columnheader"),a.aoColumns[b].bSortable&&(c.setAttribute("tabindex",a.iTabIndex),c.setAttribute("aria-controls",a.sTableId)),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}else{var i=l.createElement("tr");b=0;for(d=a.aoColumns.length;b<d;b++)c=a.aoColumns[b].nTh,c.innerHTML=a.aoColumns[b].sTitle, 
     35c.setAttribute("tabindex","0"),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),i.appendChild(c);h(a.nTHead).html("")[0].appendChild(i);V(a.aoHeader,a.nTHead)}h(a.nTHead).children("tr").attr("role","row");if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;i=l.createElement("div");i.className=a.oClasses.sSortJUIWrapper;h(c).contents().appendTo(i);var f=l.createElement("span");f.className=a.oClasses.sSortIcon;i.appendChild(f);c.appendChild(i)}}if(a.oFeatures.bSort)for(b= 
     360;b<a.aoColumns.length;b++)!1!==a.aoColumns[b].bSortable?ia(a,a.aoColumns[b].nTh,b):h(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);""!==a.oClasses.sFooterTH&&h(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);if(null!==a.nTFoot){c=N(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)c[b]&&(a.aoColumns[b].nTf=c[b],a.aoColumns[b].sClass&&h(c[b]).addClass(a.aoColumns[b].sClass))}}function W(a,b,c){var d,i,f,g=[],e=[],h=a.aoColumns.length,j;c===n&&(c=!1);d=0;for(i= 
     37b.length;d<i;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=h-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);e.push([])}d=0;for(i=g.length;d<i;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(j=h=1,e[d][f]===n){a.appendChild(g[d][f].cell);for(e[d][f]=1;g[d+h]!==n&&g[d][f].cell==g[d+h][f].cell;)e[d+h][f]=1,h++;for(;g[d][f+j]!==n&&g[d][f].cell==g[d][f+j].cell;){for(c=0;c<h;c++)e[d+c][f+j]=1;j++}g[d][f].cell.rowSpan=h;g[d][f].cell.colSpan=j}}}function x(a){var b= 
     38A(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))E(a,!1);else{var c,d,b=[],i=0,f=a.asStripeClasses.length;c=a.aoOpenRows.length;a.bDrawing=!0;a.iInitDisplayStart!==n&&-1!=a.iInitDisplayStart&&(a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart,a.iInitDisplayStart=-1,y(a));if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++;else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!wa(a))return}else a.iDraw++;if(0!==a.aiDisplay.length){var g= 
     39a._iDisplayStart;d=a._iDisplayEnd;a.oFeatures.bServerSide&&(g=0,d=a.aoData.length);for(;g<d;g++){var e=a.aoData[a.aiDisplay[g]];null===e.nTr&&ea(a,a.aiDisplay[g]);var j=e.nTr;if(0!==f){var o=a.asStripeClasses[i%f];e._sRowStripe!=o&&(h(j).removeClass(e._sRowStripe).addClass(o),e._sRowStripe=o)}A(a,"aoRowCallback",null,[j,a.aoData[a.aiDisplay[g]]._aData,i,g]);b.push(j);i++;if(0!==c)for(e=0;e<c;e++)if(j==a.aoOpenRows[e].nParent){b.push(a.aoOpenRows[e].nTr);break}}}else b[0]=l.createElement("tr"),a.asStripeClasses[0]&& 
     40(b[0].className=a.asStripeClasses[0]),c=a.oLanguage,f=c.sZeroRecords,1==a.iDraw&&null!==a.sAjaxSource&&!a.oFeatures.bServerSide?f=c.sLoadingRecords:c.sEmptyTable&&0===a.fnRecordsTotal()&&(f=c.sEmptyTable),c=l.createElement("td"),c.setAttribute("valign","top"),c.colSpan=t(a),c.className=a.oClasses.sRowEmpty,c.innerHTML=ja(a,f),b[i].appendChild(c);A(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);A(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0], 
     41Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);i=l.createDocumentFragment();c=l.createDocumentFragment();if(a.nTBody){f=a.nTBody.parentNode;c.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered)for(;c=a.nTBody.firstChild;)a.nTBody.removeChild(c);c=0;for(d=b.length;c<d;c++)i.appendChild(b[c]);a.nTBody.appendChild(i);null!==f&&f.appendChild(a.nTBody)}A(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1;a.oFeatures.bServerSide&&(E(a,!1), 
     42a._bInitComplete||$(a))}}function aa(a){a.oFeatures.bSort?O(a,a.oPreviousSearch):a.oFeatures.bFilter?K(a,a.oPreviousSearch):(y(a),x(a))}function xa(a){var b=h("<div></div>")[0];a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=h('<div id="'+a.sTableId+'_wrapper" class="'+a.oClasses.sWrapper+'" role="grid"></div>')[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),i,f,g,e,w,o,k,m=0;m<d.length;m++){f=0;g=d[m];if("<"==g){e=h("<div></div>")[0];w=d[m+ 
     431];if("'"==w||'"'==w){o="";for(k=2;d[m+k]!=w;)o+=d[m+k],k++;"H"==o?o=a.oClasses.sJUIHeader:"F"==o&&(o=a.oClasses.sJUIFooter);-1!=o.indexOf(".")?(w=o.split("."),e.id=w[0].substr(1,w[0].length-1),e.className=w[1]):"#"==o.charAt(0)?e.id=o.substr(1,o.length-1):e.className=o;m+=k}c.appendChild(e);c=e}else if(">"==g)c=c.parentNode;else if("l"==g&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange)i=ya(a),f=1;else if("f"==g&&a.oFeatures.bFilter)i=za(a),f=1;else if("r"==g&&a.oFeatures.bProcessing)i=Aa(a),f= 
     441;else if("t"==g)i=Ba(a),f=1;else if("i"==g&&a.oFeatures.bInfo)i=Ca(a),f=1;else if("p"==g&&a.oFeatures.bPaginate)i=Da(a),f=1;else if(0!==j.ext.aoFeatures.length){e=j.ext.aoFeatures;k=0;for(w=e.length;k<w;k++)if(g==e[k].cFeature){(i=e[k].fnInit(a))&&(f=1);break}}1==f&&null!==i&&("object"!==typeof a.aanFeatures[g]&&(a.aanFeatures[g]=[]),a.aanFeatures[g].push(i),c.appendChild(i))}b.parentNode.replaceChild(a.nTableWrapper,b)}function V(a,b){var c=h(b).children("tr"),d,i,f,g,e,j,o,k,m,p;a.splice(0,a.length); 
     45f=0;for(j=c.length;f<j;f++)a.push([]);f=0;for(j=c.length;f<j;f++){d=c[f];for(i=d.firstChild;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase()){k=1*i.getAttribute("colspan");m=1*i.getAttribute("rowspan");k=!k||0===k||1===k?1:k;m=!m||0===m||1===m?1:m;g=0;for(e=a[f];e[g];)g++;o=g;p=1===k?!0:!1;for(e=0;e<k;e++)for(g=0;g<m;g++)a[f+g][o+e]={cell:i,unique:p},a[f+g].nTr=d}i=i.nextSibling}}}function N(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],V(c,b)));for(var b=0,i=c.length;b<i;b++)for(var f= 
     460,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function wa(a){if(a.bAjaxDataGet){a.iDraw++;E(a,!0);var b=Ea(a);ka(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(b){Fa(a,b)},a);return!1}return!0}function Ea(a){var b=a.aoColumns.length,c=[],d,i,f,g;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:M(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength", 
    4747value:!1!==a.oFeatures.bPaginate?a._iDisplayLength:-1});for(f=0;f<b;f++)d=a.aoColumns[f].mData,c.push({name:"mDataProp_"+f,value:"function"===typeof d?"function":d});if(!1!==a.oFeatures.bFilter){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++)c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch}),c.push({name:"bRegex_"+f,value:a.aoPreSearchCols[f].bRegex}),c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}if(!1!== 
    48 a.oFeatures.bSort){var e=0;d=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(f=0;f<d.length;f++){h=a.aoColumns[d[f][0]].aDataSort;for(g=0;g<h.length;g++)c.push({name:"iSortCol_"+e,value:h[g]}),c.push({name:"sSortDir_"+e,value:d[f][1]}),e++}c.push({name:"iSortingCols",value:e});for(f=0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}return c}function ja(a,b){C(a,"aoServerParams","serverParams",[b])}function Ga(a,b){if(b.sEcho!==n){if(1*b.sEcho< 
    49 a.iDraw)return;a.iDraw=1*b.sEcho}(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))&&fa(a);a._iRecordsTotal=parseInt(b.iTotalRecords,10);a._iRecordsDisplay=parseInt(b.iTotalDisplayRecords,10);var c=H(a),c=b.sColumns!==n&&""!==c&&b.sColumns!=c,d;c&&(d=y(a,b.sColumns));for(var h=S(a.sAjaxDataProp)(b),f=0,g=h.length;f<g;f++)if(c){for(var e=[],i=0,m=a.aoColumns.length;i<m;i++)e.push(h[f][d[i]]);J(a,e)}else J(a,h[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;z(a);a.bAjaxDataGet= 
    50 !0;F(a,!1)}function Aa(a){var b=a.oPreviousSearch,c=a.oLanguage.sSearch,c=-1!==c.indexOf("_INPUT_")?c.replace("_INPUT_",'<input type="text" />'):""===c?'<input type="text" />':c+' <input type="text" />',d=l.createElement("div");d.className=a.oClasses.sFilter;d.innerHTML="<label>"+c+"</label>";a.aanFeatures.f||(d.id=a.sTableId+"_filter");c=i('input[type="text"]',d);d._DT_Input=c[0];c.val(b.sSearch.replace('"',"&quot;"));c.bind("keyup.DT",function(){for(var c=a.aanFeatures.f,d=this.value===""?"":this.value, 
    51 g=0,e=c.length;g<e;g++)c[g]!=i(this).parents("div.dataTables_filter")[0]&&i(c[g]._DT_Input).val(d);d!=b.sSearch&&M(a,{sSearch:d,bRegex:b.bRegex,bSmart:b.bSmart,bCaseInsensitive:b.bCaseInsensitive})});c.attr("aria-controls",a.sTableId).bind("keypress.DT",function(a){if(a.keyCode==13)return false});return d}function M(a,b,c){var d=a.oPreviousSearch,h=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};if(a.oFeatures.bServerSide)f(b); 
    52 else{Ha(a,b.sSearch,c,b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<a.aoPreSearchCols.length;b++)Ia(a,h[b].sSearch,b,h[b].bRegex,h[b].bSmart,h[b].bCaseInsensitive);Ja(a)}a.bFiltered=!0;i(a.oInstance).trigger("filter",a);a._iDisplayStart=0;A(a);z(a);ka(a,0)}function Ja(a){for(var b=j.ext.afnFiltering,c=v(a,"bSearchable"),d=0,h=b.length;d<h;d++)for(var f=0,g=0,e=a.aiDisplay.length;g<e;g++){var i=a.aiDisplay[g-f];b[d](a,Y(a,i,"filter",c),i)||(a.aiDisplay.splice(g-f,1),f++)}}function Ia(a,b,c, 
    53 d,h,f){if(""!==b)for(var g=0,b=la(b,d,h,f),d=a.aiDisplay.length-1;0<=d;d--)h=Ka(x(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType),b.test(h)||(a.aiDisplay.splice(d,1),g++)}function Ha(a,b,c,d,h,f){d=la(b,d,h,f);h=a.oPreviousSearch;c||(c=0);0!==j.ext.afnFiltering.length&&(c=1);if(0>=b.length)a.aiDisplay.splice(0,a.aiDisplay.length),a.aiDisplay=a.aiDisplayMaster.slice();else if(a.aiDisplay.length==a.aiDisplayMaster.length||h.sSearch.length>b.length||1==c||0!==b.indexOf(h.sSearch)){a.aiDisplay.splice(0, 
    54 a.aiDisplay.length);ka(a,1);for(b=0;b<a.aiDisplayMaster.length;b++)d.test(a.asDataSearch[b])&&a.aiDisplay.push(a.aiDisplayMaster[b])}else for(b=c=0;b<a.asDataSearch.length;b++)d.test(a.asDataSearch[b])||(a.aiDisplay.splice(b-c,1),c++)}function ka(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch=[];for(var c=v(a,"bSearchable"),d=1===b?a.aiDisplayMaster:a.aiDisplay,h=0,f=d.length;h<f;h++)a.asDataSearch[h]=ma(a,Y(a,d[h],"filter",c))}}function ma(a,b){var c=b.join("  ");-1!==c.indexOf("&")&&(c=i("<div>").html(c).text()); 
    55 return c.replace(/[\n\r]/g," ")}function la(a,b,c,d){if(c)return a=b?a.split(" "):na(a).split(" "),a="^(?=.*?"+a.join(")(?=.*?")+").*$",RegExp(a,d?"i":"");a=b?a:na(a);return RegExp(a,d?"i":"")}function Ka(a,b){return"function"===typeof j.ext.ofnSearch[b]?j.ext.ofnSearch[b](a):null===a?"":"html"==b?a.replace(/[\r\n]/g," ").replace(/<.*?>/g,""):"string"===typeof a?a.replace(/[\r\n]/g," "):a}function na(a){return a.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"), 
    56 "\\$1")}function Da(a){var b=l.createElement("div");b.className=a.oClasses.sInfo;a.aanFeatures.i||(a.aoDrawCallback.push({fn:La,sName:"information"}),b.id=a.sTableId+"_info");a.nTable.setAttribute("aria-describedby",a.sTableId+"_info");return b}function La(a){if(a.oFeatures.bInfo&&0!==a.aanFeatures.i.length){var b=a.oLanguage,c=a._iDisplayStart+1,d=a.fnDisplayEnd(),h=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),g;g=0===f&&f==h?b.sInfoEmpty:0===f?b.sInfoEmpty+" "+b.sInfoFiltered:f==h?b.sInfo:b.sInfo+ 
    57 " "+b.sInfoFiltered;g+=b.sInfoPostFix;g=ia(a,g);null!==b.fnInfoCallback&&(g=b.fnInfoCallback.call(a.oInstance,a,c,d,h,f,g));a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)i(a[b]).html(g)}}function ia(a,b){var c=a.fnFormatNumber(a._iDisplayStart+1),d=a.fnDisplayEnd(),d=a.fnFormatNumber(d),h=a.fnRecordsDisplay(),h=a.fnFormatNumber(h),f=a.fnRecordsTotal(),f=a.fnFormatNumber(f);a.oScroll.bInfinite&&(c=a.fnFormatNumber(1));return b.replace("_START_",c).replace("_END_",d).replace("_TOTAL_",h).replace("_MAX_", 
    58 f)}function ba(a){var b,c,d=a.iInitDisplayStart;if(!1===a.bInitialised)setTimeout(function(){ba(a)},200);else{ya(a);wa(a);X(a,a.aoHeader);a.nTFoot&&X(a,a.aoFooter);F(a,!0);a.oFeatures.bAutoWidth&&ca(a);b=0;for(c=a.aoColumns.length;b<c;b++)null!==a.aoColumns[b].sWidth&&(a.aoColumns[b].nTh.style.width=q(a.aoColumns[b].sWidth));a.oFeatures.bSort?Q(a):a.oFeatures.bFilter?M(a,a.oPreviousSearch):(a.aiDisplay=a.aiDisplayMaster.slice(),A(a),z(a));null!==a.sAjaxSource&&!a.oFeatures.bServerSide?(c=[],ja(a, 
    59 c),a.fnServerData.call(a.oInstance,a.sAjaxSource,c,function(c){var f=a.sAjaxDataProp!==""?S(a.sAjaxDataProp)(c):c;for(b=0;b<f.length;b++)J(a,f[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)Q(a);else{a.aiDisplay=a.aiDisplayMaster.slice();A(a);z(a)}F(a,false);$(a,c)},a)):a.oFeatures.bServerSide||(F(a,!1),$(a))}}function $(a,b){a._bInitComplete=!0;C(a,"aoInitComplete","init",[a,b])}function oa(a){var b=j.defaults.oLanguage;!a.sEmptyTable&&(a.sZeroRecords&&"No data available in table"===b.sEmptyTable)&& 
    60 p(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(a.sZeroRecords&&"Loading..."===b.sLoadingRecords)&&p(a,a,"sZeroRecords","sLoadingRecords")}function za(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+('name="'+a.sTableId+'_length"')+">",c,d,h=a.aLengthMenu;if(2==h.length&&"object"===typeof h[0]&&"object"===typeof h[1]){c=0;for(d=h[0].length;c<d;c++)b+='<option value="'+h[0][c]+'">'+h[1][c]+"</option>"}else{c=0;for(d=h.length;c<d;c++)b+='<option value="'+h[c]+'">'+h[c]+"</option>"}b+= 
    61 "</select>";h=l.createElement("div");a.aanFeatures.l||(h.id=a.sTableId+"_length");h.className=a.oClasses.sLength;h.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";i('select option[value="'+a._iDisplayLength+'"]',h).attr("selected",!0);i("select",h).bind("change.DT",function(){var b=i(this).val(),h=a.aanFeatures.l;c=0;for(d=h.length;c<d;c++)h[c]!=this.parentNode&&i("select",h[c]).val(b);a._iDisplayLength=parseInt(b,10);A(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart= 
    62 a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<0)a._iDisplayStart=0}if(a._iDisplayLength==-1)a._iDisplayStart=0;z(a)});i("select",h).attr("aria-controls",a.sTableId);return h}function A(a){a._iDisplayEnd=!1===a.oFeatures.bPaginate?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||-1==a._iDisplayLength?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Ea(a){if(a.oScroll.bInfinite)return null;var b=l.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType; 
    63 j.ext.oPagination[a.sPaginationType].fnInit(a,b,function(a){A(a);z(a)});a.aanFeatures.p||a.aoDrawCallback.push({fn:function(a){j.ext.oPagination[a.sPaginationType].fnUpdate(a,function(a){A(a);z(a)})},sName:"pagination"});return b}function pa(a,b){var c=a._iDisplayStart;if("number"===typeof b)a._iDisplayStart=b*a._iDisplayLength,a._iDisplayStart>a.fnRecordsDisplay()&&(a._iDisplayStart=0);else if("first"==b)a._iDisplayStart=0;else if("previous"==b)a._iDisplayStart=0<=a._iDisplayLength?a._iDisplayStart- 
    64 a._iDisplayLength:0,0>a._iDisplayStart&&(a._iDisplayStart=0);else if("next"==b)0<=a._iDisplayLength?a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay()&&(a._iDisplayStart+=a._iDisplayLength):a._iDisplayStart=0;else if("last"==b)if(0<=a._iDisplayLength){var d=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(d-1)*a._iDisplayLength}else a._iDisplayStart=0;else E(a,0,"Unknown paging action: "+b);i(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Ba(a){var b= 
    65 l.createElement("div");a.aanFeatures.r||(b.id=a.sTableId+"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function F(a,b){if(a.oFeatures.bProcessing)for(var c=a.aanFeatures.r,d=0,h=c.length;d<h;d++)c[d].style.visibility=b?"visible":"hidden";i(a.oInstance).trigger("processing",[a,b])}function Ca(a){if(""===a.oScroll.sX&&""===a.oScroll.sY)return a.nTable;var b=l.createElement("div"),c=l.createElement("div"),d= 
    66 l.createElement("div"),h=l.createElement("div"),f=l.createElement("div"),g=l.createElement("div"),e=a.nTable.cloneNode(!1),j=a.nTable.cloneNode(!1),m=a.nTable.getElementsByTagName("thead")[0],o=0===a.nTable.getElementsByTagName("tfoot").length?null:a.nTable.getElementsByTagName("tfoot")[0],k=a.oClasses;c.appendChild(d);f.appendChild(g);h.appendChild(a.nTable);b.appendChild(c);b.appendChild(h);d.appendChild(e);e.appendChild(m);null!==o&&(b.appendChild(f),g.appendChild(j),j.appendChild(o));b.className= 
    67 k.sScrollWrapper;c.className=k.sScrollHead;d.className=k.sScrollHeadInner;h.className=k.sScrollBody;f.className=k.sScrollFoot;g.className=k.sScrollFootInner;a.oScroll.bAutoCss&&(c.style.overflow="hidden",c.style.position="relative",f.style.overflow="hidden",h.style.overflow="auto");c.style.border="0";c.style.width="100%";f.style.border="0";d.style.width=""!==a.oScroll.sXInner?a.oScroll.sXInner:"100%";e.removeAttribute("id");e.style.marginLeft="0";a.nTable.style.marginLeft="0";null!==o&&(j.removeAttribute("id"), 
    68 j.style.marginLeft="0");d=i(a.nTable).children("caption");0<d.length&&(d=d[0],"top"===d._captionSide?e.appendChild(d):"bottom"===d._captionSide&&o&&j.appendChild(d));""!==a.oScroll.sX&&(c.style.width=q(a.oScroll.sX),h.style.width=q(a.oScroll.sX),null!==o&&(f.style.width=q(a.oScroll.sX)),i(h).scroll(function(){c.scrollLeft=this.scrollLeft;if(o!==null)f.scrollLeft=this.scrollLeft}));""!==a.oScroll.sY&&(h.style.height=q(a.oScroll.sY));a.aoDrawCallback.push({fn:Ma,sName:"scrolling"});a.oScroll.bInfinite&& 
    69 i(h).scroll(function(){if(!a.bDrawing&&i(this).scrollTop()!==0&&i(this).scrollTop()+i(this).height()>i(a.nTable).height()-a.oScroll.iLoadGap&&a.fnDisplayEnd()<a.fnRecordsDisplay()){pa(a,"next");A(a);z(a)}});a.nScrollHead=c;a.nScrollFoot=f;return b}function Ma(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,h,f,g,e,j,m,o,k,r=[],n=null!==a.nTFoot?a.nScrollFoot.getElementsByTagName("div")[0]:null,p=null!==a.nTFoot?n.getElementsByTagName("table")[0]: 
    70 null,l=a.oBrowser.bScrollOversize;i(a.nTable).children("thead, tfoot").remove();g=i(a.nTHead).clone()[0];a.nTable.insertBefore(g,a.nTable.childNodes[0]);null!==a.nTFoot&&(j=i(a.nTFoot).clone()[0],a.nTable.insertBefore(j,a.nTable.childNodes[1]));""===a.oScroll.sX&&(d.style.width="100%",b.parentNode.style.width="100%");var t=P(a,g);h=0;for(f=t.length;h<f;h++)o=G(a,h),t[h].style.width=a.aoColumns[o].sWidth;null!==a.nTFoot&&N(function(a){a.style.width=""},j.getElementsByTagName("tr"));a.oScroll.bCollapse&& 
    71 ""!==a.oScroll.sY&&(d.style.height=d.offsetHeight+a.nTHead.offsetHeight+"px");h=i(a.nTable).outerWidth();if(""===a.oScroll.sX){if(a.nTable.style.width="100%",l&&(i("tbody",d).height()>d.offsetHeight||"scroll"==i(d).css("overflow-y")))a.nTable.style.width=q(i(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else""!==a.oScroll.sXInner?a.nTable.style.width=q(a.oScroll.sXInner):h==i(d).width()&&i(d).height()<i(a.nTable).height()?(a.nTable.style.width=q(h-a.oScroll.iBarWidth),i(a.nTable).outerWidth()>h-a.oScroll.iBarWidth&& 
    72 (a.nTable.style.width=q(h))):a.nTable.style.width=q(h);h=i(a.nTable).outerWidth();f=a.nTHead.getElementsByTagName("tr");g=g.getElementsByTagName("tr");N(function(a,b){m=a.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;k=i(a).width();b.style.width=q(k);r.push(k)},g,f);i(g).height(0);null!==a.nTFoot&&(e=j.getElementsByTagName("tr"),j=a.nTFoot.getElementsByTagName("tr"),N(function(a,b){m=a.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth= 
    73 "0";m.borderBottomWidth="0";m.height=0;k=i(a).width();b.style.width=q(k);r.push(k)},e,j),i(e).height(0));N(function(a){a.innerHTML="";a.style.width=q(r.shift())},g);null!==a.nTFoot&&N(function(a){a.innerHTML="";a.style.width=q(r.shift())},e);if(i(a.nTable).outerWidth()<h){e=d.scrollHeight>d.offsetHeight||"scroll"==i(d).css("overflow-y")?h+a.oScroll.iBarWidth:h;if(l&&(d.scrollHeight>d.offsetHeight||"scroll"==i(d).css("overflow-y")))a.nTable.style.width=q(e-a.oScroll.iBarWidth);d.style.width=q(e);b.parentNode.style.width= 
    74 q(e);null!==a.nTFoot&&(n.parentNode.style.width=q(e));""===a.oScroll.sX?E(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width."):""!==a.oScroll.sXInner&&E(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}else d.style.width=q("100%"),b.parentNode.style.width=q("100%"),null!==a.nTFoot&&(n.parentNode.style.width= 
    75 q("100%"));""===a.oScroll.sY&&l&&(d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth));""!==a.oScroll.sY&&a.oScroll.bCollapse&&(d.style.height=q(a.oScroll.sY),l=""!==a.oScroll.sX&&a.nTable.offsetWidth>d.offsetWidth?a.oScroll.iBarWidth:0,a.nTable.offsetHeight<d.offsetHeight&&(d.style.height=q(a.nTable.offsetHeight+l)));l=i(a.nTable).outerWidth();c.style.width=q(l);b.style.width=q(l);c=i(a.nTable).height()>d.clientHeight||"scroll"==i(d).css("overflow-y");b.style.paddingRight=c?a.oScroll.iBarWidth+ 
    76 "px":"0px";null!==a.nTFoot&&(p.style.width=q(l),n.style.width=q(l),n.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px");i(d).scroll();if(a.bSorted||a.bFiltered)d.scrollTop=0}function N(a,b,c){for(var d=0,h=b.length;d<h;d++)for(var f=0,g=b[d].childNodes.length;f<g;f++)1==b[d].childNodes[f].nodeType&&(c?a(b[d].childNodes[f],c[d].childNodes[f]):a(b[d].childNodes[f]))}function Na(a,b){if(!a||null===a||""===a)return 0;b||(b=l.getElementsByTagName("body")[0]);var c,d=l.createElement("div");d.style.width= 
    77 q(a);b.appendChild(d);c=d.offsetWidth;b.removeChild(d);return c}function ca(a){var b=0,c,d=0,h=a.aoColumns.length,f,g=i("th",a.nTHead),e=a.nTable.getAttribute("width");for(f=0;f<h;f++)a.aoColumns[f].bVisible&&(d++,null!==a.aoColumns[f].sWidth&&(c=Na(a.aoColumns[f].sWidthOrig,a.nTable.parentNode),null!==c&&(a.aoColumns[f].sWidth=q(c)),b++));if(h==g.length&&0===b&&d==h&&""===a.oScroll.sX&&""===a.oScroll.sY)for(f=0;f<a.aoColumns.length;f++)c=i(g[f]).width(),null!==c&&(a.aoColumns[f].sWidth=q(c));else{b= 
    78 a.nTable.cloneNode(!1);f=a.nTHead.cloneNode(!0);d=l.createElement("tbody");c=l.createElement("tr");b.removeAttribute("id");b.appendChild(f);null!==a.nTFoot&&(b.appendChild(a.nTFoot.cloneNode(!0)),N(function(a){a.style.width=""},b.getElementsByTagName("tr")));b.appendChild(d);d.appendChild(c);d=i("thead th",b);0===d.length&&(d=i("tbody tr:eq(0)>td",b));g=P(a,f);for(f=d=0;f<h;f++){var j=a.aoColumns[f];j.bVisible&&null!==j.sWidthOrig&&""!==j.sWidthOrig?g[f-d].style.width=q(j.sWidthOrig):j.bVisible?g[f- 
    79 d].style.width="":d++}for(f=0;f<h;f++)a.aoColumns[f].bVisible&&(d=Oa(a,f),null!==d&&(d=d.cloneNode(!0),""!==a.aoColumns[f].sContentPadding&&(d.innerHTML+=a.aoColumns[f].sContentPadding),c.appendChild(d)));h=a.nTable.parentNode;h.appendChild(b);""!==a.oScroll.sX&&""!==a.oScroll.sXInner?b.style.width=q(a.oScroll.sXInner):""!==a.oScroll.sX?(b.style.width="",i(b).width()<h.offsetWidth&&(b.style.width=q(h.offsetWidth))):""!==a.oScroll.sY?b.style.width=q(h.offsetWidth):e&&(b.style.width=q(e));b.style.visibility= 
    80 "hidden";Pa(a,b);h=i("tbody tr:eq(0)",b).children();0===h.length&&(h=P(a,i("thead",b)[0]));if(""!==a.oScroll.sX){for(f=d=c=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(c=null===a.aoColumns[f].sWidthOrig?c+i(h[d]).outerWidth():c+(parseInt(a.aoColumns[f].sWidth.replace("px",""),10)+(i(h[d]).outerWidth()-i(h[d]).width())),d++);b.style.width=q(c);a.nTable.style.width=q(c)}for(f=d=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(c=i(h[d]).width(),null!==c&&0<c&&(a.aoColumns[f].sWidth=q(c)), 
    81 d++);h=i(b).css("width");a.nTable.style.width=-1!==h.indexOf("%")?h:q(i(b).outerWidth());b.parentNode.removeChild(b)}e&&(a.nTable.style.width=q(e))}function Pa(a,b){""===a.oScroll.sX&&""!==a.oScroll.sY?(i(b).width(),b.style.width=q(i(b).outerWidth()-a.oScroll.iBarWidth)):""!==a.oScroll.sX&&(b.style.width=q(i(b).outerWidth()))}function Oa(a,b){var c=Qa(a,b);if(0>c)return null;if(null===a.aoData[c].nTr){var d=l.createElement("td");d.innerHTML=x(a,c,b,"");return d}return L(a,c)[b]}function Qa(a,b){for(var c= 
    82 -1,d=-1,h=0;h<a.aoData.length;h++){var f=x(a,h,b,"display")+"",f=f.replace(/<.*?>/g,"");f.length>c&&(c=f.length,d=h)}return d}function q(a){if(null===a)return"0px";if("number"==typeof a)return 0>a?"0px":a+"px";var b=a.charCodeAt(a.length-1);return 48>b||57<b?a:a+"px"}function Ra(){var a=l.createElement("p"),b=a.style;b.width="100%";b.height="200px";b.padding="0px";var c=l.createElement("div"),b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px"; 
    83 b.padding="0px";b.overflow="hidden";c.appendChild(a);l.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;b==a&&(a=c.clientWidth);l.body.removeChild(c);return b-a}function Q(a,b){var c,d,h,f,g,e,o=[],m=[],k=j.ext.oSort,r=a.aoData,l=a.aoColumns,p=a.oLanguage.oAria;if(!a.oFeatures.bServerSide&&(0!==a.aaSorting.length||null!==a.aaSortingFixed)){o=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<o.length;c++)if(d=o[c][0],h=t(a,d),f= 
    84 a.aoColumns[d].sSortDataType,j.ext.afnSortData[f])if(g=j.ext.afnSortData[f].call(a.oInstance,a,d,h),g.length===r.length){h=0;for(f=r.length;h<f;h++)I(a,h,d,g[h])}else E(a,0,"Returned data sort array (col "+d+") is the wrong length");c=0;for(d=a.aiDisplayMaster.length;c<d;c++)m[a.aiDisplayMaster[c]]=c;var q=o.length,G;c=0;for(d=r.length;c<d;c++)for(h=0;h<q;h++){G=l[o[h][0]].aDataSort;g=0;for(e=G.length;g<e;g++)f=l[G[g]].sType,f=k[(f?f:"string")+"-pre"],r[c]._aSortData[G[g]]=f?f(x(a,c,G[g],"sort")): 
    85 x(a,c,G[g],"sort")}a.aiDisplayMaster.sort(function(a,b){var c,d,h,f,g;for(c=0;c<q;c++){g=l[o[c][0]].aDataSort;d=0;for(h=g.length;d<h;d++)if(f=l[g[d]].sType,f=k[(f?f:"string")+"-"+o[c][1]](r[a]._aSortData[g[d]],r[b]._aSortData[g[d]]),0!==f)return f}return k["numeric-asc"](m[a],m[b])})}(b===n||b)&&!a.oFeatures.bDeferRender&&R(a);c=0;for(d=a.aoColumns.length;c<d;c++)f=l[c].sTitle.replace(/<.*?>/g,""),h=l[c].nTh,h.removeAttribute("aria-sort"),h.removeAttribute("aria-label"),l[c].bSortable?0<o.length&& 
    86 o[0][0]==c?(h.setAttribute("aria-sort","asc"==o[0][1]?"ascending":"descending"),h.setAttribute("aria-label",f+("asc"==(l[c].asSorting[o[0][2]+1]?l[c].asSorting[o[0][2]+1]:l[c].asSorting[0])?p.sSortAscending:p.sSortDescending))):h.setAttribute("aria-label",f+("asc"==l[c].asSorting[0]?p.sSortAscending:p.sSortDescending)):h.setAttribute("aria-label",f);a.bSorted=!0;i(a.oInstance).trigger("sort",a);a.oFeatures.bFilter?M(a,a.oPreviousSearch,1):(a.aiDisplay=a.aiDisplayMaster.slice(),a._iDisplayStart=0, 
    87 A(a),z(a))}function ha(a,b,c,d){Sa(b,{},function(b){if(!1!==a.aoColumns[c].bSortable){var f=function(){var d,f;if(b.shiftKey){for(var e=!1,i=0;i<a.aaSorting.length;i++)if(a.aaSorting[i][0]==c){e=!0;d=a.aaSorting[i][0];f=a.aaSorting[i][2]+1;a.aoColumns[d].asSorting[f]?(a.aaSorting[i][1]=a.aoColumns[d].asSorting[f],a.aaSorting[i][2]=f):a.aaSorting.splice(i,1);break}!1===e&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else 1==a.aaSorting.length&&a.aaSorting[0][0]==c?(d=a.aaSorting[0][0],f=a.aaSorting[0][2]+ 
    88 1,a.aoColumns[d].asSorting[f]||(f=0),a.aaSorting[0][1]=a.aoColumns[d].asSorting[f],a.aaSorting[0][2]=f):(a.aaSorting.splice(0,a.aaSorting.length),a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0]));Q(a)};a.oFeatures.bProcessing?(F(a,!0),setTimeout(function(){f();a.oFeatures.bServerSide||F(a,!1)},0)):f();"function"==typeof d&&d(a)}})}function R(a){var b,c,d,h,f,e=a.aoColumns.length,j=a.oClasses;for(b=0;b<e;b++)a.aoColumns[b].bSortable&&i(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+ 
    89 " "+a.aoColumns[b].sSortingClass);h=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){f=a.aoColumns[b].sSortingClass;d=-1;for(c=0;c<h.length;c++)if(h[c][0]==b){f="asc"==h[c][1]?j.sSortAsc:j.sSortDesc;d=c;break}i(a.aoColumns[b].nTh).addClass(f);a.bJUI&&(c=i("span."+j.sSortIcon,a.aoColumns[b].nTh),c.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed), 
    90 c.addClass(-1==d?a.aoColumns[b].sSortingClassJUI:"asc"==h[d][1]?j.sSortJUIAsc:j.sSortJUIDesc))}else i(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);f=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){d=L(a);if(a.oFeatures.bDeferRender)i(d).removeClass(f+"1 "+f+"2 "+f+"3");else if(d.length>=e)for(b=0;b<e;b++)if(-1!=d[b].className.indexOf(f+"1")){c=0;for(a=d.length/e;c<a;c++)d[e*c+b].className=i.trim(d[e*c+b].className.replace(f+"1",""))}else if(-1!=d[b].className.indexOf(f+ 
    91 "2")){c=0;for(a=d.length/e;c<a;c++)d[e*c+b].className=i.trim(d[e*c+b].className.replace(f+"2",""))}else if(-1!=d[b].className.indexOf(f+"3")){c=0;for(a=d.length/e;c<a;c++)d[e*c+b].className=i.trim(d[e*c+b].className.replace(" "+f+"3",""))}var j=1,o;for(b=0;b<h.length;b++){o=parseInt(h[b][0],10);c=0;for(a=d.length/e;c<a;c++)d[e*c+o].className+=" "+f+j;3>j&&j++}}}function qa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b,c;b=a.oScroll.bInfinite;var d={iCreate:(new Date).getTime(),iStart:b?0:a._iDisplayStart, 
    92 iEnd:b?a._iDisplayLength:a._iDisplayEnd,iLength:a._iDisplayLength,aaSorting:i.extend(!0,[],a.aaSorting),oSearch:i.extend(!0,{},a.oPreviousSearch),aoSearchCols:i.extend(!0,[],a.aoPreSearchCols),abVisCols:[]};b=0;for(c=a.aoColumns.length;b<c;b++)d.abVisCols.push(a.aoColumns[b].bVisible);C(a,"aoStateSaveParams","stateSaveParams",[a,d]);a.fnStateSave.call(a.oInstance,a,d)}}function Ta(a,b){if(a.oFeatures.bStateSave){var c=a.fnStateLoad.call(a.oInstance,a);if(c){var d=C(a,"aoStateLoadParams","stateLoadParams", 
    93 [a,c]);if(-1===i.inArray(!1,d)){a.oLoadedState=i.extend(!0,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();i.extend(a.oPreviousSearch,c.oSearch);i.extend(!0,a.aoPreSearchCols,c.aoSearchCols);b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++)b.saved_aoColumns[d]={},b.saved_aoColumns[d].bVisible=c.abVisCols[d];C(a,"aoStateLoaded","stateLoaded",[a,c])}}}}function Ua(a){for(var b= 
    94 O.location.pathname.split("/"),a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=",b=l.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return decodeURIComponent(d.substring(a.length,d.length))}return null}function u(a){for(var b=0;b<j.settings.length;b++)if(j.settings[b].nTable===a)return j.settings[b];return null}function U(a){for(var b=[],a=a.aoData,c=0,d=a.length;c<d;c++)null!==a[c].nTr&&b.push(a[c].nTr);return b}function L(a, 
    95 b){var c=[],d,h,f,e,i,j;h=0;var o=a.aoData.length;b!==n&&(h=b,o=b+1);for(f=h;f<o;f++)if(j=a.aoData[f],null!==j.nTr){h=[];e=0;for(i=j.nTr.childNodes.length;e<i;e++)d=j.nTr.childNodes[e].nodeName.toLowerCase(),("td"==d||"th"==d)&&h.push(j.nTr.childNodes[e]);e=d=0;for(i=a.aoColumns.length;e<i;e++)a.aoColumns[e].bVisible?c.push(h[e-d]):(c.push(j._anHidden[e]),d++)}return c}function E(a,b,c){a=null===a?"DataTables warning: "+c:"DataTables warning (table id = '"+a.sTableId+"'): "+c;if(0===b)if("alert"== 
    96 j.ext.sErrMode)alert(a);else throw Error(a);else O.console&&console.log&&console.log(a)}function p(a,b,c,d){d===n&&(d=c);b[c]!==n&&(a[d]=b[c])}function Va(a,b){var c,d;for(d in b)b.hasOwnProperty(d)&&(c=b[d],"object"===typeof e[d]&&null!==c&&!1===i.isArray(c)?i.extend(!0,a[d],c):a[d]=c);return a}function Sa(a,b,c){i(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&c(a)}).bind("selectstart.DT",function(){return!1})}function B(a,b,c,d){c&&a[b].push({fn:c, 
    97 sName:d})}function C(a,b,c,d){for(var b=a[b],h=[],e=b.length-1;0<=e;e--)h.push(b[e].fn.apply(a.oInstance,d));null!==c&&i(a.oInstance).trigger(c,d);return h}function Wa(a){var b=i('<div style="position:absolute; top:0; left:0; height:1px; width:1px; overflow:hidden"><div style="position:absolute; top:1px; left:1px; width:100px; height:50px; overflow:scroll;"><div id="DT_BrowserTest" style="width:100%; height:10px;"></div></div></div>')[0];l.body.appendChild(b);a.oBrowser.bScrollOversize=100===i("#DT_BrowserTest", 
    98 b)[0].offsetWidth?!0:!1;l.body.removeChild(b)}function Xa(a){return function(){var b=[u(this[j.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return j.ext.oApi[a].apply(this,b)}}var V=/\[.*?\]$/,Ya=O.JSON?JSON.stringify:function(a){var b=typeof a;if("object"!==b||null===a)return"string"===b&&(a='"'+a+'"'),a+"";var c,d,h=[],e=i.isArray(a);for(c in a)d=a[c],b=typeof d,"string"===b?d='"'+d+'"':"object"===b&&null!==d&&(d=Ya(d)),h.push((e?"":'"'+c+'":')+d);return(e?"[":"{")+h+(e?"]":"}")}; 
    99 this.$=function(a,b){var c,d,h=[],e;d=u(this[j.ext.iApiIndex]);var g=d.aoData,o=d.aiDisplay,k=d.aiDisplayMaster;b||(b={});b=i.extend({},{filter:"none",order:"current",page:"all"},b);if("current"==b.page){c=d._iDisplayStart;for(d=d.fnDisplayEnd();c<d;c++)(e=g[o[c]].nTr)&&h.push(e)}else if("current"==b.order&&"none"==b.filter){c=0;for(d=k.length;c<d;c++)(e=g[k[c]].nTr)&&h.push(e)}else if("current"==b.order&&"applied"==b.filter){c=0;for(d=o.length;c<d;c++)(e=g[o[c]].nTr)&&h.push(e)}else if("original"== 
    100 b.order&&"none"==b.filter){c=0;for(d=g.length;c<d;c++)(e=g[c].nTr)&&h.push(e)}else if("original"==b.order&&"applied"==b.filter){c=0;for(d=g.length;c<d;c++)e=g[c].nTr,-1!==i.inArray(c,o)&&e&&h.push(e)}else E(d,1,"Unknown selection options");h=i(h);c=h.filter(a);h=h.find(a);return i([].concat(i.makeArray(c),i.makeArray(h)))};this._=function(a,b){var c=[],d,e,f=this.$(a,b);d=0;for(e=f.length;d<e;d++)c.push(this.fnGetData(f[d]));return c};this.fnAddData=function(a,b){if(0===a.length)return[];var c=[], 
    101 d,e=u(this[j.ext.iApiIndex]);if("object"===typeof a[0]&&null!==a[0])for(var f=0;f<a.length;f++){d=J(e,a[f]);if(-1==d)return c;c.push(d)}else{d=J(e,a);if(-1==d)return c;c.push(d)}e.aiDisplay=e.aiDisplayMaster.slice();(b===n||b)&&aa(e);return c};this.fnAdjustColumnSizing=function(a){var b=u(this[j.ext.iApiIndex]);k(b);a===n||a?this.fnDraw(!1):(""!==b.oScroll.sX||""!==b.oScroll.sY)&&this.oApi._fnScrollDraw(b)};this.fnClearTable=function(a){var b=u(this[j.ext.iApiIndex]);fa(b);(a===n||a)&&z(b)};this.fnClose= 
    102 function(a){for(var b=u(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr),b.aoOpenRows.splice(c,1),0;return 1};this.fnDeleteRow=function(a,b,c){var d=u(this[j.ext.iApiIndex]),e,f,a="object"===typeof a?K(d,a):a,g=d.aoData.splice(a,1);e=0;for(f=d.aoData.length;e<f;e++)null!==d.aoData[e].nTr&&(d.aoData[e].nTr._DT_RowIndex=e);e=i.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ga(d.aiDisplayMaster, 
    103 a);ga(d.aiDisplay,a);"function"===typeof b&&b.call(this,d,g);d._iDisplayStart>=d.fnRecordsDisplay()&&(d._iDisplayStart-=d._iDisplayLength,0>d._iDisplayStart&&(d._iDisplayStart=0));if(c===n||c)A(d),z(d);return g};this.fnDestroy=function(a){var b=u(this[j.ext.iApiIndex]),c=b.nTableWrapper.parentNode,d=b.nTBody,e,f,a=a===n?!1:!0;b.bDestroying=!0;C(b,"aoDestroyCallback","destroy",[b]);e=0;for(f=b.aoColumns.length;e<f;e++)!1===b.aoColumns[e].bVisible&&this.fnSetColumnVis(e,!0);i(b.nTableWrapper).find("*").andSelf().unbind(".DT"); 
    104 i("tbody>tr>td."+b.oClasses.sRowEmpty,b.nTable).parent().remove();b.nTable!=b.nTHead.parentNode&&(i(b.nTable).children("thead").remove(),b.nTable.appendChild(b.nTHead));b.nTFoot&&b.nTable!=b.nTFoot.parentNode&&(i(b.nTable).children("tfoot").remove(),b.nTable.appendChild(b.nTFoot));b.nTable.parentNode.removeChild(b.nTable);i(b.nTableWrapper).remove();b.aaSorting=[];b.aaSortingFixed=[];R(b);i(U(b)).removeClass(b.asStripeClasses.join(" "));i("th, td",b.nTHead).removeClass([b.oClasses.sSortable,b.oClasses.sSortableAsc, 
    105 b.oClasses.sSortableDesc,b.oClasses.sSortableNone].join(" "));b.bJUI&&(i("th span."+b.oClasses.sSortIcon+", td span."+b.oClasses.sSortIcon,b.nTHead).remove(),i("th, td",b.nTHead).each(function(){var a=i("div."+b.oClasses.sSortJUIWrapper,this),c=a.contents();i(this).append(c);a.remove()}));!a&&b.nTableReinsertBefore?c.insertBefore(b.nTable,b.nTableReinsertBefore):a||c.appendChild(b.nTable);e=0;for(f=b.aoData.length;e<f;e++)null!==b.aoData[e].nTr&&d.appendChild(b.aoData[e].nTr);!0===b.oFeatures.bAutoWidth&& 
    106 (b.nTable.style.width=q(b.sDestroyWidth));i(d).children("tr:even").addClass(b.asDestroyStripes[0]);i(d).children("tr:odd").addClass(b.asDestroyStripes[1]);e=0;for(f=j.settings.length;e<f;e++)j.settings[e]==b&&j.settings.splice(e,1);b=null};this.fnDraw=function(a){var b=u(this[j.ext.iApiIndex]);!1===a?(A(b),z(b)):aa(b)};this.fnFilter=function(a,b,c,d,e,f){var g=u(this[j.ext.iApiIndex]);if(g.oFeatures.bFilter){if(c===n||null===c)c=!1;if(d===n||null===d)d=!0;if(e===n||null===e)e=!0;if(f===n||null=== 
    107 f)f=!0;if(b===n||null===b){if(M(g,{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f},1),e&&g.aanFeatures.f){b=g.aanFeatures.f;c=0;for(d=b.length;c<d;c++)i(b[c]._DT_Input).val(a)}}else i.extend(g.aoPreSearchCols[b],{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f}),M(g,g.oPreviousSearch,1)}};this.fnGetData=function(a,b){var c=u(this[j.ext.iApiIndex]);if(a!==n){var d=a;if("object"===typeof a){var e=a.nodeName.toLowerCase();"tr"===e?d=K(c,a):"td"===e&&(d=K(c,a.parentNode),b=ea(c,d,a))}return b!== 
    108 n?x(c,d,b,""):c.aoData[d]!==n?c.aoData[d]._aData:null}return Z(c)};this.fnGetNodes=function(a){var b=u(this[j.ext.iApiIndex]);return a!==n?b.aoData[a]!==n?b.aoData[a].nTr:null:U(b)};this.fnGetPosition=function(a){var b=u(this[j.ext.iApiIndex]),c=a.nodeName.toUpperCase();return"TR"==c?K(b,a):"TD"==c||"TH"==c?(c=K(b,a.parentNode),a=ea(b,c,a),[c,t(b,a),a]):null};this.fnIsOpen=function(a){for(var b=u(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return!0;return!1}; 
    109 this.fnOpen=function(a,b,c){var d=u(this[j.ext.iApiIndex]),e=U(d);if(-1!==i.inArray(a,e)){this.fnClose(a);var e=l.createElement("tr"),f=l.createElement("td");e.appendChild(f);f.className=c;f.colSpan=w(d);"string"===typeof b?f.innerHTML=b:i(f).html(b);b=i("tr",d.nTBody);-1!=i.inArray(a,b)&&i(e).insertAfter(a);d.aoOpenRows.push({nTr:e,nParent:a});return e}};this.fnPageChange=function(a,b){var c=u(this[j.ext.iApiIndex]);pa(c,a);A(c);(b===n||b)&&z(c)};this.fnSetColumnVis=function(a,b,c){var d=u(this[j.ext.iApiIndex]), 
    110 e,f,g=d.aoColumns,i=d.aoData,o,m;if(g[a].bVisible!=b){if(b){for(e=f=0;e<a;e++)g[e].bVisible&&f++;m=f>=w(d);if(!m)for(e=a;e<g.length;e++)if(g[e].bVisible){o=e;break}e=0;for(f=i.length;e<f;e++)null!==i[e].nTr&&(m?i[e].nTr.appendChild(i[e]._anHidden[a]):i[e].nTr.insertBefore(i[e]._anHidden[a],L(d,e)[o]))}else{e=0;for(f=i.length;e<f;e++)null!==i[e].nTr&&(o=L(d,e)[a],i[e]._anHidden[a]=o,o.parentNode.removeChild(o))}g[a].bVisible=b;X(d,d.aoHeader);d.nTFoot&&X(d,d.aoFooter);e=0;for(f=d.aoOpenRows.length;e< 
    111 f;e++)d.aoOpenRows[e].nTr.colSpan=w(d);if(c===n||c)k(d),z(d);qa(d)}};this.fnSettings=function(){return u(this[j.ext.iApiIndex])};this.fnSort=function(a){var b=u(this[j.ext.iApiIndex]);b.aaSorting=a;Q(b)};this.fnSortListener=function(a,b,c){ha(u(this[j.ext.iApiIndex]),a,b,c)};this.fnUpdate=function(a,b,c,d,e){var f=u(this[j.ext.iApiIndex]),b="object"===typeof b?K(f,b):b;if(i.isArray(a)&&c===n){f.aoData[b]._aData=a.slice();for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(x(f,b,c),b,c,!1,!1)}else if(i.isPlainObject(a)&& 
    112 c===n){f.aoData[b]._aData=i.extend(!0,{},a);for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(x(f,b,c),b,c,!1,!1)}else{I(f,b,c,a);var a=x(f,b,c,"display"),g=f.aoColumns[c];null!==g.fnRender&&(a=T(f,b,c),g.bUseRendered&&I(f,b,c,a));null!==f.aoData[b].nTr&&(L(f,b)[c].innerHTML=a)}c=i.inArray(b,f.aiDisplay);f.asDataSearch[c]=ma(f,Y(f,b,"filter",v(f,"bSearchable")));(e===n||e)&&k(f);(d===n||d)&&aa(f);return 0};this.fnVersionCheck=j.ext.fnVersionCheck;this.oApi={_fnExternApiFunc:Xa,_fnInitialise:ba,_fnInitComplete:$, 
    113 _fnLanguageCompat:oa,_fnAddColumn:o,_fnColumnOptions:r,_fnAddData:J,_fnCreateTr:da,_fnGatherData:va,_fnBuildHead:wa,_fnDrawHead:X,_fnDraw:z,_fnReDraw:aa,_fnAjaxUpdate:xa,_fnAjaxParameters:Fa,_fnAjaxUpdateDraw:Ga,_fnServerParams:ja,_fnAddOptionsHtml:ya,_fnFeatureHtmlTable:Ca,_fnScrollDraw:Ma,_fnAdjustColumnSizing:k,_fnFeatureHtmlFilter:Aa,_fnFilterComplete:M,_fnFilterCustom:Ja,_fnFilterColumn:Ia,_fnFilter:Ha,_fnBuildSearchArray:ka,_fnBuildSearchRow:ma,_fnFilterCreateSearch:la,_fnDataToSearch:Ka,_fnSort:Q, 
    114 _fnSortAttachListener:ha,_fnSortingClasses:R,_fnFeatureHtmlPaginate:Ea,_fnPageChange:pa,_fnFeatureHtmlInfo:Da,_fnUpdateInfo:La,_fnFeatureHtmlLength:za,_fnFeatureHtmlProcessing:Ba,_fnProcessingDisplay:F,_fnVisibleToColumnIndex:G,_fnColumnIndexToVisible:t,_fnNodeToDataIndex:K,_fnVisbleColumns:w,_fnCalculateEnd:A,_fnConvertToWidth:Na,_fnCalculateColumnWidths:ca,_fnScrollingWidthAdjust:Pa,_fnGetWidestNode:Oa,_fnGetMaxLenString:Qa,_fnStringToCss:q,_fnDetectType:D,_fnSettingsFromNode:u,_fnGetDataMaster:Z, 
    115 _fnGetTrNodes:U,_fnGetTdNodes:L,_fnEscapeRegex:na,_fnDeleteIndex:ga,_fnReOrderIndex:y,_fnColumnOrdering:H,_fnLog:E,_fnClearTable:fa,_fnSaveState:qa,_fnLoadState:Ta,_fnCreateCookie:function(a,b,c,d,e){var f=new Date;f.setTime(f.getTime()+1E3*c);var c=O.location.pathname.split("/"),a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase(),g;null!==e?(g="function"===typeof i.parseJSON?i.parseJSON(b):eval("("+b+")"),b=e(a,g,f.toGMTString(),c.join("/")+"/")):b=a+"="+encodeURIComponent(b)+"; expires="+f.toGMTString()+ 
    116 "; path="+c.join("/")+"/";e="";f=9999999999999;if(4096<(null!==Ua(a)?l.cookie.length:b.length+l.cookie.length)+10){for(var a=l.cookie.split(";"),j=0,o=a.length;j<o;j++)if(-1!=a[j].indexOf(d)){var k=a[j].split("=");try{g=eval("("+decodeURIComponent(k[1])+")")}catch(r){continue}g.iCreate&&g.iCreate<f&&(e=k[0],f=g.iCreate)}""!==e&&(l.cookie=e+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+"/")}l.cookie=b},_fnReadCookie:Ua,_fnDetectHeader:W,_fnGetUniqueThs:P,_fnScrollBarWidth:Ra,_fnApplyToChildren:N, 
    117 _fnMap:p,_fnGetRowData:Y,_fnGetCellData:x,_fnSetCellData:I,_fnGetObjectDataFn:S,_fnSetObjectDataFn:ta,_fnApplyColumnDefs:ua,_fnBindAction:Sa,_fnExtend:Va,_fnCallbackReg:B,_fnCallbackFire:C,_fnJsonString:Ya,_fnRender:T,_fnNodeToColumnIndex:ea,_fnInfoMacros:ia,_fnBrowserDetect:Wa,_fnGetColumns:v};i.extend(j.ext.oApi,this.oApi);for(var ra in j.ext.oApi)ra&&(this[ra]=Xa(ra));var sa=this;return this.each(function(){var a=0,b,c,d;c=this.getAttribute("id");var h=!1,f=!1;if("table"!=this.nodeName.toLowerCase())E(null, 
    118 0,"Attempted to initialise DataTables on a node which is not a table: "+this.nodeName);else{a=0;for(b=j.settings.length;a<b;a++){if(j.settings[a].nTable==this){if(e===n||e.bRetrieve)return j.settings[a].oInstance;if(e.bDestroy){j.settings[a].oInstance.fnDestroy();break}else{E(j.settings[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");return}}if(j.settings[a].sTableId==this.id){j.settings.splice(a, 
    119 1);break}}if(null===c||""===c)this.id=c="DataTables_Table_"+j.ext._oExternConfig.iNextUnique++;var g=i.extend(!0,{},j.models.oSettings,{nTable:this,oApi:sa.oApi,oInit:e,sDestroyWidth:i(this).width(),sInstance:c,sTableId:c});j.settings.push(g);g.oInstance=1===sa.length?sa:i(this).dataTable();e||(e={});e.oLanguage&&oa(e.oLanguage);e=Va(i.extend(!0,{},j.defaults),e);p(g.oFeatures,e,"bPaginate");p(g.oFeatures,e,"bLengthChange");p(g.oFeatures,e,"bFilter");p(g.oFeatures,e,"bSort");p(g.oFeatures,e,"bInfo"); 
    120 p(g.oFeatures,e,"bProcessing");p(g.oFeatures,e,"bAutoWidth");p(g.oFeatures,e,"bSortClasses");p(g.oFeatures,e,"bServerSide");p(g.oFeatures,e,"bDeferRender");p(g.oScroll,e,"sScrollX","sX");p(g.oScroll,e,"sScrollXInner","sXInner");p(g.oScroll,e,"sScrollY","sY");p(g.oScroll,e,"bScrollCollapse","bCollapse");p(g.oScroll,e,"bScrollInfinite","bInfinite");p(g.oScroll,e,"iScrollLoadGap","iLoadGap");p(g.oScroll,e,"bScrollAutoCss","bAutoCss");p(g,e,"asStripeClasses");p(g,e,"asStripClasses","asStripeClasses"); 
    121 p(g,e,"fnServerData");p(g,e,"fnFormatNumber");p(g,e,"sServerMethod");p(g,e,"aaSorting");p(g,e,"aaSortingFixed");p(g,e,"aLengthMenu");p(g,e,"sPaginationType");p(g,e,"sAjaxSource");p(g,e,"sAjaxDataProp");p(g,e,"iCookieDuration");p(g,e,"sCookiePrefix");p(g,e,"sDom");p(g,e,"bSortCellsTop");p(g,e,"iTabIndex");p(g,e,"oSearch","oPreviousSearch");p(g,e,"aoSearchCols","aoPreSearchCols");p(g,e,"iDisplayLength","_iDisplayLength");p(g,e,"bJQueryUI","bJUI");p(g,e,"fnCookieCallback");p(g,e,"fnStateLoad");p(g,e, 
    122 "fnStateSave");p(g.oLanguage,e,"fnInfoCallback");B(g,"aoDrawCallback",e.fnDrawCallback,"user");B(g,"aoServerParams",e.fnServerParams,"user");B(g,"aoStateSaveParams",e.fnStateSaveParams,"user");B(g,"aoStateLoadParams",e.fnStateLoadParams,"user");B(g,"aoStateLoaded",e.fnStateLoaded,"user");B(g,"aoRowCallback",e.fnRowCallback,"user");B(g,"aoRowCreatedCallback",e.fnCreatedRow,"user");B(g,"aoHeaderCallback",e.fnHeaderCallback,"user");B(g,"aoFooterCallback",e.fnFooterCallback,"user");B(g,"aoInitComplete", 
    123 e.fnInitComplete,"user");B(g,"aoPreDrawCallback",e.fnPreDrawCallback,"user");g.oFeatures.bServerSide&&g.oFeatures.bSort&&g.oFeatures.bSortClasses?B(g,"aoDrawCallback",R,"server_side_sort_classes"):g.oFeatures.bDeferRender&&B(g,"aoDrawCallback",R,"defer_sort_classes");e.bJQueryUI?(i.extend(g.oClasses,j.ext.oJUIClasses),e.sDom===j.defaults.sDom&&"lfrtip"===j.defaults.sDom&&(g.sDom='<"H"lfr>t<"F"ip>')):i.extend(g.oClasses,j.ext.oStdClasses);i(this).addClass(g.oClasses.sTable);if(""!==g.oScroll.sX||""!== 
    124 g.oScroll.sY)g.oScroll.iBarWidth=Ra();g.iInitDisplayStart===n&&(g.iInitDisplayStart=e.iDisplayStart,g._iDisplayStart=e.iDisplayStart);e.bStateSave&&(g.oFeatures.bStateSave=!0,Ta(g,e),B(g,"aoDrawCallback",qa,"state_save"));null!==e.iDeferLoading&&(g.bDeferLoading=!0,a=i.isArray(e.iDeferLoading),g._iRecordsDisplay=a?e.iDeferLoading[0]:e.iDeferLoading,g._iRecordsTotal=a?e.iDeferLoading[1]:e.iDeferLoading);null!==e.aaData&&(f=!0);""!==e.oLanguage.sUrl?(g.oLanguage.sUrl=e.oLanguage.sUrl,i.getJSON(g.oLanguage.sUrl, 
    125 null,function(a){oa(a);i.extend(true,g.oLanguage,e.oLanguage,a);ba(g)}),h=!0):i.extend(!0,g.oLanguage,e.oLanguage);null===e.asStripeClasses&&(g.asStripeClasses=[g.oClasses.sStripeOdd,g.oClasses.sStripeEven]);c=!1;d=i(this).children("tbody").children("tr");a=0;for(b=g.asStripeClasses.length;a<b;a++)if(d.filter(":lt(2)").hasClass(g.asStripeClasses[a])){c=!0;break}c&&(g.asDestroyStripes=["",""],i(d[0]).hasClass(g.oClasses.sStripeOdd)&&(g.asDestroyStripes[0]+=g.oClasses.sStripeOdd+" "),i(d[0]).hasClass(g.oClasses.sStripeEven)&& 
    126 (g.asDestroyStripes[0]+=g.oClasses.sStripeEven),i(d[1]).hasClass(g.oClasses.sStripeOdd)&&(g.asDestroyStripes[1]+=g.oClasses.sStripeOdd+" "),i(d[1]).hasClass(g.oClasses.sStripeEven)&&(g.asDestroyStripes[1]+=g.oClasses.sStripeEven),d.removeClass(g.asStripeClasses.join(" ")));c=[];a=this.getElementsByTagName("thead");0!==a.length&&(W(g.aoHeader,a[0]),c=P(g));if(null===e.aoColumns){d=[];a=0;for(b=c.length;a<b;a++)d.push(null)}else d=e.aoColumns;a=0;for(b=d.length;a<b;a++)e.saved_aoColumns!==n&&e.saved_aoColumns.length== 
    127 b&&(null===d[a]&&(d[a]={}),d[a].bVisible=e.saved_aoColumns[a].bVisible),o(g,c?c[a]:null);ua(g,e.aoColumnDefs,d,function(a,b){r(g,a,b)});a=0;for(b=g.aaSorting.length;a<b;a++){g.aaSorting[a][0]>=g.aoColumns.length&&(g.aaSorting[a][0]=0);var k=g.aoColumns[g.aaSorting[a][0]];g.aaSorting[a][2]===n&&(g.aaSorting[a][2]=0);e.aaSorting===n&&g.saved_aaSorting===n&&(g.aaSorting[a][1]=k.asSorting[0]);c=0;for(d=k.asSorting.length;c<d;c++)if(g.aaSorting[a][1]==k.asSorting[c]){g.aaSorting[a][2]=c;break}}R(g);Wa(g); 
    128 a=i(this).children("caption").each(function(){this._captionSide=i(this).css("caption-side")});b=i(this).children("thead");0===b.length&&(b=[l.createElement("thead")],this.appendChild(b[0]));g.nTHead=b[0];b=i(this).children("tbody");0===b.length&&(b=[l.createElement("tbody")],this.appendChild(b[0]));g.nTBody=b[0];g.nTBody.setAttribute("role","alert");g.nTBody.setAttribute("aria-live","polite");g.nTBody.setAttribute("aria-relevant","all");b=i(this).children("tfoot");if(0===b.length&&0<a.length&&(""!== 
    129 g.oScroll.sX||""!==g.oScroll.sY))b=[l.createElement("tfoot")],this.appendChild(b[0]);0<b.length&&(g.nTFoot=b[0],W(g.aoFooter,g.nTFoot));if(f)for(a=0;a<e.aaData.length;a++)J(g,e.aaData[a]);else va(g);g.aiDisplay=g.aiDisplayMaster.slice();g.bInitialised=!0;!1===h&&ba(g)}})};j.fnVersionCheck=function(e){for(var i=function(e,i){for(;e.length<i;)e+="0";return e},r=j.ext.sVersion.split("."),e=e.split("."),k="",l="",n=0,w=e.length;n<w;n++)k+=i(r[n],3),l+=i(e[n],3);return parseInt(k,10)>=parseInt(l,10)}; 
    130 j.fnIsDataTable=function(e){for(var i=j.settings,r=0;r<i.length;r++)if(i[r].nTable===e||i[r].nScrollHead===e||i[r].nScrollFoot===e)return!0;return!1};j.fnTables=function(e){var o=[];jQuery.each(j.settings,function(j,k){(!e||!0===e&&i(k.nTable).is(":visible"))&&o.push(k.nTable)});return o};j.version="1.9.3";j.settings=[];j.models={};j.models.ext={afnFiltering:[],afnSortData:[],aoFeatures:[],aTypes:[],fnVersionCheck:j.fnVersionCheck,iApiIndex:0,ofnSearch:{},oApi:{},oStdClasses:{},oJUIClasses:{},oPagination:{}, 
    131 oSort:{},sVersion:j.version,sErrMode:"alert",_oExternConfig:{iNextUnique:0}};j.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};j.models.oRow={nTr:null,_aData:[],_aSortData:[],_anHidden:[],_sRowStripe:""};j.models.oColumn={aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bUseRendered:null,bVisible:null,_bAutoType:!0,fnCreatedCell:null,fnGetData:null,fnRender:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null, 
    132 sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};j.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollAutoCss:!0,bScrollCollapse:!1,bScrollInfinite:!1,bServerSide:!1,bSort:!0,bSortCellsTop:!1, 
    133 bSortClasses:!0,bStateSave:!1,fnCookieCallback:null,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){if(1E3>e)return e;for(var i=e+"",e=i.split(""),j="",i=i.length,k=0;k<i;k++)0===k%3&&0!==k&&(j=this.oLanguage.sInfoThousands+j),j=e[i-k-1]+j;return j},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:function(e,j,n,k){k.jqXHR=i.ajax({url:e,data:j,success:function(e){e.sError&&k.oApi._fnLog(k,0, 
    134 e.sError);i(k.oInstance).trigger("xhr",[k,e]);n(e)},dataType:"json",cache:!1,type:k.sServerMethod,error:function(e,i){"parsererror"==i&&k.oApi._fnLog(k,0,"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})},fnServerParams:null,fnStateLoad:function(e){var e=this.oApi._fnReadCookie(e.sCookiePrefix+e.sInstance),j;try{j="function"===typeof i.parseJSON?i.parseJSON(e):eval("("+e+")")}catch(n){j=null}return j},fnStateLoadParams:null,fnStateLoaded:null, 
    135 fnStateSave:function(e,i){this.oApi._fnCreateCookie(e.sCookiePrefix+e.sInstance,this.oApi._fnJsonString(i),e.iCookieDuration,e.sCookiePrefix,e.fnCookieCallback)},fnStateSaveParams:null,iCookieDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iScrollLoadGap:100,iTabIndex:0,oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table", 
    136 sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sUrl:"",sZeroRecords:"No matching records found"},oSearch:i.extend({},j.models.oSearch),sAjaxDataProp:"aaData",sAjaxSource:null,sCookiePrefix:"SpryMedia_DataTables_",sDom:"lfrtip",sPaginationType:"two_button",sScrollX:"", 
    137 sScrollXInner:"",sScrollY:"",sServerMethod:"GET"};j.defaults.columns={aDataSort:null,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bUseRendered:!0,bVisible:!0,fnCreatedCell:null,fnRender:null,iDataSort:-1,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};j.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null, 
    138 bServerSide:null,bSort:null,bSortClasses:null,bStateSave:null},oScroll:{bAutoCss:null,bCollapse:null,bInfinite:null,iBarWidth:0,iLoadGap:null,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1},aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],asDataSearch:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:null,asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[], 
    139 aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iCookieDuration:0,sCookiePrefix:"",fnCookieCallback:null,aoStateSave:[],aoStateLoad:[],oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,fnServerData:null, 
    140 aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iDisplayEnd:10,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length},fnRecordsDisplay:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay, 
    141 10):this.aiDisplay.length},fnDisplayEnd:function(){return this.oFeatures.bServerSide?!1===this.oFeatures.bPaginate||-1==this._iDisplayLength?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null};j.ext=i.extend(!0,{},j.models.ext);i.extend(j.ext.oStdClasses,{sTable:"dataTable",sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous", 
    142 sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_", 
    143 sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody", 
    144 sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"",sJUIHeader:"",sJUIFooter:""});i.extend(j.ext.oJUIClasses,j.ext.oStdClasses,{sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e", 
    145 sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl",sPageLast:"last ui-corner-tr ui-corner-br",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default", 
    146 sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead ui-state-default", 
    147 sScrollFoot:"dataTables_scrollFoot ui-state-default",sFooterTH:"ui-state-default",sJUIHeader:"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",sJUIFooter:"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"});i.extend(j.ext.oPagination,{two_button:{fnInit:function(e,j,n){var k=e.oLanguage.oPaginate,l=function(i){e.oApi._fnPageChange(e,i.data.action)&&n(e)},k=!e.bJUI?'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+ 
    148 '" role="button">'+k.sPrevious+'</a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sNext+"</a>":'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUIPrev+'"></span></a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUINext+'"></span></a>';i(j).append(k);var t=i("a",j),k=t[0],t=t[1];e.oApi._fnBindAction(k,{action:"previous"}, 
    149 l);e.oApi._fnBindAction(t,{action:"next"},l);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_previous",t.id=e.sTableId+"_next",k.setAttribute("aria-controls",e.sTableId),t.setAttribute("aria-controls",e.sTableId))},fnUpdate:function(e){if(e.aanFeatures.p)for(var i=e.oClasses,j=e.aanFeatures.p,k=0,n=j.length;k<n;k++)0!==j[k].childNodes.length&&(j[k].childNodes[0].className=0===e._iDisplayStart?i.sPagePrevDisabled:i.sPagePrevEnabled,j[k].childNodes[1].className=e.fnDisplayEnd()==e.fnRecordsDisplay()? 
    150 i.sPageNextDisabled:i.sPageNextEnabled)}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(e,j,n){var k=e.oLanguage.oPaginate,l=e.oClasses,t=function(i){e.oApi._fnPageChange(e,i.data.action)&&n(e)};i(j).append('<a  tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageFirst+'">'+k.sFirst+'</a><a  tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPagePrevious+'">'+k.sPrevious+'</a><span></span><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageNext+'">'+k.sNext+'</a><a tabindex="'+ 
    151 e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageLast+'">'+k.sLast+"</a>");var w=i("a",j),k=w[0],l=w[1],v=w[2],w=w[3];e.oApi._fnBindAction(k,{action:"first"},t);e.oApi._fnBindAction(l,{action:"previous"},t);e.oApi._fnBindAction(v,{action:"next"},t);e.oApi._fnBindAction(w,{action:"last"},t);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_first",l.id=e.sTableId+"_previous",v.id=e.sTableId+"_next",w.id=e.sTableId+"_last")},fnUpdate:function(e,o){if(e.aanFeatures.p){var l=j.ext.oPagination.iFullNumbersShowPages, 
    152 k=Math.floor(l/2),n=Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength),t=Math.ceil(e._iDisplayStart/e._iDisplayLength)+1,w="",v,D=e.oClasses,y,H=e.aanFeatures.p,O=function(i){e.oApi._fnBindAction(this,{page:i+v-1},function(i){e.oApi._fnPageChange(e,i.data.page);o(e);i.preventDefault()})};-1===e._iDisplayLength?t=k=v=1:n<l?(v=1,k=n):t<=k?(v=1,k=l):t>=n-k?(v=n-l+1,k=n):(v=t-Math.ceil(l/2)+1,k=v+l-1);for(l=v;l<=k;l++)w+=t!==l?'<a tabindex="'+e.iTabIndex+'" class="'+D.sPageButton+'">'+e.fnFormatNumber(l)+ 
    153 "</a>":'<a tabindex="'+e.iTabIndex+'" class="'+D.sPageButtonActive+'">'+e.fnFormatNumber(l)+"</a>";l=0;for(k=H.length;l<k;l++)0!==H[l].childNodes.length&&(i("span:eq(0)",H[l]).html(w).children("a").each(O),y=H[l].getElementsByTagName("a"),y=[y[0],y[1],y[y.length-2],y[y.length-1]],i(y).removeClass(D.sPageButton+" "+D.sPageButtonActive+" "+D.sPageButtonStaticDisabled),i([y[0],y[1]]).addClass(1==t?D.sPageButtonStaticDisabled:D.sPageButton),i([y[2],y[3]]).addClass(0===n||t===n||-1===e._iDisplayLength? 
    154 D.sPageButtonStaticDisabled:D.sPageButton))}}}});i.extend(j.ext.oSort,{"string-pre":function(e){"string"!=typeof e&&(e=null!==e&&e.toString?e.toString():"");return e.toLowerCase()},"string-asc":function(e,i){return e<i?-1:e>i?1:0},"string-desc":function(e,i){return e<i?1:e>i?-1:0},"html-pre":function(e){return e.replace(/<.*?>/g,"").toLowerCase()},"html-asc":function(e,i){return e<i?-1:e>i?1:0},"html-desc":function(e,i){return e<i?1:e>i?-1:0},"date-pre":function(e){e=Date.parse(e);if(isNaN(e)||""=== 
    155 e)e=Date.parse("01/01/1970 00:00:00");return e},"date-asc":function(e,i){return e-i},"date-desc":function(e,i){return i-e},"numeric-pre":function(e){return"-"==e||""===e?0:1*e},"numeric-asc":function(e,i){return e-i},"numeric-desc":function(e,i){return i-e}});i.extend(j.ext.aTypes,[function(e){if("number"===typeof e)return"numeric";if("string"!==typeof e)return null;var i,j=!1;i=e.charAt(0);if(-1=="0123456789-".indexOf(i))return null;for(var k=1;k<e.length;k++){i=e.charAt(k);if(-1=="0123456789.".indexOf(i))return null; 
    156 if("."==i){if(j)return null;j=!0}}return"numeric"},function(e){var i=Date.parse(e);return null!==i&&!isNaN(i)||"string"===typeof e&&0===e.length?"date":null},function(e){return"string"===typeof e&&-1!=e.indexOf("<")&&-1!=e.indexOf(">")?"html":null}]);i.fn.DataTable=j;i.fn.dataTable=j;i.fn.dataTableSettings=j.settings;i.fn.dataTableExt=j.ext})(jQuery,window,document,void 0); 
     48a.oFeatures.bSort){var e=0;d=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(f=0;f<d.length;f++){i=a.aoColumns[d[f][0]].aDataSort;for(g=0;g<i.length;g++)c.push({name:"iSortCol_"+e,value:i[g]}),c.push({name:"sSortDir_"+e,value:d[f][1]}),e++}c.push({name:"iSortingCols",value:e});for(f=0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}return c}function ka(a,b){A(a,"aoServerParams","serverParams",[b])}function Fa(a,b){if(b.sEcho!==n){if(1*b.sEcho< 
     49a.iDraw)return;a.iDraw=1*b.sEcho}(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))&&ga(a);a._iRecordsTotal=parseInt(b.iTotalRecords,10);a._iRecordsDisplay=parseInt(b.iTotalDisplayRecords,10);var c=M(a),c=b.sColumns!==n&&""!==c&&b.sColumns!=c,d;c&&(d=u(a,b.sColumns));for(var i=Q(a.sAjaxDataProp)(b),f=0,g=i.length;f<g;f++)if(c){for(var e=[],h=0,j=a.aoColumns.length;h<j;h++)e.push(i[f][d[h]]);H(a,e)}else H(a,i[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;x(a);a.bAjaxDataGet= 
     50!0;E(a,!1)}function za(a){var b=a.oPreviousSearch,c=a.oLanguage.sSearch,c=-1!==c.indexOf("_INPUT_")?c.replace("_INPUT_",'<input type="text" />'):""===c?'<input type="text" />':c+' <input type="text" />',d=l.createElement("div");d.className=a.oClasses.sFilter;d.innerHTML="<label>"+c+"</label>";a.aanFeatures.f||(d.id=a.sTableId+"_filter");c=h('input[type="text"]',d);d._DT_Input=c[0];c.val(b.sSearch.replace('"',"&quot;"));c.bind("keyup.DT",function(){for(var c=a.aanFeatures.f,d=this.value===""?"":this.value, 
     51g=0,e=c.length;g<e;g++)c[g]!=h(this).parents("div.dataTables_filter")[0]&&h(c[g]._DT_Input).val(d);d!=b.sSearch&&K(a,{sSearch:d,bRegex:b.bRegex,bSmart:b.bSmart,bCaseInsensitive:b.bCaseInsensitive})});c.attr("aria-controls",a.sTableId).bind("keypress.DT",function(a){if(a.keyCode==13)return false});return d}function K(a,b,c){var d=a.oPreviousSearch,i=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};if(a.oFeatures.bServerSide)f(b); 
     52else{Ga(a,b.sSearch,c,b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<a.aoPreSearchCols.length;b++)Ha(a,i[b].sSearch,b,i[b].bRegex,i[b].bSmart,i[b].bCaseInsensitive);Ia(a)}a.bFiltered=!0;h(a.oInstance).trigger("filter",a);a._iDisplayStart=0;y(a);x(a);la(a,0)}function Ia(a){for(var b=j.ext.afnFiltering,c=r(a,"bSearchable"),d=0,i=b.length;d<i;d++)for(var f=0,g=0,e=a.aiDisplay.length;g<e;g++){var h=a.aiDisplay[g-f];b[d](a,Y(a,h,"filter",c),h)||(a.aiDisplay.splice(g-f,1),f++)}}function Ha(a,b,c, 
     53d,i,f){if(""!==b)for(var g=0,b=ma(b,d,i,f),d=a.aiDisplay.length-1;0<=d;d--)i=Ja(v(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType),b.test(i)||(a.aiDisplay.splice(d,1),g++)}function Ga(a,b,c,d,i,f){d=ma(b,d,i,f);i=a.oPreviousSearch;c||(c=0);0!==j.ext.afnFiltering.length&&(c=1);if(0>=b.length)a.aiDisplay.splice(0,a.aiDisplay.length),a.aiDisplay=a.aiDisplayMaster.slice();else if(a.aiDisplay.length==a.aiDisplayMaster.length||i.sSearch.length>b.length||1==c||0!==b.indexOf(i.sSearch)){a.aiDisplay.splice(0, 
     54a.aiDisplay.length);la(a,1);for(b=0;b<a.aiDisplayMaster.length;b++)d.test(a.asDataSearch[b])&&a.aiDisplay.push(a.aiDisplayMaster[b])}else for(b=c=0;b<a.asDataSearch.length;b++)d.test(a.asDataSearch[b])||(a.aiDisplay.splice(b-c,1),c++)}function la(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch=[];for(var c=r(a,"bSearchable"),d=1===b?a.aiDisplayMaster:a.aiDisplay,i=0,f=d.length;i<f;i++)a.asDataSearch[i]=na(a,Y(a,d[i],"filter",c))}}function na(a,b){var c=b.join("  ");-1!==c.indexOf("&")&&(c=h("<div>").html(c).text()); 
     55return c.replace(/[\n\r]/g," ")}function ma(a,b,c,d){if(c)return a=b?a.split(" "):oa(a).split(" "),a="^(?=.*?"+a.join(")(?=.*?")+").*$",RegExp(a,d?"i":"");a=b?a:oa(a);return RegExp(a,d?"i":"")}function Ja(a,b){return"function"===typeof j.ext.ofnSearch[b]?j.ext.ofnSearch[b](a):null===a?"":"html"==b?a.replace(/[\r\n]/g," ").replace(/<.*?>/g,""):"string"===typeof a?a.replace(/[\r\n]/g," "):a}function oa(a){return a.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"), 
     56"\\$1")}function Ca(a){var b=l.createElement("div");b.className=a.oClasses.sInfo;a.aanFeatures.i||(a.aoDrawCallback.push({fn:Ka,sName:"information"}),b.id=a.sTableId+"_info");a.nTable.setAttribute("aria-describedby",a.sTableId+"_info");return b}function Ka(a){if(a.oFeatures.bInfo&&0!==a.aanFeatures.i.length){var b=a.oLanguage,c=a._iDisplayStart+1,d=a.fnDisplayEnd(),i=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),g;g=0===f?b.sInfoEmpty:b.sInfo;f!=i&&(g+=" "+b.sInfoFiltered);g+=b.sInfoPostFix;g=ja(a,g); 
     57null!==b.fnInfoCallback&&(g=b.fnInfoCallback.call(a.oInstance,a,c,d,i,f,g));a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)h(a[b]).html(g)}}function ja(a,b){var c=a.fnFormatNumber(a._iDisplayStart+1),d=a.fnDisplayEnd(),d=a.fnFormatNumber(d),i=a.fnRecordsDisplay(),i=a.fnFormatNumber(i),f=a.fnRecordsTotal(),f=a.fnFormatNumber(f);a.oScroll.bInfinite&&(c=a.fnFormatNumber(1));return b.replace(/_START_/g,c).replace(/_END_/g,d).replace(/_TOTAL_/g,i).replace(/_MAX_/g,f)}function ba(a){var b,c,d=a.iInitDisplayStart; 
     58if(!1===a.bInitialised)setTimeout(function(){ba(a)},200);else{xa(a);va(a);W(a,a.aoHeader);a.nTFoot&&W(a,a.aoFooter);E(a,!0);a.oFeatures.bAutoWidth&&da(a);b=0;for(c=a.aoColumns.length;b<c;b++)null!==a.aoColumns[b].sWidth&&(a.aoColumns[b].nTh.style.width=q(a.aoColumns[b].sWidth));a.oFeatures.bSort?O(a):a.oFeatures.bFilter?K(a,a.oPreviousSearch):(a.aiDisplay=a.aiDisplayMaster.slice(),y(a),x(a));null!==a.sAjaxSource&&!a.oFeatures.bServerSide?(c=[],ka(a,c),a.fnServerData.call(a.oInstance,a.sAjaxSource, 
     59c,function(c){var f=a.sAjaxDataProp!==""?Q(a.sAjaxDataProp)(c):c;for(b=0;b<f.length;b++)H(a,f[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)O(a);else{a.aiDisplay=a.aiDisplayMaster.slice();y(a);x(a)}E(a,false);$(a,c)},a)):a.oFeatures.bServerSide||(E(a,!1),$(a))}}function $(a,b){a._bInitComplete=!0;A(a,"aoInitComplete","init",[a,b])}function pa(a){var b=j.defaults.oLanguage;!a.sEmptyTable&&(a.sZeroRecords&&"No data available in table"===b.sEmptyTable)&&p(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&& 
     60(a.sZeroRecords&&"Loading..."===b.sLoadingRecords)&&p(a,a,"sZeroRecords","sLoadingRecords")}function ya(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+('name="'+a.sTableId+'_length"')+">",c,d,i=a.aLengthMenu;if(2==i.length&&"object"===typeof i[0]&&"object"===typeof i[1]){c=0;for(d=i[0].length;c<d;c++)b+='<option value="'+i[0][c]+'">'+i[1][c]+"</option>"}else{c=0;for(d=i.length;c<d;c++)b+='<option value="'+i[c]+'">'+i[c]+"</option>"}b+="</select>";i=l.createElement("div");a.aanFeatures.l|| 
     61(i.id=a.sTableId+"_length");i.className=a.oClasses.sLength;i.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";h('select option[value="'+a._iDisplayLength+'"]',i).attr("selected",!0);h("select",i).bind("change.DT",function(){var b=h(this).val(),i=a.aanFeatures.l;c=0;for(d=i.length;c<d;c++)i[c]!=this.parentNode&&h("select",i[c]).val(b);a._iDisplayLength=parseInt(b,10);y(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart< 
     620)a._iDisplayStart=0}if(a._iDisplayLength==-1)a._iDisplayStart=0;x(a)});h("select",i).attr("aria-controls",a.sTableId);return i}function y(a){a._iDisplayEnd=!1===a.oFeatures.bPaginate?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||-1==a._iDisplayLength?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Da(a){if(a.oScroll.bInfinite)return null;var b=l.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;j.ext.oPagination[a.sPaginationType].fnInit(a, 
     63b,function(a){y(a);x(a)});a.aanFeatures.p||a.aoDrawCallback.push({fn:function(a){j.ext.oPagination[a.sPaginationType].fnUpdate(a,function(a){y(a);x(a)})},sName:"pagination"});return b}function qa(a,b){var c=a._iDisplayStart;if("number"===typeof b)a._iDisplayStart=b*a._iDisplayLength,a._iDisplayStart>a.fnRecordsDisplay()&&(a._iDisplayStart=0);else if("first"==b)a._iDisplayStart=0;else if("previous"==b)a._iDisplayStart=0<=a._iDisplayLength?a._iDisplayStart-a._iDisplayLength:0,0>a._iDisplayStart&&(a._iDisplayStart= 
     640);else if("next"==b)0<=a._iDisplayLength?a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay()&&(a._iDisplayStart+=a._iDisplayLength):a._iDisplayStart=0;else if("last"==b)if(0<=a._iDisplayLength){var d=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(d-1)*a._iDisplayLength}else a._iDisplayStart=0;else D(a,0,"Unknown paging action: "+b);h(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Aa(a){var b=l.createElement("div");a.aanFeatures.r||(b.id=a.sTableId+ 
     65"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function E(a,b){if(a.oFeatures.bProcessing)for(var c=a.aanFeatures.r,d=0,i=c.length;d<i;d++)c[d].style.visibility=b?"visible":"hidden";h(a.oInstance).trigger("processing",[a,b])}function Ba(a){if(""===a.oScroll.sX&&""===a.oScroll.sY)return a.nTable;var b=l.createElement("div"),c=l.createElement("div"),d=l.createElement("div"),i=l.createElement("div"),f=l.createElement("div"), 
     66g=l.createElement("div"),e=a.nTable.cloneNode(!1),j=a.nTable.cloneNode(!1),o=a.nTable.getElementsByTagName("thead")[0],k=0===a.nTable.getElementsByTagName("tfoot").length?null:a.nTable.getElementsByTagName("tfoot")[0],m=a.oClasses;c.appendChild(d);f.appendChild(g);i.appendChild(a.nTable);b.appendChild(c);b.appendChild(i);d.appendChild(e);e.appendChild(o);null!==k&&(b.appendChild(f),g.appendChild(j),j.appendChild(k));b.className=m.sScrollWrapper;c.className=m.sScrollHead;d.className=m.sScrollHeadInner; 
     67i.className=m.sScrollBody;f.className=m.sScrollFoot;g.className=m.sScrollFootInner;a.oScroll.bAutoCss&&(c.style.overflow="hidden",c.style.position="relative",f.style.overflow="hidden",i.style.overflow="auto");c.style.border="0";c.style.width="100%";f.style.border="0";d.style.width=""!==a.oScroll.sXInner?a.oScroll.sXInner:"100%";e.removeAttribute("id");e.style.marginLeft="0";a.nTable.style.marginLeft="0";null!==k&&(j.removeAttribute("id"),j.style.marginLeft="0");d=h(a.nTable).children("caption");0< 
     68d.length&&(d=d[0],"top"===d._captionSide?e.appendChild(d):"bottom"===d._captionSide&&k&&j.appendChild(d));""!==a.oScroll.sX&&(c.style.width=q(a.oScroll.sX),i.style.width=q(a.oScroll.sX),null!==k&&(f.style.width=q(a.oScroll.sX)),h(i).scroll(function(){c.scrollLeft=this.scrollLeft;if(k!==null)f.scrollLeft=this.scrollLeft}));""!==a.oScroll.sY&&(i.style.height=q(a.oScroll.sY));a.aoDrawCallback.push({fn:La,sName:"scrolling"});a.oScroll.bInfinite&&h(i).scroll(function(){if(!a.bDrawing&&h(this).scrollTop()!== 
     690&&h(this).scrollTop()+h(this).height()>h(a.nTable).height()-a.oScroll.iLoadGap&&a.fnDisplayEnd()<a.fnRecordsDisplay()){qa(a,"next");y(a);x(a)}});a.nScrollHead=c;a.nScrollFoot=f;return b}function La(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,i,f,g,e,j,o,k,m,p=[],n=[],l=null!==a.nTFoot?a.nScrollFoot.getElementsByTagName("div")[0]:null,R=null!==a.nTFoot?l.getElementsByTagName("table")[0]:null,r=a.oBrowser.bScrollOversize,s=function(a){k= 
     70a.style;k.paddingTop="0";k.paddingBottom="0";k.borderTopWidth="0";k.borderBottomWidth="0";k.height=0};h(a.nTable).children("thead, tfoot").remove();i=h(a.nTHead).clone()[0];a.nTable.insertBefore(i,a.nTable.childNodes[0]);g=a.nTHead.getElementsByTagName("tr");e=i.getElementsByTagName("tr");null!==a.nTFoot&&(j=h(a.nTFoot).clone()[0],a.nTable.insertBefore(j,a.nTable.childNodes[1]),o=a.nTFoot.getElementsByTagName("tr"),j=j.getElementsByTagName("tr"));""===a.oScroll.sX&&(d.style.width="100%",b.parentNode.style.width= 
     71"100%");var t=N(a,i);i=0;for(f=t.length;i<f;i++)m=G(a,i),t[i].style.width=a.aoColumns[m].sWidth;null!==a.nTFoot&&C(function(a){a.style.width=""},j);a.oScroll.bCollapse&&""!==a.oScroll.sY&&(d.style.height=d.offsetHeight+a.nTHead.offsetHeight+"px");i=h(a.nTable).outerWidth();if(""===a.oScroll.sX){if(a.nTable.style.width="100%",r&&(h("tbody",d).height()>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(h(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else""!==a.oScroll.sXInner?a.nTable.style.width= 
     72q(a.oScroll.sXInner):i==h(d).width()&&h(d).height()<h(a.nTable).height()?(a.nTable.style.width=q(i-a.oScroll.iBarWidth),h(a.nTable).outerWidth()>i-a.oScroll.iBarWidth&&(a.nTable.style.width=q(i))):a.nTable.style.width=q(i);i=h(a.nTable).outerWidth();C(s,e);C(function(a){p.push(q(h(a).width()))},e);C(function(a,b){a.style.width=p[b]},g);h(e).height(0);null!==a.nTFoot&&(C(s,j),C(function(a){n.push(q(h(a).width()))},j),C(function(a,b){a.style.width=n[b]},o),h(j).height(0));C(function(a,b){a.innerHTML= 
     73"";a.style.width=p[b]},e);null!==a.nTFoot&&C(function(a,b){a.innerHTML="";a.style.width=n[b]},j);if(h(a.nTable).outerWidth()<i){g=d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")?i+a.oScroll.iBarWidth:i;if(r&&(d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(g-a.oScroll.iBarWidth);d.style.width=q(g);a.nScrollHead.style.width=q(g);null!==a.nTFoot&&(a.nScrollFoot.style.width=q(g));""===a.oScroll.sX?D(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width."): 
     74""!==a.oScroll.sXInner&&D(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}else d.style.width=q("100%"),a.nScrollHead.style.width=q("100%"),null!==a.nTFoot&&(a.nScrollFoot.style.width=q("100%"));""===a.oScroll.sY&&r&&(d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth));""!==a.oScroll.sY&&a.oScroll.bCollapse&&(d.style.height=q(a.oScroll.sY),r=""!==a.oScroll.sX&&a.nTable.offsetWidth> 
     75d.offsetWidth?a.oScroll.iBarWidth:0,a.nTable.offsetHeight<d.offsetHeight&&(d.style.height=q(a.nTable.offsetHeight+r)));r=h(a.nTable).outerWidth();c.style.width=q(r);b.style.width=q(r);c=h(a.nTable).height()>d.clientHeight||"scroll"==h(d).css("overflow-y");b.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px";null!==a.nTFoot&&(R.style.width=q(r),l.style.width=q(r),l.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px");h(d).scroll();if(a.bSorted||a.bFiltered)d.scrollTop=0}function C(a,b,c){for(var d= 
     760,i=0,f=b.length,g,e;i<f;){g=b[i].firstChild;for(e=c?c[i].firstChild:null;g;)1===g.nodeType&&(c?a(g,e,d):a(g,d),d++),g=g.nextSibling,e=c?e.nextSibling:null;i++}}function Ma(a,b){if(!a||null===a||""===a)return 0;b||(b=l.body);var c,d=l.createElement("div");d.style.width=q(a);b.appendChild(d);c=d.offsetWidth;b.removeChild(d);return c}function da(a){var b=0,c,d=0,i=a.aoColumns.length,f,e,j=h("th",a.nTHead),o=a.nTable.getAttribute("width");e=a.nTable.parentNode;for(f=0;f<i;f++)a.aoColumns[f].bVisible&& 
     77(d++,null!==a.aoColumns[f].sWidth&&(c=Ma(a.aoColumns[f].sWidthOrig,e),null!==c&&(a.aoColumns[f].sWidth=q(c)),b++));if(i==j.length&&0===b&&d==i&&""===a.oScroll.sX&&""===a.oScroll.sY)for(f=0;f<a.aoColumns.length;f++)c=h(j[f]).width(),null!==c&&(a.aoColumns[f].sWidth=q(c));else{b=a.nTable.cloneNode(!1);f=a.nTHead.cloneNode(!0);d=l.createElement("tbody");c=l.createElement("tr");b.removeAttribute("id");b.appendChild(f);null!==a.nTFoot&&(b.appendChild(a.nTFoot.cloneNode(!0)),C(function(a){a.style.width= 
     78""},b.getElementsByTagName("tr")));b.appendChild(d);d.appendChild(c);d=h("thead th",b);0===d.length&&(d=h("tbody tr:eq(0)>td",b));j=N(a,f);for(f=d=0;f<i;f++){var k=a.aoColumns[f];k.bVisible&&null!==k.sWidthOrig&&""!==k.sWidthOrig?j[f-d].style.width=q(k.sWidthOrig):k.bVisible?j[f-d].style.width="":d++}for(f=0;f<i;f++)a.aoColumns[f].bVisible&&(d=Na(a,f),null!==d&&(d=d.cloneNode(!0),""!==a.aoColumns[f].sContentPadding&&(d.innerHTML+=a.aoColumns[f].sContentPadding),c.appendChild(d)));e.appendChild(b); 
     79""!==a.oScroll.sX&&""!==a.oScroll.sXInner?b.style.width=q(a.oScroll.sXInner):""!==a.oScroll.sX?(b.style.width="",h(b).width()<e.offsetWidth&&(b.style.width=q(e.offsetWidth))):""!==a.oScroll.sY?b.style.width=q(e.offsetWidth):o&&(b.style.width=q(o));b.style.visibility="hidden";Oa(a,b);i=h("tbody tr:eq(0)",b).children();0===i.length&&(i=N(a,h("thead",b)[0]));if(""!==a.oScroll.sX){for(f=d=e=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(e=null===a.aoColumns[f].sWidthOrig?e+h(i[d]).outerWidth(): 
     80e+(parseInt(a.aoColumns[f].sWidth.replace("px",""),10)+(h(i[d]).outerWidth()-h(i[d]).width())),d++);b.style.width=q(e);a.nTable.style.width=q(e)}for(f=d=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(e=h(i[d]).width(),null!==e&&0<e&&(a.aoColumns[f].sWidth=q(e)),d++);i=h(b).css("width");a.nTable.style.width=-1!==i.indexOf("%")?i:q(h(b).outerWidth());b.parentNode.removeChild(b)}o&&(a.nTable.style.width=q(o))}function Oa(a,b){""===a.oScroll.sX&&""!==a.oScroll.sY?(h(b).width(),b.style.width=q(h(b).outerWidth()- 
     81a.oScroll.iBarWidth)):""!==a.oScroll.sX&&(b.style.width=q(h(b).outerWidth()))}function Na(a,b){var c=Pa(a,b);if(0>c)return null;if(null===a.aoData[c].nTr){var d=l.createElement("td");d.innerHTML=v(a,c,b,"");return d}return J(a,c)[b]}function Pa(a,b){for(var c=-1,d=-1,i=0;i<a.aoData.length;i++){var e=v(a,i,b,"display")+"",e=e.replace(/<.*?>/g,"");e.length>c&&(c=e.length,d=i)}return d}function q(a){if(null===a)return"0px";if("number"==typeof a)return 0>a?"0px":a+"px";var b=a.charCodeAt(a.length-1); 
     82return 48>b||57<b?a:a+"px"}function Qa(){var a=l.createElement("p"),b=a.style;b.width="100%";b.height="200px";b.padding="0px";var c=l.createElement("div"),b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.padding="0px";b.overflow="hidden";c.appendChild(a);l.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;b==a&&(a=c.clientWidth);l.body.removeChild(c);return b-a}function O(a,b){var c,d,i,e,g,k,o=[],m=[],p= 
     83j.ext.oSort,l=a.aoData,q=a.aoColumns,G=a.oLanguage.oAria;if(!a.oFeatures.bServerSide&&(0!==a.aaSorting.length||null!==a.aaSortingFixed)){o=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<o.length;c++)if(d=o[c][0],i=R(a,d),e=a.aoColumns[d].sSortDataType,j.ext.afnSortData[e])if(g=j.ext.afnSortData[e].call(a.oInstance,a,d,i),g.length===l.length){i=0;for(e=l.length;i<e;i++)F(a,i,d,g[i])}else D(a,0,"Returned data sort array (col "+d+") is the wrong length");c= 
     840;for(d=a.aiDisplayMaster.length;c<d;c++)m[a.aiDisplayMaster[c]]=c;var r=o.length,s;c=0;for(d=l.length;c<d;c++)for(i=0;i<r;i++){s=q[o[i][0]].aDataSort;g=0;for(k=s.length;g<k;g++)e=q[s[g]].sType,e=p[(e?e:"string")+"-pre"],l[c]._aSortData[s[g]]=e?e(v(a,c,s[g],"sort")):v(a,c,s[g],"sort")}a.aiDisplayMaster.sort(function(a,b){var c,d,e,i,f;for(c=0;c<r;c++){f=q[o[c][0]].aDataSort;d=0;for(e=f.length;d<e;d++)if(i=q[f[d]].sType,i=p[(i?i:"string")+"-"+o[c][1]](l[a]._aSortData[f[d]],l[b]._aSortData[f[d]]),0!== 
     85i)return i}return p["numeric-asc"](m[a],m[b])})}(b===n||b)&&!a.oFeatures.bDeferRender&&P(a);c=0;for(d=a.aoColumns.length;c<d;c++)e=q[c].sTitle.replace(/<.*?>/g,""),i=q[c].nTh,i.removeAttribute("aria-sort"),i.removeAttribute("aria-label"),q[c].bSortable?0<o.length&&o[0][0]==c?(i.setAttribute("aria-sort","asc"==o[0][1]?"ascending":"descending"),i.setAttribute("aria-label",e+("asc"==(q[c].asSorting[o[0][2]+1]?q[c].asSorting[o[0][2]+1]:q[c].asSorting[0])?G.sSortAscending:G.sSortDescending))):i.setAttribute("aria-label", 
     86e+("asc"==q[c].asSorting[0]?G.sSortAscending:G.sSortDescending)):i.setAttribute("aria-label",e);a.bSorted=!0;h(a.oInstance).trigger("sort",a);a.oFeatures.bFilter?K(a,a.oPreviousSearch,1):(a.aiDisplay=a.aiDisplayMaster.slice(),a._iDisplayStart=0,y(a),x(a))}function ia(a,b,c,d){Ra(b,{},function(b){if(!1!==a.aoColumns[c].bSortable){var e=function(){var d,e;if(b.shiftKey){for(var f=!1,h=0;h<a.aaSorting.length;h++)if(a.aaSorting[h][0]==c){f=!0;d=a.aaSorting[h][0];e=a.aaSorting[h][2]+1;a.aoColumns[d].asSorting[e]? 
     87(a.aaSorting[h][1]=a.aoColumns[d].asSorting[e],a.aaSorting[h][2]=e):a.aaSorting.splice(h,1);break}!1===f&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else 1==a.aaSorting.length&&a.aaSorting[0][0]==c?(d=a.aaSorting[0][0],e=a.aaSorting[0][2]+1,a.aoColumns[d].asSorting[e]||(e=0),a.aaSorting[0][1]=a.aoColumns[d].asSorting[e],a.aaSorting[0][2]=e):(a.aaSorting.splice(0,a.aaSorting.length),a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0]));O(a)};a.oFeatures.bProcessing?(E(a,!0),setTimeout(function(){e(); 
     88a.oFeatures.bServerSide||E(a,!1)},0)):e();"function"==typeof d&&d(a)}})}function P(a){var b,c,d,e,f,g=a.aoColumns.length,j=a.oClasses;for(b=0;b<g;b++)a.aoColumns[b].bSortable&&h(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass);c=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){f=a.aoColumns[b].sSortingClass;e=-1;for(d=0;d<c.length;d++)if(c[d][0]==b){f="asc"==c[d][1]? 
     89j.sSortAsc:j.sSortDesc;e=d;break}h(a.aoColumns[b].nTh).addClass(f);a.bJUI&&(f=h("span."+j.sSortIcon,a.aoColumns[b].nTh),f.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed),f.addClass(-1==e?a.aoColumns[b].sSortingClassJUI:"asc"==c[e][1]?j.sSortJUIAsc:j.sSortJUIDesc))}else h(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);f=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){a=J(a);e=[];for(b=0;b<g;b++)e.push("");b=0; 
     90for(d=1;b<c.length;b++)j=parseInt(c[b][0],10),e[j]=f+d,3>d&&d++;f=RegExp(f+"[123]");var o;b=0;for(c=a.length;b<c;b++)j=b%g,d=a[b].className,o=e[j],j=d.replace(f,o),j!=d?a[b].className=h.trim(j):0<o.length&&-1==d.indexOf(o)&&(a[b].className=d+" "+o)}}function ra(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b,c;b=a.oScroll.bInfinite;var d={iCreate:(new Date).getTime(),iStart:b?0:a._iDisplayStart,iEnd:b?a._iDisplayLength:a._iDisplayEnd,iLength:a._iDisplayLength,aaSorting:h.extend(!0,[],a.aaSorting), 
     91oSearch:h.extend(!0,{},a.oPreviousSearch),aoSearchCols:h.extend(!0,[],a.aoPreSearchCols),abVisCols:[]};b=0;for(c=a.aoColumns.length;b<c;b++)d.abVisCols.push(a.aoColumns[b].bVisible);A(a,"aoStateSaveParams","stateSaveParams",[a,d]);a.fnStateSave.call(a.oInstance,a,d)}}function Sa(a,b){if(a.oFeatures.bStateSave){var c=a.fnStateLoad.call(a.oInstance,a);if(c){var d=A(a,"aoStateLoadParams","stateLoadParams",[a,c]);if(-1===h.inArray(!1,d)){a.oLoadedState=h.extend(!0,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart= 
     92c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();h.extend(a.oPreviousSearch,c.oSearch);h.extend(!0,a.aoPreSearchCols,c.aoSearchCols);b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++)b.saved_aoColumns[d]={},b.saved_aoColumns[d].bVisible=c.abVisCols[d];A(a,"aoStateLoaded","stateLoaded",[a,c])}}}}function s(a){for(var b=0;b<j.settings.length;b++)if(j.settings[b].nTable===a)return j.settings[b];return null}function T(a){for(var b= 
     93[],a=a.aoData,c=0,d=a.length;c<d;c++)null!==a[c].nTr&&b.push(a[c].nTr);return b}function J(a,b){var c=[],d,e,f,g,h,j;e=0;var o=a.aoData.length;b!==n&&(e=b,o=b+1);for(f=e;f<o;f++)if(j=a.aoData[f],null!==j.nTr){e=[];for(d=j.nTr.firstChild;d;)g=d.nodeName.toLowerCase(),("td"==g||"th"==g)&&e.push(d),d=d.nextSibling;g=d=0;for(h=a.aoColumns.length;g<h;g++)a.aoColumns[g].bVisible?c.push(e[g-d]):(c.push(j._anHidden[g]),d++)}return c}function D(a,b,c){a=null===a?"DataTables warning: "+c:"DataTables warning (table id = '"+ 
     94a.sTableId+"'): "+c;if(0===b)if("alert"==j.ext.sErrMode)alert(a);else throw Error(a);else X.console&&console.log&&console.log(a)}function p(a,b,c,d){d===n&&(d=c);b[c]!==n&&(a[d]=b[c])}function Ta(a,b){var c,d;for(d in b)b.hasOwnProperty(d)&&(c=b[d],"object"===typeof e[d]&&null!==c&&!1===h.isArray(c)?h.extend(!0,a[d],c):a[d]=c);return a}function Ra(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&c(a)}).bind("selectstart.DT",function(){return!1})} 
     95function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function A(a,b,c,d){for(var b=a[b],e=[],f=b.length-1;0<=f;f--)e.push(b[f].fn.apply(a.oInstance,d));null!==c&&h(a.oInstance).trigger(c,d);return e}function Ua(a){var b=h('<div style="position:absolute; top:0; left:0; height:1px; width:1px; overflow:hidden"><div style="position:absolute; top:1px; left:1px; width:100px; overflow:scroll;"><div id="DT_BrowserTest" style="width:100%; height:10px;"></div></div></div>')[0];l.body.appendChild(b);a.oBrowser.bScrollOversize= 
     96100===h("#DT_BrowserTest",b)[0].offsetWidth?!0:!1;l.body.removeChild(b)}function Va(a){return function(){var b=[s(this[j.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return j.ext.oApi[a].apply(this,b)}}var U=/\[.*?\]$/,Wa=X.JSON?JSON.stringify:function(a){var b=typeof a;if("object"!==b||null===a)return"string"===b&&(a='"'+a+'"'),a+"";var c,d,e=[],f=h.isArray(a);for(c in a)d=a[c],b=typeof d,"string"===b?d='"'+d+'"':"object"===b&&null!==d&&(d=Wa(d)),e.push((f?"":'"'+c+'":')+d);return(f? 
     97"[":"{")+e+(f?"]":"}")};this.$=function(a,b){var c,d,e=[],f;d=s(this[j.ext.iApiIndex]);var g=d.aoData,o=d.aiDisplay,k=d.aiDisplayMaster;b||(b={});b=h.extend({},{filter:"none",order:"current",page:"all"},b);if("current"==b.page){c=d._iDisplayStart;for(d=d.fnDisplayEnd();c<d;c++)(f=g[o[c]].nTr)&&e.push(f)}else if("current"==b.order&&"none"==b.filter){c=0;for(d=k.length;c<d;c++)(f=g[k[c]].nTr)&&e.push(f)}else if("current"==b.order&&"applied"==b.filter){c=0;for(d=o.length;c<d;c++)(f=g[o[c]].nTr)&&e.push(f)}else if("original"== 
     98b.order&&"none"==b.filter){c=0;for(d=g.length;c<d;c++)(f=g[c].nTr)&&e.push(f)}else if("original"==b.order&&"applied"==b.filter){c=0;for(d=g.length;c<d;c++)f=g[c].nTr,-1!==h.inArray(c,o)&&f&&e.push(f)}else D(d,1,"Unknown selection options");e=h(e);c=e.filter(a);e=e.find(a);return h([].concat(h.makeArray(c),h.makeArray(e)))};this._=function(a,b){var c=[],d,e,f=this.$(a,b);d=0;for(e=f.length;d<e;d++)c.push(this.fnGetData(f[d]));return c};this.fnAddData=function(a,b){if(0===a.length)return[];var c=[], 
     99d,e=s(this[j.ext.iApiIndex]);if("object"===typeof a[0]&&null!==a[0])for(var f=0;f<a.length;f++){d=H(e,a[f]);if(-1==d)return c;c.push(d)}else{d=H(e,a);if(-1==d)return c;c.push(d)}e.aiDisplay=e.aiDisplayMaster.slice();(b===n||b)&&aa(e);return c};this.fnAdjustColumnSizing=function(a){var b=s(this[j.ext.iApiIndex]);k(b);a===n||a?this.fnDraw(!1):(""!==b.oScroll.sX||""!==b.oScroll.sY)&&this.oApi._fnScrollDraw(b)};this.fnClearTable=function(a){var b=s(this[j.ext.iApiIndex]);ga(b);(a===n||a)&&x(b)};this.fnClose= 
     100function(a){for(var b=s(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr),b.aoOpenRows.splice(c,1),0;return 1};this.fnDeleteRow=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e,f,a="object"===typeof a?I(d,a):a,g=d.aoData.splice(a,1);e=0;for(f=d.aoData.length;e<f;e++)null!==d.aoData[e].nTr&&(d.aoData[e].nTr._DT_RowIndex=e);e=h.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ha(d.aiDisplayMaster, 
     101a);ha(d.aiDisplay,a);"function"===typeof b&&b.call(this,d,g);d._iDisplayStart>=d.fnRecordsDisplay()&&(d._iDisplayStart-=d._iDisplayLength,0>d._iDisplayStart&&(d._iDisplayStart=0));if(c===n||c)y(d),x(d);return g};this.fnDestroy=function(a){var b=s(this[j.ext.iApiIndex]),c=b.nTableWrapper.parentNode,d=b.nTBody,i,f,a=a===n?!1:a;b.bDestroying=!0;A(b,"aoDestroyCallback","destroy",[b]);if(!a){i=0;for(f=b.aoColumns.length;i<f;i++)!1===b.aoColumns[i].bVisible&&this.fnSetColumnVis(i,!0)}h(b.nTableWrapper).find("*").andSelf().unbind(".DT"); 
     102h("tbody>tr>td."+b.oClasses.sRowEmpty,b.nTable).parent().remove();b.nTable!=b.nTHead.parentNode&&(h(b.nTable).children("thead").remove(),b.nTable.appendChild(b.nTHead));b.nTFoot&&b.nTable!=b.nTFoot.parentNode&&(h(b.nTable).children("tfoot").remove(),b.nTable.appendChild(b.nTFoot));b.nTable.parentNode.removeChild(b.nTable);h(b.nTableWrapper).remove();b.aaSorting=[];b.aaSortingFixed=[];P(b);h(T(b)).removeClass(b.asStripeClasses.join(" "));h("th, td",b.nTHead).removeClass([b.oClasses.sSortable,b.oClasses.sSortableAsc, 
     103b.oClasses.sSortableDesc,b.oClasses.sSortableNone].join(" "));b.bJUI&&(h("th span."+b.oClasses.sSortIcon+", td span."+b.oClasses.sSortIcon,b.nTHead).remove(),h("th, td",b.nTHead).each(function(){var a=h("div."+b.oClasses.sSortJUIWrapper,this),c=a.contents();h(this).append(c);a.remove()}));!a&&b.nTableReinsertBefore?c.insertBefore(b.nTable,b.nTableReinsertBefore):a||c.appendChild(b.nTable);i=0;for(f=b.aoData.length;i<f;i++)null!==b.aoData[i].nTr&&d.appendChild(b.aoData[i].nTr);!0===b.oFeatures.bAutoWidth&& 
     104(b.nTable.style.width=q(b.sDestroyWidth));if(f=b.asDestroyStripes.length){a=h(d).children("tr");for(i=0;i<f;i++)a.filter(":nth-child("+f+"n + "+i+")").addClass(b.asDestroyStripes[i])}i=0;for(f=j.settings.length;i<f;i++)j.settings[i]==b&&j.settings.splice(i,1);e=b=null};this.fnDraw=function(a){var b=s(this[j.ext.iApiIndex]);!1===a?(y(b),x(b)):aa(b)};this.fnFilter=function(a,b,c,d,e,f){var g=s(this[j.ext.iApiIndex]);if(g.oFeatures.bFilter){if(c===n||null===c)c=!1;if(d===n||null===d)d=!0;if(e===n||null=== 
     105e)e=!0;if(f===n||null===f)f=!0;if(b===n||null===b){if(K(g,{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f},1),e&&g.aanFeatures.f){b=g.aanFeatures.f;c=0;for(d=b.length;c<d;c++)try{b[c]._DT_Input!=l.activeElement&&h(b[c]._DT_Input).val(a)}catch(o){h(b[c]._DT_Input).val(a)}}}else h.extend(g.aoPreSearchCols[b],{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f}),K(g,g.oPreviousSearch,1)}};this.fnGetData=function(a,b){var c=s(this[j.ext.iApiIndex]);if(a!==n){var d=a;if("object"===typeof a){var e=a.nodeName.toLowerCase(); 
     106"tr"===e?d=I(c,a):"td"===e&&(d=I(c,a.parentNode),b=fa(c,d,a))}return b!==n?v(c,d,b,""):c.aoData[d]!==n?c.aoData[d]._aData:null}return Z(c)};this.fnGetNodes=function(a){var b=s(this[j.ext.iApiIndex]);return a!==n?b.aoData[a]!==n?b.aoData[a].nTr:null:T(b)};this.fnGetPosition=function(a){var b=s(this[j.ext.iApiIndex]),c=a.nodeName.toUpperCase();return"TR"==c?I(b,a):"TD"==c||"TH"==c?(c=I(b,a.parentNode),a=fa(b,c,a),[c,R(b,a),a]):null};this.fnIsOpen=function(a){for(var b=s(this[j.ext.iApiIndex]),c=0;c< 
     107b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return!0;return!1};this.fnOpen=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e=T(d);if(-1!==h.inArray(a,e)){this.fnClose(a);var e=l.createElement("tr"),f=l.createElement("td");e.appendChild(f);f.className=c;f.colSpan=t(d);"string"===typeof b?f.innerHTML=b:h(f).html(b);b=h("tr",d.nTBody);-1!=h.inArray(a,b)&&h(e).insertAfter(a);d.aoOpenRows.push({nTr:e,nParent:a});return e}};this.fnPageChange=function(a,b){var c=s(this[j.ext.iApiIndex]);qa(c,a); 
     108y(c);(b===n||b)&&x(c)};this.fnSetColumnVis=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e,f,g=d.aoColumns,h=d.aoData,o,m;if(g[a].bVisible!=b){if(b){for(e=f=0;e<a;e++)g[e].bVisible&&f++;m=f>=t(d);if(!m)for(e=a;e<g.length;e++)if(g[e].bVisible){o=e;break}e=0;for(f=h.length;e<f;e++)null!==h[e].nTr&&(m?h[e].nTr.appendChild(h[e]._anHidden[a]):h[e].nTr.insertBefore(h[e]._anHidden[a],J(d,e)[o]))}else{e=0;for(f=h.length;e<f;e++)null!==h[e].nTr&&(o=J(d,e)[a],h[e]._anHidden[a]=o,o.parentNode.removeChild(o))}g[a].bVisible= 
     109b;W(d,d.aoHeader);d.nTFoot&&W(d,d.aoFooter);e=0;for(f=d.aoOpenRows.length;e<f;e++)d.aoOpenRows[e].nTr.colSpan=t(d);if(c===n||c)k(d),x(d);ra(d)}};this.fnSettings=function(){return s(this[j.ext.iApiIndex])};this.fnSort=function(a){var b=s(this[j.ext.iApiIndex]);b.aaSorting=a;O(b)};this.fnSortListener=function(a,b,c){ia(s(this[j.ext.iApiIndex]),a,b,c)};this.fnUpdate=function(a,b,c,d,e){var f=s(this[j.ext.iApiIndex]),b="object"===typeof b?I(f,b):b;if(h.isArray(a)&&c===n){f.aoData[b]._aData=a.slice(); 
     110for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(v(f,b,c),b,c,!1,!1)}else if(h.isPlainObject(a)&&c===n){f.aoData[b]._aData=h.extend(!0,{},a);for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(v(f,b,c),b,c,!1,!1)}else{F(f,b,c,a);var a=v(f,b,c,"display"),g=f.aoColumns[c];null!==g.fnRender&&(a=S(f,b,c),g.bUseRendered&&F(f,b,c,a));null!==f.aoData[b].nTr&&(J(f,b)[c].innerHTML=a)}c=h.inArray(b,f.aiDisplay);f.asDataSearch[c]=na(f,Y(f,b,"filter",r(f,"bSearchable")));(e===n||e)&&k(f);(d===n||d)&&aa(f);return 0}; 
     111this.fnVersionCheck=j.ext.fnVersionCheck;this.oApi={_fnExternApiFunc:Va,_fnInitialise:ba,_fnInitComplete:$,_fnLanguageCompat:pa,_fnAddColumn:o,_fnColumnOptions:m,_fnAddData:H,_fnCreateTr:ea,_fnGatherData:ua,_fnBuildHead:va,_fnDrawHead:W,_fnDraw:x,_fnReDraw:aa,_fnAjaxUpdate:wa,_fnAjaxParameters:Ea,_fnAjaxUpdateDraw:Fa,_fnServerParams:ka,_fnAddOptionsHtml:xa,_fnFeatureHtmlTable:Ba,_fnScrollDraw:La,_fnAdjustColumnSizing:k,_fnFeatureHtmlFilter:za,_fnFilterComplete:K,_fnFilterCustom:Ia,_fnFilterColumn:Ha, 
     112_fnFilter:Ga,_fnBuildSearchArray:la,_fnBuildSearchRow:na,_fnFilterCreateSearch:ma,_fnDataToSearch:Ja,_fnSort:O,_fnSortAttachListener:ia,_fnSortingClasses:P,_fnFeatureHtmlPaginate:Da,_fnPageChange:qa,_fnFeatureHtmlInfo:Ca,_fnUpdateInfo:Ka,_fnFeatureHtmlLength:ya,_fnFeatureHtmlProcessing:Aa,_fnProcessingDisplay:E,_fnVisibleToColumnIndex:G,_fnColumnIndexToVisible:R,_fnNodeToDataIndex:I,_fnVisbleColumns:t,_fnCalculateEnd:y,_fnConvertToWidth:Ma,_fnCalculateColumnWidths:da,_fnScrollingWidthAdjust:Oa,_fnGetWidestNode:Na, 
     113_fnGetMaxLenString:Pa,_fnStringToCss:q,_fnDetectType:B,_fnSettingsFromNode:s,_fnGetDataMaster:Z,_fnGetTrNodes:T,_fnGetTdNodes:J,_fnEscapeRegex:oa,_fnDeleteIndex:ha,_fnReOrderIndex:u,_fnColumnOrdering:M,_fnLog:D,_fnClearTable:ga,_fnSaveState:ra,_fnLoadState:Sa,_fnCreateCookie:function(a,b,c,d,e){var f=new Date;f.setTime(f.getTime()+1E3*c);var c=X.location.pathname.split("/"),a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase(),g;null!==e?(g="function"===typeof h.parseJSON?h.parseJSON(b):eval("("+b+")"), 
     114b=e(a,g,f.toGMTString(),c.join("/")+"/")):b=a+"="+encodeURIComponent(b)+"; expires="+f.toGMTString()+"; path="+c.join("/")+"/";a=l.cookie.split(";");e=b.split(";")[0].length;f=[];if(4096<e+l.cookie.length+10){for(var j=0,o=a.length;j<o;j++)if(-1!=a[j].indexOf(d)){var k=a[j].split("=");try{(g=eval("("+decodeURIComponent(k[1])+")"))&&g.iCreate&&f.push({name:k[0],time:g.iCreate})}catch(m){}}for(f.sort(function(a,b){return b.time-a.time});4096<e+l.cookie.length+10;){if(0===f.length)return;d=f.pop();l.cookie= 
     115d.name+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+"/"}}l.cookie=b},_fnReadCookie:function(a){for(var b=X.location.pathname.split("/"),a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=",b=l.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return decodeURIComponent(d.substring(a.length,d.length))}return null},_fnDetectHeader:V,_fnGetUniqueThs:N,_fnScrollBarWidth:Qa,_fnApplyToChildren:C,_fnMap:p,_fnGetRowData:Y, 
     116_fnGetCellData:v,_fnSetCellData:F,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:L,_fnApplyColumnDefs:ta,_fnBindAction:Ra,_fnExtend:Ta,_fnCallbackReg:z,_fnCallbackFire:A,_fnJsonString:Wa,_fnRender:S,_fnNodeToColumnIndex:fa,_fnInfoMacros:ja,_fnBrowserDetect:Ua,_fnGetColumns:r};h.extend(j.ext.oApi,this.oApi);for(var sa in j.ext.oApi)sa&&(this[sa]=Va(sa));var ca=this;this.each(function(){var a=0,b,c,d;c=this.getAttribute("id");var i=!1,f=!1;if("table"!=this.nodeName.toLowerCase())D(null,0,"Attempted to initialise DataTables on a node which is not a table: "+ 
     117this.nodeName);else{a=0;for(b=j.settings.length;a<b;a++){if(j.settings[a].nTable==this){if(e===n||e.bRetrieve)return j.settings[a].oInstance;if(e.bDestroy){j.settings[a].oInstance.fnDestroy();break}else{D(j.settings[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");return}}if(j.settings[a].sTableId==this.id){j.settings.splice(a,1);break}}if(null===c||""===c)this.id=c="DataTables_Table_"+j.ext._oExternConfig.iNextUnique++; 
     118var g=h.extend(!0,{},j.models.oSettings,{nTable:this,oApi:ca.oApi,oInit:e,sDestroyWidth:h(this).width(),sInstance:c,sTableId:c});j.settings.push(g);g.oInstance=1===ca.length?ca:h(this).dataTable();e||(e={});e.oLanguage&&pa(e.oLanguage);e=Ta(h.extend(!0,{},j.defaults),e);p(g.oFeatures,e,"bPaginate");p(g.oFeatures,e,"bLengthChange");p(g.oFeatures,e,"bFilter");p(g.oFeatures,e,"bSort");p(g.oFeatures,e,"bInfo");p(g.oFeatures,e,"bProcessing");p(g.oFeatures,e,"bAutoWidth");p(g.oFeatures,e,"bSortClasses"); 
     119p(g.oFeatures,e,"bServerSide");p(g.oFeatures,e,"bDeferRender");p(g.oScroll,e,"sScrollX","sX");p(g.oScroll,e,"sScrollXInner","sXInner");p(g.oScroll,e,"sScrollY","sY");p(g.oScroll,e,"bScrollCollapse","bCollapse");p(g.oScroll,e,"bScrollInfinite","bInfinite");p(g.oScroll,e,"iScrollLoadGap","iLoadGap");p(g.oScroll,e,"bScrollAutoCss","bAutoCss");p(g,e,"asStripeClasses");p(g,e,"asStripClasses","asStripeClasses");p(g,e,"fnServerData");p(g,e,"fnFormatNumber");p(g,e,"sServerMethod");p(g,e,"aaSorting");p(g, 
     120e,"aaSortingFixed");p(g,e,"aLengthMenu");p(g,e,"sPaginationType");p(g,e,"sAjaxSource");p(g,e,"sAjaxDataProp");p(g,e,"iCookieDuration");p(g,e,"sCookiePrefix");p(g,e,"sDom");p(g,e,"bSortCellsTop");p(g,e,"iTabIndex");p(g,e,"oSearch","oPreviousSearch");p(g,e,"aoSearchCols","aoPreSearchCols");p(g,e,"iDisplayLength","_iDisplayLength");p(g,e,"bJQueryUI","bJUI");p(g,e,"fnCookieCallback");p(g,e,"fnStateLoad");p(g,e,"fnStateSave");p(g.oLanguage,e,"fnInfoCallback");z(g,"aoDrawCallback",e.fnDrawCallback,"user"); 
     121z(g,"aoServerParams",e.fnServerParams,"user");z(g,"aoStateSaveParams",e.fnStateSaveParams,"user");z(g,"aoStateLoadParams",e.fnStateLoadParams,"user");z(g,"aoStateLoaded",e.fnStateLoaded,"user");z(g,"aoRowCallback",e.fnRowCallback,"user");z(g,"aoRowCreatedCallback",e.fnCreatedRow,"user");z(g,"aoHeaderCallback",e.fnHeaderCallback,"user");z(g,"aoFooterCallback",e.fnFooterCallback,"user");z(g,"aoInitComplete",e.fnInitComplete,"user");z(g,"aoPreDrawCallback",e.fnPreDrawCallback,"user");g.oFeatures.bServerSide&& 
     122g.oFeatures.bSort&&g.oFeatures.bSortClasses?z(g,"aoDrawCallback",P,"server_side_sort_classes"):g.oFeatures.bDeferRender&&z(g,"aoDrawCallback",P,"defer_sort_classes");e.bJQueryUI?(h.extend(g.oClasses,j.ext.oJUIClasses),e.sDom===j.defaults.sDom&&"lfrtip"===j.defaults.sDom&&(g.sDom='<"H"lfr>t<"F"ip>')):h.extend(g.oClasses,j.ext.oStdClasses);h(this).addClass(g.oClasses.sTable);if(""!==g.oScroll.sX||""!==g.oScroll.sY)g.oScroll.iBarWidth=Qa();g.iInitDisplayStart===n&&(g.iInitDisplayStart=e.iDisplayStart, 
     123g._iDisplayStart=e.iDisplayStart);e.bStateSave&&(g.oFeatures.bStateSave=!0,Sa(g,e),z(g,"aoDrawCallback",ra,"state_save"));null!==e.iDeferLoading&&(g.bDeferLoading=!0,a=h.isArray(e.iDeferLoading),g._iRecordsDisplay=a?e.iDeferLoading[0]:e.iDeferLoading,g._iRecordsTotal=a?e.iDeferLoading[1]:e.iDeferLoading);null!==e.aaData&&(f=!0);""!==e.oLanguage.sUrl?(g.oLanguage.sUrl=e.oLanguage.sUrl,h.getJSON(g.oLanguage.sUrl,null,function(a){pa(a);h.extend(true,g.oLanguage,e.oLanguage,a);ba(g)}),i=!0):h.extend(!0, 
     124g.oLanguage,e.oLanguage);null===e.asStripeClasses&&(g.asStripeClasses=[g.oClasses.sStripeOdd,g.oClasses.sStripeEven]);b=g.asStripeClasses.length;g.asDestroyStripes=[];if(b){c=!1;d=h(this).children("tbody").children("tr:lt("+b+")");for(a=0;a<b;a++)d.hasClass(g.asStripeClasses[a])&&(c=!0,g.asDestroyStripes.push(g.asStripeClasses[a]));c&&d.removeClass(g.asStripeClasses.join(" "))}c=[];a=this.getElementsByTagName("thead");0!==a.length&&(V(g.aoHeader,a[0]),c=N(g));if(null===e.aoColumns){d=[];a=0;for(b= 
     125c.length;a<b;a++)d.push(null)}else d=e.aoColumns;a=0;for(b=d.length;a<b;a++)e.saved_aoColumns!==n&&e.saved_aoColumns.length==b&&(null===d[a]&&(d[a]={}),d[a].bVisible=e.saved_aoColumns[a].bVisible),o(g,c?c[a]:null);ta(g,e.aoColumnDefs,d,function(a,b){m(g,a,b)});a=0;for(b=g.aaSorting.length;a<b;a++){g.aaSorting[a][0]>=g.aoColumns.length&&(g.aaSorting[a][0]=0);var k=g.aoColumns[g.aaSorting[a][0]];g.aaSorting[a][2]===n&&(g.aaSorting[a][2]=0);e.aaSorting===n&&g.saved_aaSorting===n&&(g.aaSorting[a][1]= 
     126k.asSorting[0]);c=0;for(d=k.asSorting.length;c<d;c++)if(g.aaSorting[a][1]==k.asSorting[c]){g.aaSorting[a][2]=c;break}}P(g);Ua(g);a=h(this).children("caption").each(function(){this._captionSide=h(this).css("caption-side")});b=h(this).children("thead");0===b.length&&(b=[l.createElement("thead")],this.appendChild(b[0]));g.nTHead=b[0];b=h(this).children("tbody");0===b.length&&(b=[l.createElement("tbody")],this.appendChild(b[0]));g.nTBody=b[0];g.nTBody.setAttribute("role","alert");g.nTBody.setAttribute("aria-live", 
     127"polite");g.nTBody.setAttribute("aria-relevant","all");b=h(this).children("tfoot");if(0===b.length&&0<a.length&&(""!==g.oScroll.sX||""!==g.oScroll.sY))b=[l.createElement("tfoot")],this.appendChild(b[0]);0<b.length&&(g.nTFoot=b[0],V(g.aoFooter,g.nTFoot));if(f)for(a=0;a<e.aaData.length;a++)H(g,e.aaData[a]);else ua(g);g.aiDisplay=g.aiDisplayMaster.slice();g.bInitialised=!0;!1===i&&ba(g)}});ca=null;return this};j.fnVersionCheck=function(e){for(var h=function(e,h){for(;e.length<h;)e+="0";return e},m=j.ext.sVersion.split("."), 
     128e=e.split("."),k="",n="",l=0,t=e.length;l<t;l++)k+=h(m[l],3),n+=h(e[l],3);return parseInt(k,10)>=parseInt(n,10)};j.fnIsDataTable=function(e){for(var h=j.settings,m=0;m<h.length;m++)if(h[m].nTable===e||h[m].nScrollHead===e||h[m].nScrollFoot===e)return!0;return!1};j.fnTables=function(e){var o=[];jQuery.each(j.settings,function(j,k){(!e||!0===e&&h(k.nTable).is(":visible"))&&o.push(k.nTable)});return o};j.version="1.9.4";j.settings=[];j.models={};j.models.ext={afnFiltering:[],afnSortData:[],aoFeatures:[], 
     129aTypes:[],fnVersionCheck:j.fnVersionCheck,iApiIndex:0,ofnSearch:{},oApi:{},oStdClasses:{},oJUIClasses:{},oPagination:{},oSort:{},sVersion:j.version,sErrMode:"alert",_oExternConfig:{iNextUnique:0}};j.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};j.models.oRow={nTr:null,_aData:[],_aSortData:[],_anHidden:[],_sRowStripe:""};j.models.oColumn={aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bUseRendered:null,bVisible:null,_bAutoType:!0,fnCreatedCell:null,fnGetData:null, 
     130fnRender:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};j.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0, 
     131bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollAutoCss:!0,bScrollCollapse:!1,bScrollInfinite:!1,bServerSide:!1,bSort:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCookieCallback:null,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){if(1E3>e)return e;for(var h=e+"",e=h.split(""),j="",h=h.length,k=0;k<h;k++)0===k%3&&0!==k&&(j=this.oLanguage.sInfoThousands+j),j=e[h-k-1]+j;return j},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null, 
     132fnRowCallback:null,fnServerData:function(e,j,m,k){k.jqXHR=h.ajax({url:e,data:j,success:function(e){e.sError&&k.oApi._fnLog(k,0,e.sError);h(k.oInstance).trigger("xhr",[k,e]);m(e)},dataType:"json",cache:!1,type:k.sServerMethod,error:function(e,h){"parsererror"==h&&k.oApi._fnLog(k,0,"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})},fnServerParams:null,fnStateLoad:function(e){var e=this.oApi._fnReadCookie(e.sCookiePrefix+e.sInstance),j;try{j= 
     133"function"===typeof h.parseJSON?h.parseJSON(e):eval("("+e+")")}catch(m){j=null}return j},fnStateLoadParams:null,fnStateLoaded:null,fnStateSave:function(e,h){this.oApi._fnCreateCookie(e.sCookiePrefix+e.sInstance,this.oApi._fnJsonString(h),e.iCookieDuration,e.sCookiePrefix,e.fnCookieCallback)},fnStateSaveParams:null,iCookieDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iScrollLoadGap:100,iTabIndex:0,oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"}, 
     134oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},j.models.oSearch),sAjaxDataProp:"aaData", 
     135sAjaxSource:null,sCookiePrefix:"SpryMedia_DataTables_",sDom:"lfrtip",sPaginationType:"two_button",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET"};j.defaults.columns={aDataSort:null,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bUseRendered:!0,bVisible:!0,fnCreatedCell:null,fnRender:null,iDataSort:-1,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};j.models.oSettings={oFeatures:{bAutoWidth:null, 
     136bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortClasses:null,bStateSave:null},oScroll:{bAutoCss:null,bCollapse:null,bInfinite:null,iBarWidth:0,iLoadGap:null,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1},aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],asDataSearch:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:null, 
     137asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iCookieDuration:0,sCookiePrefix:"",fnCookieCallback:null,aoStateSave:[],aoStateLoad:[], 
     138oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iDisplayEnd:10,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length}, 
     139fnRecordsDisplay:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length},fnDisplayEnd:function(){return this.oFeatures.bServerSide?!1===this.oFeatures.bPaginate||-1==this._iDisplayLength?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null};j.ext=h.extend(!0,{},j.models.ext);h.extend(j.ext.oStdClasses, 
     140{sTable:"dataTable",sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty", 
     141sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"", 
     142sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"",sJUIHeader:"",sJUIFooter:""});h.extend(j.ext.oJUIClasses,j.ext.oStdClasses,{sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right", 
     143sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl",sPageLast:"last ui-corner-tr ui-corner-br",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_", 
     144sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon", 
     145sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",sFooterTH:"ui-state-default",sJUIHeader:"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",sJUIFooter:"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"});h.extend(j.ext.oPagination,{two_button:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,n=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)},k=!e.bJUI?'<a class="'+ 
     146e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sPrevious+'</a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sNext+"</a>":'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUIPrev+'"></span></a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUINext+'"></span></a>';h(j).append(k);var l=h("a",j), 
     147k=l[0],l=l[1];e.oApi._fnBindAction(k,{action:"previous"},n);e.oApi._fnBindAction(l,{action:"next"},n);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_previous",l.id=e.sTableId+"_next",k.setAttribute("aria-controls",e.sTableId),l.setAttribute("aria-controls",e.sTableId))},fnUpdate:function(e){if(e.aanFeatures.p)for(var h=e.oClasses,j=e.aanFeatures.p,k,l=0,n=j.length;l<n;l++)if(k=j[l].firstChild)k.className=0===e._iDisplayStart?h.sPagePrevDisabled:h.sPagePrevEnabled,k=k.nextSibling, 
     148k.className=e.fnDisplayEnd()==e.fnRecordsDisplay()?h.sPageNextDisabled:h.sPageNextEnabled}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,l=e.oClasses,n=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)};h(j).append('<a  tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageFirst+'">'+k.sFirst+'</a><a  tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPagePrevious+'">'+k.sPrevious+'</a><span></span><a tabindex="'+e.iTabIndex+'" class="'+ 
     149l.sPageButton+" "+l.sPageNext+'">'+k.sNext+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageLast+'">'+k.sLast+"</a>");var t=h("a",j),k=t[0],l=t[1],r=t[2],t=t[3];e.oApi._fnBindAction(k,{action:"first"},n);e.oApi._fnBindAction(l,{action:"previous"},n);e.oApi._fnBindAction(r,{action:"next"},n);e.oApi._fnBindAction(t,{action:"last"},n);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_first",l.id=e.sTableId+"_previous",r.id=e.sTableId+"_next",t.id=e.sTableId+"_last")}, 
     150fnUpdate:function(e,o){if(e.aanFeatures.p){var m=j.ext.oPagination.iFullNumbersShowPages,k=Math.floor(m/2),l=Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength),n=Math.ceil(e._iDisplayStart/e._iDisplayLength)+1,t="",r,B=e.oClasses,u,M=e.aanFeatures.p,L=function(h){e.oApi._fnBindAction(this,{page:h+r-1},function(h){e.oApi._fnPageChange(e,h.data.page);o(e);h.preventDefault()})};-1===e._iDisplayLength?n=k=r=1:l<m?(r=1,k=l):n<=k?(r=1,k=m):n>=l-k?(r=l-m+1,k=l):(r=n-Math.ceil(m/2)+1,k=r+m-1);for(m=r;m<=k;m++)t+= 
     151n!==m?'<a tabindex="'+e.iTabIndex+'" class="'+B.sPageButton+'">'+e.fnFormatNumber(m)+"</a>":'<a tabindex="'+e.iTabIndex+'" class="'+B.sPageButtonActive+'">'+e.fnFormatNumber(m)+"</a>";m=0;for(k=M.length;m<k;m++)u=M[m],u.hasChildNodes()&&(h("span:eq(0)",u).html(t).children("a").each(L),u=u.getElementsByTagName("a"),u=[u[0],u[1],u[u.length-2],u[u.length-1]],h(u).removeClass(B.sPageButton+" "+B.sPageButtonActive+" "+B.sPageButtonStaticDisabled),h([u[0],u[1]]).addClass(1==n?B.sPageButtonStaticDisabled: 
     152B.sPageButton),h([u[2],u[3]]).addClass(0===l||n===l||-1===e._iDisplayLength?B.sPageButtonStaticDisabled:B.sPageButton))}}}});h.extend(j.ext.oSort,{"string-pre":function(e){"string"!=typeof e&&(e=null!==e&&e.toString?e.toString():"");return e.toLowerCase()},"string-asc":function(e,h){return e<h?-1:e>h?1:0},"string-desc":function(e,h){return e<h?1:e>h?-1:0},"html-pre":function(e){return e.replace(/<.*?>/g,"").toLowerCase()},"html-asc":function(e,h){return e<h?-1:e>h?1:0},"html-desc":function(e,h){return e< 
     153h?1:e>h?-1:0},"date-pre":function(e){e=Date.parse(e);if(isNaN(e)||""===e)e=Date.parse("01/01/1970 00:00:00");return e},"date-asc":function(e,h){return e-h},"date-desc":function(e,h){return h-e},"numeric-pre":function(e){return"-"==e||""===e?0:1*e},"numeric-asc":function(e,h){return e-h},"numeric-desc":function(e,h){return h-e}});h.extend(j.ext.aTypes,[function(e){if("number"===typeof e)return"numeric";if("string"!==typeof e)return null;var h,j=!1;h=e.charAt(0);if(-1=="0123456789-".indexOf(h))return null; 
     154for(var k=1;k<e.length;k++){h=e.charAt(k);if(-1=="0123456789.".indexOf(h))return null;if("."==h){if(j)return null;j=!0}}return"numeric"},function(e){var h=Date.parse(e);return null!==h&&!isNaN(h)||"string"===typeof e&&0===e.length?"date":null},function(e){return"string"===typeof e&&-1!=e.indexOf("<")&&-1!=e.indexOf(">")?"html":null}]);h.fn.DataTable=j;h.fn.dataTable=j;h.fn.dataTableSettings=j.settings;h.fn.dataTableExt=j.ext};"function"===typeof define&&define.amd?define(["jquery"],L):jQuery&&!jQuery.fn.dataTable&& 
     155L(jQuery)})(window,document); 
  • tablepress/trunk/libraries/csv-parser.class.php

    r589540 r607623  
    3030    // preferred delimiter characters, only used when all filtering method 
    3131    // returns multiple possible delimiters (happens very rarely) 
    32     protected $preferred_delimiter_chars = ";,\t:.|"; 
     32    protected $preferred_delimiter_chars = ";,\t"; 
    3333    // data to import 
    3434    protected $import_data; 
     
    8686        $data_length = strlen( $data ); 
    8787        for ( $i = 0; $i < $data_length; $i++ ) { 
     88            $prev_char = ( $i-1 >= 0 ) ? $data[$i-1] : ''; 
    8889            $curr_char = $data[$i]; 
    89             $next_char = ( isset( $data[$i+1] ) ) ? $data[$i+1] : false; // @TODO: Maybe use simpler boundaray checks, like 0 == $i and $data_length-1 == $i 
    90             $prev_char = ( isset( $data[$i-1] ) ) ? $data[$i-1] : false; 
     90            $next_char = ( $i+1 < $data_length ) ? $data[$i+1] : ''; 
    9191 
    9292            if ( $curr_char == $this->enclosure ) { 
     
    190190        for ( $i = 0; $i < $data_length; $i++ ) { 
    191191            $curr_char = $data[$i]; 
    192             $next_char = ( isset( $data[$i+1] ) ) ? $data[$i+1] : false; // @TODO: Maybe use simpler boundaray checks, like 0 == $i and $data_length-1 == $i 
    193             $prev_char = ( isset( $data[$i-1] ) ) ? $data[$i-1] : false; 
     192            $next_char = ( $i+1 < $data_length ) ? $data[$i+1] : ''; 
    194193 
    195194            if ( $curr_char == $this->enclosure ) { 
  • tablepress/trunk/models/model-options.php

    r598765 r607623  
    5353    protected $default_user_options = array( 
    5454        'user_options_db_version' => TablePress::db_version, // to prevent saving on first load 
    55         'admin_menu_parent_page' => 'bottom', 
     55        'admin_menu_parent_page' => 'middle', 
    5656        'plugin_language' => 'auto', 
    5757        'message_first_visit' => true 
     
    250250    public function save_custom_css_to_file() { 
    251251        // Set current screen to get Screen Icon to have a custom HTML ID, so that we can hide it with CSS 
    252         set_current_screen( "tablepress_options_invisible" ); 
     252        set_current_screen( 'tablepress_options_invisible' ); 
    253253 
    254254        // Start capturing the output, to get HTML of the credentials form (if needed) 
     
    261261            $form_data = ob_get_contents(); 
    262262            ob_end_clean(); 
    263             $form_data = str_replace( 'name="upgrade" id="upgrade" class="button"', 'name="upgrade" id="upgrade" class="button button-primary"', $form_data ); 
     263            $form_data = str_replace( 'name="upgrade" id="upgrade" class="button"', 'name="upgrade" id="upgrade" class="button button-primary button-large"', $form_data ); 
    264264            return $form_data; 
    265265        } 
     
    271271            $form_data = ob_get_contents(); 
    272272            ob_end_clean(); 
    273             $form_data = str_replace( 'name="upgrade" id="upgrade" class="button"', 'name="upgrade" id="upgrade" class="button button-primary"', $form_data ); 
     273            $form_data = str_replace( 'name="upgrade" id="upgrade" class="button"', 'name="upgrade" id="upgrade" class="button button-primary button-large"', $form_data ); 
    274274            return $form_data; 
    275275        } 
  • tablepress/trunk/models/model-table.php

    r598765 r607623  
    487487                'alternating_row_colors' => true, 
    488488                'row_hover' => true, 
    489                 'print_name' => 'no', 
    490                 'print_description' => 'no', 
     489                'print_name' => false, 
     490                'print_name_position' => 'above', 
     491                'print_description' => false, 
     492                'print_description_position' => 'below', 
    491493                'extra_css_classes' => '', 
    492494                // DataTables JavaScript library 
     
    743745    } 
    744746 
     747    /** 
     748     * Merge changes made for TablePress 0.6-beta: 
     749     * Table Name/Table Description 
     750     * @TODO: Remove in 1.0 
     751     * 
     752     * @since 1.0.0 
     753     */ 
     754    public function merge_table_options_tp06() { 
     755        $table_post = $this->tables->get( 'table_post' ); 
     756        if ( empty( $table_post ) ) 
     757            return; 
     758 
     759        $post_ids = array_values( $table_post ); 
     760 
     761        // go through all tables (this loop now uses the WP cache) 
     762        foreach ( $post_ids as $post_id ) { 
     763            $table_options = $this->_get_table_options( $post_id ); 
     764 
     765            // Move "Print Name" to new format 
     766            $print_name = in_array( $table_options['print_name'], array( 'above', 'below' ) ); 
     767            if ( $print_name ) 
     768                $table_options['print_name_position'] = $table_options['print_name']; 
     769            $table_options['print_name'] = $print_name; 
     770            // Move "Print Description" to new format 
     771            $print_description = in_array( $table_options['print_description'], array( 'above', 'below' ) ); 
     772            if ( $print_description ) 
     773                $table_options['print_description_position'] = $table_options['print_description']; 
     774            $table_options['print_description'] = $print_description; 
     775 
     776            $this->_update_table_options( $post_id, $table_options ); 
     777        } 
     778    } 
     779 
    745780} // class TablePress_Table_Model 
  • tablepress/trunk/readme.txt

    r600237 r607623  
    1313 
    1414= ATTENTION: = 
    15 **TablePress is absolute ALPHA software right now. Use at your own risk. No support will be provided yet! During this alpha stage, all settings, options, and functionality may change without notice, and without maintaining backwards compatibility!** 
     15**TablePress is in beta stage now. It is already usable and quite stable, but regular backups are recommended!** 
    1616 
    1717TablePress enables you to create and manage tables on your WordPress site. No HTML knowledge is needed, as a comfortable interface allows to easily edit table data. Tables can contain any type of data, even formulas that will be evaluated. An additional JavaScript library can be used to add features like sorting, pagination, filtering, and more for site visitors. You can include the tables into your posts, on your pages, or in text widgets with ease. Tables can be imported and exported from/to CSV files (e.g. from Excel), HTML files, and JSON. 
     
    2424 
    2525= Migration from WP-Table Reloaded = 
    26 TablePress is the official successor of the WP-Table Reloaded plugin. It has been written from the ground up and by using an entirely new internal structure fixes some major flaws of WP-Table Reloaded and prepares the plugin for easier, safer, and better future development. 
     26TablePress is the official successor of the WP-Table Reloaded plugin. It has been rewritten from the ground up and uses an entirely new internal structure. This fixes some major flaws of WP-Table Reloaded and prepares the plugin for easier, safer, and better future development. 
    2727If you are currently using WP-Table Reloaded, it is recommended that you switch to TablePress. WP-Table Reloaded will no longer be maintained or developed. For further information on how to switch from WP-Table Reloaded to TablePress, please see the [migration guide](http://tablepress.org/migration-from-wp-table-reloaded/) on the plugin website. 
    2828 
     
    9393== Acknowledgements == 
    9494 
    95 Special thanks go to [Allan Jardine](http://www.datatables.net/) for the DataTables jQuery plugin. 
     95Special thanks go to [Allan Jardine](http://www.sprymedia.co.uk/) for the [DataTables JavaScript library](http://www.datatables.net/). 
    9696Thanks to all language file translators! 
    9797Thanks to every donor, supporter and bug reporter! 
  • tablepress/trunk/tablepress.php

    r598765 r607623  
    1212Plugin URI: http://tablepress.org/ 
    1313Description: TablePress enables you to create and manage tables in your posts and pages, without having to write HTML code, and it adds valuable functions for your visitors. 
    14 Version: 0.5-alpha 
     14Version: 0.6-beta 
    1515Author: Tobias Bäthge 
    1616Author URI: http://tobias.baethge.com/ 
  • tablepress/trunk/views/view-about.php

    r598765 r607623  
    4444        $this->add_meta_box( 'usage', __( 'Usage', 'tablepress' ), array( &$this, 'postbox_usage' ), 'normal' ); 
    4545        $this->add_meta_box( 'more-information', __( 'More Information and Documentation', 'tablepress' ), array( &$this, 'postbox_more_information' ), 'normal' ); 
     46        $this->add_meta_box( 'help-support', __( 'Help and Support', 'tablepress' ), array( &$this, 'postbox_help_support' ), 'normal' ); 
    4647        $this->add_meta_box( 'author-license', __( 'Author and License', 'tablepress' ), array( &$this, 'postbox_author_license' ), 'side' ); 
    47         $this->add_meta_box( 'help-support', __( 'Help and Support', 'tablepress' ), array( &$this, 'postbox_help_support' ), 'side' ); 
     48        $this->add_meta_box( 'credits-thanks', __( 'Credits and Thanks', 'tablepress' ), array( &$this, 'postbox_credits_thanks' ), 'side' ); 
    4849        $this->add_meta_box( 'debug-version-information', __( 'Debug and Version Information', 'tablepress' ), array( &$this, 'postbox_debug_version_information' ), 'side' ); 
    49         $this->add_meta_box( 'credits-thanks', __( 'Credits and Thanks', 'tablepress' ), array( &$this, 'postbox_credits_thanks' ), 'side' ); 
    50     } 
    51  
    52     /** 
    53      * 
     50    } 
     51 
     52    /** 
     53     * Print the content of the "Plugin Purpose" post meta box 
    5454     * 
    5555     * @since 1.0.0 
     
    5757    public function postbox_plugin_purpose( $data, $box ) { 
    5858        ?> 
    59         <p><?php _e( 'TablePress allows you to create and manage tables in the admin-area of WordPress.', 'tablepress' ); ?> <?php _e( 'Those tables may contain strings, numbers and even HTML (e.g. to include images or links).', 'tablepress' ); ?> <?php _e( 'You can then show the tables in your posts, on your pages or in text-widgets by using a shortcode.', 'tablepress' ); ?> <?php _e( 'If you want to show your tables anywhere else in your theme, you can use a template tag function.', 'tablepress' ); ?></p> 
    60         <?php 
    61     } 
    62  
    63     /** 
    64      * 
     59    <p> 
     60        <?php _e( 'TablePress allows you to create and manage tables in the admin area of WordPress.', 'tablepress' ); ?> 
     61        <?php _e( 'Tables may contain text, numbers and even HTML (e.g. to include images or links).', 'tablepress' ); ?> 
     62        <?php _e( 'You can then show the tables in your posts, on your pages, or in text widgets by using a Shortcode.', 'tablepress' ); ?> 
     63        <?php _e( 'If you want to show your tables anywhere else in your theme, you can use a Template Tag function.', 'tablepress' ); ?> 
     64    </p> 
     65        <?php 
     66    } 
     67 
     68    /** 
     69     * Print the content of the "Usage" post meta box 
    6570     * 
    6671     * @since 1.0.0 
     
    6873    public function postbox_usage( $data, $box ) { 
    6974        ?> 
    70         <p><?php _e( 'At first you should add or import a table.', 'tablepress' ); ?> <?php _e( 'This means that you either let the plugin create an empty table for you or that you load an existing table from either a CSV, HTML, or JSON file.', 'tablepress' ); ?></p> 
    71         <p><?php _e( 'Then you can edit your data or change the structure of your table (e.g. by inserting or deleting rows or columns, swaping rows or columns or sorting them) and select specific table options like alternating row colors or whether to print the name or description, if you want.', 'tablepress' ); ?> <?php _e( 'To easily add a link or an image to a cell, use the provided buttons. Those will ask you for the URL and a title. Then you can click into a cell and the corresponding HTML will be added to it for you.', 'tablepress' ); ?></p> 
    72         <p><?php printf( __( 'To insert the table into a page, post or text-widget, copy the shortcode %s and paste it into the corresponding place in the editor.', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=&lt;ID&gt; /]" readonly="readonly" />' ); ?> <?php printf( __( 'You can also select the desired table from a list (after clicking the button &quot;%s&quot; in the editor toolbar) and the corresponding Shortcode will be added for you.', 'tablepress' ), __( 'Table', 'tablepress' ) ); ?></p> 
    73         <p><?php _e( 'Tables can be styled by changing and adding CSS commands.', 'tablepress' ); ?> <?php _e( 'The plugin ships with default CSS Stylesheets, which can be customized with own code or replaced with other Stylesheets.', 'tablepress' ); ?> <?php _e( 'For this, each table is given certain CSS classes that can be used as CSS selectors.', 'tablepress' ); ?> <?php printf ( __( 'Please see the <a href="%s">documentation</a> for a list of these selectors and for styling examples.', 'tablepress' ), 'http://tablepress.org/documentation/' ); ?></p> 
    74         <?php 
    75     } 
    76  
    77     /** 
    78      * 
     75    <p> 
     76        <?php _e( 'At first you should add or import a table.', 'tablepress' ); ?> 
     77        <?php _e( 'This means that you either let the plugin create an empty table for you or that you load an existing table from either a CSV, HTML, or JSON file.', 'tablepress' ); ?> 
     78    </p> 
     79    <p> 
     80        <?php _e( 'Then you can edit your data or change the structure of your table (e.g. by inserting, deleting, moving, or swaping rows or columns or sorting them) and select specific table features like alternating row colors or whether to print the name or description, if you want.', 'tablepress' ); ?> 
     81        <?php _e( 'To easily add a link or an image to a cell, use the provided buttons.', 'tablepress' ); ?> 
     82        <?php _e( 'Those will ask you for the necessary information and and corresponding HTML code will be added to the cell automatically.', 'tablepress' ); ?> 
     83    </p> 
     84    <p> 
     85        <?php printf( __( 'To insert a table into a page, post, or text widget, copy its Shortcode %s and paste it at the desired place in the editor.', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=&lt;ID&gt; /]" readonly="readonly" />' ); ?> 
     86        <?php printf( __( 'You can also click the &quot;%s&quot; button in the editor toolbar to select and insert a table.', 'tablepress' ), __( 'Table', 'tablepress' ) ); ?> 
     87    </p> 
     88    <p> 
     89        <?php _e( 'Tables can be styled by changing and adding CSS commands.', 'tablepress' ); ?> 
     90        <?php _e( 'The plugin ships with default CSS stylesheets, which can be customized with own code or replaced with other stylesheets.', 'tablepress' ); ?> 
     91        <?php _e( 'For this, each table is given certain CSS classes that can be used as CSS selectors.', 'tablepress' ); ?> 
     92        <?php printf ( __( 'Please see the <a href="%s">documentation</a> for a list of these selectors and for styling examples.', 'tablepress' ), 'http://tablepress.org/documentation/' ); ?> 
     93    </p> 
     94        <?php 
     95    } 
     96 
     97    /** 
     98     * Print the content of the "More Information and Documentation" post meta box 
    7999     * 
    80100     * @since 1.0.0 
     
    82102    public function postbox_more_information( $data, $box ) { 
    83103        ?> 
    84         <p><?php printf( __( 'More information about TablePress can be found on the <a href="%s">plugin\'s website</a> or on its page in the <a href="%s">WordPress Plugin Directory</a>.', 'tablepress' ), 'http://tablepress.org/website/', 'http://wordpress.org/extend/plugins/tablepress/' ); ?> <?php printf( __( 'For technical information, see the <a href="%s">documentation</a>.', 'tablepress' ), 'http://tablepress.org/documentation/' ); ?></p> 
    85         <?php 
    86     } 
    87  
    88     /** 
    89      * 
     104    <p> 
     105        <?php printf( __( 'More information about TablePress can be found on the <a href="%s">plugin\'s website</a> or on its page in the <a href="%s">WordPress Plugin Directory</a>.', 'tablepress' ), 'http://tablepress.org/', 'http://wordpress.org/extend/plugins/tablepress/' ); ?> 
     106        <?php printf( __( 'For technical information, please see the <a href="%s">documentation</a>.', 'tablepress' ), 'http://tablepress.org/documentation/' ); ?> 
     107    </p> 
     108        <?php 
     109    } 
     110 
     111    /** 
     112     * Print the content of the "Author and License" post meta box 
    90113     * 
    91114     * @since 1.0.0 
     
    93116    public function postbox_author_license( $data, $box ) { 
    94117        ?> 
    95         <p><?php printf( __( 'This plugin was written by <a href="%s">Tobias Bäthge</a>.', 'tablepress' ), 'http://tobias.baethge.com/' ); ?> <?php _e( 'It is licensed as Free Software under GPL 2.', 'tablepress' ); ?><br /><?php printf( __( 'If you like the plugin, <a href="%s"><strong>a donation</strong></a> is recommended.', 'tablepress' ), 'http://tablepress.org/donate/' ); ?> <?php printf( __( 'Please rate the plugin in the <a href="%s">WordPress Plugin Directory</a>.', 'tablepress' ), 'http://wordpress.org/extend/plugins/tablepress/' ); ?><br /><?php _e( 'Donations and good ratings encourage me to further develop the plugin and to provide countless hours of support. Any amount is appreciated! Thanks!', 'tablepress' ); ?></p> 
    96         <?php 
    97     } 
    98  
    99     /** 
    100      * 
     118    <p> 
     119        <?php printf( __( 'This plugin was written and developed by <a href="%s">Tobias Bäthge</a>.', 'tablepress' ), 'http://tobias.baethge.com/' ); ?> 
     120        <?php _e( 'It is licensed as Free Software under GNU General Public License 2 (GPL 2).', 'tablepress' ); ?> 
     121    <br /> 
     122        <?php printf( __( 'If you like the plugin, <a href="%s"><strong>giving a donation</strong></a> is recommended.', 'tablepress' ), 'http://tablepress.org/donate/' ); ?> 
     123        <?php printf( __( 'Please rate the plugin in the <a href="%s">WordPress Plugin Directory</a>.', 'tablepress' ), 'http://wordpress.org/extend/plugins/tablepress/' ); ?> 
     124    <br /> 
     125        <?php _e( 'Donations and good ratings encourage me to further develop the plugin and to provide countless hours of support. Any amount is appreciated! Thanks!', 'tablepress' ); ?> 
     126    </p> 
     127        <?php 
     128    } 
     129 
     130    /** 
     131     * Print the content of the "Help and Support" post meta box 
    101132     * 
    102133     * @since 1.0.0 
     
    104135    public function postbox_help_support( $data, $box ) { 
    105136        ?> 
    106         <p><?php printf( __( '<a href="%s">Support</a> is provided through the <a href="%s">WordPress Support Forums</a>.', 'tablepress' ), 'http://tablepress.org/support/', 'http://wordpress.org/support/plugin/tablepress' ); ?> <?php printf( __( 'Before asking for support, please carefully read the <a href="%s">Frequently Asked Questions</a> where you will find answers to the most common questions, and search through the forums.', 'tablepress' ), 'http://tablepress.org/faq/' ); ?></p><p><?php printf( __( 'If you do not find an answer there, please <a href="%s">open a new thread</a> in the WordPress Support Forums.', 'tablepress' ), 'http://wordpress.org/support/plugin/tablepress' ); ?></p> 
    107         <?php 
    108     } 
    109  
    110     /** 
    111      * 
     137    <p> 
     138        <?php printf( __( '<a href="%s">Support</a> is provided through the <a href="%s">WordPress Support Forums</a>.', 'tablepress' ), 'http://tablepress.org/support/', 'http://wordpress.org/support/plugin/tablepress' ); ?> 
     139        <?php printf( __( 'Before asking for support, please carefully read the <a href="%s">Frequently Asked Questions</a> where you will find answers to the most common questions, and search through the forums.', 'tablepress' ), 'http://tablepress.org/faq/' ); ?> 
     140    </p> 
     141    <p> 
     142        <?php printf( __( 'If you do not find an answer there, please <a href="%s">open a new thread</a> in the WordPress Support Forums.', 'tablepress' ), 'http://wordpress.org/support/plugin/tablepress' ); ?> 
     143    </p> 
     144        <?php 
     145    } 
     146 
     147    /** 
     148     * Print the content of the "Debug and Version Information" post meta box 
    112149     * 
    113150     * @since 1.0.0 
    114151     */ 
    115152    public function postbox_debug_version_information( $data, $box ) { 
    116             // @TODO: Add more relevant things? (like ZIP support?) 
    117         ?> 
    118         <p> 
    119             <?php _e( 'You are using the following versions of the software.', 'tablepress' ); ?> <strong><?php _e( 'Please provide this information in bug reports and support requests.', 'tablepress' ); ?></strong><br /> 
    120             <br />&middot; Website: <?php echo site_url(); ?> 
     153        ?> 
     154        <p> 
     155            <?php _e( 'You are using the following versions of the software.', 'tablepress' ); ?> 
     156            <strong><?php _e( 'Please provide this information in bug reports and support requests.', 'tablepress' ); ?></strong> 
     157        </p> 
     158        <p> 
     159            &middot; Website: <?php echo site_url(); ?> 
    121160            <br />&middot; TablePress: <?php echo TablePress::version; ?> 
    122161            <br />&middot; TablePress (DB): <?php echo TablePress::db_version; ?> 
     
    127166            <br />&middot; mySQL (Server): <?php echo mysql_get_server_info(); ?> 
    128167            <br />&middot; mySQL (Client): <?php echo mysql_get_client_info(); ?> 
    129         </p> 
    130         <?php 
    131     } 
    132  
    133     /** 
    134      * 
     168            <br />&middot; ZIP support: <?php echo $data['zip_support_available'] ? __( 'yes', 'tablepress' ) : __( 'no', 'tablepress' ); ?> 
     169        </p> 
     170        <?php 
     171    } 
     172 
     173    /** 
     174     * Print the content of the "Credits and Thanks" post meta box 
    135175     * 
    136176     * @since 1.0.0 
     
    139179        ?> 
    140180        <p> 
    141             <?php _e( 'Thanks go to', 'tablepress' ); ?><br /> 
    142             <?php _e( 'Allan Jardine for the <a href="http://www.datatables.net/">DataTables jQuery plugin</a>,', 'tablepress' ); ?><br /> 
    143             <?php _e( 'the submitters of translations:', 'tablepress' ); ?> 
     181            <?php _e( 'Special Thanks go to:', 'tablepress' ); ?> 
     182            <br />&middot; <?php _e( 'Allan Jardine for <a href="http://www.datatables.net/">DataTables</a>,', 'tablepress' ); ?> 
     183        </p> 
     184        <p> 
     185            <?php _e( 'Thanks to the translators:', 'tablepress' ); ?> 
    144186            <?php 
    145187                foreach ( $data['plugin_languages'] as $lang_abbr => $language ) { 
     
    148190                } 
    149191            ?> 
    150             <br /><?php _e( 'and to all donors, contributors, supporters, reviewers and users of the plugin!', 'tablepress' ); ?> 
     192        </p> 
     193        <p> 
     194            <?php _e( 'Thank you to all donors, contributors, supporters, reviewers and users of the plugin!', 'tablepress' ); ?> 
    151195        </p> 
    152196        <?php 
  • tablepress/trunk/views/view-add.php

    r578853 r607623  
    2222 
    2323    /** 
    24      * Number of screen columns for the Add Table View 
    25      * 
    26      * @since 1.0.0 
    27      * 
    28      * @var int 
    29      */ 
    30     protected $screen_columns = 2; 
    31  
    32     /** 
    3324     * Set up the view with data and do things that are specific for this view 
    3425     * 
     
    5142        } 
    5243 
    53         $this->add_meta_box( 'support', __( 'Support', 'tablepress' ), array( &$this, 'postbox_support' ), 'side' ); 
    5444        $this->add_text_box( 'head', array( &$this, 'textbox_head' ), 'normal' ); 
    5545        $this->add_meta_box( 'add-table', __( 'Add New Table', 'tablepress' ), array( &$this, 'postbox_add_table' ), 'normal' ); 
     
    5949 
    6050    /** 
    61      * 
    62      * 
    63      * @since 1.0.0 
    64      */ 
    65     public function postbox_support( $data, $box ) { 
    66         echo '<p>' . __( 'These people are proud supporters of TablePress:', 'tablepress' ) . '</p>'; 
    67     } 
    68  
    69     /** 
    70      * 
     51     * Print the screen head text 
    7152     * 
    7253     * @since 1.0.0 
     
    7455    public function textbox_head( $data, $box ) { 
    7556        ?> 
    76         <p><?php _e( 'To add a new table, enter its name, a description (optional) and the number of rows and columns.', 'tablepress' ); ?><br /><?php _e( 'You can always change the name, description, and size of your table later.', 'tablepress' ); ?></p> 
     57        <p> 
     58            <?php _e( 'To add a new table, enter its name, a description (optional), and the number of rows and columns into the form below.', 'tablepress' ); ?> 
     59        </p> 
     60        <p> 
     61            <?php _e( 'You can always change the name, description, and size of your table later.', 'tablepress' ); ?> 
     62        </p> 
    7763        <?php 
    7864    } 
    7965 
    8066    /** 
    81      * 
     67     * Print the content of the "Add New Table" post meta box 
    8268     * 
    8369     * @since 1.0.0 
     
    117103     */ 
    118104    protected function help_tab_content() { 
    119         return 'Help for the Add new Table screen'; 
     105        return 'Help for the Add New Table screen'; 
    120106    } 
    121107 
  • tablepress/trunk/views/view-edit.php

    r598765 r607623  
    133133 
    134134    /** 
    135      * 
     135     * Print the content of the "Table Information" post meta box 
    136136     * 
    137137     * @since 1.0.0 
     
    168168 
    169169    /** 
    170      * 
     170     * Print the content of the "Table Content" post meta box 
    171171     * 
    172172     * @since 1.0.0 
     
    269269 
    270270    /** 
    271      * 
     271     * Print the content of the "Table Manipulation" post meta box 
    272272     * 
    273273     * @since 1.0.0 
     
    280280    <tr class="bottom-border"> 
    281281        <td> 
    282             <input type="button" class="button button-small" id="link-add" value="<?php _e( 'Insert Link', 'tablepress' ); ?>" /> 
    283             <a href="<?php echo $media_library_url; ?>" class="button button-small" id="image-add"><?php _e( 'Insert Image', 'tablepress' ); ?></a> 
    284             <input type="button" class="button button-small" id="advanced-editor-open" value="<?php _e( 'Advanced Editor', 'tablepress' ); ?>" /> 
     282            <input type="button" class="button" id="link-add" value="<?php _e( 'Insert Link', 'tablepress' ); ?>" /> 
     283            <a href="<?php echo $media_library_url; ?>" class="button" id="image-add"><?php _e( 'Insert Image', 'tablepress' ); ?></a> 
     284            <input type="button" class="button" id="advanced-editor-open" value="<?php _e( 'Advanced Editor', 'tablepress' ); ?>" /> 
    285285        </td> 
    286286        <td> 
    287287            <?php _e( 'Combine cells', 'tablepress' ); ?>:&nbsp; 
    288             <input type="button" class="button button-small" id="span-add-rowspan" value="<?php _e( 'in a column (rowspan)', 'tablepress' ); ?>" /> 
    289             <input type="button" class="button button-small" id="span-add-colspan" value="<?php _e( 'in a row (colspan)', 'tablepress' ); ?>" /> 
    290             <input type="button" class="button button-small show-help-box" value="<?php _e( '?', 'tablepress' ); ?>" title="<?php _e( 'Help on combining cells' ); ?>" /> 
     288            <input type="button" class="button" id="span-add-rowspan" value="<?php _e( 'in a column (rowspan)', 'tablepress' ); ?>" /> 
     289            <input type="button" class="button" id="span-add-colspan" value="<?php _e( 'in a row (colspan)', 'tablepress' ); ?>" /> 
     290            <input type="button" class="button show-help-box" value="<?php _e( '?', 'tablepress' ); ?>" title="<?php _e( 'Help on combining cells' ); ?>" /> 
    291291            <div class="hidden-container hidden-help-box-container"><?php 
    292292                echo '<p>' . __( 'Table cells can span across more than one column or row.', 'tablepress' ) . '</p>'; 
     
    303303        <td> 
    304304            <?php _e( 'Selected rows', 'tablepress' ); ?>:&nbsp; 
    305             <input type="button" class="button button-small" id="rows-hide" value="<?php _e( 'Hide', 'tablepress' ); ?>" /> 
    306             <input type="button" class="button button-small" id="rows-unhide" value="<?php _e( 'Show', 'tablepress' ); ?>" /> 
     305            <input type="button" class="button" id="rows-hide" value="<?php _e( 'Hide', 'tablepress' ); ?>" /> 
     306            <input type="button" class="button" id="rows-unhide" value="<?php _e( 'Show', 'tablepress' ); ?>" /> 
    307307        </td> 
    308308        <td> 
    309309            <?php _e( 'Selected columns', 'tablepress' ); ?>:&nbsp; 
    310             <input type="button" class="button button-small" id="columns-hide" value="<?php _e( 'Hide', 'tablepress' ); ?>" /> 
    311             <input type="button" class="button button-small" id="columns-unhide" value="<?php _e( 'Show', 'tablepress' ); ?>" /> 
     310            <input type="button" class="button" id="columns-hide" value="<?php _e( 'Hide', 'tablepress' ); ?>" /> 
     311            <input type="button" class="button" id="columns-unhide" value="<?php _e( 'Show', 'tablepress' ); ?>" /> 
    312312        </td> 
    313313    </tr> 
     
    315315        <td> 
    316316            <?php _e( 'Selected rows', 'tablepress' ); ?>:&nbsp; 
    317             <input type="button" class="button button-small" id="rows-insert" value="<?php _e( 'Insert', 'tablepress' ); ?>" /> 
    318             <input type="button" class="button button-small" id="rows-remove" value="<?php _e( 'Delete', 'tablepress' ); ?>" /> 
     317            <input type="button" class="button" id="rows-insert" value="<?php _e( 'Insert', 'tablepress' ); ?>" /> 
     318            <input type="button" class="button" id="rows-remove" value="<?php _e( 'Delete', 'tablepress' ); ?>" /> 
    319319        </td> 
    320320        <td> 
    321321            <?php _e( 'Selected columns', 'tablepress' ); ?>:&nbsp; 
    322             <input type="button" class="button button-small" id="columns-insert" value="<?php _e( 'Insert', 'tablepress' ); ?>" /> 
    323             <input type="button" class="button button-small" id="columns-remove" value="<?php _e( 'Delete', 'tablepress' ); ?>" /> 
    324         </td> 
    325     </tr> 
    326     <tr class="top-border"> 
    327         <td> 
    328             <?php printf( __( 'Add %s row(s)', 'tablepress' ), '<input type="number" id="rows-append-number" class="small-text numbers-only" title="' . __( 'This field must contain a positive number.', 'tablepress' ) . '" value="1" min="1" max="99999" maxlength="5" required />' ); ?>&nbsp;<input type="button" class="button button-small" id="rows-append" value="<?php _e( 'Add', 'tablepress' ); ?>" /> 
    329         </td> 
    330         <td> 
    331             <?php printf( __( 'Add %s column(s)', 'tablepress' ), '<input type="number" id="columns-append-number" class="small-text numbers-only" title="' . __( 'This field must contain a positive number.', 'tablepress' ) . '" value="1" min="1" max="99999" maxlength="5" required />' ); ?>&nbsp;<input type="button" class="button button-small" id="columns-append" value="<?php _e( 'Add', 'tablepress' ); ?>" /> 
     322            <input type="button" class="button" id="columns-insert" value="<?php _e( 'Insert', 'tablepress' ); ?>" /> 
     323            <input type="button" class="button" id="columns-remove" value="<?php _e( 'Delete', 'tablepress' ); ?>" /> 
     324        </td> 
     325    </tr> 
     326    <tr class="top-border"> 
     327        <td> 
     328            <?php printf( __( 'Add %s row(s)', 'tablepress' ), '<input type="number" id="rows-append-number" class="small-text numbers-only" title="' . __( 'This field must contain a positive number.', 'tablepress' ) . '" value="1" min="1" max="99999" maxlength="5" required />' ); ?>&nbsp;<input type="button" class="button" id="rows-append" value="<?php _e( 'Add', 'tablepress' ); ?>" /> 
     329        </td> 
     330        <td> 
     331            <?php printf( __( 'Add %s column(s)', 'tablepress' ), '<input type="number" id="columns-append-number" class="small-text numbers-only" title="' . __( 'This field must contain a positive number.', 'tablepress' ) . '" value="1" min="1" max="99999" maxlength="5" required />' ); ?>&nbsp;<input type="button" class="button" id="columns-append" value="<?php _e( 'Add', 'tablepress' ); ?>" /> 
    332332        </td> 
    333333    </tr> 
     
    338338 
    339339    /** 
    340      * 
     340     * Print the "Preview" and "Save Changes" button 
    341341     * 
    342342     * @since 1.0.0 
     
    346346        ?> 
    347347            <p class="submit"> 
    348                 <a href="<?php echo $preview_url; ?>" class="button show-preview-button" target="_blank"><?php _e( 'Preview', 'tablepress' ); ?></a> 
    349                 <input type="button" class="button button-primary save-changes-button hide-if-no-js" value="<?php _e( 'Save Changes', 'tablepress' ); ?>" /> 
    350                 <input type="submit" class="button button-primary hide-if-js" value="<?php _e( 'Save Changes', 'tablepress' ); ?>" /> 
     348                <a href="<?php echo $preview_url; ?>" class="button button-large show-preview-button" target="_blank"><?php _e( 'Preview', 'tablepress' ); ?></a> 
     349                <input type="button" class="button button-primary button-large save-changes-button hide-if-no-js" value="<?php _e( 'Save Changes', 'tablepress' ); ?>" /> 
     350                <input type="submit" class="button button-primary button-large hide-if-js" value="<?php _e( 'Save Changes', 'tablepress' ); ?>" /> 
    351351            </p> 
    352352        <?php 
     
    354354 
    355355    /** 
    356      * 
     356     * Print the "Delete Table" and "Export Table" buttons 
    357357     * 
    358358     * @since 1.0.0 
     
    369369 
    370370    /** 
    371      * 
     371     * Print the hidden containers for the Advanced Editor and the Preview 
    372372     * 
    373373     * @since 1.0.0 
     
    388388    <div class="submitbox"> 
    389389        <a href="#" class="submitdelete" id="advanced-editor-cancel"><?php _e( 'Cancel', 'tablepress' ); ?></a> 
    390         <input type="button" class="button button-primary" id="advanced-editor-confirm" value="<?php _e( 'OK', 'tablepress' ); ?>" /> 
     390        <input type="button" class="button button-primary button-large" id="advanced-editor-confirm" value="<?php _e( 'OK', 'tablepress' ); ?>" /> 
    391391    </div> 
    392392    </div> 
     
    399399 
    400400    /** 
    401      * 
     401     * Print the content of the "Table Options" post meta box 
    402402     * 
    403403     * @since 1.0.0 
     
    409409<tbody> 
    410410    <tr> 
    411         <th class="column-1" scope="row"><label for="option-table-head"><?php _e( 'Table Head Row', 'tablepress' ); ?>:</label></th> 
    412         <td class="column-2"><input type="checkbox" id="option-table-head" name="table[options][table_head]" value="true"<?php checked( $options['table_head'] ); ?> /></td> 
    413     </tr> 
    414     <tr class="bottom-border"> 
    415         <th class="column-1" scope="row"><label for="option-table-foot"><?php _e( 'Table Foot Row', 'tablepress' ); ?>:</label></th> 
    416         <td class="column-2"><input type="checkbox" id="option-table-foot" name="table[options][table_foot]" value="true"<?php checked( $options['table_foot'] ); ?> /></td> 
    417     </tr> 
    418     <tr class="top-border"> 
    419         <th class="column-1" scope="row"><label for="option-alternating-row-colors"><?php _e( 'Alternating Row Colors', 'tablepress' ); ?>:</label></th> 
    420         <td class="column-2"><input type="checkbox" id="option-alternating-row-colors" name="table[options][alternating_row_colors]" value="true"<?php checked( $options['alternating_row_colors'] ); ?> /></td> 
    421     </tr> 
    422     <tr class="bottom-border"> 
    423         <th class="column-1" scope="row"><label for="option-row-hover"><?php _e( 'Row Hover Highlighting', 'tablepress' ); ?>:</label></th> 
    424         <td class="column-2"><input type="checkbox" id="option-row-hover" name="table[options][row_hover]" value="true"<?php checked( $options['row_hover'] ); ?> /></td> 
    425     </tr> 
    426     <tr class="top-border"> 
    427         <th class="column-1" scope="row"><label for="option-print-name"><?php _e( 'Print Table Name', 'tablepress' ); ?>:</label></th> 
    428         <td class="column-2"><select id="option-print-name" name="table[options][print_name]"> 
    429             <option<?php selected( 'no', $options['print_name'] ); ?> value="no"><?php _e( 'No', 'tablepress' ); ?></option> 
    430             <option<?php selected( 'above', $options['print_name'] ); ?> value="above"><?php _e( 'Above', 'tablepress' ); ?></option> 
    431             <option<?php selected( 'below', $options['print_name'] ); ?> value="below"><?php _e( 'Below', 'tablepress' ); ?></option> 
    432         </select></td> 
    433     </tr> 
    434     <tr class="bottom-border"> 
    435         <th class="column-1" scope="row"><label for="option-print-description"><?php _e( 'Print Table Description', 'tablepress' ); ?>:</label></th> 
    436         <td class="column-2"><select id="option-print-description" name="table[options][print_description]"> 
    437             <option<?php selected( 'no', $options['print_description'] ); ?> value="no"><?php _e( 'No', 'tablepress' ); ?></option> 
    438             <option<?php selected( 'above', $options['print_description'] ); ?> value="above"><?php _e( 'Above', 'tablepress' ); ?></option> 
    439             <option<?php selected( 'below', $options['print_description'] ); ?> value="below"><?php _e( 'Below', 'tablepress' ); ?></option> 
    440         </select></td> 
    441     </tr> 
    442     <tr class="top-border"> 
    443         <th class="column-1" scope="row"><label for="option-extra-css-classes"><?php _e( 'Extra CSS Classes', 'tablepress' ); ?>:</label></th> 
    444         <td class="column-2"><input type="text" id="option-extra-css-classes" class="large-text" name="table[options][extra_css_classes]" value="<?php echo esc_attr( $options['extra_css_classes'] ); ?>" title="<?php _e( 'This field can only contain letters, numbers, spaces, hyphens (-), and underscores (_).', 'tablepress' ); ?>" pattern="[A-Za-z0-9- _]*" /></td> 
     411        <th class="column-1" scope="row"><?php _e( 'Table Head Row', 'tablepress' ); ?>:</th> 
     412        <td class="column-2"><label for="option-table-head"><input type="checkbox" id="option-table-head" name="table[options][table_head]" value="true"<?php checked( $options['table_head'] ); ?> /> <?php _e( 'The first row of the table is the table header.', 'tablepress' ); ?></label></td> 
     413    </tr> 
     414    <tr class="bottom-border"> 
     415        <th class="column-1" scope="row"><?php _e( 'Table Foot Row', 'tablepress' ); ?>:</th> 
     416        <td class="column-2"><label for="option-table-foot"><input type="checkbox" id="option-table-foot" name="table[options][table_foot]" value="true"<?php checked( $options['table_foot'] ); ?> /> <?php _e( 'The first row of the table is the table footer.', 'tablepress' ); ?></label></td> 
     417    </tr> 
     418    <tr class="top-border"> 
     419        <th class="column-1" scope="row"><?php _e( 'Alternating Row Colors', 'tablepress' ); ?>:</th> 
     420        <td class="column-2"><label for="option-alternating-row-colors"><input type="checkbox" id="option-alternating-row-colors" name="table[options][alternating_row_colors]" value="true"<?php checked( $options['alternating_row_colors'] ); ?> /> <?php _e( 'The background colors of consecutive rows shall alternate.', 'tablepress' ); ?></label></td> 
     421    </tr> 
     422    <tr class="bottom-border"> 
     423        <th class="column-1" scope="row"><?php _e( 'Row Hover Highlighting', 'tablepress' ); ?>:</th> 
     424        <td class="column-2"><label for="option-row-hover"><input type="checkbox" id="option-row-hover" name="table[options][row_hover]" value="true"<?php checked( $options['row_hover'] ); ?> /> <?php _e( 'Highlight a row while the mouse cursor hovers above it by changing its background color.', 'tablepress' ); ?></label></td> 
     425    </tr> 
     426    <tr class="top-border"> 
     427        <th class="column-1" scope="row"><?php _e( 'Print Table Name', 'tablepress' ); ?>:</th> 
     428        <?php 
     429            $position_select = '<select id="option-print-name-position" name="table[options][print_name_position]">'; 
     430            $position_select .= '<option' . selected( 'above', $options['print_name_position'], false ) . ' value="above">' . __( 'above', 'tablepress' ) . '</option>'; 
     431            $position_select .= '<option' . selected( 'below', $options['print_name_position'], false ) . ' value="below">' . __( 'below', 'tablepress' ) . '</option>'; 
     432            $position_select .= '</select>'; 
     433        ?> 
     434        <td class="column-2"><input type="checkbox" id="option-print-name" name="table[options][print_name]" value="true"<?php checked( $options['print_name'] ); ?> /> <?php printf( __( 'The table name shall be written %s the table.', 'tablepress' ), $position_select ); ?></td> 
     435    </tr> 
     436    <tr class="bottom-border"> 
     437        <th class="column-1" scope="row"><?php _e( 'Print Table Description', 'tablepress' ); ?>:</th> 
     438        <?php 
     439            $position_select = '<select id="option-print-description-position" name="table[options][print_description_position]">'; 
     440            $position_select .= '<option' . selected( 'above', $options['print_description_position'], false ) . ' value="above">' . __( 'above', 'tablepress' ) . '</option>'; 
     441            $position_select .= '<option' . selected( 'below', $options['print_description_position'], false ) . ' value="below">' . __( 'below', 'tablepress' ) . '</option>'; 
     442            $position_select .= '</select>'; 
     443        ?> 
     444        <td class="column-2"><input type="checkbox" id="option-print-description" name="table[options][print_description]" value="true"<?php checked( $options['print_description'] ); ?> /> <?php printf( __( 'The table description shall be written %s the table.', 'tablepress' ), $position_select ); ?></td> 
     445    </tr> 
     446    <tr class="top-border"> 
     447        <th class="column-1" scope="row"><?php _e( 'Extra CSS Classes', 'tablepress' ); ?>:</th> 
     448        <td class="column-2"><label for="option-extra-css-classes"><input type="text" id="option-extra-css-classes" class="large-text" name="table[options][extra_css_classes]" value="<?php echo esc_attr( $options['extra_css_classes'] ); ?>" title="<?php _e( 'This field can only contain letters, numbers, spaces, hyphens (-), and underscores (_).', 'tablepress' ); ?>" pattern="[A-Za-z0-9- _]*" /><p class="description"><?php echo __( 'Additional CSS classes for styling purposes can be entered here.', 'tablepress' ) . ' ' . sprintf( __( 'This is NOT the place to enter <a href="%s">Custom CSS</a> code!', 'tablepress' ), TablePress::url( array( 'action' => 'options' ) ) ); ?></p></label></td> 
    445449    </tr> 
    446450</tbody> 
    447451</table> 
    448452<?php 
    449     // @TODO: Remove this Debug cruft once everything works 
    450     echo '<!--'; 
    451     echo json_encode( $options ) . "\n"; 
    452     echo json_encode( $data['table']['visibility'] ) . "\n"; 
    453     echo '-->'; 
    454 ?> 
    455 <?php 
    456     } 
    457  
    458     /** 
    459      * 
     453    } 
     454 
     455    /** 
     456     * Print the content of the "Features of the DataTables JavaScript library" post meta box 
    460457     * 
    461458     * @since 1.0.0 
     
    468465<tbody> 
    469466    <tr class="bottom-border"> 
    470         <th class="column-1" scope="row"><label for="option-use-datatables"><?php _e( 'Use DataTables', 'tablepress' ); ?>:</label></th> 
    471         <td class="column-2"><input type="checkbox" id="option-use-datatables" name="table[options][use_datatables]" value="true"<?php checked( $options['use_datatables'] ); ?> /></td> 
    472     </tr> 
    473     <tr class="top-border"> 
    474         <th class="column-1" scope="row"><label for="option-datatables-sort"><?php _e( 'Sorting', 'tablepress' ); ?>:</label></th> 
    475         <td class="column-2"><input type="checkbox" id="option-datatables-sort" name="table[options][datatables_sort]" value="true"<?php checked( $options['datatables_sort'] ); ?> /></td> 
     467        <th class="column-1" scope="row"><?php _e( 'Use DataTables', 'tablepress' ); ?>:</th> 
     468        <td class="column-2"><label for="option-use-datatables"><input type="checkbox" id="option-use-datatables" name="table[options][use_datatables]" value="true"<?php checked( $options['use_datatables'] ); ?> /> <?php _e( 'Use the following features of the DataTables JavaScript library with this table:', 'tablepress' ); ?></label></td> 
     469    </tr> 
     470    <tr class="top-border"> 
     471        <th class="column-1" scope="row"><?php _e( 'Sorting', 'tablepress' ); ?>:</th> 
     472        <td class="column-2"><label for="option-datatables-sort"><input type="checkbox" id="option-datatables-sort" name="table[options][datatables_sort]" value="true"<?php checked( $options['datatables_sort'] ); ?> /> <?php _e( 'Enable sorting of the table by the visitor.', 'tablepress' ); ?></label></td> 
    476473    </tr> 
    477474    <tr class="no-border"> 
    478         <th class="column-1" scope="row"><label for="option-datatables-filter"><?php _e( 'Search/Filtering', 'tablepress' ); ?>:</label></th> 
    479         <td class="column-2"><input type="checkbox" id="option-datatables-filter" name="table[options][datatables_filter]" value="true"<?php checked( $options['datatables_filter'] ); ?> /></td> 
     475        <th class="column-1" scope="row"><?php _e( 'Search/Filtering', 'tablepress' ); ?>:</th> 
     476        <td class="column-2"><label for="option-datatables-filter"><input type="checkbox" id="option-datatables-filter" name="table[options][datatables_filter]" value="true"<?php checked( $options['datatables_filter'] ); ?> /> <?php _e( 'Enable the visitor to filter or search the table. Only rows with the search word in them are shown.', 'tablepress' ); ?></label></td> 
    480477    </tr> 
    481478    <tr class="no-border"> 
    482         <th class="column-1" scope="row"><label for="option-datatables-paginate"><?php _e( 'Pagination', 'tablepress' ); ?>:</label></th> 
    483         <td class="column-2"><input type="checkbox" id="option-datatables-paginate" name="table[options][datatables_paginate]" value="true"<?php checked( $options['datatables_paginate'] ); ?> /></td> 
     479        <th class="column-1" scope="row" style="vertical-align: top;"><?php _e( 'Pagination', 'tablepress' ); ?>:</th> 
     480        <td class="column-2"><label for="option-datatables-paginate"><input type="checkbox" id="option-datatables-paginate" name="table[options][datatables_paginate]" value="true"<?php checked( $options['datatables_paginate'] ); ?> /> <?php _e( 'Enable pagination of the table (viewing only a certain number of rows at a time) by the visitor.', 'tablepress' ); ?></label><br /> 
     481        <label for="option-datatables-paginate_entries"><input type="checkbox" style="visibility: hidden;" <?php // Dummy checkbox for space alignment ?>/> <?php printf( __( 'Show %s rows per page.', 'tablepress' ), '<input type="number" id="option-datatables-paginate_entries" name="table[options][datatables_paginate_entries]" value="' . $options['datatables_paginate_entries'] . '" min="1" max="99999" maxlength="5" />' ); ?></label></td> 
    484482    </tr> 
    485483    <tr class="no-border"> 
    486         <th class="column-1" scope="row"><label for="option-datatables-paginate_entries"><?php _e( 'Pagination Entries', 'tablepress' ); ?>:</label></th> 
    487         <td class="column-2"><input type="number" id="option-datatables-paginate_entries" name="table[options][datatables_paginate_entries]" value="<?php echo $options['datatables_paginate_entries']; ?>" min="1" max="99999" maxlength="5" /></td> 
     484        <th class="column-1" scope="row"><?php _e( 'Pagination Length Change', 'tablepress' ); ?>:</th> 
     485        <td class="column-2"><label for="option-datatables-lengthchange"><input type="checkbox" id="option-datatables-lengthchange" name="table[options][datatables_lengthchange]" value="true"<?php checked( $options['datatables_lengthchange'] ); ?> /> <?php _e( 'Allow the visitor to change the number of rows shown when using pagination.', 'tablepress' ); ?></label></td> 
    488486    </tr> 
    489487    <tr class="no-border"> 
    490         <th class="column-1" scope="row"><label for="option-datatables-lengthchange"><?php _e( 'Pagination Length Change', 'tablepress' ); ?>:</label></th> 
    491         <td class="column-2"><input type="checkbox" id="option-datatables-lengthchange" name="table[options][datatables_lengthchange]" value="true"<?php checked( $options['datatables_lengthchange'] ); ?> /></td> 
    492     </tr> 
    493     <tr class="no-border"> 
    494         <th class="column-1" scope="row"><label for="option-datatables-info"><?php _e( 'Info', 'tablepress' ); ?>:</label></th> 
    495         <td class="column-2"><input type="checkbox" id="option-datatables-info" name="table[options][datatables_info]" value="true"<?php checked( $options['datatables_info'] ); ?> /></td> 
    496     </tr> 
    497     <tr class="bottom-border"> 
    498         <th class="column-1" scope="row"><label for="option-datatables-scrollX"><?php _e( 'Horizontal Scrolling', 'tablepress' ); ?>:</label></th> 
    499         <td class="column-2"><input type="checkbox" id="option-datatables-scrollX" name="table[options][datatables_scrollX]" value="true"<?php checked( $options['datatables_scrollX'] ); ?> /></td> 
    500     </tr> 
    501     <tr class="top-border"> 
    502         <th class="column-1" scope="row"><label for="option-datatables-custom-commands"><?php _e( 'Custom Commands', 'tablepress' ); ?>:</label></th> 
    503         <td class="column-2"><input type="text" id="option-datatables-custom-commands" class="large-text" name="table[options][datatables_custom_commands]" value="<?php echo esc_attr( $options['datatables_custom_commands'] ); ?>" /></td> 
     488        <th class="column-1" scope="row"><?php _e( 'Info', 'tablepress' ); ?>:</th> 
     489        <td class="column-2"><label for="option-datatables-info"><input type="checkbox" id="option-datatables-info" name="table[options][datatables_info]" value="true"<?php checked( $options['datatables_info'] ); ?> /> <?php _e( 'Enable the table information display, with information about the currently visible data, like the number of rows.', 'tablepress' ); ?></label></td> 
     490    </tr> 
     491    <tr class="bottom-border"> 
     492        <th class="column-1" scope="row"><?php _e( 'Horizontal Scrolling', 'tablepress' ); ?>:</th> 
     493        <td class="column-2"><label for="option-datatables-scrollX"><input type="checkbox" id="option-datatables-scrollX" name="table[options][datatables_scrollX]" value="true"<?php checked( $options['datatables_scrollX'] ); ?> /> <?php _e( 'Enable horizontal scrolling, to make viewing tables with many columns easier.', 'tablepress' ); ?></label></td> 
     494    </tr> 
     495    <tr class="top-border"> 
     496        <th class="column-1" scope="row"><?php _e( 'Custom Commands', 'tablepress' ); ?>:</th> 
     497        <td class="column-2"><label for="option-datatables-custom-commands"><input type="text" id="option-datatables-custom-commands" class="large-text" name="table[options][datatables_custom_commands]" value="<?php echo esc_attr( $options['datatables_custom_commands'] ); ?>" /><p class="description"><?php echo __( 'Additional parameters from the <a href="http://www.datatables.net/">DataTables documentation</a> to be added to the JS call.', 'tablepress' ) . ' ' . __( 'For advanced use only.', 'tablepress' ); ?></p></label></td> 
    504498    </tr> 
    505499</tbody> 
     
    509503 
    510504    /** 
    511      * 
     505     * Print the screen head text 
    512506     * 
    513507     * @since 1.0.0 
     
    515509    public function textbox_head( $data, $box ) { 
    516510        ?> 
    517         <p> 
    518         <?php _e( 'On this page, you can edit the content of the table.', 'tablepress' ); ?> <?php _e( 'It is also possible to change the table structure by inserting, deleting, moving, and swapping columns and rows.', 'tablepress' ); ?><br /> 
    519         <?php printf( __( 'To insert the table into a page, post or text widget, copy the Shortcode %s and paste it into the editor.', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=' . esc_attr( $data['table']['id'] ) . ' /]" readonly="readonly" />' ); ?> 
    520         </p> 
     511    <p> 
     512        <?php printf( __( 'On this screen, you can edit the content and structure of the table with the ID %s.', 'tablepress' ), esc_html( $data['table']['id'] ) ); ?> 
     513        <?php _e( 'For example, you can insert things like text, images, or links into the table, or change the used table features. You can also insert, delete, move, hide, and swap columns and rows.', 'tablepress' ); ?> 
     514    </p> 
     515    <p> 
     516        <?php printf( __( 'To insert the table into a page, post, or text widget, copy the Shortcode %s and paste it at the desired place in the editor.', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=' . esc_attr( $data['table']['id'] ) . ' /]" readonly="readonly" />' ); ?> 
     517    </p> 
    521518        <?php 
    522519    } 
  • tablepress/trunk/views/view-editor_button_thickbox.php

    r598765 r607623  
    7171        wp_print_scripts( 'jquery' ); 
    7272?> 
    73 <title><?php printf( __( '%s &lsaquo; TablePress', 'tablepress' ), __( 'List of Tables', 'tablepress' ) ); ?></title> 
     73<title><?php printf( __( '%1$s &lsaquo; %2$s', 'tablepress' ), __( 'List of Tables', 'tablepress' ), 'TablePress' ); ?></title> 
    7474<style type="text/css"> 
    7575body { 
     
    7979#icon-tablepress { 
    8080    background: transparent url( '<?php echo plugins_url( 'admin/tablepress-icon.png', TABLEPRESS__FILE__ ); ?>' ) no-repeat; 
     81} 
     82/* Retina images */ 
     83@media only screen and (-webkit-min-device-pixel-ratio: 1.5) { 
     84    /* Screen icon */ 
     85    #icon-tablepress { 
     86        background-image: url( '<?php echo plugins_url( 'admin/tablepress-icon-2x.png', TABLEPRESS__FILE__ ); ?>' ); 
     87        background-size: 36px 36px; 
     88    } 
    8189} 
    8290 
     
    119127<div id="tablepress-page" class="wrap"> 
    120128<?php screen_icon( 'tablepress' ); ?> 
    121 <h2><?php printf( __( '%s &lsaquo; TablePress', 'tablepress' ), __( 'List of Tables', 'tablepress' ) ); ?></h2> 
     129<h2><?php printf( __( '%1$s &lsaquo; %2$s', 'tablepress' ), __( 'List of Tables', 'tablepress' ), 'TablePress' ); ?></h2> 
    122130<div id="poststuff"> 
    123131<p> 
    124132<?php _e( 'This is a list of all available tables.', 'tablepress' ); ?> <?php _e( 'You may insert a table into a post or page here.', 'tablepress' ); ?> 
    125133</p><p> 
    126 <?php printf( __( 'Click the &quot;%s&quot; button for the desired table to insert the corresponding Shortcode (%s) into the editor.', 'tablepress' ), __( 'Insert Shortcode', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=&lt;ID&gt; /]" readonly="readonly" />' ); ?> 
     134<?php printf( __( 'Click the &quot;%s&quot; button for the desired table to automatically insert the<br />corresponding Shortcode (%s) into the editor.', 'tablepress' ), __( 'Insert Shortcode', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=&lt;ID&gt; /]" readonly="readonly" />' ); ?> 
    127135</p> 
    128136<?php 
     
    183191            'singular'  => 'tablepress-table',              // singular name of the listed records 
    184192            'plural'    => 'tablepress-editor-button-list', // plural name of the listed records 
    185             'ajax'      => false                            // does this list table support AJAX? 
     193            'ajax'      => false,                           // does this list table support AJAX? 
     194            'screen'    => convert_to_screen( 'tablepress_editor_button_thickbox' ) 
    186195        ) ); 
    187196    } 
     
    299308     */ 
    300309    protected function column_table_action( $item ) { 
    301         return '<input type="button" class="insert-shortcode button button-small" title="[' . TablePress::$shortcode . ' id=' . esc_attr( $item['id'] ) . ' /]" value="' . __( 'Insert Shortcode', 'tablepress' ) . '" />'; 
     310        return '<input type="button" class="insert-shortcode button" title="[' . TablePress::$shortcode . ' id=' . esc_attr( $item['id'] ) . ' /]" value="' . __( 'Insert Shortcode', 'tablepress' ) . '" />'; 
    302311    } 
    303312 
  • tablepress/trunk/views/view-export.php

    r598765 r607623  
    5454 
    5555    /** 
    56      * 
     56     * Print the screen head text 
    5757     * 
    5858     * @since 1.0.0 
     
    6161        ?> 
    6262        <p> 
    63             <?php _e( 'It is recommended to export and backup the data of important tables regularly.', 'tablepress' ); ?> 
    64             <?php _e( 'Select the table, the desired export format and (for CSV only) a delimiter.', 'tablepress' ); ?> 
    65             <?php _e( 'You may choose to download the export file. Otherwise it will be shown on this page.', 'tablepress' ); ?> 
    66             <?php _e( 'Be aware that only the table data, but no options or settings are exported with this method.', 'tablepress' ); ?> 
    67             <?php printf( __( 'To backup all tables, including their settings, at once, use the &quot;%s&quot; button in the &quot;%s&quot;.', 'tablepress' ), __( 'Create and Download Dump File', 'tablepress' ), __( 'Plugin Options', 'tablepress' ) ); ?> 
     63            <?php _e( 'Exporting a table allows you to use it in other programs, like spreadsheets applications.', 'tablepress' ); ?> 
     64            <?php _e( 'Regularly exporting tables is also recommended as a backup of your data.', 'tablepress' ); ?> 
     65        </p> 
     66        <p> 
     67            <?php _e( 'To export, select the tables and the desired export format.', 'tablepress' ); ?> 
     68            <?php _e( 'If you choose more than one table, the exported files will automatically be stored in a ZIP archive file.', 'tablepress' ); ?> 
     69            <?php _e( 'Be aware that only the table data, but no options or settings are exported with this method!', 'tablepress' ); ?> 
    6870        </p> 
    6971        <?php 
     
    7173 
    7274    /** 
    73      * 
     75     * Print the content of the "No tables found" post meta box 
    7476     * 
    7577     * @since 1.0.0 
     
    8587 
    8688    /** 
    87      * 
     89     * Print the content of the "Export Tables" post meta box 
    8890     * 
    8991     * @since 1.0.0 
  • tablepress/trunk/views/view-import.php

    r600237 r607623  
    5858 
    5959    /** 
    60      * 
     60     * Print the screen head text 
    6161     * 
    6262     * @since 1.0.0 
     
    6464    public function textbox_head( $data, $box ) { 
    6565        ?> 
    66         <p><?php _e( 'TablePress can import tables from existing data.', 'tablepress' ); ?> <?php _e( 'This may be a CSV, HTML, or JSON file, each with a certain structure.', 'tablepress' ); ?></p> 
    67         <p><?php _e( 'To import an existing table, please select its format and the source for the import.', 'tablepress' ); ?> <?php if ( 0 < $data['tables_count'] ) _e( 'You can also decide, if you want to import it as a new table or replace an existing table.', 'tablepress' ); ?></p> 
     66        <p> 
     67            <?php _e( 'TablePress can import tables from existing data, like from a CSV file from a spreadsheet application (e.g. Excel), an HTML file resembling a webpage, or its own JSON format.', 'tablepress' ); ?> 
     68            <?php _e( 'You can also import existing tables from the WP-Table Reloaded plugin below.', 'tablepress' ); ?> 
     69        </p> 
     70        <p> 
     71            <?php _e( 'To import a table, select and enter the import source in the following form.', 'tablepress' ); ?> <?php if ( 0 < $data['tables_count'] ) _e( 'You can also choose to import it as a new table or to replace an existing table.', 'tablepress' ); ?> 
     72        </p> 
    6873        <?php 
    6974    } 
    7075 
    7176    /** 
    72      * 
     77     * Print the content of the "Import Tables" post meta box 
    7378     * 
    7479     * @since 1.0.0 
     
    166171    <tr class="top-border"> 
    167172        <th class="column-1" scope="row"></th> 
    168         <td class="column-2"><input type="submit" value="<?php echo esc_attr__( 'Import', 'tablepress' ); ?>" class="button button-primary" name="submit" /></td> 
     173        <td class="column-2"><input type="submit" value="<?php echo esc_attr__( 'Import', 'tablepress' ); ?>" class="button button-primary button-large" name="submit" /></td> 
    169174    </tr> 
    170175</tbody> 
     
    174179 
    175180    /** 
    176      * 
     181     * Print the content of the "Import from WP-Table Reloaded" post meta box 
    177182     * 
    178183     * @since 1.0.0 
     
    180185    public function postbox_wp_table_reloaded_import( $data, $box ) { 
    181186        ?> 
    182 <p><?php _e( 'Import from WP-Table Reloaded', 'tablepress' ); ?></p> 
     187<p> 
     188    <?php _e( 'To import all tables from a WP-Table Reloaded installation, choose the relevant import source below.', 'tablepress' ); ?> 
     189<br /> 
     190    <?php _e( 'If WP-Table Reloaded is installed on this site, the "WordPress database" option is recommended.', 'tablepress' ); ?> 
     191    <?php _e( 'If you want to import tables from another site, create a "WP-Table Reloaded Dump File" there and upload it below, after choosing "WP-Table Reloaded Dump File".', 'tablepress' ); ?> 
     192<br /> 
     193    <?php printf( __( 'Before doing this, it is highly recommended to read the <a href="%s" title"Migration Guide from WP-Table Reloaded to TablePress">migration guide</a> on the TablePress website.', 'tablepress' ), 'http://tablepress.org/migration-from-wp-table-reloaded/' ); ?> 
     194</p> 
    183195<table class="tablepress-postbox-table fixed"> 
    184196<tbody> 
     
    187199        <td class="column-2"> 
    188200            <input name="import[wp_table_reloaded][source]" id="import-wp-table-reloaded-source-db" type="radio" value="db"<?php checked( $data['import_wp_table_reloaded_source'], 'db', true ); disabled( $data['wp_table_reloaded_installed'], false, true ); ?> /> <label for="import-wp-table-reloaded-source-db"><?php _e( 'WordPress database', 'tablepress' ); ?></label> 
    189             <input name="import[wp_table_reloaded][source]" id="import-wp-table-reloaded-source-dump-file" type="radio" value="dump-file" disabled="disabled"<?php checked( $data['import_wp_table_reloaded_source'], 'dump-file', true ); ?> /> <label for="import-wp-table-reloaded-source-dump-file"><?php _e( 'WP-Table Reloaded Dump File', 'tablepress' ); ?></label> 
     201            <input name="import[wp_table_reloaded][source]" id="import-wp-table-reloaded-source-dump-file" type="radio" value="dump-file"<?php checked( $data['import_wp_table_reloaded_source'], 'dump-file', true ); ?> /> <label for="import-wp-table-reloaded-source-dump-file"><?php _e( 'WP-Table Reloaded Dump File', 'tablepress' ); ?></label> 
    190202        </td> 
    191203    </tr> 
     
    201213    </tr> 
    202214    <tr class="top-border"> 
    203         <th class="column-1" scope="row"><?php _e( 'Tables', 'tablepress' ); ?>:</th> 
     215        <th class="column-1" scope="row"><?php _e( 'Import tables', 'tablepress' ); ?>:</th> 
    204216        <td class="column-2"><label for="import-wp-table-reloaded-tables"> <input type="checkbox" id="import-wp-table-reloaded-tables" name="import[wp_table_reloaded][tables]" value="true" checked="checked" /> <?php _e( 'Import all tables and their settings from WP-Table Reloaded.', 'tablepress' ); ?> <?php _e( '<span class="description">(recommended)</span>', 'tablepress' ); ?></label></td> 
    205217    </tr> 
    206218    <tr class="bottom-border"> 
    207         <th class="column-1" scope="row"><?php _e( 'Styling', 'tablepress' ); ?>:</th> 
     219        <th class="column-1" scope="row"><?php _e( 'Import styling', 'tablepress' ); ?>:</th> 
    208220        <td class="column-2"><label for="import-wp-table-reloaded-css"> <input type="checkbox" id="import-wp-table-reloaded-css" name="import[wp_table_reloaded][css]" value="true" checked="checked" /> <?php _e( 'Try to automatically convert the "Custom CSS" code from the "Plugin Options" screen of WP-Table Reloaded.', 'tablepress' ); ?></label></td> 
    209221    </tr> 
    210222    <tr class="top-border"> 
    211223        <th class="column-1" scope="row"></th> 
    212         <td class="column-2"><input type="submit" value="<?php echo esc_attr__( 'Import from WP-Table Reloaded', 'tablepress' ); ?>" class="button" id="submit_wp_table_reloaded_import" name="submit_wp_table_reloaded_import" /></td> 
     224        <td class="column-2"><input type="submit" value="<?php echo esc_attr__( 'Import from WP-Table Reloaded', 'tablepress' ); ?>" class="button button-large" id="submit_wp_table_reloaded_import" name="submit_wp_table_reloaded_import" /></td> 
    213225    </tr> 
    214226</tbody> 
  • tablepress/trunk/views/view-list.php

    r598765 r607623  
    5353        $this->admin_page->enqueue_script( 'list', array( 'jquery' ), array( 
    5454            'list' => array( 
    55                 'shortcode_popup' => __( 'To embed this table into a post or page, use this Shortcode:', 'tablepress' ) 
     55                'shortcode_popup' => __( 'To embed this table into a post or page, use this Shortcode:', 'tablepress' ), 
     56                'donation-message-already-donated' => __( 'Thank you very much! Your donation is highly appreciated. You just contributed to the further development of TablePress!', 'tablepress' ), 
     57                'donation-message-maybe-later' => sprintf ( __( 'No problem! I still hope you enjoy the benefits that TablePress adds to your site. If you should change your mind, you\'ll always find the &quot;Donate&quot; button on the <a href="%s">TablePress website</a>.', 'tablepress' ), 'http://tablepress.org/' ), 
    5658            ) 
    5759        ) ); 
     
    5961        if ( $data['messages']['first_visit'] ) 
    6062            $this->add_header_message( 
    61                 '<strong><em>Welcome!</em></strong><br />Thank you for using TablePress for the first time!<br />' 
     63                '<strong><em>' . __( 'Welcome!', 'tablepress' ) . '</em></strong><br />' 
     64                . __( 'Thank you for using TablePress for the first time!', 'tablepress' ) . ' ' 
     65                . sprintf( __( 'If you encounter any questions or problems, please visit the <a href="%1$s">FAQ</a>, the <a href="%2$s">documentation</a>, and the <a href="%3$s">Support</a> section on the <a href="%4$s">plugin website</a>.', 'tablepress' ), 'http://tablepress.org/faq/', 'http://tablepress.org/documentation/', 'http://tablepress.org/support/', 'http://tablepress.org/' ) . '<br /><br />' 
    6266                . $this->ajax_link( array( 'action' => 'hide_message', 'item' => 'first_visit', 'return' => 'list' ) , __( 'Hide this message', 'tablepress' ) ) 
    6367            ); 
     
    6771                '<strong><em>' . __( 'Attention!', 'tablepress' ) . '</em></strong><br />' 
    6872                . __( 'You have activated the plugin WP-Table Reloaded, which can not be used together with TablePress.', 'tablepress' ) . '<br />' 
    69                 . sprintf( __( 'Please follow the <a href="%s" title"Migration Guide from WP-Table Reloaded to TablePress">migration guide</a> and then deactivate WP-Table Reloaded!', 'tablepress' ), 'http://tablepress.org/migration-from-wp-table-reloaded/' ) . '<br />' 
    70                 . '<a href="' . TablePress::url( array( 'action' => 'import' ) ) . '" class="button button-primary" title="' . __( 'Import your tables from WP-Table Reloaded', 'tablepress' ) . '" style="color:#ffffff;margin-top:5px;">' . __( 'Import your tables from WP-Table Reloaded', 'tablepress' ) . '</a>', 
     73                . __( 'It is strongly recommended that you switch from WP-Table Reloaded to TablePress, which not only fixes many problems, but also has more and better features than WP-Table Reloaded.', 'tablepress' ) . '<br />' 
     74                . sprintf( __( 'Please follow the <a href="%s" title"Migration Guide from WP-Table Reloaded to TablePress">migration guide</a> to move your tables and then deactivate WP-Table Reloaded!', 'tablepress' ), 'http://tablepress.org/migration-from-wp-table-reloaded/' ) . '<br />' 
     75                . '<a href="' . TablePress::url( array( 'action' => 'import' ) ) . '" class="button button-primary button-large" title="' . __( 'Import your tables from WP-Table Reloaded', 'tablepress' ) . '" style="color:#ffffff;margin-top:5px;">' . __( 'Import your tables from WP-Table Reloaded', 'tablepress' ) . '</a>', 
    7176                'error' 
    7277            ); 
     
    8186                __( 'Sincerly, Tobias', 'tablepress' ) . '<br /><br />' . 
    8287                sprintf( '<a href="%s" target="_blank"><strong>%s</strong></a>', 'http://tablepress.org/donate/', __( 'Sure, I\'ll buy you a coffee and support TablePress!', 'tablepress' ) ) . '&nbsp;&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;&nbsp;&nbsp;' . 
    83                 $this->ajax_link( array( 'action' => 'hide_message', 'item' => 'donation_nag', 'return' => 'list' ) , __( 'I already donated.', 'tablepress' ) ) . '&nbsp;&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;&nbsp;&nbsp;' . 
    84                 $this->ajax_link( array( 'action' => 'hide_message', 'item' => 'donation_nag', 'return' => 'list' ) , __( 'No, thanks. Don\'t ask again.', 'tablepress' ) ) 
     88                $this->ajax_link( array( 'action' => 'hide_message', 'item' => 'donation_nag', 'return' => 'list', 'target' => 'already-donated' ) , __( 'I already donated.', 'tablepress' ) ) . '&nbsp;&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;&nbsp;&nbsp;' . 
     89                $this->ajax_link( array( 'action' => 'hide_message', 'item' => 'donation_nag', 'return' => 'list', 'target' => 'maybe-later' ) , __( 'No, thanks. Don\'t ask again.', 'tablepress' ) ) 
    8590            ); 
    8691 
    8792        if ( $data['messages']['show_plugin_update'] ) { 
    88             $message = '<strong><em>Thank you for updating to TablePress ' . TablePress::version . '!</em></strong><br />'; 
     93            $message = '<strong><em>' . sprintf( __( 'Thank you for updating to TablePress %s!', 'tablepress' ), TablePress::version ) . '</em></strong><br />'; 
    8994            if ( ! empty( $data['messages']['plugin_update_message'] ) ) 
    90                 $message .= $data['messages']['plugin_update_message'] . '<br /><br />'; 
     95                $message .= $data['messages']['plugin_update_message'] . '<br />'; 
     96            $message .= sprintf( __( 'Please read the <a href="%s">release announcement</a> for more information.', 'tablepress' ), 'http://tablepress.org/news/' ) . ' ' 
     97                . sprintf( __( 'If you like the new features and enhancements, <a href="%s">giving a donation</a> towards the further support and development of TablePress is recommended. Thank you!', 'tablepress' ), 'http://tablepress.org/donate/' ) 
     98                . '<br /><br />'; 
    9199            $message .= $this->ajax_link( array( 'action' => 'hide_message', 'item' => 'plugin_update', 'return' => 'list' ) , __( 'Hide this message', 'tablepress' ) ); 
    92100            $this->add_header_message( $message ); 
     
    172180 
    173181    /** 
    174      * 
     182     * Print the screen head text 
    175183     * 
    176184     * @since 1.0.0 
     
    179187        ?> 
    180188        <p> 
    181             <?php _e( 'This is a list of all available tables.', 'tablepress' ); ?> 
    182             <?php _e( 'You may add, edit, copy, delete or preview tables here.', 'tablepress' ); ?> 
     189            <?php _e( 'This is a list of your tables.', 'tablepress' ); ?> 
     190            <?php _e( 'Click the corresponding links within the list to edit, copy, delete, or preview a table.', 'tablepress' ); ?> 
    183191        </p> 
    184192        <p> 
    185             <?php printf( __( 'To insert the table into a page, post or text-widget, copy the shortcode %s and paste it into the corresponding place in the editor.', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=&lt;ID&gt; /]" readonly="readonly" />' ); ?> 
    186             <?php _e( 'Each table has a unique ID that needs to be adjusted in that shortcode.', 'tablepress' ); ?> 
    187             <?php printf( __( 'You can also click the button &quot;%s&quot; in the editor toolbar to select and insert a table.', 'tablepress' ), __( 'Table', 'tablepress' ) ); ?> 
     193            <?php printf( __( 'To insert a table into a page, post, or text widget, copy its Shortcode %s and paste it at the desired place in the editor.', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=&lt;ID&gt; /]" readonly="readonly" />' ); ?> 
     194            <?php _e( 'Each table has a unique ID that needs to be adjusted in that Shortcode.', 'tablepress' ); ?> 
     195            <?php printf( __( 'You can also click the &quot;%s&quot; button in the editor toolbar to select and insert a table.', 'tablepress' ), __( 'Table', 'tablepress' ) ); ?> 
    188196        </p> 
    189197        <?php 
     
    191199 
    192200    /** 
    193      * 
     201     * Print the content of the "All Tables" text box 
    194202     * 
    195203     * @since 1.0.0 
     
    216224 
    217225    /** 
     226     * Create HTML code for an AJAXified link 
     227     * 
     228     * @since 1.0.0 
     229     * 
     230     * @param array $params Parameters for the URL 
     231     * @param string $text Text for the link 
     232     * @return string HTML code for the link 
     233     */ 
     234    protected function ajax_link( $params = array( 'action' => 'list', 'item' => '' ), $text ) { 
     235        $url = TablePress::url( $params, true, 'admin-post.php' ); 
     236        $action = esc_attr( $params['action'] ); 
     237        $item = esc_attr( $params['item'] ); 
     238        $target = isset( $params['target'] ) ? esc_attr( $params['target'] ) : ''; 
     239        return "<a class=\"ajax-link\" href=\"{$url}\" data-action=\"{$action}\" data-item=\"{$item}\" data-target=\"{$target}\">{$text}</a>"; 
     240    } 
     241 
     242    /** 
    218243     * Return the content for the help tab for this screen 
    219244     * 
     
    385410        $row_actions = array( 
    386411            'edit' => sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $edit_url, sprintf ( __( 'Edit &#8220;%s&#8221;', 'tablepress' ), esc_attr( $item['name'] ) ), __( 'Edit', 'tablepress' ) ), 
    387             'shortcode hide-if-no-js' => sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', '#', '[' . TablePress::$shortcode . ' id=' . esc_attr( $item['id'] ) . ' /]', __( 'Shortcode', 'tablepress' ) ), 
     412            'shortcode hide-if-no-js' => sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', '#', '[' . TablePress::$shortcode . ' id=' . esc_attr( $item['id'] ) . ' /]', __( 'Show Shortcode', 'tablepress' ) ), 
    388413            'copy' => sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $copy_url, sprintf ( __( 'Copy &#8220;%s&#8221;', 'tablepress' ), esc_attr( $item['name'] ) ), __( 'Copy', 'tablepress' ) ), 
    389414            'export' => sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $export_url, sprintf ( __( 'Export &#8220;%s&#8221;', 'tablepress' ), esc_attr( $item['name'] ) ), __( 'Export', 'tablepress' ) ), 
     
    571596 
    572597        // certain fields require some extra work before being sortable 
    573         switch( $orderby ) { 
     598        switch ( $orderby ) { 
    574599            case 'last_modified': 
    575600                // Compare UNIX timestamps for "last modified", which actually is a mySQL datetime string 
  • tablepress/trunk/views/view-options.php

    r598765 r607623  
    4242 
    4343        $this->admin_page->enqueue_style( 'codemirror' ); 
    44         $this->admin_page->enqueue_script( 'codemirror' ); 
    45         $this->admin_page->enqueue_script( 'codemirror-css', array( 'tablepress-codemirror' ) ); 
    46         $this->admin_page->enqueue_script( 'options', array( 'jquery', 'tablepress-codemirror', 'tablepress-codemirror-css' ) ); 
     44        $this->admin_page->enqueue_script( 'codemirror', array(), false, true ); 
     45        $this->admin_page->enqueue_script( 'options', array( 'jquery', 'tablepress-codemirror' ) ); 
    4746 
    4847        $action_messages = array( 
     
    5857        $this->add_text_box( 'head', array( &$this, 'textbox_head' ), 'normal' ); 
    5958        $this->add_meta_box( 'frontend-options', __( 'Frontend Options', 'tablepress' ), array( &$this, 'postbox_frontend_options' ), 'normal' ); 
    60         // $this->add_meta_box( 'backend-options', __( 'Backend Options', 'tablepress' ), array( &$this, 'postbox_backend_options' ), 'normal' ); // @TODO: Commented out as backend options are not yet used 
    6159        $this->add_meta_box( 'user-options', __( 'User Options', 'tablepress' ), array( &$this, 'postbox_user_options' ), 'normal' ); 
    6260        $this->data['submit_button_caption'] = __( 'Save Changes', 'tablepress' ); 
     
    6563 
    6664    /** 
    67      * 
     65     * Print the screen head text 
    6866     * 
    6967     * @since 1.0.0 
     
    7169    public function textbox_head( $data, $box ) { 
    7270        ?> 
    73         <p><?php _e( 'TablePress has several options which affect the plugin behavior in different areas.', 'tablepress' ); ?><br /><?php _e( 'Frontend Options influence the output and used features of tables in pages, posts or text-widgets.', 'tablepress' ); ?> <?php printf( __( 'The Backend Options control the plugin\'s admin area, e.g. the &quot;%s&quot; screen.', 'tablepress' ), __( 'Edit Table', 'tablepress' ) ); ?> <?php _e( 'Administrators have access to further Admin Options.', 'tablepress' ); ?></p> 
     71        <p> 
     72            <?php _e( 'TablePress has several options which affect the plugin\'s behavior in different areas.', 'tablepress' ); ?> 
     73        </p> 
     74        <p> 
     75            <?php _e( 'Frontend Options influence the styling of tables in pages, posts, or text widgets, by defining which CSS code shall be loaded.', 'tablepress' ); ?> 
     76        <br /> 
     77            <?php _e( 'In the User Options, every TablePress user can choose the position of the plugin in the WordPress admin menu, and the desired plugin language.', 'tablepress' ); ?> 
     78            <?php // _e( 'Administrators have access to further Admin Options, e.g. to control which user groups are allowed to use TablePress.', 'tablepress' ); ?></p> 
    7479        <?php 
    7580    } 
    7681 
    7782    /** 
    78      * 
     83     * Print the content of the "Frontend Options" post meta box 
    7984     * 
    8085     * @since 1.0.0 
     
    106111            ?></p> 
    107112            <label for="option-use-custom-css-file"><input type="checkbox" id="option-use-custom-css-file" name="options[use_custom_css_file]" value="true"<?php checked( $data['frontend_options']['use_custom_css_file'] ); ?> /> <?php _e( 'Use a file for storing and loading the "Custom CSS" code.', 'tablepress' ); ?> <?php _e( '<span class="description">(recommended)</span>', 'tablepress' ); ?></label><br /> 
    108         <?php 
    109             echo content_url( 'tablepress-custom.css' ); 
    110             echo ' '; 
    111             echo ( $data['frontend_options']['custom_css_file_exists'] ) ? '(File exists.)' : '(File seems not to exist.)'; 
    112         ?> 
     113            <input type="checkbox" style="visibility: hidden;" <?php // Dummy checkbox for space alignment ?>/> <?php echo content_url( 'tablepress-custom.css' ) . ' ' . ( ( $data['frontend_options']['custom_css_file_exists'] ) ? '(File exists.)' : '(File seems not to exist.)' ); ?> 
    113114        </td> 
    114115    </tr> 
     
    119120 
    120121    /** 
    121      * 
    122      * 
    123      * @since 1.0.0 
    124      */ 
    125     public function postbox_backend_options( $data, $box ) { 
    126 ?> 
    127 <table class="tablepress-postbox-table fixed"> 
    128 <tbody> 
    129     <tr> 
    130         <th class="column-1" scope="row">Label</th> 
    131         <td class="column-2">Field</td> 
    132     </tr> 
    133 </tbody> 
    134 </table> 
    135 <?php 
    136     } 
    137  
    138     /** 
    139      * Render a form for user options 
     122     * Print the content of the "User Options" post meta box 
    140123     * 
    141124     * @since 1.0.0 
     
    160143 
    161144        // add separator and generic positions 
    162         $entries['-'] = __( '---', 'tablepress' ); 
     145        $entries['-'] = '---'; 
    163146        $entries['top'] = __( 'Top-Level (top)', 'tablepress' ); 
    164147        $entries['middle'] = __( 'Top-Level (middle)', 'tablepress' ); 
  • tablepress/trunk/views/view-options_custom_css.php

    r598765 r607623  
    3434 
    3535        // Set page <title> 
    36         $GLOBALS['title'] = sprintf( __( '%s &lsaquo; TablePress', 'tablepress' ), $this->data['view_actions'][ $this->action ]['page_title'] ); 
     36        $GLOBALS['title'] = sprintf( __( '%1$s &lsaquo; %2$s', 'tablepress' ), $this->data['view_actions'][ $this->action ]['page_title'], 'TablePress' ); 
    3737 
    3838        $this->add_header_message( '<strong>' . __( 'Attention: Further action is required to save the changes to your &quot;Custom CSS&quot;!', 'tablepress' ) . '</strong>', 'updated' ); 
     
    9696 
    9797    /** 
    98      * 
     98     * Print the content of the "Explanation" text box 
    9999     * 
    100100     * @since 1.0.0 
     
    104104        <p> 
    105105            <?php _e( 'Due to the configuration of your server, TablePress was not able to automatically save your &quot;Custom CSS&quot; to a file.', 'tablepress' ); ?> 
    106             <?php printf( __( 'To try again via the same method that you use for updating plugins or themes, please fill out the &quot;%s&quot; form below.', 'tablepress' ), __( 'Connection Information', 'default' ) ); ?> 
     106            <?php printf( __( 'To try again with the same method that you use for updating plugins or themes, please fill out the &quot;%s&quot; form below.', 'tablepress' ), __( 'Connection Information', 'default' ) ); ?> 
    107107        </p> 
    108108        <?php 
     
    110110 
    111111    /** 
    112      * 
     112     * Print the content of the "Credentials" text box 
    113113     * 
    114114     * @since 1.0.0 
     
    119119 
    120120    /** 
    121      * 
     121     * Print the content of the "Cancel Saving" text box 
    122122     * 
    123123     * @since 1.0.0 
     
    130130            <?php _e( 'Your &quot;Custom CSS&quot; will then be loaded inline.', 'tablepress' ); ?> 
    131131        </p><p> 
    132             <a href="<?php echo TablePress::url( array( 'action' => 'options', 'message' => 'success_save_error_custom_css' ) ); ?>" class="button"><?php _e( 'Proceed without saving &quot;Custom CSS&quot; to a file', 'tablepress' ); ?></a> 
     132            <a href="<?php echo TablePress::url( array( 'action' => 'options', 'message' => 'success_save_error_custom_css' ) ); ?>" class="button button-large"><?php _e( 'Proceed without saving &quot;Custom CSS&quot; to a file', 'tablepress' ); ?></a> 
    133133        </p> 
    134134        <?php 
  • tablepress/trunk/views/view-preview_table.php

    r558089 r607623  
    5353        _wp_admin_html_begin(); 
    5454?> 
    55 <title><?php printf( __( '%s &lsaquo; TablePress', 'tablepress' ), __( 'Preview', 'tablepress' ) ); ?></title> 
     55<title><?php printf( __( '%1$s &lsaquo; %2$s', 'tablepress' ), __( 'Preview', 'tablepress' ), 'TablePress' ); ?></title> 
    5656<style type="text/css"> 
    5757body { 
    58     margin: 10px; 
     58    margin: -6px 10px 10px; 
    5959} 
    6060</style> 
     
    6464<div id="tablepress-page"> 
    6565<p> 
    66 <?php _e( 'This is a preview of your table.', 'tablepress' ); ?> <?php _e( 'Because of CSS styling, the table might look different on your page!', 'tablepress' ); ?> <?php _e( 'The features of the DataTables JavaScript library are also not visible in this preview!', 'tablepress' ); ?><br /> 
    67 <?php printf( __( 'To insert the table into a page, post or text widget, copy the Shortcode %s and paste it into the editor.', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=' . esc_attr( $this->data['table_id'] ) . ' /]" readonly="readonly" />' ); ?> 
     66<?php _e( 'This is a preview of your table.', 'tablepress' ); ?> <?php _e( 'Because of CSS styling in your theme, the table might look different on your page!', 'tablepress' ); ?> <?php _e( 'The features of the DataTables JavaScript library are also not available or visible in this preview!', 'tablepress' ); ?><br /> 
     67<?php printf( __( 'To insert the table into a page, post, or text widget, copy the Shortcode %s and paste it into the editor.', 'tablepress' ), '<input type="text" class="table-shortcode table-shortcode-inline" value="[' . TablePress::$shortcode . ' id=' . esc_attr( $this->data['table_id'] ) . ' /]" readonly="readonly" />' ); ?> 
    6868</p> 
    6969<?php echo $this->data['body_html']; ?> 
Note: See TracChangeset for help on using the changeset viewer.