/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.highlight.widget.Code"],["require","dijit._Widget"],["require","dijit._Templated"],["require","dojox.highlight"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.highlight.widget.Code"]){_4._hasResource["dojox.highlight.widget.Code"]=true;_4.provide("dojox.highlight.widget.Code");_4.require("dijit._Widget");_4.require("dijit._Templated");_4.require("dojox.highlight");_4.declare("highlight.Code",[_5._Widget,_5._Templated],{url:"",range:null,style:"",listType:"1",lang:"",templateString:"<div class=\"formatted\" style=\"${style}\">"+"<div class=\"titleBar\"></div>"+"<ol type=\"${listType}\" dojoAttachPoint=\"codeList\" class=\"numbers\"></ol>"+"<div style=\"display:none\" dojoAttachPoint=\"containerNode\"></div>"+"</div>",postCreate:function(){this.inherited(arguments);if(this.url){_4.xhrGet({url:this.url,load:_4.hitch(this,"_populate"),error:_4.hitch(this,"_loadError")});}else{this._populate(this.containerNode.innerHTML);}},_populate:function(_7){this.containerNode.innerHTML="<pre><code class='"+this.lang+"'>"+_7.replace(/\</g,"&lt;")+"</code></pre>";_4.query("pre > code",this.containerNode).forEach(_6.highlight.init);var _8=this.containerNode.innerHTML.split("\n");_4.forEach(_8,function(_9,i){var li=_4.doc.createElement("li");_4.addClass(li,(i%2!==0?"even":"odd"));_9="<pre><code>"+_9+"&nbsp;</code></pre>";_9=_9.replace(/\t/g," &nbsp; ");li.innerHTML=_9;this.codeList.appendChild(li);},this);this._lines=_4.query("li",this.codeList);this._updateView();},setRange:function(_a){if(_4.isArray(_a)){this.range=_a;this._updateView();}},_updateView:function(){if(this.range){var r=this.range;this._lines.style({display:"none"}).filter(function(n,i){return (i+1>=r[0]&&i+1<=r[1]);}).style({display:""});_4.attr(this.codeList,"start",r[0]);}},_loadError:function(_b){console.warn("loading: ",this.url," FAILED",_b);}});}}};});