mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
DEV: Apply syntax_tree formatting to lib/*
This commit is contained in:
@ -10,10 +10,11 @@ module MobileDetection
|
||||
return false unless SiteSetting.enable_mobile_theme
|
||||
|
||||
session[:mobile_view] = params[:mobile_view] if params && params.has_key?(:mobile_view)
|
||||
session[:mobile_view] = nil if params && params.has_key?(:mobile_view) && params[:mobile_view] == 'auto'
|
||||
session[:mobile_view] = nil if params && params.has_key?(:mobile_view) &&
|
||||
params[:mobile_view] == "auto"
|
||||
|
||||
if session && session[:mobile_view]
|
||||
session[:mobile_view] == '1'
|
||||
session[:mobile_view] == "1"
|
||||
else
|
||||
mobile_device?(user_agent)
|
||||
end
|
||||
@ -23,7 +24,8 @@ module MobileDetection
|
||||
user_agent =~ /iPad|iPhone|iPod/
|
||||
end
|
||||
|
||||
MODERN_MOBILE_REGEX = %r{
|
||||
MODERN_MOBILE_REGEX =
|
||||
%r{
|
||||
\(.*iPhone\ OS\ 1[3-9].*\)|
|
||||
\(.*iPad.*OS\ 1[3-9].*\)|
|
||||
Chrome\/8[89]|
|
||||
@ -37,5 +39,4 @@ module MobileDetection
|
||||
def self.modern_mobile_device?(user_agent)
|
||||
user_agent.match?(MODERN_MOBILE_REGEX)
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user