Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Mashup project

<<<<<<< HEAD
This project is open-ended!

* [AJAX demos](https://github.com/advanced-js/deck/tree/gh-pages/demos/ajax)
Expand Down Expand Up @@ -53,3 +54,10 @@ Within this repository directory in your [virtual machine](https://github.com/st
```bash
npm test -s
```
=======
This web app takes an image URL and pulls Creative tools from Aviary to facilitate in-app photo editing. It also saves the newly edited image back to the website and can then be easily downloaded.

API used: Aviary

References: Aviary guide to using Aviary API
>>>>>>> 8b2f4f7182ee3413d13dbc17a42da76c8612a225
1 change: 1 addition & 0 deletions ajax_text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p id="p1">Image editing, courtesy of Aviary. Try editing snother image</p>
51 changes: 46 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<title>Mashup</title>
</head>
<body>
</body>
<head>
<title>Mashup</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<!-- Load Feather code -->
<script type="text/javascript" src="http://feather.aviary.com/imaging/v3/editor.js"></script>
<!-- Instantiate Feather -->
<script type='text/javascript'>
var featherEditor = new Aviary.Feather({
apiKey: '463822cfe2b94aae9c119ab8ab6179ca',
theme: 'light', // Check out our new 'light' and 'light' themes!
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;
}
function myFunct(){
var txt = document.getElementById("myurl").value;
document.getElementById("image1").setAttribute("src", txt);
launchEditor("image1", txt);
}
$(document).ready(function(){
$("button").click(function(){
$("#div1").load("ajax_text.txt");
});
});
</script>
</head>
<body>
<div id='injection_site'></div>
<input type="text" id="myurl" placeholder="Enter the url of an image" style="width: 250px; height: 45px"/>
<button id="geturl" onclick="myFunct()" style="width: 60px; height: 51px" >GO</button>
<img id='image1' src="http://www.stuarthoward.com/images/uploads/projects/1/blank-white__background.png" alt="Your image"/>
<div id="div1"></div>
</body>
</html>
1 change: 0 additions & 1 deletion testAjax.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const fs = require('fs');
const globby = require('globby');


// get current file path, relative to directory that the script is run from
const currentFileRelative = () => {
// based off of http://stackoverflow.com/a/31856198/358804
Expand Down