diff --git a/app.js b/app.js index f5d395978f5..a5505731d40 100755 --- a/app.js +++ b/app.js @@ -71,7 +71,7 @@ app.get('/api/nyt', api.getNewYorkTimes); app.get('/api/twilio', api.getTwilio); app.get('/api/etsy', api.getEtsy); app.get('/api/twitter', passportConf.ensureAuthenticated, api.getTwitter); -app.get('/api/aviary', passportConf.ensureAuthenticated, api.getAviary); +app.get('/api/aviary', api.getAviary); app.get('/contact', contact.getContact); app.post('/contact', contact.postContact); diff --git a/controllers/api.js b/controllers/api.js index d8d9f3d602e..6a7171699b9 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -178,7 +178,9 @@ exports.getTwilio = function(req, res) { * GET /api/aviary */ exports.getAviary = function(req, res) { - + res.render('api/aviary', { + title: 'Aviary API' + }); }; exports.getEtsy = function(req, res) { diff --git a/views/api/aviary.jade b/views/api/aviary.jade new file mode 100644 index 00000000000..7fa90c53b9d --- /dev/null +++ b/views/api/aviary.jade @@ -0,0 +1,46 @@ +extends ../layout + +block content + .page-header + h1 + i.fa.fa-picture-o + | Aviary API + .btn-group.btn-group-justified + a.btn.btn-lg.btn-primary(href='http://developers.aviary.com/docs/web/setup-guide#constructor', target='_blank') + i.fa.fa-check-square-o + | API Overview + a.btn.btn-lg.btn-primary(href='http://developers.aviary.com/docs/web/setup-guide#saving', target='_blank') + i.fa.fa-save + | Saving Images + a.btn.btn-lg.btn-primary(href='http://developers.aviary.com/docs/web/setup-guide#styling', target='_blank') + i.fa.fa-flask + | CSS Styling + button.btn.btn-primary-outline(onclick='return launchEditor("evanescence", "http://i.imgur.com/fM7OHvr.png");') + i.fa.fa-magic + | Edit Photo + br + img#evanescence(src='http://i.imgur.com/fM7OHvr.png') + + script(src='http://feather.aviary.com/js/feather.js') + script + var featherEditor = new Aviary.Feather({ + apiKey: 'c83c98c0da041785', + apiVersion: 3, + theme: 'dark', + tools: 'all', + appendTo: '', + onSave: function(imageID, newURL) { + var img = document.getElementById(imageID); + img.src = newURL; + }, + onError: function(errorObj) { + alert(errorObj.message); + } + }); + function launchEditor(id, src) { + featherEditor.launch({ + image: id, + url: src + }); + return false; + } \ No newline at end of file