Skip to content
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
Binary file added Assignment/HW4_Soundcloud/OhLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions Assignment/HW4_Soundcloud/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

<!-- index.html created by Robin Oh -->



<!DOCTYPE html>

<html>
<head>
<title>OH SOUND</title>

</head>
<!-- TODO i need to center this and put this into body -->
<input id="search_bar">
<button id="search_button">Search</button>

<body>
<div class = "row">
<div class = "col-md-6">
<div class="panel panel-warning">
<div class="panel-heading">Search Result</div>
<div class="panel-body"></div>
<table class = "table" id="displayed_search">
<thead>
<tr>
<th>Song</th>
<th>Album Art</th>
<th>Listen</th>
<th>Playlist</th>
</tr>
</thead>

<tbody id='search_body'>
</tbody>
</table>
</div>
</div>
<div class = "col-md-6">
<div class="panel panel-info">
<div class="panel-heading">Playlist</div>
<div class="panel-body"></div>
<table class = "table">
<thead>
<tr>
<th>Song</th>
<th>Album Art</th>
<th>Listen</th>
<th>Playlist</th>
<th>Up</th>
<th>Down</th>
</tr>
</thead>

<tbody id="playlist">

</tbody>

</table>
</div>
</div>
</div>

<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="main.js"> </script>
<script type="text/javascript" src="https://stratus.soundcloud.com/stratus.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">


</body>




</html>
132 changes: 132 additions & 0 deletions Assignment/HW4_Soundcloud/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
//created by Robin Oh

// Event hander for calling the SoundCloud API using the user's search query
function callAPI(query) {
$.get("https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb",
{'q': query,
'limit': '200'},
function(data) {
// PUT IN YOUR CODE HERE TO PROCESS THE SOUNDCLOUD API'S RESPONSE OBJECT
// HINT: CREATE A SEPARATE FUNCTION AND CALL IT HERE
display_20(data)
},'json'
);
}

// 'Play' button event handler - play the track in the Stratus player
function changeTrack(url) {
// Remove any existing instances of the Stratus player
$('#stratus').remove();

// Create a new Stratus player using the clicked song's permalink URL
$.stratus({
key: "b3179c0738764e846066975c2571aebb",
auto_play: true,
align: "bottom",
links: url
});
}


//clicking on the search bar
$(document).ready(
$("#search_button").on('click', function() {
get_search()
})
);

//pressing enter on the search funtion
$('#search_bar').bind("enterKey",function(e){
get_search()
});

//pressing enter on the search funtion
$('#search_bar').keyup(function(e){
if(e.keyCode == 13)
{
$(this).trigger("enterKey");
}
});

//get variable from the search bar, clears existing
function get_search(){
var user_input = $("#search_bar").val();
$("#search_bar").val('');
callAPI(user_input)
}

//display the first 20 got from soundcloud api
function display_20(dick){

$("#search_body").empty();

for(var i=0;i<20; i++){
var artist = dick[i].artist;
var title = dick[i].title;
var image = dick[i].artwork_url;
var permalink = dick[i].permalink_url;
if(image == null){
if(i%2==0){
image = "https://store-images.s-microsoft.com/image/apps.62807.9007199266242506.1b72c6b3-a4b4-4841-b9f2-f45f38b18c8f.fd6d73e9-8feb-4c96-bb77-84bd32fac8c2?w=96&h=96&q=60"
} else{
image="OhLogo.png"
}
}
//creates play button and add to playlist button
$('#search_body').append("<tr>\
<td>" + title + "</td>\
<td> <img src = '" + image + "'> </td>\
<td> <button data-url=" + permalink +
" type='button' class='btn btn-default btn-lg play' role='button'>\
<span class='glyphicon glyphicon-play' aria-hidden='true'></span> Play\
</button></td>\
<td> <button type='button' class='btn btn-default btn-lg add' role='button'>\
<span class='glyphicon glyphicon-plus' aria-hidden='true'></span> Playlist\
</button></td>\
</tr>")
}
}

//when clicked on play button, plays the song
$("table").on('click', '.play', function() {
var url = (this).getAttribute("data-url")
changeTrack(url)
})


//when clicked on add to list button, adds to the playlist
$("#displayed_search").on('click', '.add', function() {
var copy = $(this).parent().parent().clone();

// changes the plus sign to minus sign
var to_change= $(copy).find("span").eq(1)
$(to_change).removeClass('glyphicon-plus').addClass('glyphicon-minus')

//add up and down button
$(copy).append("<td> <button type='button' class='btn btn-default btn-lg up' role='button'>\
<span class='glyphicon glyphicon-menu-up'></span>\
</button></td>")

$(copy).append("<td> <button type='button' class='btn btn-default btn-lg down' role='button'>\
<span class='glyphicon glyphicon-menu-down'></span>\
</button></td>")


$('#playlist').prepend(copy)

})

//remove song from playlist
$("#playlist").on('click', '.add', function() {
$(this).parent().parent().remove();
})

//Make the songs go up one in the playlist
$("#playlist").on('click', '.up', function() {
$(this).parent().parent().insertBefore($(this).parent().parent().prev());
})

//Make the songs go down one in the playlist
$("#playlist").on('click', '.down', function() {
$(this).parent().parent().insertAfter($(this).parent().parent().next());
})
38 changes: 26 additions & 12 deletions Assignment/HW4_Soundcloud/startercode_HW4_skeleton.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
//created by Robin Oh

// Event hander for calling the SoundCloud API using the user's search query
function callAPI(query) {
$.get("https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb",
{'q': query,
'limit': '200'},
function(data) {
// PUT IN YOUR CODE HERE TO PROCESS THE SOUNDCLOUD API'S RESPONSE OBJECT
// HINT: CREATE A SEPARATE FUNCTION AND CALL IT HERE
},'json'
);
$.get("https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb",
{'q': query,
'limit': '200'},
function(data) {
// PUT IN YOUR CODE HERE TO PROCESS THE SOUNDCLOUD API'S RESPONSE OBJECT
// HINT: CREATE A SEPARATE FUNCTION AND CALL IT HERE
},'json'
);
}

// 'Play' button event handler - play the track in the Stratus player
function changeTrack(url) {
// Remove any existing instances of the Stratus player
$('#stratus').remove();
// Remove any existing instances of the Stratus player
$('#stratus').remove();

// Create a new Stratus player using the clicked song's permalink URL
$.stratus({
// Create a new Stratus player using the clicked song's permalink URL
$.stratus({
key: "b3179c0738764e846066975c2571aebb",
auto_play: true,
align: "bottom",
Expand All @@ -25,3 +27,15 @@ function changeTrack(url) {
}


$(document).ready(
$("#search_button").on('click', function() {
// once the document loads, create new item with this function
var user_input = $("#search_bar").val();
console.log(user_input)

})
);




Empty file.
24 changes: 24 additions & 0 deletions Assignment/Homework_1 - HTML/area.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body background="shrooms.jpg">
<footer>
<button>
<a href="hw1.html">Pokedex</a>
</button>

<button>

<a href="map.html">Map</a>
</button>

<button>

<a href="area.html">Area</a>
</button>
</footer>

</body>
</html>
24 changes: 24 additions & 0 deletions Assignment/Homework_1 - HTML/map.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body background="pallet_town.png">
<footer>
<button>
<a href="hw1.html">Pokedex</a>
</button>

<button>

<a href="map.html">Map</a>
</button>

<button>

<a href="area.html">Area</a>
</button>
</footer>

</body>
</html>
Empty file.
Empty file added Assignment/test1.css
Empty file.
Binary file added Labs/flasklab2/flaskLab2/.spyderworkspace
Binary file not shown.
4 changes: 4 additions & 0 deletions Labs/flasklab2/flaskLab2/app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from flask import Flask

myapp = Flask(__name__)
from app import views
Binary file added Labs/flasklab2/flaskLab2/app/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
39 changes: 39 additions & 0 deletions Labs/flasklab2/flaskLab2/app/static/interactions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
$('#submit-survey').on('click', function submitSurvey() {
var color = $("input[name=color]").val();
var food = $("input[name=food]").val();
var vacation = $("input[name=vacation]").val();
var feBefore = $("input[name=front-end-before]").val();
var feAfter = $("input[name=front-end-after]").val();
$.post("submit-survey",
{color: color,
food: food,
vacation: vacation,
feBefore: feBefore,
feAfter: feAfter},
function(data) {
$("html").html(data);
}
)
});

$("#results-email-container").on('click', '#email-results-button', function emailResults() {
console.log($(this));
});

$("#site-title-wrapper").on('click', function goHome() {
window.location.href = '/';
});

$(document).ready(function applySliderLabels() {
var currentValue = $("#fe-before").val();
$("#fe-before").next().html(currentValue);

currentValue = $("#fe-after").val();
$("#fe-after").next().html(currentValue);
});


$("input[type='range']").on('change', function updateLabel() {
var currentValue = $(this).val();
$(this).next().html(currentValue);
});
Loading