Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
Updating CardPrototype object so that the developer can retrieve the …
Browse files Browse the repository at this point in the history
…ID and card information
  • Loading branch information
charlesportwoodii committed Jan 1, 2015
1 parent 32a52e1 commit 48c848c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 214 deletions.
218 changes: 20 additions & 198 deletions assets/dist/dashboard.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions assets/dist/dashboard.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/dist/fonts/font-awesome.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* -------------------------- */
@font-face {
font-family: 'FontAwesome';
src: url('./fonts/fontawesome-webfont.eot?v=4.1.0');
src: url('./fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('./fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('./fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('./fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
src: url('../fonts/fontawesome-webfont.eot?v=4.1.0');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
Expand Down
15 changes: 13 additions & 2 deletions assets/js/CardPrototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@
// Prototype options
CardPrototype.prototype.options = {};

CardPrototype.prototype.id = null;

CardPrototype.prototype.properties = {};

/**
* Preload function, populates some internal data for the card
* @param The ID of the card
*/
CardPrototype.prototype.preload = function(id) {
this.id = id;
}

/**
* Prototype init method
*/
CardPrototype.prototype.init = function() {
if (typeof(this.options.init) == "function")
this.options.init();
this.options.init(this.id);
}

/**
Expand All @@ -37,7 +49,6 @@
* ;(function() {
* var CardName = new CardPrototype({
* name: "CardName",
* constructor: function() {},
* init: function() {},
* reload:function() {},
* render: function() {}
Expand Down
5 changes: 4 additions & 1 deletion assets/js/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
Card.prototype.registerScript = function(type, e)
{
var self = this,
e = typeof e == "undefined" ? null : e,
e = (typeof e == "undefined") ? null : e,
jsCardClass = self.options.name;

if (type == "js")
Expand All @@ -342,6 +342,9 @@
else
var element = window.cardObjects[self.id];

if (e == "init")
event2 = "preload";

element[e]();

});
Expand Down

0 comments on commit 48c848c

Please sign in to comment.