Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FontAwesome Icons #1342

Merged
merged 24 commits into from
Jan 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8a7cb3b
Do not change icon when set element dirty/clean
tvdeyen Jan 2, 2018
46ba478
Install FontAwesome 5 files
tvdeyen Jan 4, 2018
0be3048
Remove PNG based icon sprite sheet and styles
tvdeyen Jan 4, 2018
be8216d
Change render_icon helper to render FontAwesome icon
tvdeyen Jan 4, 2018
7959b51
Replace PNG icons with FontAwesome SVG icons
tvdeyen Jan 4, 2018
8f5a430
Update hint_with_tooltip helper to support FA icons
tvdeyen Jan 4, 2018
e00bd9b
Update attachment icon css classes
tvdeyen Jan 5, 2018
7a250b6
Add flash message icon name helper
tvdeyen Jan 5, 2018
43fd46c
Use FontAwesome icon names for flash message icons
tvdeyen Jan 5, 2018
5aa17fe
Update unlock page js for new fa icons
tvdeyen Jan 6, 2018
976ee9b
Use a b/w svg for dashboard icon
tvdeyen Jan 5, 2018
8df8f71
Fix positions of new FontAwesome icons
tvdeyen Jan 5, 2018
db45c07
Change icon and text color
tvdeyen Jan 5, 2018
dc12973
Remove old icon references
tvdeyen Jan 8, 2018
341014e
Use latest element icon for clipboard item
tvdeyen Jan 9, 2018
ae88591
Do not display element toggle button if is trashed
tvdeyen Jan 10, 2018
e6272a2
Replace old icon font with FontAwesome icons
tvdeyen Jan 11, 2018
dd75ad0
Use FontAwesome icon font for tag lists
tvdeyen Jan 11, 2018
45659c4
Use FontAwesome icons for select2 theme
tvdeyen Jan 12, 2018
962a92e
Remove jQuery UI icons
tvdeyen Jan 12, 2018
a76a4cd
Remove old icon font
tvdeyen Jan 12, 2018
6aa214f
Use FontAwesome icons for dialog error messages
tvdeyen Jan 12, 2018
db56d69
Add changelog for FontAwesome icon replacement
tvdeyen Jan 13, 2018
809b77e
Slighty raise the toolbar icons size
tvdeyen Jan 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 4.1.0 (unreleased)

* Replaces PNG icons with FontAwesome icon font [#1342](https://github.com/AlchemyCMS/alchemy_cms/pull/1342) by [tvdeyen](https://github.com/tvdeyen)
* Remove pleaseWait overlay from links with GET requests [#1343](https://github.com/AlchemyCMS/alchemy_cms/pull/1343) by [tvdeyen](https://github.com/tvdeyen)
* Removed fixed table headers from admin resource tables [#1339](https://github.com/AlchemyCMS/alchemy_cms/pull/1339) by [tvdeyen](https://github.com/tvdeyen)
* Removed Bourbon Sass library [#1339](https://github.com/AlchemyCMS/alchemy_cms/pull/1339) by [tvdeyen](https://github.com/tvdeyen)
Expand Down
Binary file removed app/assets/fonts/alchemy/icons.eot
Binary file not shown.
33 changes: 0 additions & 33 deletions app/assets/fonts/alchemy/icons.svg

This file was deleted.

Binary file removed app/assets/fonts/alchemy/icons.ttf
Binary file not shown.
Binary file removed app/assets/fonts/alchemy/icons.woff
Binary file not shown.
15 changes: 1 addition & 14 deletions app/assets/images/alchemy/icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/assets/images/alchemy/icons.png
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions app/assets/javascripts/alchemy/alchemy.base.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ $.extend Alchemy,
removePicture: (selector) ->
$form_field = $(selector)
$element = $form_field.closest(".element-editor")
if $form_field
if $form_field[0]
$form_field.val ""
$form_field.prev().remove()
$form_field.parent().addClass "missing"
$form_field.parent().html '<i class="icon far fa-image fa-fw"/>'
Alchemy.setElementDirty $element
false

Expand Down
14 changes: 12 additions & 2 deletions app/assets/javascripts/alchemy/alchemy.dialog.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class window.Alchemy.Dialog
error_header = "#{xhr.statusText} (#{xhr.status})"
error_body = "Please check log and try again."
$errorDiv = $("<div class=\"message #{error_type}\" />")
$errorDiv.append "<span class=\"icon #{error_type}\" />"
$errorDiv.append Alchemy.messageIcon(error_type)
$errorDiv.append "<h1>#{error_header}</h1>"
$errorDiv.append "<p>#{error_body}</p>"
@dialog_body.html $errorDiv
Expand Down Expand Up @@ -171,7 +171,7 @@ class window.Alchemy.Dialog
@dialog_body = $('<div class="alchemy-dialog-body" />')
@dialog_header = $('<div class="alchemy-dialog-header" />')
@dialog_title = $('<div class="alchemy-dialog-title" />')
@close_button = $('<a class="alchemy-dialog-close"><span class="icon close small"></span></a>')
@close_button = $('<a class="alchemy-dialog-close"><i class="icon fas fa-times fa-fw fa-xs"/></a>')
@dialog_title.text(@options.title)
@dialog_header.append(@dialog_title)
@dialog_header.append(@close_button)
Expand Down Expand Up @@ -272,3 +272,13 @@ window.Alchemy.watchForDialogs = (scope = '#alchemy') ->
@form.submit()
return
false

# Returns a FontAwesome icon for given message type
#
window.Alchemy.messageIcon = (messageType) ->
icon_class = switch messageType
when "warning", "warn", "alert" then "exclamation"
when "notice" then "check"
when "error" then "bug"
else messageType
"<i class=\"icon fas fa-#{icon_class} fa-fw\" />"
4 changes: 0 additions & 4 deletions app/assets/javascripts/alchemy/alchemy.dirty.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ $.extend Alchemy,
setElementDirty: (element) ->
$element = $(element)
$element.addClass('dirty')
$element
.find('> .element-header .icon[class*="element_"]')
.addClass('element_dirty')
window.onbeforeunload = @pageUnload

pageUnload: ->
Expand All @@ -23,7 +20,6 @@ $.extend Alchemy,
setElementClean: (element) ->
$element = $(element)
$element.removeClass('dirty')
$element.find('> .element-header .icon').removeClass('element_dirty')
$element.find('> .element-content .dirty').removeClass('dirty')
window.onbeforeunload = undefined

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Alchemy.ElementEditors =
toggleFold: (id, callback) ->
spinner = new Alchemy.Spinner('small')
spinner.spin("#element_#{id} > .element-header .ajax-folder")
$("#element_#{id}_folder").hide()
$("#element_#{id}_folder .icon").hide()
$.post Alchemy.routes.fold_admin_element_path(id), =>
callback.call() if callback?
return
Expand Down Expand Up @@ -194,7 +194,7 @@ Alchemy.ElementEditors =

# Click event handler for element toggle icon.
onClickToggle: (e) ->
id = $(e.target).data('element-toggle')
id = $(e.currentTarget).data('element-toggle')
@toggle(id)
e.preventDefault()
e.stopPropagation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Alchemy.ToolbarButton = (options) ->
e.preventDefault()
options.onClick(e)
false
$lnk.append "<span class='icon #{options.iconClass}' />"
$lnk.append "<i class='icon fas fa-#{options.iconClass} fa-fw' />"
$btn.append $lnk
$btn.append "<br><label>#{options.label}</label>"
$btn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Alchemy.FileProgress = (file) ->
@$fileProgressElement = $('<div class="progress-container"/>')

# Append Cancel Button
@$fileProgressCancel = $('<a href="javascript:void(0);" class="progress-cancel"/>')
@$fileProgressCancel = $('<a href="javascript:void(0);" class="progress-cancel"><i class="fas fa-times fa-fw"/></a>')
@$fileProgressElement.append @$fileProgressCancel

# Append Filename
Expand Down
3 changes: 1 addition & 2 deletions app/assets/javascripts/alchemy/alchemy.growler.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Alchemy.Growler =

build: (message, flash_type) ->
$flash_container = $("<div class=\"flash #{flash_type}\" />")
icon_class = (if flash_type is "notice" then "tick" else flash_type)
$flash_container.append "<span class=\"icon #{icon_class}\" />"
$flash_container.append Alchemy.messageIcon(flash_type)
$flash_container.append message
$("#flash_notices").append $flash_container
$("#flash_notices").show()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class window.Alchemy.ImageOverlay extends Alchemy.Dialog
@dialog = $('<div class="alchemy-image-overlay-dialog" />')
@dialog_body = $('<div class="alchemy-image-overlay-body" />')
@close_button = $('<a class="alchemy-image-overlay-close">
<span class="icon close small"></span>
<i class="icon fas fa-times fa-fw"></i>
</a>')
@dialog.append(@close_button)
@dialog.append(@dialog_body)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Alchemy.PreviewWindow =

_hideSpinner: ->
@spinner.stop()
@reload.html('<span class="icon reload"></span>')
@reload.html('<i class="icon fas fa-redo fa-fw"></i>')

_bindReloadButton: ->
$reload = $('#reload_preview_button')
Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/alchemy/_defaults.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "alchemy/variables";
@import "alchemy/mixins";
@import "alchemy/extends";
@import "alchemy/icon-font";