Skip to content

Commit

Permalink
Merge pull request #1700 from AlchemyCMS/remove-alchemy-debug-js
Browse files Browse the repository at this point in the history
Remove custom JS logging
  • Loading branch information
tvdeyen committed Dec 30, 2019
2 parents 6b3fa9a + 48acde9 commit cdd907a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
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

0 comments on commit cdd907a

Please sign in to comment.