Sha256: f9094bb7918acd32446ce4377b057f0ab9e0c20a231e5c0733f093e5d7295e70

Contents?: true

Size: 1.73 KB

Versions: 75

Compression:

Stored size: 1.73 KB

Contents


// call PROFILE.show() to show the profileViewer

var PROFILE = {

  init : function(bool) {
  
  	// define what objects, constructors and functions you want to profile
  	// documentation here: http://developer.yahoo.com/yui/profiler/
  	
  	YAHOO.tool.Profiler.registerObject("jQuery", jQuery, true);
  	
  	// the following would profile all methods within constructor's prototype
    // YAHOO.tool.Profiler.registerConstructor("Person");
  	
    // the following would profile the global function sayHi
    // YAHOO.tool.Profiler.registerFunction("sayHi", window); 
    
    // if true is passed into init(), F9 will bring up the profiler
    if (bool){
      $(document).keyup(function(e){
        if (e.keyCode === 120){ 
          PROFILE.show(); 
          $(document).unbind('keyup',arguments.callee); 
        }
      })
    }
  },
  
  //When the showProfile button is clicked, use YUI Loader to get all required
  //dependencies and then show the profile:
  show : function() {
  
          
          
          var s = document.createElement('link');
          s.setAttribute('rel','stylesheet');      
          s.setAttribute('type','text/css');
          s.setAttribute('href','js/profiling/yahoo-profiling.css');
          document.body.appendChild(s);
          
	        YAHOO.util.Dom.addClass(document.body, 'yui-skin-sam');

      		//instantiate ProfilerViewer with desired options:
      		var pv = new YAHOO.widget.ProfilerViewer("", {
      			visible: true, //expand the viewer mmediately after instantiation
      			showChart: true,
      		  //	base:"../../build/",
      		  swfUrl: "js/profiling/charts.swf"
      		});
  	
  }

};

// check some global debug variable to see if we should be profiling..
if (true) { PROFILE.init(true) }

Version data entries

75 entries across 75 versions & 17 rubygems

Version Path
fog-nirvanix-1.8.2 docs/public/js/profiling/config.js
fog-nirvanix-1.8.1 docs/public/js/profiling/config.js
fog-parser-fix-1.6.1 docs/public/js/profiling/config.js
fog-test-again-1.6.0 docs/public/js/profiling/config.js
fog-parser-fix-1.6.0 docs/public/js/profiling/config.js
fog-sgonyea-1.8.1 docs/public/js/profiling/config.js
fog-1.8.0 docs/public/js/profiling/config.js
fog-maestrodev-1.7.0.20121114190951 docs/public/js/profiling/config.js
fog-1.7.0 docs/public/js/profiling/config.js
fog-1.6.0 docs/public/js/profiling/config.js
fog-1.5.0 docs/public/js/profiling/config.js
rackspace-fog-1.4.2 docs/public/js/profiling/config.js
fog-1.4.0 docs/public/js/profiling/config.js
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/docs/public/js/profiling/config.js
michiels-fog-1.3.1 docs/public/js/profiling/config.js
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/docs/public/js/profiling/config.js
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/docs/public/js/profiling/config.js
fog-1.3.1 docs/public/js/profiling/config.js
fog-1.3.0 docs/public/js/profiling/config.js
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/docs/public/js/profiling/config.js