3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.3.1
11 * Copyright(c) 2006-2010 Sencha Inc.
12 * licensing@sencha.com
13 * http://www.sencha.com/license
15 Ext.ns('Ext.debug');
\r
16 Ext.debug.Assistant = function(){
\r
24 disable: function(){
\r
28 init : function(classes){
\r
33 Ext.each(classes, function(cls){
\r
34 if(this.namespaceExists(cls.name)){
\r
35 klass = this.getClass(cls.name);
\r
36 method = cls.instance ? this.addInstanceCheck : this.addPrototypeCheck;
\r
37 Ext.each(cls.checks, function(check){
\r
38 intercept = check.intercept == true;
\r
39 fn = method.call(this, klass, check.name, check.fn, check.intercept == true);
\r
48 namespaceExists: function(name){
\r
49 var parent = window,
\r
52 Ext.each(name.split('.'), function(n){
\r
53 if(!Ext.isDefined(parent[n])){
\r
62 getClass : function(name){
\r
63 var parent = window;
\r
64 Ext.each(name.split('.'), function(n){
\r
71 if(enabled && window.console){
\r
72 console.warn.apply(console, arguments);
\r
77 if(enabled && window.console){
\r
78 console.error.apply(console, arguments);
\r
82 addPrototypeCheck : function(cls, method, fn, intercept){
\r
83 return (cls.prototype[method] = cls.prototype[method][intercept ? 'createInterceptor' : 'createSequence'](fn));
\r
86 addInstanceCheck : function(cls, method, fn, intercept){
\r
87 return (cls[method] = cls[method][intercept ? 'createInterceptor' : 'createSequence'](fn));
\r
93 var A = Ext.debug.Assistant,
\r
97 name: 'Ext.util.Observable',
\r
99 name: 'addListener',
\r
101 fn: function(eventName, fn){
\r
102 if(typeof eventName == 'object'){
\r
104 for(ev in eventName){
\r
105 if(!this.filterOptRe.test(ev)){
\r
107 o = o && o.fn ? o.fn : o;
\r
108 if(!Ext.isFunction(o)){
\r
109 A.error('Non function passed to event listener', this, ev);
\r
115 if(!Ext.isFunction(fn)){
\r
116 A.error('Non function passed to event listener', this, eventName);
\r
120 after: function(method){
\r
121 Ext.util.Observable.prototype.on = method;
\r
127 name: 'Ext.Component',
\r
131 fn: function(container, position){
\r
132 if(!container && !this.el){
\r
133 A.error('Unable to render to container', this, container);
\r
136 if(this.contentEl){
\r
137 var el = Ext.getDom(this.contentEl);
\r
139 A.error('Specified contentEl does not exist', this, this.contentEl);
\r
148 name: 'Ext.Container',
\r
150 name: 'onBeforeAdd',
\r
154 A.warn('Adding destroyed component to container', c, this);
\r
157 A.warn('Using renderTo while adding an item to a Container. You should use the add() method or put the item in the items configuration', c, this);
\r
160 A.warn('Using applyTo while adding an item to a Container. You should use the add() method or put the item in the items configuration', c, this);
\r
163 var type = this.layout.type;
\r
164 if(type == 'container' || type == 'auto'){
\r
165 A.warn('A non sizing layout is being used in a container that has child components. This means the child components will not be sized.', this);
\r
169 name: 'lookupComponent',
\r
173 if(Ext.isEmpty(c)){
\r
176 if(Ext.isString(c)){
\r
177 c = Ext.ComponentMgr.get(comp);
\r
178 valid = !Ext.isEmpty(c);
\r
181 A.error('Adding invalid component to container', this, c);
\r
189 name: 'Ext.DataView',
\r
191 name: 'initComponent',
\r
193 if(!this.itemSelector){
\r
194 A.error('No itemSelector specified', this);
\r
198 name: 'afterRender',
\r
201 A.error('No store attached to DataView', this);
\r
208 name: 'Ext.Window',
\r
213 if(this.isDestroyed){
\r
214 A.error('Trying to show a destroyed window. If you want to reuse the window, look at the closeAction configuration.', this);
\r
222 name: 'Ext.grid.GridPanel',
\r
224 name: 'initComponent',
\r
226 if(!this.colModel){
\r
227 A.error('No column model specified for grid', this);
\r
230 A.error('No store specified for grid', this);
\r
237 name: 'Ext.grid.GridView',
\r
239 name: 'autoExpand',
\r
242 var g = this.grid,
\r
244 if(!this.userResized && g.autoExpandColumn){
\r
245 var tw = cm.getTotalWidth(false),
\r
246 aw = this.grid.getGridEl().getWidth(true) - this.getScrollOffset();
\r
248 var ci = cm.getIndexById(g.autoExpandColumn);
\r
250 A.error('The autoExpandColumn does not exist in the column model', g, g.autoExpandColumn);
\r
260 name: 'Ext.chart.Chart',
\r
262 name: 'initComponent',
\r
265 A.error('No store specified for chart', this);
\r
272 name: 'Ext.tree.TreePanel',
\r
274 name: 'afterRender',
\r
278 A.error('No root node specified for tree', this);
\r
292 if(arguments.length == 2 && !arguments[0]){
\r
293 A.error('Invalid base class passed to extend', arguments[0]);
\r
296 if(arguments.length == 3){
\r
298 A.error('Invalid class to extend', arguments[0]);
\r
300 }else if(!arguments[1]){
\r
301 A.error('Invalid base class passed to extend', arguments[1]);
\r
311 A.error('Invalid class passed to override', c);
\r
319 name: 'Ext.ComponentMgr',
\r
325 if(this.all.indexOfKey(c.id) > -1){
\r
326 A.warn('A component with this id already exists', c, c.id);
\r
332 fn: function(config, defaultType){
\r
333 var types = Ext.ComponentMgr.types;
\r
334 if(!config.render){
\r
336 if(!types[config.xtype]){
\r
337 A.error('Unknown xtype specified', config, config.xtype);
\r
341 if(!types[defaultType]){
\r
342 A.error('Unknown defaultType specified', config, defaultType);
\r
352 name: 'Ext.layout.FitLayout',
\r
357 var ct = this.container;
\r
358 if(ct.items.getCount() > 1){
\r
359 A.warn('More than 1 item in the container. A fit layout will only display a single item.', ct);
\r
365 if(Ext.BLANK_IMAGE_URL == 'http:/' + '/www.extjs.com/s.gif'){
\r
366 A.warn('You should set the Ext.BLANK_IMAGE_URL to reference a local copy.');
\r