浏览代码

removed FB login and room chat

unknown 9 年之前
父节点
当前提交
fdb669cce9
共有 5 个文件被更改,包括 16 次插入77 次删除
  1. 1 34
      app/app.css
  2. 13 19
      app/app.js
  3. 0 2
      app/templates/login.html
  4. 0 2
      app/templates/register.html
  5. 2 20
      app/templates/room.html

+ 1 - 34
app/app.css

@@ -276,12 +276,6 @@ form button:hover {
             transform: translateY(-700px) rotate(600deg);
   }
 }
-.fa-facebook{
-  margin-top: 3px;
-}
-#facebook-login{
-  background-color: #3b5998;
-}
 .fa-github{
   margin-top: 3px;
 }
@@ -662,33 +656,6 @@ footer a:hover{
 .embed-responsive{
   margin-top: 15px;
 }
-#chat {
-  /*margin-top: 100px;*/
-  height: 100vh;
-  background-color: rgba(255,255,255,0.4);
-}
-.chat-message {
-  font-size: 20px;
-  color: white;
-}
-#chat-ul {
-  height: 90vh;
-  overflow-y: scroll;
-  margin: 0;
-  padding: 0;
-}
-.chat-message:nth-child(even) {
-  color: white;
-}
-.chat-message:nth-child(odd) {
-  color: darkblue;
-}
-#submit{
-  margin-left: 10px;
-  font-size: 1.5em;
-  cursor: pointer;
-  display: inline-block;
-}
 #header {
   margin-bottom: 0px;
 }
@@ -717,5 +684,5 @@ footer a:hover{
   color: white;
 }
 #doorbell-button{
-  margin-right: 500px;
+  margin-right: 2000px;
 }

+ 13 - 19
app/app.js

@@ -136,10 +136,6 @@ if (Meteor.isClient) {
             });
         },
 
-        "click #facebook-login": function(){
-            Meteor.loginWithFacebook()
-        },
-
         "click #github-login": function(){
             Meteor.loginWithGithub()
         },
@@ -167,10 +163,6 @@ if (Meteor.isClient) {
             });
         },
 
-        "click #facebook-login": function(){
-            Meteor.loginWithFacebook()
-        },
-
         "click #github-login": function(){
             Meteor.loginWithGithub()
         },
@@ -648,7 +640,8 @@ if (Meteor.isServer) {
     Meteor.users.deny({insert: function () { return true; }});
     Meteor.users.deny({remove: function () { return true; }});
 
-    function getSongDuration(query){
+    function getSongDuration(query, artistName){
+        console.log(artistName);
         var duration;
         var search = query;
         query = query.toLowerCase().split(" ").join("%20");
@@ -657,7 +650,7 @@ if (Meteor.isServer) {
 
         for(var i in res.data){
             for(var j in res.data[i].items){
-                if(search.indexOf(res.data[i].items[j].name) !== -1){
+                if(search.indexOf(res.data[i].items[j].name) !== -1 && artistName.indexOf(res.data[i].items[j].artists[0].name) !== -1){
                     duration = res.data[i].items[j].duration_ms / 1000;
                     return duration;
                 }
@@ -665,7 +658,8 @@ if (Meteor.isServer) {
         }
     }
 
-    function getSongAlbumArt(query){
+    function getSongAlbumArt(query, artistName){
+        console.log(artistName);
         var albumart;
         var search = query;
         query = query.toLowerCase().split(" ").join("%20");
@@ -674,7 +668,7 @@ if (Meteor.isServer) {
 
         for(var i in res.data){
             for(var j in res.data[i].items){
-                if(search.indexOf(res.data[i].items[j].name) !== -1){
+                if(search.indexOf(res.data[i].items[j].name) !== -1 && artistName.indexOf(res.data[i].items[j].artists[0].name) !== -1){
                     albumart = res.data[i].items[j].album.images[1].url
                     return albumart;
                 }
@@ -688,13 +682,13 @@ if (Meteor.isServer) {
     function getSongsByType(type) {
         if (type === "edm") {
             return [
-                {id: "aE2GCa-_nyU", title: "Radioactive - Lindsey Stirling and Pentatonix", duration: getSongDuration("Radioactive - Lindsey Stirling and Pentatonix"), artist: "Lindsey Stirling, Pentatonix", type: "youtube", img: "https://i.scdn.co/image/62167a9007cef2e8ef13ab1d93019312b9b03655"},
-                {id: "aHjpOzsQ9YI", title: "Crystallize", artist: "Lindsey Stirling", duration: getSongDuration("Crystallize"), type: "youtube", img: "https://i.scdn.co/image/b0c1ccdd0cd7bcda741ccc1c3e036f4ed2e52312"}
+                {id: "aE2GCa-_nyU", title: "Radioactive - Lindsey Stirling and Pentatonix", duration: getSongDuration("Radioactive - Lindsey Stirling and Pentatonix", "Lindsey Stirling, Pentatonix"), artist: "Lindsey Stirling, Pentatonix", type: "youtube", img: "https://i.scdn.co/image/62167a9007cef2e8ef13ab1d93019312b9b03655"},
+                {id: "aHjpOzsQ9YI", title: "Crystallize", artist: "Lindsey Stirling", duration: getSongDuration("Crystallize", "Lindsey Stirling"), type: "youtube", img: "https://i.scdn.co/image/b0c1ccdd0cd7bcda741ccc1c3e036f4ed2e52312"}
             ];
         } else if (type === "nightcore") {
-            return [{id: "f7RKOP87tt4", title: "Monster (DotEXE Remix)", duration: getSongDuration("Monster (DotEXE Remix)"), artist: "Meg & Dia", type: "youtube", img: "https://i.scdn.co/image/35ecdfba9c31a6c54ee4c73dcf1ad474c560cd00"}];
+            return [{id: "f7RKOP87tt4", title: "Monster (DotEXE Remix)", duration: getSongDuration("Monster (DotEXE Remix)", "Meg & Dia"), artist: "Meg & Dia", type: "youtube", img: "https://i.scdn.co/image/35ecdfba9c31a6c54ee4c73dcf1ad474c560cd00"}];
         } else {
-            return [{id: "dQw4w9WgXcQ", title: "Never Gonna Give You Up", duration: getSongDuration("Never Gonna Give You Up"), artist: "Rick Astley", type: "youtube", img: "https://i.scdn.co/image/5246898e19195715e65e261899baba890a2c1ded"}];
+            return [{id: "dQw4w9WgXcQ", title: "Never Gonna Give You Up", duration: getSongDuration("Never Gonna Give You Up", "Rick Astley"), artist: "Rick Astley", type: "youtube", img: "https://i.scdn.co/image/5246898e19195715e65e261899baba890a2c1ded"}];
         }
     }
 
@@ -757,7 +751,7 @@ if (Meteor.isServer) {
             if (user.services.github) {
                 username = user.services.github.username;
             } else if (user.services.facebook) {
-                //username = user.services.facebook.username;
+                username = user.services.facebook.first_name;
             } else if (user.services.password) {
                 username = user.username;
             }
@@ -844,8 +838,8 @@ if (Meteor.isServer) {
                     Queues.insert({type: type, songs: []});
                 }
                 if (songData !== undefined && Object.keys(songData).length === 5 && songData.type !== undefined && songData.title !== undefined && songData.title !== undefined && songData.artist !== undefined && songData.img !== undefined) {
-                    songData.duration = getSongDuration(songData.title);
-                    songData.img = getSongAlbumArt(songData.title);
+                    songData.duration = getSongDuration(songData.title, songData.artist);
+                    songData.img = getSongAlbumArt(songData.title, songData.artist);
                     Queues.update({type: type}, {$push: {songs: {id: songData.id, title: songData.title, artist: songData.artist, duration: songData.duration, img: songData.img, type: songData.type}}});
                     return true;
                 } else {

+ 0 - 2
app/templates/login.html

@@ -7,8 +7,6 @@
             <input type="password" autocorrect="off" name="loginPassword" placeholder="Enter your password" onfocus="this.placeholder = ''" onblur="this.placeholder='Enter your password'" required/>
             <button type="submit">Login</button>
         </form>
-        <button class="btn-social" id="facebook-login"><i class="fa fa-facebook pull-left"></i>Login with Facebook</button>
-        <p></p>
         <button class="btn-social" id="github-login"><i class="fa fa-github pull-left"></i>Login with Github</button>
     </div>
 </template>

+ 0 - 2
app/templates/register.html

@@ -9,8 +9,6 @@
             <p>By registering, you agree to the Terms and Conditions and Privacy Policy.</p>
             <button type="submit">Sign Up</button>
         </form>
-        <button class="btn-social" id="facebook-login"><i class="fa fa-facebook pull-left"></i>Signup with Facebook</button>
-        <p></p>
         <button class="btn-social" id="github-login"><i class="fa fa-github pull-left"></i>Signup with Github</button>
     </div>
 </template>

+ 2 - 20
app/templates/room.html

@@ -24,26 +24,8 @@
               </div>
               <button type="button" id="song-modal" class="button-nowidth col-md-4 col-sm-4 col-xs-4 col-md-offset-4 col-sm-offset-4 col-xs-offset-4" data-toggle="modal" data-target="#myModal">Add songs</button>
             </div>
-            <div class="col-md-4" id="chat">
-              <ul id="chat-ul">
-                {{#each chat}}
-                    <li class="chat-message"><b class="bold">{{userid}}:</b> {{message}}</li>
-                {{/each}}
-              </ul>
-              <!-- <div class="row" id="chat-container">
-                <div class="col-md-10">
-                  <input id="chat-input"/>
-                </div>
-                <div class="col-md-2" id="submit">
-                  <i id="submit-message" class="fa fa-paper-plane-o"></i>
-                </div>
-              </div> -->
-              <div>
-                <input id="chat-input" placeholder="Type a message...">
-                <div id="submit">
-                  <i id="submit-message" class="fa fa-paper-plane-o"></i>
-                </div>
-              </div>
+            <div class="col-md-4" id="side-panel">
+
             </div>
           </div>
             <!--<h1 class="room-name">{{{type}}}</h1>