Explorar o código

re-added ability to make room private upon creation

Akira Laine %!s(int64=9) %!d(string=hai) anos
pai
achega
285c17f784
Modificáronse 3 ficheiros con 27 adicións e 26 borrados
  1. 1 2
      app/client/app.css
  2. 24 24
      app/client/client.js
  3. 2 0
      app/client/templates/admin.html

+ 1 - 2
app/client/app.css

@@ -1469,9 +1469,8 @@ input[type="checkbox"]:checked + #two-label:after {
     max-width: 25px; /*an arbitratry number more than the icon's width*/
     opacity: 1; /*for fade in effect*/
 }
-
-/*adding some colors for fun*/
 #two+label:before, #two+label:after {color: hsl(180, 45%, 40%);}
+/*End of checkbox awesomeness!*/
 
 #chat-tab, #global-chat-tab {
     -webkit-transition: background-color 500ms linear;

+ 24 - 24
app/client/client.js

@@ -125,7 +125,7 @@ Template.settings.events({
 });
 
 Template.profile.events({
-    //Edit reak name
+    //Edit real name
     "click #edit-name": function(){
         $("#name").hide();
         $("#name-div").show();
@@ -1245,20 +1245,29 @@ Template.admin.helpers({
 });
 
 Template.admin.events({
-  "click #croom_create": function() {
-      Meteor.call("createRoom", $("#croom_display").val(), $("#croom_tag").val(), function (err, res) {
-          if (err) {
-              alert("Error " + err.error + ": " + err.reason);
-          } else {
-              window.location = "/" + $("#croom_tag").val();
-          }
-      });
-  },
-  "click a": function(e){
-    var id = e.currentTarget.id;
-    console.log(id.toLowerCase());
-    Session.set("playlistToEdit", id);
-  }
+    "click #croom_create": function() {
+        Meteor.call("createRoom", $("#croom_display").val(), $("#croom_tag").val(), function (err, res) {
+            if (err) {
+            alert("Error " + err.error + ": " + err.reason);
+        } else {
+            window.location = "/" + $("#croom_tag").val();
+            }
+        });
+    },
+    "click a": function(e){
+        var id = e.currentTarget.id;
+        console.log(id.toLowerCase());
+        Session.set("playlistToEdit", id);
+    },
+    "click #croom_create": function() {
+        Meteor.call("createRoom", $("#croom_display").val(), $("#croom_tag").val(), $("#two").prop("checked"), function (err, res) {
+            if (err) {
+                alert("Error " + err.error + ": " + err.reason);
+            } else {
+                window.location = "/" + $("#croom_tag").val();
+            }
+        });
+    },
 });
 
 Template.stations.helpers({
@@ -1471,15 +1480,6 @@ Template.stations.events({
             }, 10000);
         }
     },
-    "click #croom_create": function() {
-        Meteor.call("createRoom", $("#croom_display").val(), $("#croom_tag").val(), $("#two").prop("checked"), function (err, res) {
-            if (err) {
-                alert("Error " + err.error + ": " + err.reason);
-            } else {
-                window.location = "/" + $("#croom_tag").val();
-            }
-        });
-    },
     "click #get-spotify-info": function() {
         var search = $("#title").val();
         var artistName = $("#artist").val();

+ 2 - 0
app/client/templates/admin.html

@@ -56,6 +56,8 @@
                           <div class="input-group">
                             <input type="text" class="croom" id="croom_tag" name="croom" required />
                           </div>
+                          <input type="checkbox" name="two" id="two"/>
+                          <label id="two-label" for="two">Make Room Private?</label>
                           <button class="btn btn-warning btn-block" id="croom_create">Create</button>
                         </div>
                       </div>