Create context.JK.isQWebEngine property instead of gon.isQWebEngine

This commit is contained in:
Seth Call 2022-08-01 21:49:33 -05:00
parent e19819e035
commit 08b2de242e
5 changed files with 7 additions and 4 deletions

View File

@ -11,4 +11,4 @@ module JamRuby
Ars.where(active: true, beta: beta).where('ip is not NULL').where("ip != ''").all
end
end
end
end

View File

@ -554,6 +554,8 @@ GEM
rabl (0.13.1)
activesupport (>= 2.3.14)
rack (1.6.13)
rack-cors (1.0.6)
rack (>= 1.6.0)
rack-oauth2 (1.12.0)
activesupport
attr_required
@ -873,6 +875,7 @@ DEPENDENCIES
puma
quiet_assets
rabl (= 0.13.1)
rack-cors (~> 1.0, >= 1.0.6)
rack-test
rails (= 4.2.8)
rails-assets-bluebird!

View File

@ -8,6 +8,8 @@
context.JK = context.JK || {};
var logger = context.JK.logger;
context.JK.isQWebEngine = !!navigator.userAgent.match("jamkazam")
context.JK.MIDI_TRACK = 100
context.JK.CLIENT_ROLE = {

View File

@ -1303,7 +1303,7 @@
var opts = options || {}
opts = $.extend({}, {nativeTouch: !gon.isQWebEngine && gon.global.env != "test", cutOff: 7}, opts)
opts = $.extend({}, {nativeTouch: !context.JK.isQWebEngine && gon.global.env != "test", cutOff: 7}, opts)
$select.each(function (index) {
var $item = $(this);

View File

@ -1,7 +1,6 @@
module ClientHelper
# is this for *certain* the native client (no overrides allowed)?
# this ends up as gon.isQWebEngine
def is_certified_native_client?
# is this the native client or browser?
user_agent = request.env["HTTP_USER_AGENT"]
@ -86,7 +85,6 @@ module ClientHelper
# let javascript have access to the server's opinion if this is a native client
gon.isNativeClient = @nativeClient
gon.isQWebEngine = is_certified_native_client?
gon.use_cached_session_scores = Rails.application.config.use_cached_session_scores
gon.allow_both_find_algos = Rails.application.config.allow_both_find_algos