Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Inspector = {
- classes: [],
- used: [],
- init: function(){
- Inspector.iterate(Ext, 'Ext.');
- },
- iterate: function(root, chain){
- var I = Inspector,
- prop,
- first,
- o;
- for (var prop in root) {
- o = root[prop];
- first = prop.substr(0, 1);
- if (/[A-Z]/.test(first)) {
- if (Ext.isFunction(o)) {
- o.prototype.constructor = o.prototype.constructor.createInterceptor(function(){
- Ext.each(I.classes, function(detail){
- if (this instanceof detail.cls) {
- if (I.used.indexOf(detail.name) == -1) {
- I.used.push(detail.name);
- }
- }
- }, this);
- });
- I.classes.push({
- cls: o,
- name: chain + prop
- });
- }
- } else if (Ext.isObject(o)) {
- I.iterate(o, chain + prop + '.');
- }
- }
- }
- };
- Inspector.init();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement