Finished embeds

This commit is contained in:
hydrabolt
2015-10-29 14:48:39 +00:00
parent cefbcd05af
commit 0938382e51
13 changed files with 146 additions and 28 deletions

View File

@@ -4,6 +4,22 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var Embed = function Embed(data) {
_classCallCheck(this, Embed);
this.url = data.url;
this.type = data.type;
this.title = data.title;
this.thumbnail = data.thumbnail;
//width
//height
//url
//proxy_url
this.provider = data.provider;
//url
//name
this.description = data.description;
this.author = data.author;
//url
//name
};
module.exports = Embed;

19
lib/Embeds/IEmbed.js Normal file
View File

@@ -0,0 +1,19 @@
"use strict";
var ImageEmbed = require("./ImageEmbed.js"),
VideoEmbed = require("./VideoEmbed.js"),
LinkEmbed = require("./LinkEmbed.js");
exports.createEmbed = function (data) {
switch (data.type) {
case "image":
return new ImageEmbed(data);
break;
case "video":
return new VideoEmbed(data);
break;
case "link":
return new LinkEmbed(data);
break;
}
};

View File

@@ -13,6 +13,10 @@ var VideoEmbed = (function (_Embed) {
_classCallCheck(this, VideoEmbed);
_Embed.call(this, data);
this.video = data.video;
//width
//height
//url
}
return VideoEmbed;