Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Syntax highlighter configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspermdegroot committed Nov 24, 2012
1 parent a91f560 commit 76bec7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/demos/_assets/js/jqm-demos.js
Expand Up @@ -90,15 +90,15 @@ $.fn.viewSourceCode = function() {
html = $( "<div></div>" ).append( $( this ).contents().clone() ).html();
collapsibleHTML = $( "<div data-role='collapsible' data-collapsed='true' data-theme='b' data-iconpos='right' data-content-theme='a'>" +
"<h1>HTML</h1>" +
"<pre class='brush: xml; toolbar: false;'></pre>" +
"<pre class='brush: xml;'></pre>" +
"</div>" );
appendSource( html, collapsibleHTML );
}
if ( $( this ).is( "[data-demo-js='true']" ) ) {
js = $( "<div></div>" ).append( $( "head" ).find( "script" ).contents().clone() ).html();
collapsibleJS = $( "<div data-role='collapsible' data-collapsed='true' data-theme='f' data-iconpos='right' data-content-theme='a'>" +
"<h1>JS</h1>" +
"<pre class='brush: js; toolbar: false;'></pre>" +
"<pre class='brush: js;'></pre>" +
"</div>" );
appendSource( js, collapsibleJS );
}
Expand All @@ -107,7 +107,7 @@ $.fn.viewSourceCode = function() {

collapsibleCSS = $( "<div data-role='collapsible' data-collapsed='true' data-theme='e' data-iconpos='right' data-content-theme='a'>" +
"<h1>CSS</h1>" +
"<pre class='brush: css; toolbar: false;'></pre>" +
"<pre class='brush: css;'></pre>" +
"</div>" );
appendSource( css, collapsibleCSS );
}
Expand All @@ -121,6 +121,8 @@ $.fn.viewSourceCode = function() {

$( document ).on( "pagebeforecreate", "[data-role='page']", function() {
$( this ).find( "[data-demo-html='true'], [data-demo-js='true'], [data-demo-css='true']" ).viewSourceCode();
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.defaults['auto-links'] = false;
SyntaxHighlighter.all();
});

Expand Down

0 comments on commit 76bec7c

Please sign in to comment.