forked from External/greenlight
		
	set room name in html
This commit is contained in:
		@@ -3,7 +3,7 @@
 | 
				
			|||||||
  var initRooms = function() {
 | 
					  var initRooms = function() {
 | 
				
			||||||
    App.messages = App.cable.subscriptions.create({
 | 
					    App.messages = App.cable.subscriptions.create({
 | 
				
			||||||
      channel: 'ModeratorJoinsChannel',
 | 
					      channel: 'ModeratorJoinsChannel',
 | 
				
			||||||
      username: window.location.pathname.split('/').pop()
 | 
					      username: getRoomName()
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      received: function(data) {
 | 
					      received: function(data) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@
 | 
				
			|||||||
  var initRooms = function() {
 | 
					  var initRooms = function() {
 | 
				
			||||||
    App.messages = App.cable.subscriptions.create({
 | 
					    App.messages = App.cable.subscriptions.create({
 | 
				
			||||||
      channel: 'RecordingUpdatesChannel',
 | 
					      channel: 'RecordingUpdatesChannel',
 | 
				
			||||||
      username: window.location.pathname.split('/').pop()
 | 
					      username: getRoomName()
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      received: function(data) {
 | 
					      received: function(data) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -112,7 +112,7 @@
 | 
				
			|||||||
          targets: -1,
 | 
					          targets: -1,
 | 
				
			||||||
          render: function(data, type, row) {
 | 
					          render: function(data, type, row) {
 | 
				
			||||||
            if (type === 'display') {
 | 
					            if (type === 'display') {
 | 
				
			||||||
              var roomName = window.location.pathname.split('/').pop();
 | 
					              var roomName = getRoomName();
 | 
				
			||||||
              var published = row.published;
 | 
					              var published = row.published;
 | 
				
			||||||
              var eye = getPublishClass(published);
 | 
					              var eye = getPublishClass(published);
 | 
				
			||||||
              return '<button type="button" class="btn btn-default recording-update" data-id="'+data+'" data-room="'+roomName+'" data-published="'+published+'">' +
 | 
					              return '<button type="button" class="btn btn-default recording-update" data-id="'+data+'" data-room="'+roomName+'" data-published="'+published+'">' +
 | 
				
			||||||
@@ -162,7 +162,7 @@
 | 
				
			|||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    table = recordingsTable.api();
 | 
					    table = recordingsTable.api();
 | 
				
			||||||
    $.get("/rooms/"+window.location.pathname.split('/').pop()+"/recordings", function(data) {
 | 
					    $.get("/rooms/"+getRoomName()+"/recordings", function(data) {
 | 
				
			||||||
      if (!data.is_owner) {
 | 
					      if (!data.is_owner) {
 | 
				
			||||||
        table.column(-1).visible( false );
 | 
					        table.column(-1).visible( false );
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,10 @@ $.ajaxSetup({
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var getRoomName = function() {
 | 
				
			||||||
 | 
					  return $(".page-wrapper.rooms").data('room');
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var PUBLISHED_CLASSES = ['fa-eye-slash', 'fa-eye']
 | 
					var PUBLISHED_CLASSES = ['fa-eye-slash', 'fa-eye']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var getPublishClass = function(published) {
 | 
					var getPublishClass = function(published) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,7 +16,7 @@
 | 
				
			|||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
<% end %>
 | 
					<% end %>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<div class="page-wrapper rooms">
 | 
					<div class="page-wrapper rooms" data-room="<%= @user.username %>">
 | 
				
			||||||
  <div class="container-fluid">
 | 
					  <div class="container-fluid">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <%= render 'shared/title', title: page_title %>
 | 
					    <%= render 'shared/title', title: page_title %>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user