Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / docs / app / Syntax.js
1 /**
2  * Utility for performing syntax highlighting.
3  */
4 Ext.define("Docs.Syntax", {
5     singleton: true,
6
7     /**
8      * Marks all code blocks with "prettyprint" class and then calls
9      * the prettify library function to highlight them.
10      *
11      * @param {HTMLElement/Ext.core.Element} root HTML element inside
12      * which to perform the highlighting.
13      */
14     highlight: function(root) {
15         Ext.Array.forEach(Ext.query("pre > code", root.dom || root), function(el) {
16             Ext.get(el).addCls("prettyprint");
17         });
18         prettyPrint();
19     }
20 });