Remove some dead code and broken links from comments

This commit is contained in:
Luis Ramos
2020-08-19 10:14:24 +01:00
parent 496f9c106e
commit d5d2ae3ce0
2 changed files with 2 additions and 29 deletions

View File

@@ -1,4 +1,5 @@
//= require handlebars
Handlebars.registerHelper("t", function(key) {
if (Spree.translations[key]) {
return Spree.translations[key]
@@ -6,4 +7,3 @@ Handlebars.registerHelper("t", function(key) {
console.error("No translation found for " + key + ". Does it exist within spree/admin/shared/_translations.html.erb?")
}
});

View File

@@ -1,11 +1,7 @@
#= require jsuri
class window.Spree
@ready: (callback) ->
jQuery(document).ready(callback)
class window.Spree
# Helper function to take a URL and add query parameters to it
# Uses the JSUri library from here: https://code.google.com/p/jsuri/
# Thanks to Jake Moffat for the suggestion: https://twitter.com/jakeonrails/statuses/321776992221544449
@url: (uri, query) ->
if uri.path == undefined
uri = new Uri(uri)
@@ -15,26 +11,3 @@ class window.Spree
if Spree.api_key
uri.addQueryParam('token', Spree.api_key)
return uri
# Helper method in case people want to call uri rather than url
@uri: (uri, query) ->
url(uri, query)
# This function automatically appends the API token
# for the user to the end of any URL.
# Immediately after, this string is then passed to jQuery.ajax.
#
# ajax works in two ways in jQuery:
#
# $.ajax("url", {settings: 'go here'})
# or:
# $.ajax({url: "url", settings: 'go here'})
#
# This function will support both of these calls.
@ajax: (url_or_settings, settings) ->
if (typeof(url_or_settings) == "string")
$.ajax(Spree.url(url_or_settings).toString(), settings)
else
url = url_or_settings['url']
delete url_or_settings['url']
$.ajax(Spree.url(url).toString(), url_or_settings)