Convert browser-dependent code to use $.engine.
This commit is contained in:
parent
8026b0a320
commit
efb896414a
@ -103,7 +103,7 @@ Settings =
|
||||
description = arr[1]
|
||||
div = $.el 'div',
|
||||
<%= html('<label><input type="checkbox" name="${key}">${key}</label><span class="description">: ${description}</span>') %>
|
||||
div.hidden = true if chrome? and key is 'Remember QR Size' # XXX not supported
|
||||
div.hidden = true if $.engine isnt 'gecko' and key is 'Remember QR Size' # XXX not supported
|
||||
input = $ 'input', div
|
||||
$.on input, 'change', ->
|
||||
@parentNode.parentNode.dataset.checked = @checked
|
||||
|
||||
@ -83,7 +83,7 @@ ImageCommon =
|
||||
$.off video, 'mouseover', handler
|
||||
# Hacky workaround for Firefox forever-loading bug for very short videos
|
||||
t = new Date().getTime()
|
||||
$.asap (-> chrome? or (video.readyState >= 3 and video.currentTime <= Math.max 0.1, (video.duration - 0.5)) or new Date().getTime() >= t + 1000), ->
|
||||
$.asap (-> $.engine isnt 'gecko' or (video.readyState >= 3 and video.currentTime <= Math.max 0.1, (video.duration - 0.5)) or new Date().getTime() >= t + 1000), ->
|
||||
video.controls = true
|
||||
$.on video, 'mouseover', handler
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ ImageLoader =
|
||||
clone.file.thumb.preload = 'auto' for clone in post.clones
|
||||
thumb.preload = 'auto'
|
||||
# XXX Cloned video elements with poster in Firefox cause momentary display of image loading icon.
|
||||
if !chrome?
|
||||
if $.engine is 'gecko'
|
||||
$.on thumb, 'loadeddata', -> @removeAttribute 'poster'
|
||||
return
|
||||
|
||||
|
||||
@ -243,6 +243,5 @@ Unread =
|
||||
Favicon[if isDead then 'unreadDead' else 'unread']
|
||||
else
|
||||
Favicon[if isDead then 'dead' else 'default']
|
||||
unless chrome?
|
||||
# `favicon.href = href` doesn't work on Firefox.
|
||||
$.add d.head, Favicon.el
|
||||
# `favicon.href = href` doesn't work on Firefox.
|
||||
$.add d.head, Favicon.el
|
||||
|
||||
@ -202,7 +202,7 @@ QR =
|
||||
body: el.textContent
|
||||
icon: Favicon.logo
|
||||
notif.onclick = -> window.focus()
|
||||
if chrome?
|
||||
if $.engine isnt 'gecko'
|
||||
# Firefox automatically closes notifications
|
||||
# so we can't control the onclose properly.
|
||||
notif.onclose = -> notice.close()
|
||||
@ -530,7 +530,7 @@ QR =
|
||||
# We don't receive blur events from captcha iframe.
|
||||
$.on d, 'click', QR.focus
|
||||
|
||||
unless chrome?
|
||||
if $.engine is 'gecko'
|
||||
nodes.pasteArea.hidden = false
|
||||
new MutationObserver(QR.pasteFF).observe nodes.pasteArea, {childList: true}
|
||||
|
||||
@ -543,8 +543,8 @@ QR =
|
||||
event = if node.nodeName is 'SELECT' then 'change' else 'input'
|
||||
$.on nodes[name], event, save
|
||||
|
||||
# XXX Chromium treats width and height as min-width and min-height
|
||||
if !chrome? and Conf['Remember QR Size']
|
||||
# XXX Blink and WebKit treat width and height of <textarea>s as min-width and min-height
|
||||
if $.engine is 'gecko' and Conf['Remember QR Size']
|
||||
$.get 'QR Size', '', (item) ->
|
||||
nodes.com.style.cssText = item['QR Size']
|
||||
$.on nodes.com, 'mouseup', (e) ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user