Load initial streams

This commit is contained in:
Artyom Abubakirov 2018-07-16 12:14:27 +05:00
parent 9bcdf905dd
commit dd1de99ae5
6 changed files with 40 additions and 8 deletions

View File

@ -1,2 +1,2 @@
.dashboard{min-height:100vh;min-width:100%}.dashboard--elem{position:relative;border:1px dashed gainsboro;width:50%;float:left;height:50vh;background-image:url('../img/dragdrop.png');background-repeat:no-repeat;background-position:center center;background-size:100px 100px}.dashboard--elem.small{display:none}.dashboard--elem.small--panel{display:none}.dashboard--elem.fullscreen{display:block !important;height:100vh !important;width:100% !important}.dashboard--elem--panel{z-index:999;position:absolute;left:15px;top:15px;background-color:black;border-radius:15px;color:white;text-align:center;padding:10px}.dashboard--elem--panel span{cursor:pointer;margin-left:10px}.dashboard--elem--panel span:first-child{margin-left:0} .dashboard{min-height:100vh;min-width:100%}.dashboard--elem{position:relative;border:1px dashed gainsboro;width:50%;float:left;height:50vh;background-image:url('../img/dragdrop.png');background-repeat:no-repeat;background-position:center center;background-size:100px 100px}.dashboard--elem iframe{border:none}.dashboard--elem.small{display:none}.dashboard--elem.small--panel{display:none}.dashboard--elem.fullscreen{display:block !important;height:100vh !important;width:100% !important}.dashboard--elem--panel{z-index:999;position:absolute;left:15px;top:15px;background-color:black;border-radius:15px;color:white;text-align:center;padding:10px}.dashboard--elem--panel span{cursor:pointer;margin-left:10px}.dashboard--elem--panel span:first-child{margin-left:0}
/*# sourceMappingURL=dashboard.css.map */ /*# sourceMappingURL=dashboard.css.map */

View File

@ -1 +1 @@
{"version":3,"sources":["dashboard.less"],"names":[],"mappings":"AAEA,WACI,iBACA,cAAA,CACA,iBACI,kBACA,4BACA,UACA,WACA,YACA,4CACA,4BACA,kCACA,2BAAA,CAEA,uBACI,YAAA,CACA,8BACI,YAAA,CAIR,4BACI,yBACA,wBACA,qBAAA,CAGJ,wBACI,YACA,kBACA,UACA,SACA,uBACA,mBACA,YACA,kBACA,YAAA,CATJ,6BAcQ,eACA,gBAAA,CAJA,yCACI,aAAA,CAAA","file":"to.css"} {"version":3,"sources":["dashboard.less"],"names":[],"mappings":"AAEA,WACI,iBACA,cAAA,CACA,iBACI,kBACA,4BACA,UACA,WACA,YACA,4CACA,4BACA,kCACA,2BAAA,CATJ,wBAYQ,WAAA,CAGJ,uBACI,YAAA,CACA,8BACI,YAAA,CAIR,4BACI,yBACA,wBACA,qBAAA,CAGJ,wBACI,YACA,kBACA,UACA,SACA,uBACA,mBACA,YACA,kBACA,YAAA,CATJ,6BAcQ,eACA,gBAAA,CAJA,yCACI,aAAA,CAAA","file":"to.css"}

View File

@ -14,6 +14,10 @@
background-position: center center; background-position: center center;
background-size: 100px 100px; background-size: 100px 100px;
iframe {
border: none;
}
&.small { &.small {
display: none; display: none;
&--panel{ &--panel{

View File

@ -16,10 +16,10 @@
</head> </head>
<body> <body>
<div class="dashboard"> <div class="dashboard">
<div ondragover="return false" ondragenter="return false" class="dashboard--elem"></div> <div id="r1" ondragover="return false" ondragenter="return false" class="dashboard--elem"></div>
<div ondragover="return false" ondragenter="return false" class="dashboard--elem"></div> <div id="r2" ondragover="return false" ondragenter="return false" class="dashboard--elem"></div>
<div ondragover="return false" ondragenter="return false" class="dashboard--elem"></div> <div id="r3" ondragover="return false" ondragenter="return false" class="dashboard--elem"></div>
<div ondragover="return false" ondragenter="return false" class="dashboard--elem"></div> <div id="r4" ondragover="return false" ondragenter="return false" class="dashboard--elem"></div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -2,6 +2,36 @@ $( document ).ready(() => {
var counter = 0; var counter = 0;
let url_string = window.location.href;
let url = new URL(url_string);
let r = url.searchParams.get('r');
if(r){
init(r.split('|'));
}
function init(arr) {
let blocks = ['r4', 'r3', 'r2', 'r1'];
for(let i = 0; i< arr.length; i++){
if(blocks.length > 0 ){
let id = blocks.pop();
let panel = generatePanel(counter);
$( '#' + id ).append( panel + '<iframe src="https://gto.to/?r=' + arr[i] + '" width="100%" height="100%" align="center">\n' +
' Iframe is not supported\n' +
' </iframe>' );
bindEvents(counter);
counter++;
} else {
break;
}
}
}
function generatePanel(i) { function generatePanel(i) {
return '<div class="dashboard--elem--panel">' + return '<div class="dashboard--elem--panel">' +
'<span id="full' + i + '"><i class="glyphicon glyphicon-fullscreen"></i></span> ' + '<span id="full' + i + '"><i class="glyphicon glyphicon-fullscreen"></i></span> ' +

View File

@ -32,8 +32,6 @@ $(function() {
let url = new URL(url_string); let url = new URL(url_string);
room = url.searchParams.get('r'); room = url.searchParams.get('r');
console.log(room);
socket = io('https://gto.to/'); socket = io('https://gto.to/');
$('#call').on('click', function(e) { presenter(); e.preventDefault(); } ); $('#call').on('click', function(e) { presenter(); e.preventDefault(); } );