×

Status message

Demo Page: demos/crayon-syntax-highlighting potentially unstable
×

Status message

Caution: demos/crayon-syntax-highlighting in development

Demo: Crayon Syntax Highlighting

Below is a pre tag meant to be modified by Crayon Syntax Highlighter .

function iframeInjector(elem, cssFile, jsFile) {
  var ibody = elem.contents().find( 'body' );
	if (ibody.length) {
		ibody.attr('ontouchstart', '');
		if (!("ontouchstart" in document.documentElement)) ibody.addClass('notouch');
	}
	var ihead = elem.contents().find( 'head' );
  if(ihead.length) {
    var iheadlinklast = ihead.find("link[rel='stylesheet']:last"), linkElement = "";
    if (iheadlinklast.length && isDefined(true, cssFile)) iheadlinklast.after(linkElement);
    else ihead.append(linkElement); /* Inject our own CSS at iframe head end, overrides previous declarations */
    var iheadscriptlast = ihead.find("script[type='text/javascript']:last"), scriptElement = "";
    if (iheadscriptlast.length && isDefined(true, jsFile)) iheadscriptlast.after(scriptElement);
    else ihead.append(scriptElement);
  }
}