From bb38d02177972abc48b6a98bd461a0ef2d54c60c Mon Sep 17 00:00:00 2001 From: Ivan Sein Date: Mon, 3 Dec 2018 12:16:48 +0100 Subject: [PATCH] Create specific button to show your screen. Signed-off-by: Ivan Sein --- js/app.js | 39 +++++++++++++++++++++----------------- js/publicshareauth.js | 16 ++++++++++++++-- templates/index-public.php | 14 ++++++++++---- templates/index.php | 14 ++++++++++---- 4 files changed, 56 insertions(+), 27 deletions(-) diff --git a/js/app.js b/js/app.js index 0c63ca3f8..cf8908015 100644 --- a/js/app.js +++ b/js/app.js @@ -265,12 +265,16 @@ // The parent CSS of the menu list items is using "display:block !important", // so we need to also hide with "!important". if (webrtc.getLocalScreen()) { - $('#show-window-entry').attr('style','display:none !important'); + $('#share-screen-entry').attr('style','display:none !important'); + $('#share-window-entry').attr('style','display:none !important'); + $('#show-screen-entry').show(); $('#stop-screen-entry').show(); $('#screensharing-menu').toggleClass('open'); } else { if (splitShare) { - $('#show-window-entry').show(); + $('#share-screen-entry').show(); + $('#share-window-entry').show(); + $('#show-screen-entry').attr('style','display:none !important'); $('#stop-screen-entry').attr('style','display:none !important'); $('#screensharing-menu').toggleClass('open'); return; @@ -280,27 +284,28 @@ } }.bind(this)); + $("#share-screen-button").on('click', function() { + var webrtc = OCA.SpreedMe.webrtc; + if (!webrtc.getLocalScreen()) { + this.startShareScreen('screen'); + } + $('#screensharing-menu').toggleClass('open', false); + }.bind(this)); + + $("#share-window-button").on('click', function() { + var webrtc = OCA.SpreedMe.webrtc; + if (!webrtc.getLocalScreen()) { + this.startShareScreen('window'); + } + $('#screensharing-menu').toggleClass('open', false); + }.bind(this)); + $("#show-screen-button").on('click', function() { var webrtc = OCA.SpreedMe.webrtc; if (webrtc.getLocalScreen()) { var currentUser = OCA.SpreedMe.webrtc.connection.getSessionid(); OCA.SpreedMe.sharedScreens.switchScreenToId(currentUser); - } else { - this.startShareScreen('screen'); } - - $('#screensharing-menu').toggleClass('open', false); - }.bind(this)); - - $("#show-window-button").on('click', function() { - var webrtc = OCA.SpreedMe.webrtc; - if (webrtc.getLocalScreen()) { - var currentUser = OCA.SpreedMe.webrtc.connection.getSessionid(); - OCA.SpreedMe.sharedScreens.switchScreenToId(currentUser); - } else { - this.startShareScreen('window'); - } - $('#screensharing-menu').toggleClass('open', false); }.bind(this)); diff --git a/js/publicshareauth.js b/js/publicshareauth.js index c1f320258..2f29dc0f4 100644 --- a/js/publicshareauth.js +++ b/js/publicshareauth.js @@ -79,13 +79,25 @@ ' ' + '
' + '
    ' + - '
  • ' + + '
  • ' + + ' ' + + '
  • ' + + '
  • ' + + ' ' + + '
  • ' + + '
  • ' + ' ' + '
  • ' + - '
  • ' + + '
  • ' + '
      -
    • -
    • -
    • -
    • +
    • + +
      • -
      • -
      • -
      • -
      • +
      • + +