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
html5-boilerplate-0.2.5 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.2.4 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.2.3 templates/project/javascripts/profiling/config.js
vileda-generators-0.1.0 lib/generators/vileda/layout/templates/js/profiling/config.js
html5-boilerplate-0.2.2 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.2.1 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.2.0 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.1.7 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.1.6 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.1.5 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.1.4 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.1.3 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.1.2 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.1.1 templates/project/javascripts/profiling/config.js
html5-boilerplate-0.1.0 templates/project/javascripts/profiling/config.js