From 0329dbc66481065f0729b43bb53af4292448104d Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 9 Sep 2016 14:45:33 +0800 Subject: [PATCH] roojs-doc.js roojs-doc-debug.js --- roojs-doc-debug.js | 5 ++++- roojs-doc.js | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/roojs-doc-debug.js b/roojs-doc-debug.js index ec7f748568..684e519471 100644 --- a/roojs-doc-debug.js +++ b/roojs-doc-debug.js @@ -127,6 +127,9 @@ Roo.extend(Roo.doc.Example, Roo.bootstrap.Component, { // no colour highlighting in here.... + var code = hljs ? hljs.highlight(this.code, this.lang) : String.format('{0}',this.code).replace(/\n/g, '
'); + + var cfg ={ cls : 'panel panel-info', cn : [ @@ -140,7 +143,7 @@ Roo.extend(Roo.doc.Example, Roo.bootstrap.Component, { { tag: 'pre', cls : 'lang-' + this.lang, - html : String.format('{0}',this.code).replace(/\n/g, '
') + html : code } ] } diff --git a/roojs-doc.js b/roojs-doc.js index da72697385..05e4ddf528 100644 --- a/roojs-doc.js +++ b/roojs-doc.js @@ -3,9 +3,9 @@ Roo.doc=Roo.doc||{};Roo.doc.Entry=function(A){Roo.doc.Entry.superclass.construct ,{cls:'refnamediv',html:this.purpose}]};return A;},addxtype:function(A,B){return this.addxtypeChild(A,B);},onRender:function(ct,A){Roo.doc.Entry._calls++;if(Roo.doc.Entry._calls>1||!ct){return;}Roo.bootstrap.Component.prototype.onRender.call(this,ct,A);}} ); // Roo/doc/Example.js -Roo.doc.Example=function(A){Roo.doc.Example.superclass.constructor.call(this,A);};Roo.extend(Roo.doc.Example,Roo.bootstrap.Component,{title:'',lang:'php',code:'',output:'',getAutoCreate:function(){var A={cls:'panel panel-info',cn:[{cls:'panel-heading',html:this.title} -,{cls:'panel-body',cn:[{tag:'pre',cls:'lang-'+this.lang,html:String.format('{0}',this.code).replace(/\n/g,'
')}]}]};if(this.output){A.cn.push({cls:'panel-footer',cn:{tag:'code',html:String.format('{0}',this.output).replace(/\n/g,'
')}});}return A; -}}); +Roo.doc.Example=function(A){Roo.doc.Example.superclass.constructor.call(this,A);};Roo.extend(Roo.doc.Example,Roo.bootstrap.Component,{title:'',lang:'php',code:'',output:'',getAutoCreate:function(){var A=hljs?hljs.highlight(this.code,this.lang):String.format('{0}',this.code).replace(/\n/g,'
'); +var B={cls:'panel panel-info',cn:[{cls:'panel-heading',html:this.title},{cls:'panel-body',cn:[{tag:'pre',cls:'lang-'+this.lang,html:A}]}]};if(this.output){B.cn.push({cls:'panel-footer',cn:{tag:'code',html:String.format('{0}',this.output).replace(/\n/g,'
')} +});}return B;}}); // Roo/doc/Para.js Roo.doc.Para=function(A){Roo.doc.Para.superclass.constructor.call(this,A);};Roo.extend(Roo.doc.Para,Roo.bootstrap.Component,{html:'',getAutoCreate:function(){var A={tag:'p',cls:'para',html:this.html};if(this.parent().is_list){return {tag:'li',cls:listitme,cn:[A]} ;}return A;}}); -- 2.39.2