Did this work?

idk
This commit is contained in:
hydrabolt
2015-11-20 22:23:06 +00:00
parent 409635d50a
commit 95fe52cda1
131 changed files with 10479 additions and 22580 deletions

25
lib/Embeds/Embed.js Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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;
}
};

21
lib/Embeds/ImageEmbed.js Normal file
View File

@@ -0,0 +1,21 @@
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Embed = require("./Embed.js");
var ImageEmbed = (function (_Embed) {
_inherits(ImageEmbed, _Embed);
function ImageEmbed(data) {
_classCallCheck(this, ImageEmbed);
_Embed.call(this, data);
}
return ImageEmbed;
})(Embed);
module.exports = ImageEmbed;

21
lib/Embeds/LinkEmbed.js Normal file
View File

@@ -0,0 +1,21 @@
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Embed = require("./Embed.js");
var LinkEmbed = (function (_Embed) {
_inherits(LinkEmbed, _Embed);
function LinkEmbed(data) {
_classCallCheck(this, LinkEmbed);
_Embed.call(this, data);
}
return LinkEmbed;
})(Embed);
module.exports = LinkEmbed;

25
lib/Embeds/VideoEmbed.js Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Embed = require("./Embed.js");
var VideoEmbed = (function (_Embed) {
_inherits(VideoEmbed, _Embed);
function VideoEmbed(data) {
_classCallCheck(this, VideoEmbed);
_Embed.call(this, data);
this.video = data.video;
//width
//height
//url
}
return VideoEmbed;
})(Embed);
module.exports = VideoEmbed;