X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/app/Syntax.js?ds=sidebyside diff --git a/docs/app/Syntax.js b/docs/app/Syntax.js new file mode 100644 index 00000000..0ad38cdf --- /dev/null +++ b/docs/app/Syntax.js @@ -0,0 +1,20 @@ +/** + * Utility for performing syntax highlighting. + */ +Ext.define("Docs.Syntax", { + singleton: true, + + /** + * Marks all code blocks with "prettyprint" class and then calls + * the prettify library function to highlight them. + * + * @param {HTMLElement/Ext.core.Element} root HTML element inside + * which to perform the highlighting. + */ + highlight: function(root) { + Ext.Array.forEach(Ext.query("pre > code", root.dom || root), function(el) { + Ext.get(el).addCls("prettyprint"); + }); + prettyPrint(); + } +});