From: Alan Knowles Date: Fri, 7 Feb 2020 07:01:50 +0000 (+0800) Subject: roojs-core.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=901f69540cf7a8ff9a78df918291ddd34864ab7f roojs-core.js roojs-core-debug.js roojs-all.js roojs-debug.js --- diff --git a/roojs-all.js b/roojs-all.js index 5daa16218a..174e28d5d9 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -683,60 +683,60 @@ Roo.debug&&Roo.log(C);if(!E.hideProgress&&Roo.MessageBox){Roo.MessageBox.updateP // Roo/Markdown.js Roo.Markdown={};Roo.Markdown.toHtml=function(A){var c=new Roo.Markdown.marked.setOptions({renderer:new Roo.Markdown.marked.Renderer(),gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:true,smartypants:false});A=A.replace(/\\\n/g,' '); -return Roo.Markdown.marked(A);};(function(){var A={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/} -;A.bullet=/(?:[*+-]|\d+\.)/;A.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;A.item=replace(A.item,'gm')(/bull/g,A.bullet)();A.list=replace(A.list)(/bull/g,A.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+A.def.source+')')();A.blockquote=replace(A.blockquote)('def',A.def)(); -A._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';A.html=replace(A.html)('comment',//)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/])*?>/)(/tag/g,A._tag)(); -A.paragraph=replace(A.paragraph)('hr',A.hr)('heading',A.heading)('lheading',A.lheading)('blockquote',A.blockquote)('tag','<'+A._tag)('def',A.def)();A.normal=merge({},A);A.gfm=merge({},A.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/} -);A.gfm.paragraph=replace(A.paragraph)('(?!','(?!'+A.gfm.fences.source.replace('\\1','\\2')+'|'+A.list.source.replace('\\1','\\3')+'|')();A.tables=merge({},A.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/} -);var B=function(G){this.tokens=[];this.tokens.links={};this.options=G||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(G,H){var I=new B(H);return I.lex(G); -};B.prototype.lex=function(G){G=G.replace(/\r\n|\r/g,'\n').replace(/\t/g,' ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(G,true);};B.prototype.token=function(G,H,bq){var G=G.replace(/^ +$/gm,''),I,J,K,L,b,M,N,i,l;while(G){if(K=this.rules.newline.exec(G)){G=G.substring(K[0].length); -if(K[0].length>1){this.tokens.push({type:'space'});}}if(K=this.rules.code.exec(G)){G=G.substring(K[0].length);K=K[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?K.replace(/\n+$/,''):K});continue;}if(K=this.rules.fences.exec(G)){G=G.substring(K[0].length); -this.tokens.push({type:'code',lang:K[2],text:K[3]||''});continue;}if(K=this.rules.heading.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'heading',depth:K[1].length,text:K[2]});continue;}if(H&&(K=this.rules.nptable.exec(G))){G=G.substring(K[0].length); -M={type:'table',header:K[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:K[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:K[3].replace(/\n$/,'').split('\n')};for(i=0;i ?/gm,'');this.token(K,H,true); -this.tokens.push({type:'blockquote_end'});continue;}if(K=this.rules.list.exec(G)){G=G.substring(K[0].length);L=K[2];this.tokens.push({type:'list_start',ordered:L.length>1});K=K[0].match(this.rules.item);I=false;l=K.length;i=0;for(;i1&&b.length>1)){G=K.slice(i+1).join('\n')+G; -i=l-1;}}J=I||/\n\n(?!\s*$)/.test(M);if(i!==l-1){I=M.charAt(M.length-1)==='\n';if(!J){J=I;}}this.tokens.push({type:J?'loose_item_start':'list_item_start'});this.token(M,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'}); -continue;}if(K=this.rules.html.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(K[1]==='pre'||K[1]==='script'||K[1]==='style'),text:K[0]});continue;}if((!bq&&H)&&(K=this.rules.def.exec(G))){G=G.substring(K[0].length); -this.tokens.links[K[1].toLowerCase()]={href:K[2],title:K[3]};continue;}if(H&&(K=this.rules.table.exec(G))){G=G.substring(K[0].length);M={type:'table',header:K[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:K[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:K[3].replace(/(?: *\| *)?\n$/,'').split('\n')} -;for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;C.link=replace(C.link)('inside',C._inside)('href',C._href)();C.reflink=replace(C.reflink)('inside',C._inside)();C.normal=merge({},C);C.pedantic=merge({} -,C.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});C.gfm=merge({},C.normal,{escape:replace(C.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(C.text)(']|','~]|')('|','|https?://|')()} -);C.breaks=merge({},C.gfm,{br:replace(C.br)('{2,}','*')(),text:replace(C.gfm.text)('{2,}','*')()});var D=function(G,H){this.options=H||marked.defaults;this.links=G;this.rules=C.normal;this.renderer=this.options.renderer||new E;this.renderer.options=this.options; -if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks;}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}};D.rules=C;D.output=function(G,H,I){var J=new D(H,I); -return J.output(G);};D.prototype.output=function(G){var H='',I,J,K,L;while(G){if(L=this.rules.escape.exec(G)){G=G.substring(L[0].length);H+=L[1];continue;}if(L=this.rules.autolink.exec(G)){G=G.substring(L[0].length);if(L[2]==='@'){J=L[1].charAt(6)===':'?this.mangle(L[1].substring(7)):this.mangle(L[1]); -K=this.mangle('mailto:')+J;}else{J=escape(L[1]);K=J;}H+=this.renderer.link(K,null,J);continue;}if(!this.inLink&&(L=this.rules.url.exec(G))){G=G.substring(L[0].length);J=escape(L[1]);K=J;H+=this.renderer.link(K,null,J);continue;}if(L=this.rules.tag.exec(G)){if(!this.inLink&&/^/i.test(L[0])){this.inLink=false;}G=G.substring(L[0].length);H+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(L[0]):escape(L[0]):L[0];continue;}if(L=this.rules.link.exec(G)){G=G.substring(L[0].length);this.inLink=true; -H+=this.outputLink(L,{href:L[2],title:L[3]});this.inLink=false;continue;}if((L=this.rules.reflink.exec(G))||(L=this.rules.nolink.exec(G))){G=G.substring(L[0].length);I=(L[2]||L[1]).replace(/\s+/g,' ');I=this.links[I.toLowerCase()];if(!I||!I.href){H+=L[0].charAt(0); -G=L[0].substring(1)+G;continue;}this.inLink=true;H+=this.outputLink(L,I);this.inLink=false;continue;}if(L=this.rules.strong.exec(G)){G=G.substring(L[0].length);H+=this.renderer.strong(this.output(L[2]||L[1]));continue;}if(L=this.rules.em.exec(G)){G=G.substring(L[0].length); -H+=this.renderer.em(this.output(L[2]||L[1]));continue;}if(L=this.rules.code.exec(G)){G=G.substring(L[0].length);H+=this.renderer.codespan(escape(L[2],true));continue;}if(L=this.rules.br.exec(G)){G=G.substring(L[0].length);H+=this.renderer.br();continue;}if(L=this.rules.del.exec(G)){G=G.substring(L[0].length); -H+=this.renderer.del(this.output(L[1]));continue;}if(L=this.rules.text.exec(G)){G=G.substring(L[0].length);H+=this.renderer.text(escape(this.smartypants(L[0])));continue;}if(G){throw new Error('Infinite loop on byte: '+G.charCodeAt(0));}}return H;};D.prototype.outputLink=function(G,H){var I=escape(H.href),J=H.title?escape(H.title):null; -return G[0].charAt(0)!=='!'?this.renderer.link(I,J,this.output(G[1])):this.renderer.image(I,J,escape(G[1]));};D.prototype.smartypants=function(G){if(!this.options.smartypants){return G;}return G.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026'); -};D.prototype.mangle=function(G){if(!this.options.mangle){return G;}var H='',l=G.length,i=0,ch;for(;i0.5){ch='x'+ch.toString(16);}H+='&#'+ch+';';}return H;};var E=function(G){this.options=G||{};};E.prototype.code=function(G,H,I){if(this.options.highlight){var J=this.options.highlight(G,H); -if(J!=null&&J!==G){I=true;G=J;}}else{I=true;}if(!H){return '
'+(I?G:escape(G,true))+'\n
';}return '
'+(I?G:escape(G,true))+'\n
\n';};E.prototype.blockquote=function(G){return '
\n'+G+'
\n'; -};E.prototype.html=function(G){return G;};E.prototype.heading=function(G,H,I){return ''+G+'\n';};E.prototype.hr=function(){return this.options.xhtml?'
\n':'
\n'; -};E.prototype.list=function(G,H){var I=H?'ol':'ul';return '<'+I+'>\n'+G+'\n';};E.prototype.listitem=function(G){return '
  • '+G+'
  • \n';};E.prototype.paragraph=function(G){return '

    '+G+'

    \n';};E.prototype.table=function(G,H){return '\n'+'\n'+G+'\n'+'\n'+H+'\n'+'
    \n'; -};E.prototype.tablerow=function(G){return '\n'+G+'\n';};E.prototype.tablecell=function(G,H){var I=H.header?'th':'td';var J=H.align?'<'+I+' style="text-align:'+H.align+'">':'<'+I+'>';return J+G+'\n';};E.prototype.strong=function(G){return ''+G+''; -};E.prototype.em=function(G){return ''+G+'';};E.prototype.codespan=function(G){return ''+G+'';};E.prototype.br=function(){return this.options.xhtml?'
    ':'
    ';};E.prototype.del=function(G){return ''+G+'';};E.prototype.link=function(G,H,I){if(this.options.sanitize){try{var J=decodeURIComponent(unescape(G)).replace(/[^\w:]/g,'').toLowerCase(); -}catch(e){return '';}if(J.indexOf('javascript:')===0||J.indexOf('vbscript:')===0){return '';}}var K='
    ';return K;};E.prototype.image=function(G,H,I){var J=''+I+'':'>';return J;};E.prototype.text=function(G){return G;};var F=function(G){this.tokens=[];this.token=null;this.options=G||marked.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options; -};F.parse=function(G,H,I){var J=new F(H,I);return J.parse(G);};F.prototype.parse=function(G){this.inline=new D(G.links,this.options,this.renderer);this.tokens=G.reverse();var H='';while(this.next()){H+=this.tok();}return H;};F.prototype.next=function(){return this.token=this.tokens.pop(); -};F.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};F.prototype.parseText=function(){var G=this.token.text;while(this.peek().type==='text'){G+='\n'+this.next().text;}return this.inline.output(G);};F.prototype.tok=function(){switch(this.token.type){case 'space':{return ''; -}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var G='',H='',i,I,J,K,j; -J='';for(i=0;i/g,'>').replace(/"/g,'"').replace(/'/g,'''); -}function unescape(G){return G.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)); -}return '';});}function replace(G,H){G=G.source;H=H||'';return function I(J,K){if(!J){return new RegExp(G,H);}K=K.source||K;K=K.replace(/(^|[^\[])\^/g,'$1');G=G.replace(J,K);return I;};}function noop(){}noop.exec=noop;function merge(G){var i=1,H,I;for(;iAn error occured:

    '+escape(e.message+'',true)+'
    ';}throw e;}}marked.options=marked.setOptions=function(G){merge(marked.defaults,G);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new E,xhtml:false} +return Roo.Markdown.marked(A);};(function(){var A={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:J,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:J,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:J,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/} +;A.bullet=/(?:[*+-]|\d+\.)/;A.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;A.item=I(A.item,'gm')(/bull/g,A.bullet)();A.list=I(A.list)(/bull/g,A.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+A.def.source+')')();A.blockquote=I(A.blockquote)('def',A.def)(); +A._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';A.html=I(A.html)('comment',//)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/])*?>/)(/tag/g,A._tag)(); +A.paragraph=I(A.paragraph)('hr',A.hr)('heading',A.heading)('lheading',A.lheading)('blockquote',A.blockquote)('tag','<'+A._tag)('def',A.def)();A.normal=merge({},A);A.gfm=merge({},A.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/} +);A.gfm.paragraph=I(A.paragraph)('(?!','(?!'+A.gfm.fences.source.replace('\\1','\\2')+'|'+A.list.source.replace('\\1','\\3')+'|')();A.tables=merge({},A.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/} +);var B=function(K){this.tokens=[];this.tokens.links={};this.options=K||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(K,L){var M=new B(L);return M.lex(K); +};B.prototype.lex=function(K){K=K.replace(/\r\n|\r/g,'\n').replace(/\t/g,' ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(K,true);};B.prototype.token=function(K,L,bq){var K=K.replace(/^ +$/gm,''),M,N,O,P,b,Q,R,i,l;while(K){if(O=this.rules.newline.exec(K)){K=K.substring(O[0].length); +if(O[0].length>1){this.tokens.push({type:'space'});}}if(O=this.rules.code.exec(K)){K=K.substring(O[0].length);O=O[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?O.replace(/\n+$/,''):O});continue;}if(O=this.rules.fences.exec(K)){K=K.substring(O[0].length); +this.tokens.push({type:'code',lang:O[2],text:O[3]||''});continue;}if(O=this.rules.heading.exec(K)){K=K.substring(O[0].length);this.tokens.push({type:'heading',depth:O[1].length,text:O[2]});continue;}if(L&&(O=this.rules.nptable.exec(K))){K=K.substring(O[0].length); +Q={type:'table',header:O[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:O[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:O[3].replace(/\n$/,'').split('\n')};for(i=0;i ?/gm,'');this.token(O,L,true); +this.tokens.push({type:'blockquote_end'});continue;}if(O=this.rules.list.exec(K)){K=K.substring(O[0].length);P=O[2];this.tokens.push({type:'list_start',ordered:P.length>1});O=O[0].match(this.rules.item);M=false;l=O.length;i=0;for(;i1&&b.length>1)){K=O.slice(i+1).join('\n')+K; +i=l-1;}}N=M||/\n\n(?!\s*$)/.test(Q);if(i!==l-1){M=Q.charAt(Q.length-1)==='\n';if(!N){N=M;}}this.tokens.push({type:N?'loose_item_start':'list_item_start'});this.token(Q,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'}); +continue;}if(O=this.rules.html.exec(K)){K=K.substring(O[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(O[1]==='pre'||O[1]==='script'||O[1]==='style'),text:O[0]});continue;}if((!bq&&L)&&(O=this.rules.def.exec(K))){K=K.substring(O[0].length); +this.tokens.links[O[1].toLowerCase()]={href:O[2],title:O[3]};continue;}if(L&&(O=this.rules.table.exec(K))){K=K.substring(O[0].length);Q={type:'table',header:O[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:O[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:O[3].replace(/(?: *\| *)?\n$/,'').split('\n')} +;for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:J,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:J,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;C.link=I(C.link)('inside',C._inside)('href',C._href)();C.reflink=I(C.reflink)('inside',C._inside)();C.normal=merge({},C);C.pedantic=merge({},C.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/} +);C.gfm=merge({},C.normal,{escape:I(C.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:I(C.text)(']|','~]|')('|','|https?://|')()});C.breaks=merge({},C.gfm,{br:I(C.br)('{2,}','*')(),text:I(C.gfm.text)('{2,}','*')()} +);var D=function(K,L){this.options=L||marked.defaults;this.links=K;this.rules=C.normal;this.renderer=this.options.renderer||new E;this.renderer.options=this.options;if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks; +}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}};D.rules=C;D.output=function(K,L,M){var N=new D(L,M);return N.output(K);};D.prototype.output=function(K){var L='',M,N,O,P;while(K){if(P=this.rules.escape.exec(K)){K=K.substring(P[0].length); +L+=P[1];continue;}if(P=this.rules.autolink.exec(K)){K=K.substring(P[0].length);if(P[2]==='@'){N=P[1].charAt(6)===':'?this.mangle(P[1].substring(7)):this.mangle(P[1]);O=this.mangle('mailto:')+N;}else{N=G(P[1]);O=N;}L+=this.renderer.link(O,null,N);continue; +}if(!this.inLink&&(P=this.rules.url.exec(K))){K=K.substring(P[0].length);N=G(P[1]);O=N;L+=this.renderer.link(O,null,N);continue;}if(P=this.rules.tag.exec(K)){if(!this.inLink&&/^
    /i.test(P[0])){this.inLink=false; +}K=K.substring(P[0].length);L+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(P[0]):G(P[0]):P[0];continue;}if(P=this.rules.link.exec(K)){K=K.substring(P[0].length);this.inLink=true;L+=this.outputLink(P,{href:P[2],title:P[3]});this.inLink=false; +continue;}if((P=this.rules.reflink.exec(K))||(P=this.rules.nolink.exec(K))){K=K.substring(P[0].length);M=(P[2]||P[1]).replace(/\s+/g,' ');M=this.links[M.toLowerCase()];if(!M||!M.href){L+=P[0].charAt(0);K=P[0].substring(1)+K;continue;}this.inLink=true;L+=this.outputLink(P,M); +this.inLink=false;continue;}if(P=this.rules.strong.exec(K)){K=K.substring(P[0].length);L+=this.renderer.strong(this.output(P[2]||P[1]));continue;}if(P=this.rules.em.exec(K)){K=K.substring(P[0].length);L+=this.renderer.em(this.output(P[2]||P[1]));continue; +}if(P=this.rules.code.exec(K)){K=K.substring(P[0].length);L+=this.renderer.codespan(G(P[2],true));continue;}if(P=this.rules.br.exec(K)){K=K.substring(P[0].length);L+=this.renderer.br();continue;}if(P=this.rules.del.exec(K)){K=K.substring(P[0].length);L+=this.renderer.del(this.output(P[1])); +continue;}if(P=this.rules.text.exec(K)){K=K.substring(P[0].length);L+=this.renderer.text(G(this.smartypants(P[0])));continue;}if(K){throw new Error('Infinite loop on byte: '+K.charCodeAt(0));}}return L;};D.prototype.outputLink=function(K,L){var M=G(L.href),N=L.title?G(L.title):null; +return K[0].charAt(0)!=='!'?this.renderer.link(M,N,this.output(K[1])):this.renderer.image(M,N,G(K[1]));};D.prototype.smartypants=function(K){if(!this.options.smartypants){return K;}return K.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026'); +};D.prototype.mangle=function(K){if(!this.options.mangle){return K;}var L='',l=K.length,i=0,ch;for(;i0.5){ch='x'+ch.toString(16);}L+='&#'+ch+';';}return L;};var E=function(K){this.options=K||{};};E.prototype.code=function(K,L,M){if(this.options.highlight){var N=this.options.highlight(K,L); +if(N!=null&&N!==K){M=true;K=N;}}else{M=true;}if(!L){return '
    '+(M?K:G(K,true))+'\n
    ';}return '
    '+(M?K:G(K,true))+'\n
    \n';};E.prototype.blockquote=function(K){return '
    \n'+K+'
    \n'; +};E.prototype.html=function(K){return K;};E.prototype.heading=function(K,L,M){return ''+K+'\n';};E.prototype.hr=function(){return this.options.xhtml?'
    \n':'
    \n'; +};E.prototype.list=function(K,L){var M=L?'ol':'ul';return '<'+M+'>\n'+K+'\n';};E.prototype.listitem=function(K){return '
  • '+K+'
  • \n';};E.prototype.paragraph=function(K){return '

    '+K+'

    \n';};E.prototype.table=function(K,L){return '\n'+'\n'+K+'\n'+'\n'+L+'\n'+'
    \n'; +};E.prototype.tablerow=function(K){return '\n'+K+'\n';};E.prototype.tablecell=function(K,L){var M=L.header?'th':'td';var N=L.align?'<'+M+' style="text-align:'+L.align+'">':'<'+M+'>';return N+K+'\n';};E.prototype.strong=function(K){return ''+K+''; +};E.prototype.em=function(K){return ''+K+'';};E.prototype.codespan=function(K){return ''+K+'';};E.prototype.br=function(){return this.options.xhtml?'
    ':'
    ';};E.prototype.del=function(K){return ''+K+'';};E.prototype.link=function(K,L,M){if(this.options.sanitize){try{var N=decodeURIComponent(H(K)).replace(/[^\w:]/g,'').toLowerCase(); +}catch(e){return '';}if(N.indexOf('javascript:')===0||N.indexOf('vbscript:')===0){return '';}}var O='
    ';return O;};E.prototype.image=function(K,L,M){var N=''+M+'':'>';return N;};E.prototype.text=function(K){return K;};var F=function(K){this.tokens=[];this.token=null;this.options=K||marked.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options; +};F.parse=function(K,L,M){var N=new F(L,M);return N.parse(K);};F.prototype.parse=function(K){this.inline=new D(K.links,this.options,this.renderer);this.tokens=K.reverse();var L='';while(this.next()){L+=this.tok();}return L;};F.prototype.next=function(){return this.token=this.tokens.pop(); +};F.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};F.prototype.parseText=function(){var K=this.token.text;while(this.peek().type==='text'){K+='\n'+this.next().text;}return this.inline.output(K);};F.prototype.tok=function(){switch(this.token.type){case 'space':{return ''; +}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var K='',L='',i,M,N,O,j; +N='';for(i=0;i/g,'>').replace(/"/g,'"').replace(/'/g,'''); +};function H(K){return K.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)); +}return '';});}function I(K,L){K=K.source;L=L||'';return function M(N,O){if(!N){return new RegExp(K,L);}O=O.source||O;O=O.replace(/(^|[^\[])\^/g,'$1');K=K.replace(N,O);return M;};}function J(){}J.exec=J;function merge(K){var i=1,L,M;for(;iAn error occured:

    '+G(e.message+'',true)+'
    ';}throw e;}}marked.options=marked.setOptions=function(K){merge(marked.defaults,K);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new E,xhtml:false} ;marked.Parser=F;marked.parser=F.parse;marked.Renderer=E;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})(); // Roo/dd/DragDrop.js (function(){var A=Roo.EventManager;var B=Roo.lib.Dom;Roo.dd.DragDrop=function(id,C,D){if(id){this.init(id,C,D);}};Roo.extend(Roo.dd.DragDrop,Roo.util.Observable,{id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true; diff --git a/roojs-core-debug.js b/roojs-core-debug.js index 5fe012b525..7f131fb8e3 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -17886,7 +17886,7 @@ Roo.Markdown.toHtml = function(text) { * Helpers */ - function escape(html, encode) { + var escape = function (html, encode) { return html .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') .replace(/[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/} -;A.bullet=/(?:[*+-]|\d+\.)/;A.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;A.item=replace(A.item,'gm')(/bull/g,A.bullet)();A.list=replace(A.list)(/bull/g,A.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+A.def.source+')')();A.blockquote=replace(A.blockquote)('def',A.def)(); -A._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';A.html=replace(A.html)('comment',//)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/])*?>/)(/tag/g,A._tag)(); -A.paragraph=replace(A.paragraph)('hr',A.hr)('heading',A.heading)('lheading',A.lheading)('blockquote',A.blockquote)('tag','<'+A._tag)('def',A.def)();A.normal=merge({},A);A.gfm=merge({},A.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/} -);A.gfm.paragraph=replace(A.paragraph)('(?!','(?!'+A.gfm.fences.source.replace('\\1','\\2')+'|'+A.list.source.replace('\\1','\\3')+'|')();A.tables=merge({},A.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/} -);var B=function(G){this.tokens=[];this.tokens.links={};this.options=G||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(G,H){var I=new B(H);return I.lex(G); -};B.prototype.lex=function(G){G=G.replace(/\r\n|\r/g,'\n').replace(/\t/g,' ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(G,true);};B.prototype.token=function(G,H,bq){var G=G.replace(/^ +$/gm,''),I,J,K,L,b,M,N,i,l;while(G){if(K=this.rules.newline.exec(G)){G=G.substring(K[0].length); -if(K[0].length>1){this.tokens.push({type:'space'});}}if(K=this.rules.code.exec(G)){G=G.substring(K[0].length);K=K[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?K.replace(/\n+$/,''):K});continue;}if(K=this.rules.fences.exec(G)){G=G.substring(K[0].length); -this.tokens.push({type:'code',lang:K[2],text:K[3]||''});continue;}if(K=this.rules.heading.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'heading',depth:K[1].length,text:K[2]});continue;}if(H&&(K=this.rules.nptable.exec(G))){G=G.substring(K[0].length); -M={type:'table',header:K[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:K[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:K[3].replace(/\n$/,'').split('\n')};for(i=0;i ?/gm,'');this.token(K,H,true); -this.tokens.push({type:'blockquote_end'});continue;}if(K=this.rules.list.exec(G)){G=G.substring(K[0].length);L=K[2];this.tokens.push({type:'list_start',ordered:L.length>1});K=K[0].match(this.rules.item);I=false;l=K.length;i=0;for(;i1&&b.length>1)){G=K.slice(i+1).join('\n')+G; -i=l-1;}}J=I||/\n\n(?!\s*$)/.test(M);if(i!==l-1){I=M.charAt(M.length-1)==='\n';if(!J){J=I;}}this.tokens.push({type:J?'loose_item_start':'list_item_start'});this.token(M,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'}); -continue;}if(K=this.rules.html.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(K[1]==='pre'||K[1]==='script'||K[1]==='style'),text:K[0]});continue;}if((!bq&&H)&&(K=this.rules.def.exec(G))){G=G.substring(K[0].length); -this.tokens.links[K[1].toLowerCase()]={href:K[2],title:K[3]};continue;}if(H&&(K=this.rules.table.exec(G))){G=G.substring(K[0].length);M={type:'table',header:K[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:K[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:K[3].replace(/(?: *\| *)?\n$/,'').split('\n')} -;for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;C.link=replace(C.link)('inside',C._inside)('href',C._href)();C.reflink=replace(C.reflink)('inside',C._inside)();C.normal=merge({},C);C.pedantic=merge({} -,C.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});C.gfm=merge({},C.normal,{escape:replace(C.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(C.text)(']|','~]|')('|','|https?://|')()} -);C.breaks=merge({},C.gfm,{br:replace(C.br)('{2,}','*')(),text:replace(C.gfm.text)('{2,}','*')()});var D=function(G,H){this.options=H||marked.defaults;this.links=G;this.rules=C.normal;this.renderer=this.options.renderer||new E;this.renderer.options=this.options; -if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks;}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}};D.rules=C;D.output=function(G,H,I){var J=new D(H,I); -return J.output(G);};D.prototype.output=function(G){var H='',I,J,K,L;while(G){if(L=this.rules.escape.exec(G)){G=G.substring(L[0].length);H+=L[1];continue;}if(L=this.rules.autolink.exec(G)){G=G.substring(L[0].length);if(L[2]==='@'){J=L[1].charAt(6)===':'?this.mangle(L[1].substring(7)):this.mangle(L[1]); -K=this.mangle('mailto:')+J;}else{J=escape(L[1]);K=J;}H+=this.renderer.link(K,null,J);continue;}if(!this.inLink&&(L=this.rules.url.exec(G))){G=G.substring(L[0].length);J=escape(L[1]);K=J;H+=this.renderer.link(K,null,J);continue;}if(L=this.rules.tag.exec(G)){if(!this.inLink&&/^
    /i.test(L[0])){this.inLink=false;}G=G.substring(L[0].length);H+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(L[0]):escape(L[0]):L[0];continue;}if(L=this.rules.link.exec(G)){G=G.substring(L[0].length);this.inLink=true; -H+=this.outputLink(L,{href:L[2],title:L[3]});this.inLink=false;continue;}if((L=this.rules.reflink.exec(G))||(L=this.rules.nolink.exec(G))){G=G.substring(L[0].length);I=(L[2]||L[1]).replace(/\s+/g,' ');I=this.links[I.toLowerCase()];if(!I||!I.href){H+=L[0].charAt(0); -G=L[0].substring(1)+G;continue;}this.inLink=true;H+=this.outputLink(L,I);this.inLink=false;continue;}if(L=this.rules.strong.exec(G)){G=G.substring(L[0].length);H+=this.renderer.strong(this.output(L[2]||L[1]));continue;}if(L=this.rules.em.exec(G)){G=G.substring(L[0].length); -H+=this.renderer.em(this.output(L[2]||L[1]));continue;}if(L=this.rules.code.exec(G)){G=G.substring(L[0].length);H+=this.renderer.codespan(escape(L[2],true));continue;}if(L=this.rules.br.exec(G)){G=G.substring(L[0].length);H+=this.renderer.br();continue;}if(L=this.rules.del.exec(G)){G=G.substring(L[0].length); -H+=this.renderer.del(this.output(L[1]));continue;}if(L=this.rules.text.exec(G)){G=G.substring(L[0].length);H+=this.renderer.text(escape(this.smartypants(L[0])));continue;}if(G){throw new Error('Infinite loop on byte: '+G.charCodeAt(0));}}return H;};D.prototype.outputLink=function(G,H){var I=escape(H.href),J=H.title?escape(H.title):null; -return G[0].charAt(0)!=='!'?this.renderer.link(I,J,this.output(G[1])):this.renderer.image(I,J,escape(G[1]));};D.prototype.smartypants=function(G){if(!this.options.smartypants){return G;}return G.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026'); -};D.prototype.mangle=function(G){if(!this.options.mangle){return G;}var H='',l=G.length,i=0,ch;for(;i0.5){ch='x'+ch.toString(16);}H+='&#'+ch+';';}return H;};var E=function(G){this.options=G||{};};E.prototype.code=function(G,H,I){if(this.options.highlight){var J=this.options.highlight(G,H); -if(J!=null&&J!==G){I=true;G=J;}}else{I=true;}if(!H){return '
    '+(I?G:escape(G,true))+'\n
    ';}return '
    '+(I?G:escape(G,true))+'\n
    \n';};E.prototype.blockquote=function(G){return '
    \n'+G+'
    \n'; -};E.prototype.html=function(G){return G;};E.prototype.heading=function(G,H,I){return ''+G+'\n';};E.prototype.hr=function(){return this.options.xhtml?'
    \n':'
    \n'; -};E.prototype.list=function(G,H){var I=H?'ol':'ul';return '<'+I+'>\n'+G+'\n';};E.prototype.listitem=function(G){return '
  • '+G+'
  • \n';};E.prototype.paragraph=function(G){return '

    '+G+'

    \n';};E.prototype.table=function(G,H){return '\n'+'\n'+G+'\n'+'\n'+H+'\n'+'
    \n'; -};E.prototype.tablerow=function(G){return '\n'+G+'\n';};E.prototype.tablecell=function(G,H){var I=H.header?'th':'td';var J=H.align?'<'+I+' style="text-align:'+H.align+'">':'<'+I+'>';return J+G+'\n';};E.prototype.strong=function(G){return ''+G+''; -};E.prototype.em=function(G){return ''+G+'';};E.prototype.codespan=function(G){return ''+G+'';};E.prototype.br=function(){return this.options.xhtml?'
    ':'
    ';};E.prototype.del=function(G){return ''+G+'';};E.prototype.link=function(G,H,I){if(this.options.sanitize){try{var J=decodeURIComponent(unescape(G)).replace(/[^\w:]/g,'').toLowerCase(); -}catch(e){return '';}if(J.indexOf('javascript:')===0||J.indexOf('vbscript:')===0){return '';}}var K='
    ';return K;};E.prototype.image=function(G,H,I){var J=''+I+'':'>';return J;};E.prototype.text=function(G){return G;};var F=function(G){this.tokens=[];this.token=null;this.options=G||marked.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options; -};F.parse=function(G,H,I){var J=new F(H,I);return J.parse(G);};F.prototype.parse=function(G){this.inline=new D(G.links,this.options,this.renderer);this.tokens=G.reverse();var H='';while(this.next()){H+=this.tok();}return H;};F.prototype.next=function(){return this.token=this.tokens.pop(); -};F.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};F.prototype.parseText=function(){var G=this.token.text;while(this.peek().type==='text'){G+='\n'+this.next().text;}return this.inline.output(G);};F.prototype.tok=function(){switch(this.token.type){case 'space':{return ''; -}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var G='',H='',i,I,J,K,j; -J='';for(i=0;i/g,'>').replace(/"/g,'"').replace(/'/g,'''); -}function unescape(G){return G.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)); -}return '';});}function replace(G,H){G=G.source;H=H||'';return function I(J,K){if(!J){return new RegExp(G,H);}K=K.source||K;K=K.replace(/(^|[^\[])\^/g,'$1');G=G.replace(J,K);return I;};}function noop(){}noop.exec=noop;function merge(G){var i=1,H,I;for(;iAn error occured:

    '+escape(e.message+'',true)+'
    ';}throw e;}}marked.options=marked.setOptions=function(G){merge(marked.defaults,G);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new E,xhtml:false} +return Roo.Markdown.marked(A);};(function(){var A={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:J,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:J,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:J,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/} +;A.bullet=/(?:[*+-]|\d+\.)/;A.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;A.item=I(A.item,'gm')(/bull/g,A.bullet)();A.list=I(A.list)(/bull/g,A.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+A.def.source+')')();A.blockquote=I(A.blockquote)('def',A.def)(); +A._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';A.html=I(A.html)('comment',//)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/])*?>/)(/tag/g,A._tag)(); +A.paragraph=I(A.paragraph)('hr',A.hr)('heading',A.heading)('lheading',A.lheading)('blockquote',A.blockquote)('tag','<'+A._tag)('def',A.def)();A.normal=merge({},A);A.gfm=merge({},A.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/} +);A.gfm.paragraph=I(A.paragraph)('(?!','(?!'+A.gfm.fences.source.replace('\\1','\\2')+'|'+A.list.source.replace('\\1','\\3')+'|')();A.tables=merge({},A.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/} +);var B=function(K){this.tokens=[];this.tokens.links={};this.options=K||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(K,L){var M=new B(L);return M.lex(K); +};B.prototype.lex=function(K){K=K.replace(/\r\n|\r/g,'\n').replace(/\t/g,' ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(K,true);};B.prototype.token=function(K,L,bq){var K=K.replace(/^ +$/gm,''),M,N,O,P,b,Q,R,i,l;while(K){if(O=this.rules.newline.exec(K)){K=K.substring(O[0].length); +if(O[0].length>1){this.tokens.push({type:'space'});}}if(O=this.rules.code.exec(K)){K=K.substring(O[0].length);O=O[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?O.replace(/\n+$/,''):O});continue;}if(O=this.rules.fences.exec(K)){K=K.substring(O[0].length); +this.tokens.push({type:'code',lang:O[2],text:O[3]||''});continue;}if(O=this.rules.heading.exec(K)){K=K.substring(O[0].length);this.tokens.push({type:'heading',depth:O[1].length,text:O[2]});continue;}if(L&&(O=this.rules.nptable.exec(K))){K=K.substring(O[0].length); +Q={type:'table',header:O[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:O[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:O[3].replace(/\n$/,'').split('\n')};for(i=0;i ?/gm,'');this.token(O,L,true); +this.tokens.push({type:'blockquote_end'});continue;}if(O=this.rules.list.exec(K)){K=K.substring(O[0].length);P=O[2];this.tokens.push({type:'list_start',ordered:P.length>1});O=O[0].match(this.rules.item);M=false;l=O.length;i=0;for(;i1&&b.length>1)){K=O.slice(i+1).join('\n')+K; +i=l-1;}}N=M||/\n\n(?!\s*$)/.test(Q);if(i!==l-1){M=Q.charAt(Q.length-1)==='\n';if(!N){N=M;}}this.tokens.push({type:N?'loose_item_start':'list_item_start'});this.token(Q,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'}); +continue;}if(O=this.rules.html.exec(K)){K=K.substring(O[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(O[1]==='pre'||O[1]==='script'||O[1]==='style'),text:O[0]});continue;}if((!bq&&L)&&(O=this.rules.def.exec(K))){K=K.substring(O[0].length); +this.tokens.links[O[1].toLowerCase()]={href:O[2],title:O[3]};continue;}if(L&&(O=this.rules.table.exec(K))){K=K.substring(O[0].length);Q={type:'table',header:O[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:O[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:O[3].replace(/(?: *\| *)?\n$/,'').split('\n')} +;for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:J,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:J,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;C.link=I(C.link)('inside',C._inside)('href',C._href)();C.reflink=I(C.reflink)('inside',C._inside)();C.normal=merge({},C);C.pedantic=merge({},C.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/} +);C.gfm=merge({},C.normal,{escape:I(C.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:I(C.text)(']|','~]|')('|','|https?://|')()});C.breaks=merge({},C.gfm,{br:I(C.br)('{2,}','*')(),text:I(C.gfm.text)('{2,}','*')()} +);var D=function(K,L){this.options=L||marked.defaults;this.links=K;this.rules=C.normal;this.renderer=this.options.renderer||new E;this.renderer.options=this.options;if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks; +}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}};D.rules=C;D.output=function(K,L,M){var N=new D(L,M);return N.output(K);};D.prototype.output=function(K){var L='',M,N,O,P;while(K){if(P=this.rules.escape.exec(K)){K=K.substring(P[0].length); +L+=P[1];continue;}if(P=this.rules.autolink.exec(K)){K=K.substring(P[0].length);if(P[2]==='@'){N=P[1].charAt(6)===':'?this.mangle(P[1].substring(7)):this.mangle(P[1]);O=this.mangle('mailto:')+N;}else{N=G(P[1]);O=N;}L+=this.renderer.link(O,null,N);continue; +}if(!this.inLink&&(P=this.rules.url.exec(K))){K=K.substring(P[0].length);N=G(P[1]);O=N;L+=this.renderer.link(O,null,N);continue;}if(P=this.rules.tag.exec(K)){if(!this.inLink&&/^
    /i.test(P[0])){this.inLink=false; +}K=K.substring(P[0].length);L+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(P[0]):G(P[0]):P[0];continue;}if(P=this.rules.link.exec(K)){K=K.substring(P[0].length);this.inLink=true;L+=this.outputLink(P,{href:P[2],title:P[3]});this.inLink=false; +continue;}if((P=this.rules.reflink.exec(K))||(P=this.rules.nolink.exec(K))){K=K.substring(P[0].length);M=(P[2]||P[1]).replace(/\s+/g,' ');M=this.links[M.toLowerCase()];if(!M||!M.href){L+=P[0].charAt(0);K=P[0].substring(1)+K;continue;}this.inLink=true;L+=this.outputLink(P,M); +this.inLink=false;continue;}if(P=this.rules.strong.exec(K)){K=K.substring(P[0].length);L+=this.renderer.strong(this.output(P[2]||P[1]));continue;}if(P=this.rules.em.exec(K)){K=K.substring(P[0].length);L+=this.renderer.em(this.output(P[2]||P[1]));continue; +}if(P=this.rules.code.exec(K)){K=K.substring(P[0].length);L+=this.renderer.codespan(G(P[2],true));continue;}if(P=this.rules.br.exec(K)){K=K.substring(P[0].length);L+=this.renderer.br();continue;}if(P=this.rules.del.exec(K)){K=K.substring(P[0].length);L+=this.renderer.del(this.output(P[1])); +continue;}if(P=this.rules.text.exec(K)){K=K.substring(P[0].length);L+=this.renderer.text(G(this.smartypants(P[0])));continue;}if(K){throw new Error('Infinite loop on byte: '+K.charCodeAt(0));}}return L;};D.prototype.outputLink=function(K,L){var M=G(L.href),N=L.title?G(L.title):null; +return K[0].charAt(0)!=='!'?this.renderer.link(M,N,this.output(K[1])):this.renderer.image(M,N,G(K[1]));};D.prototype.smartypants=function(K){if(!this.options.smartypants){return K;}return K.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026'); +};D.prototype.mangle=function(K){if(!this.options.mangle){return K;}var L='',l=K.length,i=0,ch;for(;i0.5){ch='x'+ch.toString(16);}L+='&#'+ch+';';}return L;};var E=function(K){this.options=K||{};};E.prototype.code=function(K,L,M){if(this.options.highlight){var N=this.options.highlight(K,L); +if(N!=null&&N!==K){M=true;K=N;}}else{M=true;}if(!L){return '
    '+(M?K:G(K,true))+'\n
    ';}return '
    '+(M?K:G(K,true))+'\n
    \n';};E.prototype.blockquote=function(K){return '
    \n'+K+'
    \n'; +};E.prototype.html=function(K){return K;};E.prototype.heading=function(K,L,M){return ''+K+'\n';};E.prototype.hr=function(){return this.options.xhtml?'
    \n':'
    \n'; +};E.prototype.list=function(K,L){var M=L?'ol':'ul';return '<'+M+'>\n'+K+'\n';};E.prototype.listitem=function(K){return '
  • '+K+'
  • \n';};E.prototype.paragraph=function(K){return '

    '+K+'

    \n';};E.prototype.table=function(K,L){return '\n'+'\n'+K+'\n'+'\n'+L+'\n'+'
    \n'; +};E.prototype.tablerow=function(K){return '\n'+K+'\n';};E.prototype.tablecell=function(K,L){var M=L.header?'th':'td';var N=L.align?'<'+M+' style="text-align:'+L.align+'">':'<'+M+'>';return N+K+'\n';};E.prototype.strong=function(K){return ''+K+''; +};E.prototype.em=function(K){return ''+K+'';};E.prototype.codespan=function(K){return ''+K+'';};E.prototype.br=function(){return this.options.xhtml?'
    ':'
    ';};E.prototype.del=function(K){return ''+K+'';};E.prototype.link=function(K,L,M){if(this.options.sanitize){try{var N=decodeURIComponent(H(K)).replace(/[^\w:]/g,'').toLowerCase(); +}catch(e){return '';}if(N.indexOf('javascript:')===0||N.indexOf('vbscript:')===0){return '';}}var O='
    ';return O;};E.prototype.image=function(K,L,M){var N=''+M+'':'>';return N;};E.prototype.text=function(K){return K;};var F=function(K){this.tokens=[];this.token=null;this.options=K||marked.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options; +};F.parse=function(K,L,M){var N=new F(L,M);return N.parse(K);};F.prototype.parse=function(K){this.inline=new D(K.links,this.options,this.renderer);this.tokens=K.reverse();var L='';while(this.next()){L+=this.tok();}return L;};F.prototype.next=function(){return this.token=this.tokens.pop(); +};F.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};F.prototype.parseText=function(){var K=this.token.text;while(this.peek().type==='text'){K+='\n'+this.next().text;}return this.inline.output(K);};F.prototype.tok=function(){switch(this.token.type){case 'space':{return ''; +}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var K='',L='',i,M,N,O,j; +N='';for(i=0;i/g,'>').replace(/"/g,'"').replace(/'/g,'''); +};function H(K){return K.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)); +}return '';});}function I(K,L){K=K.source;L=L||'';return function M(N,O){if(!N){return new RegExp(K,L);}O=O.source||O;O=O.replace(/(^|[^\[])\^/g,'$1');K=K.replace(N,O);return M;};}function J(){}J.exec=J;function merge(K){var i=1,L,M;for(;iAn error occured:

    '+G(e.message+'',true)+'
    ';}throw e;}}marked.options=marked.setOptions=function(K){merge(marked.defaults,K);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new E,xhtml:false} ;marked.Parser=F;marked.parser=F.parse;marked.Renderer=E;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})(); // Roo/dd/DragDrop.js (function(){var A=Roo.EventManager;var B=Roo.lib.Dom;Roo.dd.DragDrop=function(id,C,D){if(id){this.init(id,C,D);}};Roo.extend(Roo.dd.DragDrop,Roo.util.Observable,{id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true; diff --git a/roojs-debug.js b/roojs-debug.js index 4bd6823ab6..f152960d69 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -17886,7 +17886,7 @@ Roo.Markdown.toHtml = function(text) { * Helpers */ - function escape(html, encode) { + var escape = function (html, encode) { return html .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') .replace(/