Files
fizzy/app/models/application_platform.rb
T
Jorge Manrubia 0278fe6ae4 Revert "Mobile app / Scoped stylesheets" (#1698)
This reverts commit 39c1906e67.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 17:20:18 +01:00

55 lines
870 B
Ruby

class ApplicationPlatform < PlatformAgent
def ios?
match? /iPhone|iPad/
end
def android?
match? /Android/
end
def mac?
match? /Macintosh/
end
def chrome?
user_agent.browser.match? /Chrome/
end
def edge?
user_agent.browser.match? /Edg/
end
def firefox?
user_agent.browser.match? /Firefox|FxiOS/
end
def safari?
user_agent.browser.match? /Safari/
end
def mobile?
ios? || android?
end
def desktop?
!mobile?
end
def windows?
operating_system == "Windows"
end
def operating_system
case user_agent.platform
when /Android/ then "Android"
when /iPad/ then "iPad"
when /iPhone/ then "iPhone"
when /Macintosh/ then "macOS"
when /Windows/ then "Windows"
when /CrOS/ then "ChromeOS"
else
os =~ /Linux/ ? "Linux" : os
end
end
end