From bdc7e2e5a21da853494d986c88d31dadbba514bc Mon Sep 17 00:00:00 2001 From: Robin Oh Date: Tue, 13 Sep 2016 13:02:36 -0700 Subject: [PATCH 1/8] hw 1 submission --- Assignment/Homework_1 - HTML/area.html | 24 ++++++++++++++++++++++++ Assignment/Homework_1 - HTML/map.html | 24 ++++++++++++++++++++++++ Assignment/Homework_1 - HTML/test.html | 0 Assignment/test1.css | 0 4 files changed, 48 insertions(+) create mode 100644 Assignment/Homework_1 - HTML/area.html create mode 100644 Assignment/Homework_1 - HTML/map.html create mode 100644 Assignment/Homework_1 - HTML/test.html create mode 100644 Assignment/test1.css diff --git a/Assignment/Homework_1 - HTML/area.html b/Assignment/Homework_1 - HTML/area.html new file mode 100644 index 0000000..62e25ad --- /dev/null +++ b/Assignment/Homework_1 - HTML/area.html @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/Homework_1 - HTML/map.html b/Assignment/Homework_1 - HTML/map.html new file mode 100644 index 0000000..9b470a7 --- /dev/null +++ b/Assignment/Homework_1 - HTML/map.html @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/Homework_1 - HTML/test.html b/Assignment/Homework_1 - HTML/test.html new file mode 100644 index 0000000..e69de29 diff --git a/Assignment/test1.css b/Assignment/test1.css new file mode 100644 index 0000000..e69de29 From 6cfe9ef1ebee046d2ce49cb0ff7de2d4a89e8d95 Mon Sep 17 00:00:00 2001 From: Robin Oh Date: Tue, 13 Sep 2016 13:02:36 -0700 Subject: [PATCH 2/8] hw 1 submission --- Assignment/Homework_1 - HTML/area.html | 24 ++++++++++++++++++++++++ Assignment/Homework_1 - HTML/map.html | 24 ++++++++++++++++++++++++ Assignment/Homework_1 - HTML/test.html | 0 Assignment/test1.css | 0 4 files changed, 48 insertions(+) create mode 100644 Assignment/Homework_1 - HTML/area.html create mode 100644 Assignment/Homework_1 - HTML/map.html create mode 100644 Assignment/Homework_1 - HTML/test.html create mode 100644 Assignment/test1.css diff --git a/Assignment/Homework_1 - HTML/area.html b/Assignment/Homework_1 - HTML/area.html new file mode 100644 index 0000000..62e25ad --- /dev/null +++ b/Assignment/Homework_1 - HTML/area.html @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/Homework_1 - HTML/map.html b/Assignment/Homework_1 - HTML/map.html new file mode 100644 index 0000000..9b470a7 --- /dev/null +++ b/Assignment/Homework_1 - HTML/map.html @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/Homework_1 - HTML/test.html b/Assignment/Homework_1 - HTML/test.html new file mode 100644 index 0000000..e69de29 diff --git a/Assignment/test1.css b/Assignment/test1.css new file mode 100644 index 0000000..e69de29 From f81dc0de2e2ee8aab6a8eeb10980817f2cafc99f Mon Sep 17 00:00:00 2001 From: Robin Oh Date: Tue, 13 Sep 2016 13:02:36 -0700 Subject: [PATCH 3/8] hw 1 submission --- Assignment/Homework_1 - HTML/area.html | 24 ++++++++++++++++++++++++ Assignment/Homework_1 - HTML/map.html | 24 ++++++++++++++++++++++++ Assignment/Homework_1 - HTML/test.html | 0 Assignment/test1.css | 0 4 files changed, 48 insertions(+) create mode 100644 Assignment/Homework_1 - HTML/area.html create mode 100644 Assignment/Homework_1 - HTML/map.html create mode 100644 Assignment/Homework_1 - HTML/test.html create mode 100644 Assignment/test1.css diff --git a/Assignment/Homework_1 - HTML/area.html b/Assignment/Homework_1 - HTML/area.html new file mode 100644 index 0000000..62e25ad --- /dev/null +++ b/Assignment/Homework_1 - HTML/area.html @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/Homework_1 - HTML/map.html b/Assignment/Homework_1 - HTML/map.html new file mode 100644 index 0000000..9b470a7 --- /dev/null +++ b/Assignment/Homework_1 - HTML/map.html @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/Homework_1 - HTML/test.html b/Assignment/Homework_1 - HTML/test.html new file mode 100644 index 0000000..e69de29 diff --git a/Assignment/test1.css b/Assignment/test1.css new file mode 100644 index 0000000..e69de29 From 60dda4af02087f2553634bf7589edeeee68e0698 Mon Sep 17 00:00:00 2001 From: Robin Oh Date: Tue, 13 Sep 2016 13:02:36 -0700 Subject: [PATCH 4/8] hw 1 submission --- Assignment/Homework_1 - HTML/area.html | 24 ++++++++++++++++++++++++ Assignment/Homework_1 - HTML/map.html | 24 ++++++++++++++++++++++++ Assignment/Homework_1 - HTML/test.html | 0 Assignment/test1.css | 0 4 files changed, 48 insertions(+) create mode 100644 Assignment/Homework_1 - HTML/area.html create mode 100644 Assignment/Homework_1 - HTML/map.html create mode 100644 Assignment/Homework_1 - HTML/test.html create mode 100644 Assignment/test1.css diff --git a/Assignment/Homework_1 - HTML/area.html b/Assignment/Homework_1 - HTML/area.html new file mode 100644 index 0000000..62e25ad --- /dev/null +++ b/Assignment/Homework_1 - HTML/area.html @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/Homework_1 - HTML/map.html b/Assignment/Homework_1 - HTML/map.html new file mode 100644 index 0000000..9b470a7 --- /dev/null +++ b/Assignment/Homework_1 - HTML/map.html @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/Homework_1 - HTML/test.html b/Assignment/Homework_1 - HTML/test.html new file mode 100644 index 0000000..e69de29 diff --git a/Assignment/test1.css b/Assignment/test1.css new file mode 100644 index 0000000..e69de29 From 4e0e4b31c9f02e1d59872cd4cf46a16d70f17f21 Mon Sep 17 00:00:00 2001 From: Robin Oh Date: Wed, 28 Sep 2016 13:11:33 -0700 Subject: [PATCH 5/8] finished soundcloud --- Assignment/HW4_Soundcloud/OhLogo.png | Bin 0 -> 646 bytes Assignment/HW4_Soundcloud/index.html | 75 ++++++++++ Assignment/HW4_Soundcloud/main.js | 132 ++++++++++++++++++ .../startercode_HW4_skeleton.js | 38 +++-- Assignment/HW4_Soundcloud/style.css | 0 5 files changed, 233 insertions(+), 12 deletions(-) create mode 100644 Assignment/HW4_Soundcloud/OhLogo.png create mode 100644 Assignment/HW4_Soundcloud/index.html create mode 100644 Assignment/HW4_Soundcloud/main.js create mode 100644 Assignment/HW4_Soundcloud/style.css diff --git a/Assignment/HW4_Soundcloud/OhLogo.png b/Assignment/HW4_Soundcloud/OhLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..004c90ba769bf8807f2a81c8cb490cb3460b098d GIT binary patch literal 646 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1SE5RJ;(=AjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85o30K$!7fntTNV1Cz9;i(^Pd+}oRuS%(}X93I~L&t}^k{(;@Z=Q4Bd>-2LkZ&+7UzN!oAdv&FlIkY4}dfgtad9`T^3cQ!uF4eww zj``*uhl^h?tti$v(h{F9x?)cG6dgnWIAE zijC7}%r2=?h`4kjK~l3Zu5z)2P3GzP#S*#B!tX^trucA)oT)w)CR=m<#d<~UfC{1B z-4_lWzj2g#@*anW_xIn_s5>D)r+H@MBH1T)ZQmEa__U|D;@i%~ysJHViz7TOAMXz| z_T?{GUF5cY-OX@o?(@$~zjXgJygs($_R^V5XAK$^$bf9o c@AomNont#%Z-1c~n06REUHx3vIVCg!09P#{7XSbN literal 0 HcmV?d00001 diff --git a/Assignment/HW4_Soundcloud/index.html b/Assignment/HW4_Soundcloud/index.html new file mode 100644 index 0000000..73c09e5 --- /dev/null +++ b/Assignment/HW4_Soundcloud/index.html @@ -0,0 +1,75 @@ + + + + + + + + + + OH SOUND + + + + + + + +
+
+
+
Search Result
+
+ + + + + + + + + + + + + +
+
+
+
+
Playlist
+
+ + + + + + + + + + + + + + + + +
SongAlbum ArtListenPlaylistUpDown
+
+
+
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/HW4_Soundcloud/main.js b/Assignment/HW4_Soundcloud/main.js new file mode 100644 index 0000000..bf2665c --- /dev/null +++ b/Assignment/HW4_Soundcloud/main.js @@ -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("\ + " + title + "\ + \ + \ + \ + ") + } +} + +//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(" ") + + $(copy).append(" ") + + + $('#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()); +}) \ No newline at end of file diff --git a/Assignment/HW4_Soundcloud/startercode_HW4_skeleton.js b/Assignment/HW4_Soundcloud/startercode_HW4_skeleton.js index dbd277e..cb2804f 100644 --- a/Assignment/HW4_Soundcloud/startercode_HW4_skeleton.js +++ b/Assignment/HW4_Soundcloud/startercode_HW4_skeleton.js @@ -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", @@ -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) + + }) +); + + + + diff --git a/Assignment/HW4_Soundcloud/style.css b/Assignment/HW4_Soundcloud/style.css new file mode 100644 index 0000000..e69de29 From f682b5df565f5993988a961ac07f92aebff3f2ae Mon Sep 17 00:00:00 2001 From: Robin Oh Date: Tue, 13 Sep 2016 13:02:36 -0700 Subject: [PATCH 6/8] hw 1 submission --- Assignment/Homework_1 - HTML/area.html | 24 ++++++++++++++++++++++++ Assignment/Homework_1 - HTML/map.html | 24 ++++++++++++++++++++++++ Assignment/Homework_1 - HTML/test.html | 0 Assignment/test1.css | 0 4 files changed, 48 insertions(+) create mode 100644 Assignment/Homework_1 - HTML/area.html create mode 100644 Assignment/Homework_1 - HTML/map.html create mode 100644 Assignment/Homework_1 - HTML/test.html create mode 100644 Assignment/test1.css diff --git a/Assignment/Homework_1 - HTML/area.html b/Assignment/Homework_1 - HTML/area.html new file mode 100644 index 0000000..62e25ad --- /dev/null +++ b/Assignment/Homework_1 - HTML/area.html @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/Homework_1 - HTML/map.html b/Assignment/Homework_1 - HTML/map.html new file mode 100644 index 0000000..9b470a7 --- /dev/null +++ b/Assignment/Homework_1 - HTML/map.html @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/Homework_1 - HTML/test.html b/Assignment/Homework_1 - HTML/test.html new file mode 100644 index 0000000..e69de29 diff --git a/Assignment/test1.css b/Assignment/test1.css new file mode 100644 index 0000000..e69de29 From 47270ff580d4062fb1d49fea57b23d641e32ccda Mon Sep 17 00:00:00 2001 From: Robin Oh Date: Wed, 28 Sep 2016 13:11:33 -0700 Subject: [PATCH 7/8] finished soundcloud --- Assignment/HW4_Soundcloud/OhLogo.png | Bin 0 -> 646 bytes Assignment/HW4_Soundcloud/index.html | 75 ++++++++++ Assignment/HW4_Soundcloud/main.js | 132 ++++++++++++++++++ .../startercode_HW4_skeleton.js | 38 +++-- Assignment/HW4_Soundcloud/style.css | 0 5 files changed, 233 insertions(+), 12 deletions(-) create mode 100644 Assignment/HW4_Soundcloud/OhLogo.png create mode 100644 Assignment/HW4_Soundcloud/index.html create mode 100644 Assignment/HW4_Soundcloud/main.js create mode 100644 Assignment/HW4_Soundcloud/style.css diff --git a/Assignment/HW4_Soundcloud/OhLogo.png b/Assignment/HW4_Soundcloud/OhLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..004c90ba769bf8807f2a81c8cb490cb3460b098d GIT binary patch literal 646 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1SE5RJ;(=AjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85o30K$!7fntTNV1Cz9;i(^Pd+}oRuS%(}X93I~L&t}^k{(;@Z=Q4Bd>-2LkZ&+7UzN!oAdv&FlIkY4}dfgtad9`T^3cQ!uF4eww zj``*uhl^h?tti$v(h{F9x?)cG6dgnWIAE zijC7}%r2=?h`4kjK~l3Zu5z)2P3GzP#S*#B!tX^trucA)oT)w)CR=m<#d<~UfC{1B z-4_lWzj2g#@*anW_xIn_s5>D)r+H@MBH1T)ZQmEa__U|D;@i%~ysJHViz7TOAMXz| z_T?{GUF5cY-OX@o?(@$~zjXgJygs($_R^V5XAK$^$bf9o c@AomNont#%Z-1c~n06REUHx3vIVCg!09P#{7XSbN literal 0 HcmV?d00001 diff --git a/Assignment/HW4_Soundcloud/index.html b/Assignment/HW4_Soundcloud/index.html new file mode 100644 index 0000000..73c09e5 --- /dev/null +++ b/Assignment/HW4_Soundcloud/index.html @@ -0,0 +1,75 @@ + + + + + + + + + + OH SOUND + + + + + + + +
+
+
+
Search Result
+
+ + + + + + + + + + + + + +
+
+
+
+
Playlist
+
+ + + + + + + + + + + + + + + + +
SongAlbum ArtListenPlaylistUpDown
+
+
+
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assignment/HW4_Soundcloud/main.js b/Assignment/HW4_Soundcloud/main.js new file mode 100644 index 0000000..bf2665c --- /dev/null +++ b/Assignment/HW4_Soundcloud/main.js @@ -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("\ + " + title + "\ + \ + \ + \ + ") + } +} + +//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(" ") + + $(copy).append(" ") + + + $('#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()); +}) \ No newline at end of file diff --git a/Assignment/HW4_Soundcloud/startercode_HW4_skeleton.js b/Assignment/HW4_Soundcloud/startercode_HW4_skeleton.js index dbd277e..cb2804f 100644 --- a/Assignment/HW4_Soundcloud/startercode_HW4_skeleton.js +++ b/Assignment/HW4_Soundcloud/startercode_HW4_skeleton.js @@ -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", @@ -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) + + }) +); + + + + diff --git a/Assignment/HW4_Soundcloud/style.css b/Assignment/HW4_Soundcloud/style.css new file mode 100644 index 0000000..e69de29 From f3a4df324bfd7d53ada6e94c41d7b9b72289ff1c Mon Sep 17 00:00:00 2001 From: Robin Oh Date: Wed, 12 Oct 2016 15:17:38 -0700 Subject: [PATCH 8/8] labflask --- Labs/flasklab2/flaskLab2/.spyderworkspace | Bin 0 -> 50 bytes Labs/flasklab2/flaskLab2/app/__init__.py | 4 + Labs/flasklab2/flaskLab2/app/__init__.pyc | Bin 0 -> 278 bytes .../app/__pycache__/__init__.cpython-35.pyc | Bin 0 -> 268 bytes .../app/__pycache__/views.cpython-35.pyc | Bin 0 -> 1917 bytes .../flaskLab2/app/static/interactions.js | 39 +++ Labs/flasklab2/flaskLab2/app/static/main.css | 225 ++++++++++++++++++ .../flaskLab2/app/templates/base.html | 33 +++ .../flaskLab2/app/templates/login.html | 19 ++ .../app/templates/not_authorized.html | 13 + .../app/templates/page_not_found.html | 12 + .../flaskLab2/app/templates/results.html | 32 +++ .../flaskLab2/app/templates/survey.html | 33 +++ Labs/flasklab2/flaskLab2/app/views.py | 51 ++++ Labs/flasklab2/flaskLab2/app/views.pyc | Bin 0 -> 2299 bytes Labs/flasklab2/flaskLab2/run.py | 3 + 16 files changed, 464 insertions(+) create mode 100644 Labs/flasklab2/flaskLab2/.spyderworkspace create mode 100644 Labs/flasklab2/flaskLab2/app/__init__.py create mode 100644 Labs/flasklab2/flaskLab2/app/__init__.pyc create mode 100644 Labs/flasklab2/flaskLab2/app/__pycache__/__init__.cpython-35.pyc create mode 100644 Labs/flasklab2/flaskLab2/app/__pycache__/views.cpython-35.pyc create mode 100644 Labs/flasklab2/flaskLab2/app/static/interactions.js create mode 100644 Labs/flasklab2/flaskLab2/app/static/main.css create mode 100644 Labs/flasklab2/flaskLab2/app/templates/base.html create mode 100644 Labs/flasklab2/flaskLab2/app/templates/login.html create mode 100644 Labs/flasklab2/flaskLab2/app/templates/not_authorized.html create mode 100644 Labs/flasklab2/flaskLab2/app/templates/page_not_found.html create mode 100644 Labs/flasklab2/flaskLab2/app/templates/results.html create mode 100644 Labs/flasklab2/flaskLab2/app/templates/survey.html create mode 100644 Labs/flasklab2/flaskLab2/app/views.py create mode 100644 Labs/flasklab2/flaskLab2/app/views.pyc create mode 100644 Labs/flasklab2/flaskLab2/run.py diff --git a/Labs/flasklab2/flaskLab2/.spyderworkspace b/Labs/flasklab2/flaskLab2/.spyderworkspace new file mode 100644 index 0000000000000000000000000000000000000000..be24de3f58bb019a1446608c26e01e2dc4121a3e GIT binary patch literal 50 zcmZo*sx4&H2<0s(%FjwoE{QKlEXgP?WQq-C$xF;lEo6@1WME+MNla2m%SkNGE@Uay F0|1r^4`~1Z literal 0 HcmV?d00001 diff --git a/Labs/flasklab2/flaskLab2/app/__init__.py b/Labs/flasklab2/flaskLab2/app/__init__.py new file mode 100644 index 0000000..9a4e940 --- /dev/null +++ b/Labs/flasklab2/flaskLab2/app/__init__.py @@ -0,0 +1,4 @@ +from flask import Flask + +myapp = Flask(__name__) +from app import views diff --git a/Labs/flasklab2/flaskLab2/app/__init__.pyc b/Labs/flasklab2/flaskLab2/app/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d4e5adeb859807192e959f25c2546b087e0a2ed GIT binary patch literal 278 zcmYjLOA5j;5S_GEL=-%N%dR9_Kd7L%5*LatBrv2lLNTeOiNCe?^D-Vlr$x~r^JZQi z^Je^Kvp(uSHaqx)M|DhTIYCU1fd()PwhWkJpggz}@k`AET>%roHUJj;unH?Ql)NZH zMx6@?W?I_AkDe2Cv5TlUe3``lh-p97D=Kuw9~)o>*Iz zTM^}H&XIF2rpg}NF%wd&tC-8EU2YNNA`p`_afqGlRxTWvV|>zTSh(Bb{Fc{XZ~f0Y AU;qFB literal 0 HcmV?d00001 diff --git a/Labs/flasklab2/flaskLab2/app/__pycache__/__init__.cpython-35.pyc b/Labs/flasklab2/flaskLab2/app/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b28a8e135ab6fbb1c2caedd5ae1e9b96f1a5d9a GIT binary patch literal 268 zcmWgR<>e|XejD!2z`*brh~a<<$Z`PUVgn$N0z`}qISdTBj0{nX42-Fa45>^E%|H$_ zSdNJyhlL@Rl_83ifiZ=dAy|{;B~TZGCgUwux17Y{Y!IU?Gqt?fPm?W*H4P+G1hU{3 zM|^xV+2}J L%mO3?n0Ocg+Kxk1 literal 0 HcmV?d00001 diff --git a/Labs/flasklab2/flaskLab2/app/__pycache__/views.cpython-35.pyc b/Labs/flasklab2/flaskLab2/app/__pycache__/views.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f418e223897d5ac28e3164f6e0ee6fa1abd0d471 GIT binary patch literal 1917 zcmaJ>&2A$_5U!qI+wotLCA+|~%WdUD64)bJp@o1DTI8VhBBYU}XyR!nPG&r&yB&y? zm5{-)T6?gk zr&zizh%)>Iy*L524zh;@o*%v7G>?FX3}1% zb)1ndWt*#`&gy9EEeqR}-C3!1o!Ta4?>GxPl-*q&;i6B2-n|;APX-Y_J-&@BK4SzAn?e>y8sDi#$z9|fUX!hG2p$!c7UV} zdQsn!t(#S^ zPln&Ylpa1Wk0;X)4^M|*NPTX~+3@SbZ_?u>1*eDOJk{sm9Fp{imvE-s*4?xGr@wg{9HDH0F%6w6-p-ucQq~!{w|&KLNulc--O}*TNt0S(|mM>ge><2BLcn zt_??JUaAD;P-aQ(A|0g$qadk`<>wM5A{X_s+&y+|5|8C)V)CV}7{E8tp;z7j^zdbCMYVKR)7TE?w$n)4k@%jD5_AEV-N7K?^ z2+pUOi_V$Bc&VlgdP}KNz3E{4-xoiIea&AZPdxfI + + + + + {% block title %}{% endblock %} - Ape Ask + + + + {% block styles %}{% endblock %} + + + + +
+ {% block header %} +
+
+ +
+

Ape Ask

+
+ {% endblock %} +
+
{% block content %}{% endblock %}
+ +
+

© Copyright 2016 Ape Ask, all rights reserved

+
+ + + + \ No newline at end of file diff --git a/Labs/flasklab2/flaskLab2/app/templates/login.html b/Labs/flasklab2/flaskLab2/app/templates/login.html new file mode 100644 index 0000000..834eb71 --- /dev/null +++ b/Labs/flasklab2/flaskLab2/app/templates/login.html @@ -0,0 +1,19 @@ +{% extends "base.html"%} + +{% block title %} + Login +{% endblock %} + + +{% block content %} +

Hi There! Welcome to Ape Ask, the leading online survey site.

+
+

Let's get you logged in

+
+ + + +
+
+ +{% endblock %} \ No newline at end of file diff --git a/Labs/flasklab2/flaskLab2/app/templates/not_authorized.html b/Labs/flasklab2/flaskLab2/app/templates/not_authorized.html new file mode 100644 index 0000000..0baeb84 --- /dev/null +++ b/Labs/flasklab2/flaskLab2/app/templates/not_authorized.html @@ -0,0 +1,13 @@ + + + + + Oops! + + +

Uh Oh! You're not authorized

+ +
+ Take me back home, already! + + \ No newline at end of file diff --git a/Labs/flasklab2/flaskLab2/app/templates/page_not_found.html b/Labs/flasklab2/flaskLab2/app/templates/page_not_found.html new file mode 100644 index 0000000..2dacddb --- /dev/null +++ b/Labs/flasklab2/flaskLab2/app/templates/page_not_found.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block title %} + Oops! +{% endblock %} + +{% block content %} +

Oh, Pooh Bear! You're stuck because we don't have that page for you.

+ +
+ Go back! +{% endblock %} \ No newline at end of file diff --git a/Labs/flasklab2/flaskLab2/app/templates/results.html b/Labs/flasklab2/flaskLab2/app/templates/results.html new file mode 100644 index 0000000..c1efdc8 --- /dev/null +++ b/Labs/flasklab2/flaskLab2/app/templates/results.html @@ -0,0 +1,32 @@ +{% extends "base.html" %} + +{% block title %} + Survey +{% endblock %} + +{% block header %} + {{ super() }} +
+ Logged in as {{ name }} + +
+{% endblock %} + +{% block content %} +

Great news - your results are in! Check it out...

+
+

Here are some of your favorite things

+ Your favorite color is {{ surveyResponse['color']}} + Your favorite food is {{ surveyResponse['food']}} + Your favorite vacation spot is {{ surveyResponse['vacation']}} + +

Wow! Your front end skillz are getting sharp!

+ Before IO Lab, your front end skillz were at a {{ surveyResponse['fe-before']}} + But in just a few short weeks of IO Lab, your front end skillz are now a {{ surveyResponse['fe-after']}} + +
+ Want your survey results emailed to you? + Yes! +
+
+{% endblock %} \ No newline at end of file diff --git a/Labs/flasklab2/flaskLab2/app/templates/survey.html b/Labs/flasklab2/flaskLab2/app/templates/survey.html new file mode 100644 index 0000000..1c9f6da --- /dev/null +++ b/Labs/flasklab2/flaskLab2/app/templates/survey.html @@ -0,0 +1,33 @@ +{% extends "base.html"%} + +{% block title %} + Survey +{% endblock %} + + +{% block header %} + {{super()}} +
+ Logged in as {{ name }} + +
+{% endblock %} + +{% block content %} +

A Little Survey About You

+
+

Some of your favorites

+ + + + +

Let's look at your front end skillz progression

+ + + + + +{% endblock %} +
\ No newline at end of file diff --git a/Labs/flasklab2/flaskLab2/app/views.py b/Labs/flasklab2/flaskLab2/app/views.py new file mode 100644 index 0000000..b66b413 --- /dev/null +++ b/Labs/flasklab2/flaskLab2/app/views.py @@ -0,0 +1,51 @@ +from app import myapp +from flask import request, render_template, session, redirect, url_for, escape +import os + +myapp.secret_key = os.urandom(24) + +@myapp.route('/') +@myapp.route('/index') +def index(): + username = '' + if 'username' in session: + username = escape(session['username']) + return render_template('survey.html', name=username) + else: + return render_template('login.html') + +@myapp.route('/login', methods=['GET', 'POST']) +def login(): + if request.method=='POST': + session['username'] = request.form.get("username") + session['email'] = request.form.get("email") + return redirect(url_for('index')) + +@myapp.route('/logout') +def logout(): + session.pop('username', None) + session.pop('email', None) + return redirect(url_for('index')) + +@myapp.route('/submit-survey', methods=['GET', 'POST']) +def submitSurvey(): + username = '' + email = '' + if 'username' in session: + username = escape(session['username']) + email = escape(session['email']) + surveyResponse = {} + + surveyResponse['color'] = request.form.get('color') + surveyResponse['food'] = request.form.get('food') + surveyResponse['vacation'] = request.form.get('vacation') + + surveyResponse['fe-before'] = request.form.get('feBefore') + surveyResponse['fe-after'] = request.form.get('feAfter') + return render_template('results.html', name=username, email=email, surveyResponse=surveyResponse) + else: + return render_template('login.html') + +@myapp.errorhandler(404) +def page_not_found(error): + return render_template('page_not_found.html'), 404 \ No newline at end of file diff --git a/Labs/flasklab2/flaskLab2/app/views.pyc b/Labs/flasklab2/flaskLab2/app/views.pyc new file mode 100644 index 0000000000000000000000000000000000000000..259c8d15006dc6248a0b27530dcff389a33fa068 GIT binary patch literal 2299 zcmcIlOK&4Z5U%cV{79U{&I+`!Aoj2aUpBEo;(%6Ym$2f33>q&8jVxIcPdgcVUQD;c zM#`STPvA#!Z*QJef3p2_-l9jr@#OBaYpOU7QUZj*teJx z{42_caz&9M#cNHOraYi1pu9m*gYqqkwkU5>)TF#cQH%06MQy)3psYhthfIeS+mtlu zN|8}C-QjuBrDSWZVY$h2(xP991^h?5n{91MI+Wms9Xi!8sieE!7VT~J?8@=IjedWl z-@kLVx7pK^J$*|0a`s@OKcFO_@!$b4NZ;Z!P>>vBlV8MDHE8m(g{d|_uZ(qWU*sY& z_0*ZX%3^24ZjH5RS-7^?le9K7Cx%s>P3L9p_$Fg#ab-s7L&%O_IYnEt^z-$_F7MJs$u#*qr7Vk_KHenrh5z0eg%rjwON-4qzkuwz8%! z;@sFBEbOX2Hy4LzF3%jlDu!(cS$Uckq8|iUhBC3Mp~fU2g&meK{A53ebo|BS2i$Kb zCv{N|r^DfJ^0l!`S5}iaGp{G##wU;GS!|aRU^_Wa%`f(_x)8Vp0tVXh`xG=)SM^j+ zdw|3rfipMmtW2z9kG^^NO5FbbyYZ_TpW+W2jxp>@Oo)2{rYTx#s$a+w=m0vL$JaBq z3w)voplERR0jB4rhmh$o3imKe(BiMj<1`ByL_s(d-Y`PmLGcS|&pmVuZphc%04CCX zQ4?JHxYu%SN$=~v>MP4Q9>G?w++AFTFka&Vid<<@>ouTQuLD8^pw$|N0S7RW=tHgm zA2u2Cy}@=(i+~ouMd)z}v>IT{wN{FbwOhBf((72;ysd39 zvaD_2)^;}9ZD>Km9YXg*StAjb@OYO`T&ZBpwmshK`Ng&gTkhJ>WEGDGL#T+GWd zk@`Q6XR+Hfs=4{ffTYH9Ezix<6In@}&CQFsLn-sEu*9=;YKd(3O*5b35` zHyYK{?<@St{E<$7gOf9Mlm|CGAyE$kSOXpbd@yLP(P7!|k>#I|Dn2#SqI78Zt0EDI zl)S>F?1Km}RI!`(en@=A61M&306#xJL literal 0 HcmV?d00001 diff --git a/Labs/flasklab2/flaskLab2/run.py b/Labs/flasklab2/flaskLab2/run.py new file mode 100644 index 0000000..dae9904 --- /dev/null +++ b/Labs/flasklab2/flaskLab2/run.py @@ -0,0 +1,3 @@ +#!flask/bin/python +from app import myapp +myapp.run(debug=True,host='0.0.0.0')