Skip to content

Commit

Permalink
Drop embed in favor of bustle cards
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic committed Aug 10, 2015
1 parent e632b88 commit 237bf4a
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 124 deletions.
2 changes: 0 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var express = require('express');
var UploadService = require('./services/upload');
var EmbedService = require('./services/embed');

// Express app
var app = express();
Expand All @@ -19,7 +18,6 @@ app.get('/', function(req, res) {
});

app.post('/upload', UploadService);
app.get('/embed', EmbedService);

app.listen(process.env.PORT || 5000, function() {
console.log('content-kit-server: listening on port %d', this.address().port);
Expand Down
26 changes: 0 additions & 26 deletions server/services/embed.js

This file was deleted.

62 changes: 0 additions & 62 deletions src/js/commands/oembed.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/js/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import SubheadingCommand from '../commands/subheading';
import UnorderedListCommand from '../commands/unordered-list';
import OrderedListCommand from '../commands/ordered-list';
import ImageCommand from '../commands/image';
import OEmbedCommand from '../commands/oembed';
import CardCommand from '../commands/card';

import ImageCard from '../cards/image';
Expand Down Expand Up @@ -64,7 +63,6 @@ const defaults = {
],
embedCommands: [
new ImageCommand(),
new OEmbedCommand({ serviceUrl: '/embed' }),
new CardCommand()
],
autoTypingCommands: [
Expand Down
33 changes: 1 addition & 32 deletions src/js/utils/http-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ function createXHR(options) {
return xhr;
}

function xhrGet(options) {
options.method = 'GET';
var xhr = createXHR(options);
try {
xhr.send();
} catch(error) {}
}

function xhrPost(options) {
options.method = 'POST';
var xhr = createXHR(options);
Expand Down Expand Up @@ -83,27 +75,4 @@ FileUploader.prototype.upload = function(options) {
});
};

function OEmbedder(options) {
options = options || {};
var url = options.url;
if (url) {
this.url = url;
} else {
throw new Error('OEmbedder: setting the `url` to an embed service is required');
}
}

OEmbedder.prototype.fetch = function(options) {
var callback = options.complete;
xhrGet({
url: this.url + "?url=" + encodeURI(options.url),
success: function(response) {
if (callback) { callback.call(this, responseJSON(response)); }
},
error: function(error) {
if (callback) { callback.call(this, null, responseJSON(error)); }
}
});
};

export { FileUploader, OEmbedder };
export { FileUploader };

0 comments on commit 237bf4a

Please sign in to comment.