client/js/ldtjson-bin.js
changeset 42 48d825187d67
parent 37 db991a757015
child 44 869410bab434
equal deleted inserted replaced
41:9b9aabbb83bb 42:48d825187d67
    14 
    14 
    15 Rkns.Ldt.ProjectBin.prototype._init = function(_renkan, _opts) {
    15 Rkns.Ldt.ProjectBin.prototype._init = function(_renkan, _opts) {
    16     this.proj_id = _opts.project_id;
    16     this.proj_id = _opts.project_id;
    17     this.ldt_platform = _opts.ldt_platform || "http://ldt.iri.centrepompidou.fr/";
    17     this.ldt_platform = _opts.ldt_platform || "http://ldt.iri.centrepompidou.fr/";
    18     this.title_$.html(_opts.title);
    18     this.title_$.html(_opts.title);
       
    19     this.refresh();
       
    20 }
       
    21 
       
    22 Rkns.Ldt.ProjectBin.prototype.refresh = function() {
    19     var _this = this;
    23     var _this = this;
    20     function convertTC(_ms) {
    24     function convertTC(_ms) {
    21         function pad(_n) {
    25         function pad(_n) {
    22             var _res = _n.toString();
    26             var _res = _n.toString();
    23             while (_res.length < 2) {
    27             while (_res.length < 2) {
    34             _res += pad(_hours) + ':'
    38             _res += pad(_hours) + ':'
    35         }
    39         }
    36         _res += pad(_minutes) + ':' + pad(_seconds);
    40         _res += pad(_minutes) + ':' + pad(_seconds);
    37         return _res;
    41         return _res;
    38     }
    42     }
    39     Rkns.$.getJSON(
    43     Rkns.$.ajax({
    40         this.ldt_platform + 'ldtplatform/ldt/cljson/id/' + this.proj_id + '?callback=?',
    44         url: this.ldt_platform + 'ldtplatform/ldt/cljson/id/' + this.proj_id,
    41         function(_data) {
    45         dataType: "jsonp",
       
    46         success: function(_data) {
    42             var _html = '<li><h3>Tags</h3></li>',
    47             var _html = '<li><h3>Tags</h3></li>',
    43                 _projtitle = _data.meta["dc:title"];
    48                 _projtitle = _data.meta["dc:title"];
    44             _this.title_$.html('LDT Project: "' + _projtitle + '"');
    49             _this.title_$.html('LDT Project: "' + _projtitle + '"');
    45             _html += Rkns._(_data.tags).map(function(_tag) {
    50             _html += Rkns._(_data.tags).map(function(_tag) {
    46                 var _title = _tag.meta["dc:title"]
    51                 var _title = _tag.meta["dc:title"]
    74             }).join("");
    79             }).join("");
    75             
    80             
    76             _this.main_$.html(_html);
    81             _this.main_$.html(_html);
    77             _renkan.resizeBins();
    82             _renkan.resizeBins();
    78         }
    83         }
    79     );
    84     });
    80 }
    85 }