forked from raycohen/glazier-card-bootstrap
/
card.js
58 lines (45 loc) · 1.7 KB
/
card.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import Conductor from 'conductor';
import TestConsumer from 'app/consumers/test';
/* Uncomment/add required javascript files */
Conductor.require('/vendor/jquery.js');
Conductor.require('/vendor/handlebars.js');
Conductor.require('/vendor/ember-latest.js');
//Conductor.require('/vendor/resolver.js'); // if you are using Ember
/* css files */
Conductor.requireCSS('/css/glazier_card.css');
Conductor.requireCSS('card.css');
var card = Conductor.card({
/* uncomment or add needed services here */
consumers: {
//'fullXhr': Conductor.Oasis.Consumer,
//'paneUserStorage': Conductor.Oasis.Consumer,
//'authenticatedGithubApi': Conductor.Oasis.Consumer,
//'unauthenticatedGithubApi': Conductor.Oasis.Consumer,
'test': TestConsumer
},
defaultContentDiv: "<div id=\"card\"></div>",
bootstrapDiv: "<div id=\"card\">Hello New Card!! (remove me from /card.js)</div>",
render: function (intent, dimensions) {
document.body.innerHTML = this.bootstrapDiv; //this.defaultContentDiv
/*
After verifying card bootstrapped, replace this.bootstrapDiv with
this.defaultContentDiv and you can delete the bootstrapDiv property
If using Ember, the App.rootElement is set to '#card', so you will need
it in your DOM as below.
*/
/* Remove this line if not using Ember.js in your card */
//todo make this a try/catch with appropriate msg if can't find ember
Ember.run(this.App, 'advanceReadiness');
},
activate: function() {
this.App = require('app/application');
},
metadata: {
document: function(promise) {
promise.resolve({
title: "Give this card a proper title in card.js card.metadata"
});
}
}
});
export default card;