daily pastebin goal
85%
SHARE
TWEET

Untitled

a guest Feb 21st, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git root/static/js/remedie.js root/static/js/remedie.js
  2. index 34db719..c539ba0 100644
  3. --- root/static/js/remedie.js
  4. +++ root/static/js/remedie.js
  5. @@ -77,11 +77,16 @@ Remedie.prototype = {
  6.      this.installHotKey('down', 'next item', function(){ if (remedie.current_id) remedie.moveCursorNext() });
  7.      this.installHotKey('up',   'prev item', function(){ if (remedie.current_id) remedie.moveCursorPrev() });
  8.  
  9. -    this.installHotKey('o', 'open channel (or item)', function(){
  10. +    this.installHotKey('o', 'open channel (or play/close item)', function(){
  11.        if (remedie.current_id) {
  12. -        var items = $('.channel-item');
  13. -        if (items) remedie.playVideoInline(remedie.items[items[remedie.cursorPos].id.replace("channel-item-", "")]);
  14. -        return false;
  15. +        if ( remedie.isPlayingVideo ) {
  16. +          $.unblockUI();
  17. +          return false;
  18. +        } else {
  19. +          var items = $('.channel-item');
  20. +          if (items) remedie.playVideoInline(remedie.items[items[remedie.cursorPos].id.replace("channel-item-", "")]);
  21. +          return false;
  22. +        }
  23.        } else {
  24.          var channels = $('.channel');
  25.          if (channels) remedie.showChannel(remedie.channels[channels[remedie.cursorPos].id.replace("channel-", "")])
  26. @@ -243,7 +248,10 @@ Remedie.prototype = {
  27.      this.markItemAsWatched(item); // TODO setTimeout?
  28.    },
  29.  
  30. +  isPlayingVideo: false,
  31. +
  32.    playVideoInline: function(item, player) {
  33. +    remedie.isPlayingVideo = true;
  34.      var channel_id = item.channel_id;
  35.      var id   = item.id;
  36.      var url  = item.ident;
  37. @@ -388,6 +396,7 @@ Remedie.prototype = {
  38.  
  39.      this.runOnUnblock(function(){
  40.        $('#embed-player').children().remove();
  41. +      remedie.isPlayingVideo = false;
  42.      });
  43.  
  44.      $('#embed-player').append(
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top