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

Remove custom JS logging #1700

Merged
merged 2 commits into from
Dec 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions app/assets/javascripts/alchemy/alchemy.base.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,6 @@ $.extend Alchemy,
dropdownAutoWidth: true
return

# Logs exception to js console, if present.
debug: (e) ->
if window["console"]
console.warn(e)
return

# Logs errors to js console, if present.
log_error: (e) ->
if window["console"]
console.error e
return

getUrlParam: (name) ->
results = new RegExp("[\\?&]" + name + "=([^&#]*)").exec(window.location.href)
results[1] or 0 if results
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/alchemy/alchemy.i18n.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Alchemy.I18n =
else
translation
else
Alchemy.debug "Translations for locale #{Alchemy.locale} not found!"
console.warn "Translations for locale #{Alchemy.locale} not found!"
key

# Global utility method for translating a given string
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Alchemy.Sitemap =
self.options.ready()

request.fail (jqXHR, status) ->
Alchemy.debug("Request failed: " + status)
console.warn("Request failed: " + status)

# Filters the sitemap
filter: (term) ->
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/alchemy/alchemy.tinymce.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ $.extend Alchemy.Tinymce,
# remove editor instance, if already initialized
editor.remove() if editor
if textarea.length == 0
Alchemy.log_error "Could not initialize TinyMCE for textarea#tinymce_#{id}!"
console.warn "Could not initialize TinyMCE for textarea#tinymce_#{id}!"
return
config = @getConfig(id, textarea[0].classList[1])
if config
spinner = new Alchemy.Spinner('small')
textarea.closest('.tinymce_container').prepend spinner.spin().el
tinymce.init(config)
else
Alchemy.debug('No tinymce configuration found for', id)
console.warn('No tinymce configuration found for', id)

# Gets called after an editor instance gets intialized
#
Expand Down