mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:47:22 +08:00
UX: use solid circle to indicate selected option in polls
This commit is contained in:
parent
1f8ff85ff9
commit
cba6bdaf52
|
@ -13,11 +13,11 @@ module SvgSprite
|
|||
"angle-right",
|
||||
"angle-up",
|
||||
"archive",
|
||||
"arrow-down",
|
||||
"arrow-left",
|
||||
"arrow-up",
|
||||
"arrows-alt-h",
|
||||
"arrows-alt-v",
|
||||
"arrow-down",
|
||||
"arrow-up",
|
||||
"arrow-left",
|
||||
"at",
|
||||
"backward",
|
||||
"ban",
|
||||
|
@ -63,16 +63,16 @@ module SvgSprite
|
|||
"exclamation-circle",
|
||||
"exclamation-triangle",
|
||||
"external-link-alt",
|
||||
"fab-apple",
|
||||
"fab-android",
|
||||
"fab-apple",
|
||||
"fab-discourse",
|
||||
"fab-facebook-f",
|
||||
"fab-facebook-square",
|
||||
"fab-github",
|
||||
"fab-google-plus-square",
|
||||
"fab-instagram",
|
||||
"fab-twitter",
|
||||
"fab-linux",
|
||||
"fab-twitter",
|
||||
"fab-twitter-square",
|
||||
"fab-windows",
|
||||
"fab-yahoo",
|
||||
|
@ -127,8 +127,8 @@ module SvgSprite
|
|||
"list-ol",
|
||||
"list-ul",
|
||||
"lock",
|
||||
"map-marker-alt",
|
||||
"magic",
|
||||
"map-marker-alt",
|
||||
"microphone-slash",
|
||||
"minus",
|
||||
"minus-circle",
|
||||
|
@ -154,15 +154,14 @@ module SvgSprite
|
|||
"share",
|
||||
"shield-alt",
|
||||
"shower",
|
||||
"signal",
|
||||
"sign-out-alt",
|
||||
"signal",
|
||||
"step-backward",
|
||||
"step-forward",
|
||||
"sync",
|
||||
"table",
|
||||
"tag",
|
||||
"tasks",
|
||||
"tv",
|
||||
"thermometer-three-quarters",
|
||||
"thumbs-down",
|
||||
"thumbs-up",
|
||||
|
@ -170,6 +169,7 @@ module SvgSprite
|
|||
"times",
|
||||
"times-circle",
|
||||
"trash-alt",
|
||||
"tv",
|
||||
"undo",
|
||||
"unlink",
|
||||
"unlock",
|
||||
|
@ -193,8 +193,7 @@ module SvgSprite
|
|||
end
|
||||
|
||||
def self.all_icons
|
||||
icons = Set.new()
|
||||
icons
|
||||
Set.new()
|
||||
.merge(settings_icons)
|
||||
.merge(plugin_icons)
|
||||
.merge(badge_icons)
|
||||
|
@ -203,13 +202,13 @@ module SvgSprite
|
|||
.delete_if { |i| i.blank? || i.include?("/") }
|
||||
.map! { |i| process(i.dup) }
|
||||
.merge(SVG_ICONS)
|
||||
icons
|
||||
.sort
|
||||
end
|
||||
|
||||
def self.rebuild_cache
|
||||
icons = all_icons
|
||||
svg_sprite_cache['icons'] = icons
|
||||
svg_sprite_cache['version'] = Digest::SHA1.hexdigest(icons.sort.join('|'))
|
||||
svg_sprite_cache['version'] = Digest::SHA1.hexdigest(icons.join('|'))
|
||||
end
|
||||
|
||||
def self.expire_cache
|
||||
|
@ -244,7 +243,7 @@ Discourse SVG subset of #{fa_license}
|
|||
|
||||
if icons.include? icon_id
|
||||
sym.attributes['id'].value = icon_id
|
||||
sym.css('title').each { |t| t.remove }
|
||||
sym.css('title').each(&:remove)
|
||||
svg_subset << sym.to_xml
|
||||
end
|
||||
end
|
||||
|
@ -265,13 +264,13 @@ Discourse SVG subset of #{fa_license}
|
|||
|
||||
if searched_icon == icon_id
|
||||
sym.attributes['id'].value = icon_id
|
||||
sym.css('title').each { |t| t.remove }
|
||||
sym.css('title').each(&:remove)
|
||||
return sym.to_xml
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
false
|
||||
end
|
||||
|
||||
def self.prepare_symbol(symbol, svg_filename)
|
||||
|
@ -313,7 +312,7 @@ Discourse SVG subset of #{fa_license}
|
|||
end
|
||||
|
||||
def self.badge_icons
|
||||
Badge.all.pluck(:icon).uniq
|
||||
Badge.pluck(:icon).uniq
|
||||
end
|
||||
|
||||
def self.group_icons
|
||||
|
@ -340,11 +339,11 @@ Discourse SVG subset of #{fa_license}
|
|||
end
|
||||
|
||||
def self.fa4_to_fa5_names
|
||||
@db ||= File.open(fa4_shim_file, "r:UTF-8") { |f| JSON.parse(f.read); }
|
||||
@db ||= File.open(fa4_shim_file, "r:UTF-8") { |f| JSON.parse(f.read) }
|
||||
end
|
||||
|
||||
def self.process(icon_name)
|
||||
icon_name = icon_name.strip
|
||||
icon_name.strip!
|
||||
FA_ICON_MAP.each { |k, v| icon_name.sub!(k, v) }
|
||||
fa4_to_fa5_names[icon_name] || icon_name
|
||||
end
|
||||
|
|
|
@ -45,7 +45,7 @@ createWidget("discourse-poll-option", {
|
|||
if (attrs.isMultiple) {
|
||||
contents.push(iconNode(chosen ? "far-check-square" : "far-square"));
|
||||
} else {
|
||||
contents.push(iconNode(chosen ? "far-dot-circle" : "far-circle"));
|
||||
contents.push(iconNode(chosen ? "circle" : "far-circle"));
|
||||
}
|
||||
|
||||
contents.push(" ");
|
||||
|
|
Loading…
Reference in New Issue
Block a user