2020-08-31 06:14:09 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "enum_site_setting"
|
|
|
|
|
|
|
|
class BaseFontSetting < EnumSiteSetting
|
|
|
|
def self.valid_value?(val)
|
|
|
|
values.any? { |v| v[:value].to_s == val.to_s }
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.values
|
|
|
|
@values ||= DiscourseFonts.fonts.map do |font|
|
2020-09-23 05:00:07 -04:00
|
|
|
{ name: font[:name], value: font[:key] }
|
2020-08-31 06:14:09 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|