src/js/init.js
changeset 984 e034099276f6
parent 969 353b0881a0b9
child 986 f9d51dd4a3fe
equal deleted inserted replaced
983:97fef7a4b189 984:e034099276f6
    72 }
    72 }
    73 
    73 
    74 IriSP.Metadataplayer.prototype.onLibsLoaded = function() {
    74 IriSP.Metadataplayer.prototype.onLibsLoaded = function() {
    75     IriSP.log("IriSP.Metadataplayer.prototype.onLibsLoaded");
    75     IriSP.log("IriSP.Metadataplayer.prototype.onLibsLoaded");
    76     if (typeof IriSP.jQuery === "undefined" && typeof window.jQuery !== "undefined") {
    76     if (typeof IriSP.jQuery === "undefined" && typeof window.jQuery !== "undefined") {
    77         IriSP.jQuery = window.jQuery.noConflict();
    77         IriSP.jQuery = window.jQuery;
    78     }
    78     }
    79     if (typeof IriSP._ === "undefined" && typeof window._ !== "undefined") {
    79     if (typeof IriSP._ === "undefined" && typeof window._ !== "undefined") {
    80         IriSP._ = window._;
    80         IriSP._ = window._;
    81     }
    81     }
    82     IriSP.loadCss(IriSP.getLib("cssjQueryUI"));
    82     IriSP.loadCss(IriSP.getLib("cssjQueryUI"));
    91         this.$.css("height", this.config.height);
    91         this.$.css("height", this.config.height);
    92     }
    92     }
    93       
    93       
    94     this.widgets = [];
    94     this.widgets = [];
    95     var _this = this;
    95     var _this = this;
    96     for(var i = 0; i < this.config.widgets.length; i++) {
    96     IriSP._(this.config.widgets).each(function(widgetconf, key) {
    97         this.loadWidget(this.config.widgets[i], function(_widget) {
    97         _this.widgets.push(null);
    98             _this.widgets.push(_widget)
    98         _this.loadWidget(widgetconf, function(widget) {
       
    99             _this.widgets[key] = widget;
    99         });
   100         });
   100     };
   101     });
   101     this.$.find('.Ldt-Loader').detach();
   102     this.$.find('.Ldt-Loader').detach();
       
   103     
       
   104     var endload = false;
       
   105     
       
   106     this.on("widget-loaded", function() {
       
   107         if (endload) {
       
   108             return;
       
   109         }
       
   110         var isloaded = !IriSP._(_this.widgets).any(function(w) {
       
   111             return !(w && w.isLoaded())
       
   112         });
       
   113         if (isloaded) {
       
   114             endload = true;
       
   115             _this.trigger("widgets-loaded");
       
   116         }
       
   117     });   
   102 }
   118 }
   103 
   119 
   104 IriSP.Metadataplayer.prototype.loadMetadata = function(_metadataInfo) {
   120 IriSP.Metadataplayer.prototype.loadMetadata = function(_metadataInfo) {
   105     if (_metadataInfo.elementType === "source") {
   121     if (_metadataInfo.elementType === "source") {
   106         return _metadataInfo;
   122         return _metadataInfo;