示例#1
0
  init: function() {
    if (!this.$) { this.$ = jQuery; }
    this.__container__ = this.buildContainer();

    this.Router = this.defaultRouter();

    this._super();

    this.scheduleInitialize();

    Ember.libraries.registerCoreLibrary('Handlebars', EmberHandlebars.VERSION);
    Ember.libraries.registerCoreLibrary('jQuery', jQuery().jquery);

    if ( Ember.LOG_VERSION ) {
      Ember.LOG_VERSION = false; // we only need to see this once per Application#init

      var nameLengths = EnumerableUtils.map(Ember.libraries, function(item) {
        return get(item, "name.length");
      });

      var maxNameLength = Math.max.apply(this, nameLengths);

      Ember.debug('-------------------------------');
      Ember.libraries.each(function(name, version) {
        var spaces = new Array(maxNameLength - name.length + 1).join(" ");
        Ember.debug([name, spaces, ' : ', version].join(""));
      });
      Ember.debug('-------------------------------');
    }
  },
示例#2
0
  init: function() {
    // Start off the number of deferrals at 1. This will be
    // decremented by the Application's own `initialize` method.
    this._readinessDeferrals = 1;

    if (!this.$) {
      this.$ = jQuery;
    }

    this.buildRegistry();
    this.buildContainer();

    this.Router = this.defaultRouter();

    this._super();

    this.scheduleInitialize();

    if (!librariesRegistered) {
      librariesRegistered = true;

      if (environment.hasDOM) {
        Ember.libraries.registerCoreLibrary('jQuery', jQuery().jquery);
      }
    }

    if (Ember.LOG_VERSION) {
      // we only need to see this once per Application#init
      Ember.LOG_VERSION = false;
      var libs = Ember.libraries._registry;

      var nameLengths = EnumerableUtils.map(libs, function(item) {
        return get(item, 'name.length');
      });

      var maxNameLength = Math.max.apply(this, nameLengths);

      Ember.debug('-------------------------------');
      for (var i = 0, l = libs.length; i < l; i++) {
        var lib = libs[i];
        var spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');
        Ember.debug([lib.name, spaces, ' : ', lib.version].join(''));
      }
      Ember.debug('-------------------------------');
    }
  },
示例#3
0
  runInDebug(() => {
    if (ENV.LOG_VERSION) {
      // we only need to see this once per Application#init
      ENV.LOG_VERSION = false;
      let libs = libraries._registry;

      let nameLengths = libs.map(item => get(item, 'name.length'));

      let maxNameLength = Math.max.apply(this, nameLengths);

      debug('-------------------------------');
      for (let i = 0; i < libs.length; i++) {
        let lib = libs[i];
        let spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');
        debug([lib.name, spaces, ' : ', lib.version].join(''));
      }
      debug('-------------------------------');
    }
  });
示例#4
0
function logLibraryVersions() {
  if (Ember.LOG_VERSION) {
    // we only need to see this once per Application#init
    Ember.LOG_VERSION = false;
    var libs = Ember.libraries._registry;

    var nameLengths = EnumerableUtils.map(libs, function(item) {
      return get(item, 'name.length');
    });

    var maxNameLength = Math.max.apply(this, nameLengths);

    Ember.debug('-------------------------------');
    for (var i = 0, l = libs.length; i < l; i++) {
      var lib = libs[i];
      var spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');
      Ember.debug([lib.name, spaces, ' : ', lib.version].join(''));
    }
    Ember.debug('-------------------------------');
  }
}
示例#5
0
    window.addEventListener('load', () => {
      if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) {
        var downloadURL;

        if (isChrome) {
          downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi';
        } else if (isFirefox) {
          downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/';
        }

        debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL);
      }
    }, false);
示例#6
0
 Ember.libraries.each(function(name, version) {
   var spaces = new Array(maxNameLength - name.length + 1).join(" ");
   Ember.debug([name, spaces, ' : ', version].join(""));
 });