Show More
@@ -0,0 +1,1 b'' | |||||
|
1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} No newline at end of file |
@@ -0,0 +1,28 b'' | |||||
|
1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; | |||
|
2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= | |||
|
3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c< | |||
|
4 | f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&& | |||
|
5 | (j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r= | |||
|
6 | {b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length, | |||
|
7 | t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b=== | |||
|
8 | "string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), | |||
|
9 | l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, | |||
|
10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, | |||
|
11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, | |||
|
12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), | |||
|
13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} | |||
|
14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value", | |||
|
15 | m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m= | |||
|
16 | a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue= | |||
|
17 | j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], | |||
|
18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], | |||
|
19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], | |||
|
20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ | |||
|
21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), | |||
|
22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", | |||
|
23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), | |||
|
24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", | |||
|
25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b= | |||
|
26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m, | |||
|
27 | 250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit", | |||
|
28 | PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})(); |
@@ -1,258 +1,270 b'' | |||||
1 | //---------------------------------------------------------------------------- |
|
1 | //---------------------------------------------------------------------------- | |
2 | // Copyright (C) 2008-2011 The IPython Development Team |
|
2 | // Copyright (C) 2008-2011 The IPython Development Team | |
3 | // |
|
3 | // | |
4 | // Distributed under the terms of the BSD License. The full license is in |
|
4 | // Distributed under the terms of the BSD License. The full license is in | |
5 | // the file COPYING, distributed as part of this software. |
|
5 | // the file COPYING, distributed as part of this software. | |
6 | //---------------------------------------------------------------------------- |
|
6 | //---------------------------------------------------------------------------- | |
7 |
|
7 | |||
8 | //============================================================================ |
|
8 | //============================================================================ | |
9 | // TextCell |
|
9 | // TextCell | |
10 | //============================================================================ |
|
10 | //============================================================================ | |
11 |
|
11 | |||
12 | var IPython = (function (IPython) { |
|
12 | var IPython = (function (IPython) { | |
13 |
|
13 | |||
14 | // TextCell base class |
|
14 | // TextCell base class | |
15 |
|
15 | |||
16 | var TextCell = function (notebook) { |
|
16 | var TextCell = function (notebook) { | |
17 | this.code_mirror_mode = this.code_mirror_mode || 'htmlmixed'; |
|
17 | this.code_mirror_mode = this.code_mirror_mode || 'htmlmixed'; | |
18 | this.placeholder = this.placeholder || ''; |
|
18 | this.placeholder = this.placeholder || ''; | |
19 | IPython.Cell.apply(this, arguments); |
|
19 | IPython.Cell.apply(this, arguments); | |
20 | this.rendered = false; |
|
20 | this.rendered = false; | |
21 | this.cell_type = this.cell_type || 'text'; |
|
21 | this.cell_type = this.cell_type || 'text'; | |
22 | }; |
|
22 | }; | |
23 |
|
23 | |||
24 |
|
24 | |||
25 | TextCell.prototype = new IPython.Cell(); |
|
25 | TextCell.prototype = new IPython.Cell(); | |
26 |
|
26 | |||
27 |
|
27 | |||
28 | TextCell.prototype.create_element = function () { |
|
28 | TextCell.prototype.create_element = function () { | |
29 | var cell = $("<div>").addClass('cell text_cell border-box-sizing'); |
|
29 | var cell = $("<div>").addClass('cell text_cell border-box-sizing'); | |
30 | cell.attr('tabindex','2'); |
|
30 | cell.attr('tabindex','2'); | |
31 | var input_area = $('<div/>').addClass('text_cell_input'); |
|
31 | var input_area = $('<div/>').addClass('text_cell_input'); | |
32 | this.code_mirror = CodeMirror(input_area.get(0), { |
|
32 | this.code_mirror = CodeMirror(input_area.get(0), { | |
33 | indentUnit : 4, |
|
33 | indentUnit : 4, | |
34 | mode: this.code_mirror_mode, |
|
34 | mode: this.code_mirror_mode, | |
35 | theme: 'default', |
|
35 | theme: 'default', | |
36 | value: this.placeholder |
|
36 | value: this.placeholder | |
37 | }); |
|
37 | }); | |
38 | // The tabindex=-1 makes this div focusable. |
|
38 | // The tabindex=-1 makes this div focusable. | |
39 | var render_area = $('<div/>').addClass('text_cell_render'). |
|
39 | var render_area = $('<div/>').addClass('text_cell_render'). | |
40 | addClass('rendered_html').attr('tabindex','-1'); |
|
40 | addClass('rendered_html').attr('tabindex','-1'); | |
41 | cell.append(input_area).append(render_area); |
|
41 | cell.append(input_area).append(render_area); | |
42 | this.element = cell; |
|
42 | this.element = cell; | |
43 | }; |
|
43 | }; | |
44 |
|
44 | |||
45 |
|
45 | |||
46 | TextCell.prototype.bind_events = function () { |
|
46 | TextCell.prototype.bind_events = function () { | |
47 | IPython.Cell.prototype.bind_events.apply(this); |
|
47 | IPython.Cell.prototype.bind_events.apply(this); | |
48 | var that = this; |
|
48 | var that = this; | |
49 | this.element.keydown(function (event) { |
|
49 | this.element.keydown(function (event) { | |
50 | if (event.which === 13) { |
|
50 | if (event.which === 13) { | |
51 | if (that.rendered) { |
|
51 | if (that.rendered) { | |
52 | that.edit(); |
|
52 | that.edit(); | |
53 | event.preventDefault(); |
|
53 | event.preventDefault(); | |
54 | }; |
|
54 | }; | |
55 | }; |
|
55 | }; | |
56 | }); |
|
56 | }); | |
57 | }; |
|
57 | }; | |
58 |
|
58 | |||
59 |
|
59 | |||
60 | TextCell.prototype.select = function () { |
|
60 | TextCell.prototype.select = function () { | |
61 | IPython.Cell.prototype.select.apply(this); |
|
61 | IPython.Cell.prototype.select.apply(this); | |
62 | var output = this.element.find("div.text_cell_render"); |
|
62 | var output = this.element.find("div.text_cell_render"); | |
63 | output.trigger('focus'); |
|
63 | output.trigger('focus'); | |
64 | }; |
|
64 | }; | |
65 |
|
65 | |||
66 |
|
66 | |||
67 | TextCell.prototype.edit = function () { |
|
67 | TextCell.prototype.edit = function () { | |
68 | if (this.rendered === true) { |
|
68 | if (this.rendered === true) { | |
69 | var text_cell = this.element; |
|
69 | var text_cell = this.element; | |
70 | var output = text_cell.find("div.text_cell_render"); |
|
70 | var output = text_cell.find("div.text_cell_render"); | |
71 | output.hide(); |
|
71 | output.hide(); | |
72 | text_cell.find('div.text_cell_input').show(); |
|
72 | text_cell.find('div.text_cell_input').show(); | |
73 | this.code_mirror.focus(); |
|
73 | this.code_mirror.focus(); | |
74 | this.code_mirror.refresh(); |
|
74 | this.code_mirror.refresh(); | |
75 | this.rendered = false; |
|
75 | this.rendered = false; | |
76 | if (this.get_source() === this.placeholder) { |
|
76 | if (this.get_source() === this.placeholder) { | |
77 | this.set_source(''); |
|
77 | this.set_source(''); | |
78 | }; |
|
78 | }; | |
79 | }; |
|
79 | }; | |
80 | }; |
|
80 | }; | |
81 |
|
81 | |||
82 |
|
82 | |||
83 | // Subclasses must define render. |
|
83 | // Subclasses must define render. | |
84 | TextCell.prototype.render = function () {}; |
|
84 | TextCell.prototype.render = function () {}; | |
85 |
|
85 | |||
86 |
|
86 | |||
87 | TextCell.prototype.config_mathjax = function () { |
|
87 | TextCell.prototype.config_mathjax = function () { | |
88 | var text_cell = this.element; |
|
88 | var text_cell = this.element; | |
89 | var that = this; |
|
89 | var that = this; | |
90 | text_cell.click(function () { |
|
90 | text_cell.click(function () { | |
91 | that.edit(); |
|
91 | that.edit(); | |
92 | }).focusout(function () { |
|
92 | }).focusout(function () { | |
93 | that.render(); |
|
93 | that.render(); | |
94 | }); |
|
94 | }); | |
95 |
|
95 | |||
96 | text_cell.trigger("focusout"); |
|
96 | text_cell.trigger("focusout"); | |
97 | }; |
|
97 | }; | |
98 |
|
98 | |||
99 |
|
99 | |||
100 | TextCell.prototype.get_source = function() { |
|
100 | TextCell.prototype.get_source = function() { | |
101 | return this.code_mirror.getValue(); |
|
101 | return this.code_mirror.getValue(); | |
102 | }; |
|
102 | }; | |
103 |
|
103 | |||
104 |
|
104 | |||
105 | TextCell.prototype.set_source = function(text) { |
|
105 | TextCell.prototype.set_source = function(text) { | |
106 | this.code_mirror.setValue(text); |
|
106 | this.code_mirror.setValue(text); | |
107 | this.code_mirror.refresh(); |
|
107 | this.code_mirror.refresh(); | |
108 | }; |
|
108 | }; | |
109 |
|
109 | |||
110 |
|
110 | |||
111 | TextCell.prototype.get_rendered = function() { |
|
111 | TextCell.prototype.get_rendered = function() { | |
112 | return this.element.find('div.text_cell_render').html(); |
|
112 | return this.element.find('div.text_cell_render').html(); | |
113 | }; |
|
113 | }; | |
114 |
|
114 | |||
115 |
|
115 | |||
116 | TextCell.prototype.set_rendered = function(text) { |
|
116 | TextCell.prototype.set_rendered = function(text) { | |
117 | this.element.find('div.text_cell_render').html(text); |
|
117 | this.element.find('div.text_cell_render').html(text); | |
118 | }; |
|
118 | }; | |
119 |
|
119 | |||
120 |
|
120 | |||
121 | TextCell.prototype.at_top = function () { |
|
121 | TextCell.prototype.at_top = function () { | |
122 | if (this.rendered) { |
|
122 | if (this.rendered) { | |
123 | return true; |
|
123 | return true; | |
124 | } else { |
|
124 | } else { | |
125 | return false; |
|
125 | return false; | |
126 | } |
|
126 | } | |
127 | }; |
|
127 | }; | |
128 |
|
128 | |||
129 |
|
129 | |||
130 | TextCell.prototype.at_bottom = function () { |
|
130 | TextCell.prototype.at_bottom = function () { | |
131 | if (this.rendered) { |
|
131 | if (this.rendered) { | |
132 | return true; |
|
132 | return true; | |
133 | } else { |
|
133 | } else { | |
134 | return false; |
|
134 | return false; | |
135 | } |
|
135 | } | |
136 | }; |
|
136 | }; | |
137 |
|
137 | |||
138 |
|
138 | |||
139 | TextCell.prototype.fromJSON = function (data) { |
|
139 | TextCell.prototype.fromJSON = function (data) { | |
140 | if (data.cell_type === this.cell_type) { |
|
140 | if (data.cell_type === this.cell_type) { | |
141 | if (data.source !== undefined) { |
|
141 | if (data.source !== undefined) { | |
142 | this.set_source(data.source); |
|
142 | this.set_source(data.source); | |
143 | this.set_rendered(data.rendered || ''); |
|
143 | this.set_rendered(data.rendered || ''); | |
144 | this.rendered = false; |
|
144 | this.rendered = false; | |
145 | this.render(); |
|
145 | this.render(); | |
146 | }; |
|
146 | }; | |
147 | }; |
|
147 | }; | |
148 | }; |
|
148 | }; | |
149 |
|
149 | |||
150 |
|
150 | |||
151 | TextCell.prototype.toJSON = function () { |
|
151 | TextCell.prototype.toJSON = function () { | |
152 | var data = {} |
|
152 | var data = {} | |
153 | data.cell_type = this.cell_type; |
|
153 | data.cell_type = this.cell_type; | |
154 | data.source = this.get_source(); |
|
154 | data.source = this.get_source(); | |
155 | return data; |
|
155 | return data; | |
156 | }; |
|
156 | }; | |
157 |
|
157 | |||
158 |
|
158 | |||
159 | // HTMLCell |
|
159 | // HTMLCell | |
160 |
|
160 | |||
161 | var HTMLCell = function (notebook) { |
|
161 | var HTMLCell = function (notebook) { | |
162 | this.placeholder = "Type <strong>HTML</strong> and LaTeX: $\\alpha^2$"; |
|
162 | this.placeholder = "Type <strong>HTML</strong> and LaTeX: $\\alpha^2$"; | |
163 | IPython.TextCell.apply(this, arguments); |
|
163 | IPython.TextCell.apply(this, arguments); | |
164 | this.cell_type = 'html'; |
|
164 | this.cell_type = 'html'; | |
165 | }; |
|
165 | }; | |
166 |
|
166 | |||
167 |
|
167 | |||
168 | HTMLCell.prototype = new TextCell(); |
|
168 | HTMLCell.prototype = new TextCell(); | |
169 |
|
169 | |||
170 |
|
170 | |||
171 | HTMLCell.prototype.render = function () { |
|
171 | HTMLCell.prototype.render = function () { | |
172 | if (this.rendered === false) { |
|
172 | if (this.rendered === false) { | |
173 | var text = this.get_source(); |
|
173 | var text = this.get_source(); | |
174 | if (text === "") {text = this.placeholder;}; |
|
174 | if (text === "") {text = this.placeholder;}; | |
175 | this.set_rendered(text); |
|
175 | this.set_rendered(text); | |
176 | MathJax.Hub.Queue(["Typeset",MathJax.Hub]); |
|
176 | MathJax.Hub.Queue(["Typeset",MathJax.Hub]); | |
177 | this.element.find('div.text_cell_input').hide(); |
|
177 | this.element.find('div.text_cell_input').hide(); | |
178 | this.element.find("div.text_cell_render").show(); |
|
178 | this.element.find("div.text_cell_render").show(); | |
179 | this.rendered = true; |
|
179 | this.rendered = true; | |
180 | }; |
|
180 | }; | |
181 | }; |
|
181 | }; | |
182 |
|
182 | |||
183 |
|
183 | |||
184 | // MarkdownCell |
|
184 | // MarkdownCell | |
185 |
|
185 | |||
186 | var MarkdownCell = function (notebook) { |
|
186 | var MarkdownCell = function (notebook) { | |
187 | this.placeholder = "Type *Markdown* and LaTeX: $\\alpha^2$"; |
|
187 | this.placeholder = "Type *Markdown* and LaTeX: $\\alpha^2$"; | |
188 | IPython.TextCell.apply(this, arguments); |
|
188 | IPython.TextCell.apply(this, arguments); | |
189 | this.cell_type = 'markdown'; |
|
189 | this.cell_type = 'markdown'; | |
190 | }; |
|
190 | }; | |
191 |
|
191 | |||
192 |
|
192 | |||
193 | MarkdownCell.prototype = new TextCell(); |
|
193 | MarkdownCell.prototype = new TextCell(); | |
194 |
|
194 | |||
195 |
|
195 | |||
196 | MarkdownCell.prototype.render = function () { |
|
196 | MarkdownCell.prototype.render = function () { | |
197 | if (this.rendered === false) { |
|
197 | if (this.rendered === false) { | |
198 | var text = this.get_source(); |
|
198 | var text = this.get_source(); | |
199 | if (text === "") {text = this.placeholder;}; |
|
199 | if (text === "") {text = this.placeholder;}; | |
200 | var html = IPython.markdown_converter.makeHtml(text); |
|
200 | var html = IPython.markdown_converter.makeHtml(text); | |
201 | this.set_rendered(html); |
|
201 | this.set_rendered(html); | |
202 | MathJax.Hub.Queue(["Typeset",MathJax.Hub]); |
|
202 | MathJax.Hub.Queue(["Typeset",MathJax.Hub]); | |
203 | this.element.find('div.text_cell_input').hide(); |
|
203 | this.element.find('div.text_cell_input').hide(); | |
204 | this.element.find("div.text_cell_render").show(); |
|
204 | this.element.find("div.text_cell_render").show(); | |
|
205 | var code_snippets = this.element.find("pre > code"); | |||
|
206 | code_snippets.replaceWith(function () { | |||
|
207 | var code = $(this).html(); | |||
|
208 | /* Substitute br for newlines and for spaces | |||
|
209 | before highlighting, since prettify doesn't | |||
|
210 | preserve those on all browsers */ | |||
|
211 | code = code.replace(/(\r\n|\n|\r)/gm, "<br/>"); | |||
|
212 | code = code.replace(/ /gm, ' '); | |||
|
213 | code = prettyPrintOne(code); | |||
|
214 | ||||
|
215 | return '<code class="prettyprint">' + code + '</code>'; | |||
|
216 | }); | |||
205 | this.rendered = true; |
|
217 | this.rendered = true; | |
206 | }; |
|
218 | }; | |
207 | }; |
|
219 | }; | |
208 |
|
220 | |||
209 |
|
221 | |||
210 | // RSTCell |
|
222 | // RSTCell | |
211 |
|
223 | |||
212 | var RSTCell = function (notebook) { |
|
224 | var RSTCell = function (notebook) { | |
213 | this.placeholder = "Type *ReStructured Text* and LaTeX: $\\alpha^2$"; |
|
225 | this.placeholder = "Type *ReStructured Text* and LaTeX: $\\alpha^2$"; | |
214 | IPython.TextCell.apply(this, arguments); |
|
226 | IPython.TextCell.apply(this, arguments); | |
215 | this.cell_type = 'rst'; |
|
227 | this.cell_type = 'rst'; | |
216 | }; |
|
228 | }; | |
217 |
|
229 | |||
218 |
|
230 | |||
219 | RSTCell.prototype = new TextCell(); |
|
231 | RSTCell.prototype = new TextCell(); | |
220 |
|
232 | |||
221 |
|
233 | |||
222 | RSTCell.prototype.render = function () { |
|
234 | RSTCell.prototype.render = function () { | |
223 | if (this.rendered === false) { |
|
235 | if (this.rendered === false) { | |
224 | var text = this.get_source(); |
|
236 | var text = this.get_source(); | |
225 | if (text === "") {text = this.placeholder;}; |
|
237 | if (text === "") {text = this.placeholder;}; | |
226 | var settings = { |
|
238 | var settings = { | |
227 | processData : false, |
|
239 | processData : false, | |
228 | cache : false, |
|
240 | cache : false, | |
229 | type : "POST", |
|
241 | type : "POST", | |
230 | data : text, |
|
242 | data : text, | |
231 | headers : {'Content-Type': 'application/x-rst'}, |
|
243 | headers : {'Content-Type': 'application/x-rst'}, | |
232 | success : $.proxy(this.handle_render,this) |
|
244 | success : $.proxy(this.handle_render,this) | |
233 | }; |
|
245 | }; | |
234 | $.ajax("/rstservice/render", settings); |
|
246 | $.ajax("/rstservice/render", settings); | |
235 | this.element.find('div.text_cell_input').hide(); |
|
247 | this.element.find('div.text_cell_input').hide(); | |
236 | this.element.find("div.text_cell_render").show(); |
|
248 | this.element.find("div.text_cell_render").show(); | |
237 | this.set_rendered("Rendering..."); |
|
249 | this.set_rendered("Rendering..."); | |
238 | }; |
|
250 | }; | |
239 | }; |
|
251 | }; | |
240 |
|
252 | |||
241 |
|
253 | |||
242 | RSTCell.prototype.handle_render = function (data, status, xhr) { |
|
254 | RSTCell.prototype.handle_render = function (data, status, xhr) { | |
243 | this.set_rendered(data); |
|
255 | this.set_rendered(data); | |
244 | MathJax.Hub.Queue(["Typeset",MathJax.Hub]); |
|
256 | MathJax.Hub.Queue(["Typeset",MathJax.Hub]); | |
245 | this.rendered = true; |
|
257 | this.rendered = true; | |
246 | }; |
|
258 | }; | |
247 |
|
259 | |||
248 |
|
260 | |||
249 | IPython.TextCell = TextCell; |
|
261 | IPython.TextCell = TextCell; | |
250 | IPython.HTMLCell = HTMLCell; |
|
262 | IPython.HTMLCell = HTMLCell; | |
251 | IPython.MarkdownCell = MarkdownCell; |
|
263 | IPython.MarkdownCell = MarkdownCell; | |
252 | IPython.RSTCell = RSTCell; |
|
264 | IPython.RSTCell = RSTCell; | |
253 |
|
265 | |||
254 |
|
266 | |||
255 | return IPython; |
|
267 | return IPython; | |
256 |
|
268 | |||
257 | }(IPython)); |
|
269 | }(IPython)); | |
258 |
|
270 |
@@ -1,238 +1,242 b'' | |||||
1 | <!DOCTYPE HTML> |
|
1 | <!DOCTYPE HTML> | |
2 | <html> |
|
2 | <html> | |
3 |
|
3 | |||
4 | <head> |
|
4 | <head> | |
5 | <meta charset="utf-8"> |
|
5 | <meta charset="utf-8"> | |
6 |
|
6 | |||
7 | <title>IPython Notebook</title> |
|
7 | <title>IPython Notebook</title> | |
8 |
|
8 | |||
9 | <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" /> |
|
9 | <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" /> | |
10 | <!-- <link rel="stylesheet" href="static/jquery/css/themes/rocket/jquery-wijmo.css" type="text/css" /> --> |
|
10 | <!-- <link rel="stylesheet" href="static/jquery/css/themes/rocket/jquery-wijmo.css" type="text/css" /> --> | |
11 | <!-- <link rel="stylesheet" href="static/jquery/css/themes/smoothness/jquery-ui-1.8.14.custom.css" type="text/css" />--> |
|
11 | <!-- <link rel="stylesheet" href="static/jquery/css/themes/smoothness/jquery-ui-1.8.14.custom.css" type="text/css" />--> | |
12 |
|
12 | |||
13 | <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" charset="utf-8"></script> |
|
13 | <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" charset="utf-8"></script> | |
14 | <!-- <script type='text/javascript' src='static/mathjax/MathJax.js?config=TeX-AMS_HTML' charset='utf-8'></script> --> |
|
14 | <!-- <script type='text/javascript' src='static/mathjax/MathJax.js?config=TeX-AMS_HTML' charset='utf-8'></script> --> | |
15 | <script type="text/javascript"> |
|
15 | <script type="text/javascript"> | |
16 | if (typeof MathJax == 'undefined') { |
|
16 | if (typeof MathJax == 'undefined') { | |
17 | console.log("Trying to load local copy of MathJax"); |
|
17 | console.log("Trying to load local copy of MathJax"); | |
18 | document.write(unescape("%3Cscript type='text/javascript' src='static/mathjax/MathJax.js%3Fconfig=TeX-AMS_HTML' charset='utf-8'%3E%3C/script%3E")); |
|
18 | document.write(unescape("%3Cscript type='text/javascript' src='static/mathjax/MathJax.js%3Fconfig=TeX-AMS_HTML' charset='utf-8'%3E%3C/script%3E")); | |
19 | } |
|
19 | } | |
20 | </script> |
|
20 | </script> | |
21 |
|
21 | |||
22 | <link rel="stylesheet" href="static/codemirror-2.12/lib/codemirror.css"> |
|
22 | <link rel="stylesheet" href="static/codemirror-2.12/lib/codemirror.css"> | |
23 | <link rel="stylesheet" href="static/codemirror-2.12/mode/rst/rst.css"> |
|
23 | <link rel="stylesheet" href="static/codemirror-2.12/mode/rst/rst.css"> | |
24 | <link rel="stylesheet" href="static/codemirror-2.12/theme/ipython.css"> |
|
24 | <link rel="stylesheet" href="static/codemirror-2.12/theme/ipython.css"> | |
25 | <link rel="stylesheet" href="static/codemirror-2.12/theme/default.css"> |
|
25 | <link rel="stylesheet" href="static/codemirror-2.12/theme/default.css"> | |
26 |
|
26 | |||
|
27 | <link rel="stylesheet" href="static/prettify/prettify.css"/> | |||
|
28 | ||||
27 | <link rel="stylesheet" href="static/css/boilerplate.css" type="text/css" /> |
|
29 | <link rel="stylesheet" href="static/css/boilerplate.css" type="text/css" /> | |
28 | <link rel="stylesheet" href="static/css/layout.css" type="text/css" /> |
|
30 | <link rel="stylesheet" href="static/css/layout.css" type="text/css" /> | |
29 | <link rel="stylesheet" href="static/css/base.css" type="text/css" /> |
|
31 | <link rel="stylesheet" href="static/css/base.css" type="text/css" /> | |
30 | <link rel="stylesheet" href="static/css/notebook.css" type="text/css" /> |
|
32 | <link rel="stylesheet" href="static/css/notebook.css" type="text/css" /> | |
31 | <link rel="stylesheet" href="static/css/renderedhtml.css" type="text/css" /> |
|
33 | <link rel="stylesheet" href="static/css/renderedhtml.css" type="text/css" /> | |
32 |
|
34 | |||
33 |
|
35 | |||
34 | </head> |
|
36 | </head> | |
35 |
|
37 | |||
36 | <body> |
|
38 | <body> | |
37 |
|
39 | |||
38 | <div id="header"> |
|
40 | <div id="header"> | |
39 | <span id="ipython_notebook"><h1>IPython Notebook</h1></span> |
|
41 | <span id="ipython_notebook"><h1>IPython Notebook</h1></span> | |
40 | <span id="save_widget"> |
|
42 | <span id="save_widget"> | |
41 | <input type="text" id="notebook_name" size="20"></textarea> |
|
43 | <input type="text" id="notebook_name" size="20"></textarea> | |
42 | <span id="notebook_id" style="display:none">{{notebook_id}}</span> |
|
44 | <span id="notebook_id" style="display:none">{{notebook_id}}</span> | |
43 | <button id="save_notebook">Save</button> |
|
45 | <button id="save_notebook">Save</button> | |
44 | </span> |
|
46 | </span> | |
45 | <span id="kernel_status">Idle</span> |
|
47 | <span id="kernel_status">Idle</span> | |
46 | </div> |
|
48 | </div> | |
47 |
|
49 | |||
48 | <div id="main_app"> |
|
50 | <div id="main_app"> | |
49 |
|
51 | |||
50 | <div id="left_panel"> |
|
52 | <div id="left_panel"> | |
51 |
|
53 | |||
52 | <div id="notebook_section"> |
|
54 | <div id="notebook_section"> | |
53 | <h3 class="section_header">Notebook</h3> |
|
55 | <h3 class="section_header">Notebook</h3> | |
54 | <div class="section_content"> |
|
56 | <div class="section_content"> | |
55 | <div class="section_row"> |
|
57 | <div class="section_row"> | |
56 | <span id="new_open" class="section_row_buttons"> |
|
58 | <span id="new_open" class="section_row_buttons"> | |
57 | <button id="new_notebook">New</button> |
|
59 | <button id="new_notebook">New</button> | |
58 | <button id="open_notebook">Open</button> |
|
60 | <button id="open_notebook">Open</button> | |
59 | </span> |
|
61 | </span> | |
60 | <span class="section_row_header">Actions</span> |
|
62 | <span class="section_row_header">Actions</span> | |
61 | </div> |
|
63 | </div> | |
62 | <div class="section_row"> |
|
64 | <div class="section_row"> | |
63 | <span> |
|
65 | <span> | |
64 | <select id="download_format"> |
|
66 | <select id="download_format"> | |
65 | <option value="json">ipynb</option> |
|
67 | <option value="json">ipynb</option> | |
66 | <option value="py">py</option> |
|
68 | <option value="py">py</option> | |
67 | </select> |
|
69 | </select> | |
68 | </span> |
|
70 | </span> | |
69 | <span class="section_row_buttons"> |
|
71 | <span class="section_row_buttons"> | |
70 | <button id="download_notebook">Download</button> |
|
72 | <button id="download_notebook">Download</button> | |
71 | </span> |
|
73 | </span> | |
72 | </div> |
|
74 | </div> | |
73 | <div class="section_row"> |
|
75 | <div class="section_row"> | |
74 | <span class="section_row_buttons"> |
|
76 | <span class="section_row_buttons"> | |
75 | <span id="print_widget"> |
|
77 | <span id="print_widget"> | |
76 | <button id="print_notebook">Print</button> |
|
78 | <button id="print_notebook">Print</button> | |
77 | </span> |
|
79 | </span> | |
78 | </span> |
|
80 | </span> | |
79 | </div> |
|
81 | </div> | |
80 | </div> |
|
82 | </div> | |
81 | </div> |
|
83 | </div> | |
82 |
|
84 | |||
83 | <div id="cell_section"> |
|
85 | <div id="cell_section"> | |
84 | <h3 class="section_header">Cell</h3> |
|
86 | <h3 class="section_header">Cell</h3> | |
85 | <div class="section_content"> |
|
87 | <div class="section_content"> | |
86 | <div class="section_row"> |
|
88 | <div class="section_row"> | |
87 | <span class="section_row_buttons"> |
|
89 | <span class="section_row_buttons"> | |
88 | <button id="delete_cell">Delete</button> |
|
90 | <button id="delete_cell">Delete</button> | |
89 | </span> |
|
91 | </span> | |
90 | <span class="section_row_header">Actions</span> |
|
92 | <span class="section_row_header">Actions</span> | |
91 | </div> |
|
93 | </div> | |
92 | <div class="section_row"> |
|
94 | <div class="section_row"> | |
93 | <span id="cell_type" class="section_row_buttons"> |
|
95 | <span id="cell_type" class="section_row_buttons"> | |
94 | <button id="to_code">Code</button> |
|
96 | <button id="to_code">Code</button> | |
95 | <!-- <button id="to_html">HTML</button>--> |
|
97 | <!-- <button id="to_html">HTML</button>--> | |
96 | <button id="to_markdown">Markdown</button> |
|
98 | <button id="to_markdown">Markdown</button> | |
97 | </span> |
|
99 | </span> | |
98 | <span class="button_label">Format</span> |
|
100 | <span class="button_label">Format</span> | |
99 | </div> |
|
101 | </div> | |
100 | <div class="section_row"> |
|
102 | <div class="section_row"> | |
101 | <span id="cell_output" class="section_row_buttons"> |
|
103 | <span id="cell_output" class="section_row_buttons"> | |
102 | <button id="toggle_output">Toggle</button> |
|
104 | <button id="toggle_output">Toggle</button> | |
103 | <button id="clear_all_output">ClearAll</button> |
|
105 | <button id="clear_all_output">ClearAll</button> | |
104 | </span> |
|
106 | </span> | |
105 | <span class="button_label">Output</span> |
|
107 | <span class="button_label">Output</span> | |
106 | </div> |
|
108 | </div> | |
107 | <div class="section_row"> |
|
109 | <div class="section_row"> | |
108 | <span id="insert" class="section_row_buttons"> |
|
110 | <span id="insert" class="section_row_buttons"> | |
109 | <button id="insert_cell_above">Above</button> |
|
111 | <button id="insert_cell_above">Above</button> | |
110 | <button id="insert_cell_below">Below</button> |
|
112 | <button id="insert_cell_below">Below</button> | |
111 | </span> |
|
113 | </span> | |
112 | <span class="button_label">Insert</span> |
|
114 | <span class="button_label">Insert</span> | |
113 | </div> |
|
115 | </div> | |
114 | <div class="section_row"> |
|
116 | <div class="section_row"> | |
115 | <span id="move" class="section_row_buttons"> |
|
117 | <span id="move" class="section_row_buttons"> | |
116 | <button id="move_cell_up">Up</button> |
|
118 | <button id="move_cell_up">Up</button> | |
117 | <button id="move_cell_down">Down</button> |
|
119 | <button id="move_cell_down">Down</button> | |
118 | </span> |
|
120 | </span> | |
119 | <span class="button_label">Move</span> |
|
121 | <span class="button_label">Move</span> | |
120 | </div> |
|
122 | </div> | |
121 | <div class="section_row"> |
|
123 | <div class="section_row"> | |
122 | <span id="run_cells" class="section_row_buttons"> |
|
124 | <span id="run_cells" class="section_row_buttons"> | |
123 | <button id="run_selected_cell">Selected</button> |
|
125 | <button id="run_selected_cell">Selected</button> | |
124 | <button id="run_all_cells">All</button> |
|
126 | <button id="run_all_cells">All</button> | |
125 | </span> |
|
127 | </span> | |
126 | <span class="button_label">Run</span> |
|
128 | <span class="button_label">Run</span> | |
127 | </div> |
|
129 | </div> | |
128 | <div class="section_row"> |
|
130 | <div class="section_row"> | |
129 | <span id="autoindent_span"> |
|
131 | <span id="autoindent_span"> | |
130 | <input type="checkbox" id="autoindent" checked="true"></input> |
|
132 | <input type="checkbox" id="autoindent" checked="true"></input> | |
131 | </span> |
|
133 | </span> | |
132 | <span class="checkbox_label">Autoindent:</span> |
|
134 | <span class="checkbox_label">Autoindent:</span> | |
133 | </div> |
|
135 | </div> | |
134 | </div> |
|
136 | </div> | |
135 | </div> |
|
137 | </div> | |
136 |
|
138 | |||
137 | <div id="kernel_section"> |
|
139 | <div id="kernel_section"> | |
138 | <h3 class="section_header">Kernel</h3> |
|
140 | <h3 class="section_header">Kernel</h3> | |
139 | <div class="section_content"> |
|
141 | <div class="section_content"> | |
140 | <div class="section_row"> |
|
142 | <div class="section_row"> | |
141 | <span id="int_restart" class="section_row_buttons"> |
|
143 | <span id="int_restart" class="section_row_buttons"> | |
142 | <button id="int_kernel">Interrupt</button> |
|
144 | <button id="int_kernel">Interrupt</button> | |
143 | <button id="restart_kernel">Restart</button> |
|
145 | <button id="restart_kernel">Restart</button> | |
144 | </span> |
|
146 | </span> | |
145 | <span class="section_row_header">Actions</span> |
|
147 | <span class="section_row_header">Actions</span> | |
146 | </div> |
|
148 | </div> | |
147 | <div class="section_row"> |
|
149 | <div class="section_row"> | |
148 | <span id="kernel_persist"> |
|
150 | <span id="kernel_persist"> | |
149 | <input type="checkbox" id="kill_kernel"></input> |
|
151 | <input type="checkbox" id="kill_kernel"></input> | |
150 | </span> |
|
152 | </span> | |
151 | <span class="checkbox_label">Kill kernel upon exit:</span> |
|
153 | <span class="checkbox_label">Kill kernel upon exit:</span> | |
152 | </div> |
|
154 | </div> | |
153 | </div> |
|
155 | </div> | |
154 | </div> |
|
156 | </div> | |
155 |
|
157 | |||
156 | <div id="help_section"> |
|
158 | <div id="help_section"> | |
157 | <h3 class="section_header">Help</h3> |
|
159 | <h3 class="section_header">Help</h3> | |
158 | <div class="section_content"> |
|
160 | <div class="section_content"> | |
159 | <div class="section_row"> |
|
161 | <div class="section_row"> | |
160 | <span id="help_buttons0" class="section_row_buttons"> |
|
162 | <span id="help_buttons0" class="section_row_buttons"> | |
161 | <a id="python_help" href="http://docs.python.org" target="_blank">Python</a> |
|
163 | <a id="python_help" href="http://docs.python.org" target="_blank">Python</a> | |
162 | <a id="ipython_help" href="http://ipython.org/documentation.html" target="_blank">IPython</a> |
|
164 | <a id="ipython_help" href="http://ipython.org/documentation.html" target="_blank">IPython</a> | |
163 | </span> |
|
165 | </span> | |
164 | <span class="section_row_header">Links</span> |
|
166 | <span class="section_row_header">Links</span> | |
165 | </div> |
|
167 | </div> | |
166 | <div class="section_row"> |
|
168 | <div class="section_row"> | |
167 | <span id="help_buttons1" class="section_row_buttons"> |
|
169 | <span id="help_buttons1" class="section_row_buttons"> | |
168 | <a id="numpy_help" href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a> |
|
170 | <a id="numpy_help" href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a> | |
169 | <a id="scipy_help" href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a> |
|
171 | <a id="scipy_help" href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a> | |
170 | </span> |
|
172 | </span> | |
171 | </div> |
|
173 | </div> | |
172 | <div class="section_row"> |
|
174 | <div class="section_row"> | |
173 | <span id="help_buttons2" class="section_row_buttons"> |
|
175 | <span id="help_buttons2" class="section_row_buttons"> | |
174 | <a id="matplotlib_help" href="http://matplotlib.sourceforge.net/" target="_blank">MPL</a> |
|
176 | <a id="matplotlib_help" href="http://matplotlib.sourceforge.net/" target="_blank">MPL</a> | |
175 | <a id="sympy_help" href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a> |
|
177 | <a id="sympy_help" href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a> | |
176 | </span> |
|
178 | </span> | |
177 | </div> |
|
179 | </div> | |
178 | <div class="section_row"> |
|
180 | <div class="section_row"> | |
179 | <span class="help_string">run selected cell</span> |
|
181 | <span class="help_string">run selected cell</span> | |
180 | <span class="help_string_label">Shift-Enter :</span> |
|
182 | <span class="help_string_label">Shift-Enter :</span> | |
181 | </div> |
|
183 | </div> | |
182 | <div class="section_row"> |
|
184 | <div class="section_row"> | |
183 | <span class="help_string">run in terminal mode</span> |
|
185 | <span class="help_string">run in terminal mode</span> | |
184 | <span class="help_string_label">Ctrl-Enter :</span> |
|
186 | <span class="help_string_label">Ctrl-Enter :</span> | |
185 | </div> |
|
187 | </div> | |
186 | <div class="section_row"> |
|
188 | <div class="section_row"> | |
187 | <span class="help_string">show keyboard shortcuts</span> |
|
189 | <span class="help_string">show keyboard shortcuts</span> | |
188 | <span class="help_string_label">Ctrl-m h :</span> |
|
190 | <span class="help_string_label">Ctrl-m h :</span> | |
189 | </div> |
|
191 | </div> | |
190 | </div> |
|
192 | </div> | |
191 | </div> |
|
193 | </div> | |
192 |
|
194 | |||
193 | </div> |
|
195 | </div> | |
194 | <div id="left_panel_splitter"></div> |
|
196 | <div id="left_panel_splitter"></div> | |
195 | <div id="notebook_panel"> |
|
197 | <div id="notebook_panel"> | |
196 | <div id="notebook"></div> |
|
198 | <div id="notebook"></div> | |
197 | <div id="pager_splitter"></div> |
|
199 | <div id="pager_splitter"></div> | |
198 | <div id="pager"></div> |
|
200 | <div id="pager"></div> | |
199 | </div> |
|
201 | </div> | |
200 |
|
202 | |||
201 | </div> |
|
203 | </div> | |
202 |
|
204 | |||
203 | <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script> |
|
205 | <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script> | |
204 | <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script> |
|
206 | <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script> | |
205 | <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script> |
|
207 | <script src="static/jquery/js/jquery.autogrow.js" type="text/javascript" charset="utf-8"></script> | |
206 |
|
208 | |||
207 | <script src="static/codemirror-2.12/lib/codemirror.js" charset="utf-8"></script> |
|
209 | <script src="static/codemirror-2.12/lib/codemirror.js" charset="utf-8"></script> | |
208 | <script src="static/codemirror-2.12/mode/python/python.js" charset="utf-8"></script> |
|
210 | <script src="static/codemirror-2.12/mode/python/python.js" charset="utf-8"></script> | |
209 | <script src="static/codemirror-2.12/mode/htmlmixed/htmlmixed.js" charset="utf-8"></script> |
|
211 | <script src="static/codemirror-2.12/mode/htmlmixed/htmlmixed.js" charset="utf-8"></script> | |
210 | <script src="static/codemirror-2.12/mode/xml/xml.js" charset="utf-8"></script> |
|
212 | <script src="static/codemirror-2.12/mode/xml/xml.js" charset="utf-8"></script> | |
211 | <script src="static/codemirror-2.12/mode/javascript/javascript.js" charset="utf-8"></script> |
|
213 | <script src="static/codemirror-2.12/mode/javascript/javascript.js" charset="utf-8"></script> | |
212 | <script src="static/codemirror-2.12/mode/css/css.js" charset="utf-8"></script> |
|
214 | <script src="static/codemirror-2.12/mode/css/css.js" charset="utf-8"></script> | |
213 | <script src="static/codemirror-2.12/mode/rst/rst.js" charset="utf-8"></script> |
|
215 | <script src="static/codemirror-2.12/mode/rst/rst.js" charset="utf-8"></script> | |
214 |
|
216 | |||
215 | <script src="static/pagedown/Markdown.Converter.js" charset="utf-8"></script> |
|
217 | <script src="static/pagedown/Markdown.Converter.js" charset="utf-8"></script> | |
216 |
|
218 | |||
|
219 | <script src="static/prettify/prettify.js" charset="utf-8"></script> | |||
|
220 | ||||
217 | <script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script> |
|
221 | <script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script> | |
218 | <script src="static/js/utils.js" type="text/javascript" charset="utf-8"></script> |
|
222 | <script src="static/js/utils.js" type="text/javascript" charset="utf-8"></script> | |
219 | <script src="static/js/cell.js" type="text/javascript" charset="utf-8"></script> |
|
223 | <script src="static/js/cell.js" type="text/javascript" charset="utf-8"></script> | |
220 | <script src="static/js/codecell.js" type="text/javascript" charset="utf-8"></script> |
|
224 | <script src="static/js/codecell.js" type="text/javascript" charset="utf-8"></script> | |
221 | <script src="static/js/textcell.js" type="text/javascript" charset="utf-8"></script> |
|
225 | <script src="static/js/textcell.js" type="text/javascript" charset="utf-8"></script> | |
222 | <script src="static/js/kernel.js" type="text/javascript" charset="utf-8"></script> |
|
226 | <script src="static/js/kernel.js" type="text/javascript" charset="utf-8"></script> | |
223 | <script src="static/js/kernelstatus.js" type="text/javascript" charset="utf-8"></script> |
|
227 | <script src="static/js/kernelstatus.js" type="text/javascript" charset="utf-8"></script> | |
224 | <script src="static/js/layout.js" type="text/javascript" charset="utf-8"></script> |
|
228 | <script src="static/js/layout.js" type="text/javascript" charset="utf-8"></script> | |
225 | <script src="static/js/savewidget.js" type="text/javascript" charset="utf-8"></script> |
|
229 | <script src="static/js/savewidget.js" type="text/javascript" charset="utf-8"></script> | |
226 | <script src="static/js/pager.js" type="text/javascript" charset="utf-8"></script> |
|
230 | <script src="static/js/pager.js" type="text/javascript" charset="utf-8"></script> | |
227 | <script src="static/js/panelsection.js" type="text/javascript" charset="utf-8"></script> |
|
231 | <script src="static/js/panelsection.js" type="text/javascript" charset="utf-8"></script> | |
228 | <script src="static/js/printwidget.js" type="text/javascript" charset="utf-8"></script> |
|
232 | <script src="static/js/printwidget.js" type="text/javascript" charset="utf-8"></script> | |
229 | <script src="static/js/leftpanel.js" type="text/javascript" charset="utf-8"></script> |
|
233 | <script src="static/js/leftpanel.js" type="text/javascript" charset="utf-8"></script> | |
230 | <script src="static/js/notebook.js" type="text/javascript" charset="utf-8"></script> |
|
234 | <script src="static/js/notebook.js" type="text/javascript" charset="utf-8"></script> | |
231 | <script src="static/js/notebook_main.js" type="text/javascript" charset="utf-8"></script> |
|
235 | <script src="static/js/notebook_main.js" type="text/javascript" charset="utf-8"></script> | |
232 |
|
236 | |||
233 |
|
237 | |||
234 | </body> |
|
238 | </body> | |
235 |
|
239 | |||
236 | </html> |
|
240 | </html> | |
237 |
|
241 | |||
238 |
|
242 |
General Comments 0
You need to be logged in to leave comments.
Login now