diff --git a/index.html b/index.html index e58b426..ad9b020 100644 --- a/index.html +++ b/index.html @@ -146,6 +146,7 @@ +
diff --git a/main.css b/main.css index df35fb0..6f93fb1 100644 --- a/main.css +++ b/main.css @@ -501,10 +501,23 @@ button.glyphicon-button.active.focus { padding: 0px; } } +/* Node selector to prioritise this selector above .float */ +button.btnArmTransferRoom{ + width:auto; + margin-left: 2px; + height:38px; + border-radius: 15px; +} +button.btnArmTransferRoom i{ + margin-right:3px; +} +button.btnArmTransferRoom:hover{ + background-color: var(--green-accent); +} - - - +button.btnArmTransferRoom.selected{ + background-color: var(--red-accent); +} @media only screen and (max-height: 540px){ #subControlButtons { diff --git a/main.js b/main.js index efc0b1b..3da0279 100644 --- a/main.js +++ b/main.js @@ -707,6 +707,11 @@ if (urlParams.has('director') || urlParams.has('dir')) { filename = false; } +if (urlParams.has('rooms')) { + session.rooms = urlParams.get('rooms').split(",").map(function(e) { + return sanitizeRoomName(e); + }); +} if (urlParams.has('showdirector')) { session.showDirector = true; @@ -3718,6 +3723,7 @@ function lowerhand() { var previousRoom = ""; var stillNeedRoom = true; var transferCancelled = false; +var armedTransfer = true; function directMigrate(ele, event) { // everyone in the room will hangup this guest also? I like that idea. What about the STREAM ID? I suppose we don't kick out if the viewID matches. @@ -3741,6 +3747,8 @@ function directMigrate(ele, event) { // everyone in the room will hangup this gu stillNeedRoom = false; log("Migrate queued"); return; + } else if (armedTransfer){ + migrateRoom = sanitizeRoomName(previousRoom); } else { var migrateRoom = prompt("Transfer guests to room:\n\n(Please note rooms must share the same password)", previousRoom); stillNeedRoom = true; @@ -4990,6 +4998,18 @@ function createRoomCallback(passAdd, passAdd2) { getById("miniPerformer").innerHTML = ''; } getById("miniPerformer").className = ""; + + var tabindex = 26; + if(session.rooms && session.rooms.length > 0){ + var container = getById("rooms"); + container.innerHTML += 'Arm Transfer: '; + session.rooms.forEach(function (r) { + if(session.roomid == r) return; //don't include self + container.innerHTML += ''; + tabindex++; + }); + } + } else { getById("miniPerformer").style.display = "none"; getById("controlButtons").style.display = "none"; @@ -5005,6 +5025,26 @@ function createRoomCallback(passAdd, passAdd2) { joinRoom(session.roomid); } +/** + * Handles click actions on the room selection buttons in #controlButtons + * @param {string} room - Room name to select/deselect for the next transfer call + */ +function handleRoomSelect(room) { + var elems = document.querySelectorAll(".btnArmTransferRoom"); + [].forEach.call(elems, function(el) { + el.classList.remove("selected"); + }); + if (previousRoom == room) { + previousRoom = undefined; + armedTransfer = false; + stillNeedRoom = true; + } else { + previousRoom = room; + stillNeedRoom = false; + armedTransfer = true; + getById("roomselect_" + room).classList.add('selected'); + } +} function requestAudioSettings(ele) { var UUID = ele.dataset.UUID;