This commit is contained in:
chiu 2021-09-15 22:42:05 +08:00
parent 4d14f1a80c
commit 647c9bb250
2 changed files with 6 additions and 6 deletions

View File

@ -441,9 +441,9 @@
var keyBindings = function(event) {
var f = $.jPlayer.focus,
ignoreKey;
key_pressing[event.key] = true;
// A jPlayer instance must be in focus. ie., keyEnabled and the last one played.
if(f) {
if(f && Object.keys(key_pressing).length==1) {
// What generated the key press?
$.each( $.jPlayer.keyIgnoreElementNames.split(/\s+/g), function(i, name) {
// The strings should already be uppercase.
@ -469,13 +469,13 @@
}
}
};
var key_pressing = {};
$.jPlayer.keys = function(en) {
var event = "keydown.jPlayer";
// Remove any binding, just in case enabled more than once.
$(document.documentElement).unbind(event);
if(en) {
$(document.documentElement).bind(event, keyBindings);
$(document.documentElement).bind(event, keyBindings).bind("keyup.jPlayer", function(e){delete key_pressing[e.key]});
}
};

View File

@ -142,8 +142,8 @@ class AdBannersController < ApplicationController
extra_before_html = ""
extra_after_html = ""
if has_jplayer
extra_before_html = "<link href=\"/assets/ad_banner/jplayer.blue.monday.min.css\" rel=\"stylesheet\">"
extra_after_html = "<script src=\"/assets/ad_banner/jquery.jplayer.min.js\"></script>"
extra_before_html = ActionController::Base.helpers.stylesheet_link_tag("ad_banner/jplayer.blue.monday.min")
extra_after_html = ActionController::Base.helpers.javascript_include_tag("ad_banner/jquery.jplayer")
end
{
"extras" => {