~ya-bo-ng/juju-gui/test-prototype

« back to all changes in this revision

Viewing changes to app/views/charm.js

Merged trunk, resolved conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"use strict";
 
2
 
1
3
YUI.add("juju-view-charm-collection", function(Y) {
2
4
 
3
5
var views = Y.namespace("juju.views"),
35
37
});
36
38
 
37
39
Y.Handlebars.registerHelper('markdown', function(text) {
38
 
    if (!text || text == undefined) {return '';}
 
40
    if (!text || text === undefined) {return '';}
39
41
    return new Y.Handlebars.SafeString(
40
42
        Y.Markdown.toHTML(text));
41
43
});
42
44
 
43
45
 
44
 
CharmView = Y.Base.create('CharmView', Y.View, [], {
 
46
var CharmView = Y.Base.create('CharmView', Y.View, [], {
45
47
    initializer: function () {
46
48
        this.set('charm', null);
47
49
        console.log("Loading charm view", this.get('charm_data_url'));
76
78
    },
77
79
 
78
80
    on_charm_data: function (io_request) {
79
 
        charm = Y.JSON.parse(
 
81
        var charm = Y.JSON.parse(
80
82
            io_request.response.results[0].responseText);
81
83
        console.log('results update', charm, this);
82
84
        this.set('charm', charm);
89
91
    }
90
92
});
91
93
 
92
 
CharmCollectionView = Y.Base.create('CharmCollectionView', Y.View, [], {
 
94
var CharmCollectionView = Y.Base.create('CharmCollectionView', Y.View, [], {
93
95
 
94
96
    initializer: function () {
95
97
        console.log("View: Initialized: Charm Collection", this.get('query'));
167
169
        'gallery-markdown',
168
170
        'view']
169
171
});
170