Sha256: b827343b540699af11a26e5fe731227b21517eb5540f66a02c3b5c47a8ac04f8
Contents?: true
Size: 1.15 KB
Versions: 67
Compression:
Stored size: 1.15 KB
Contents
//= require jsuri window.Spree = {}; Spree.ready = function(callback) { if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) { jQuery(document).on('turbolinks:load', function() { callback(jQuery); }); } else { jQuery(document).ready(callback); } }; Spree.mountedAt = function() { return "<%= Rails.application.routes.url_helpers.spree_path(trailing_slash: true) %>"; }; Spree.pathFor = function(path) { var locationOrigin; locationOrigin = (window.location.protocol + "//" + window.location.hostname) + (window.location.port ? ":" + window.location.port : ""); return locationOrigin + Spree.mountedAt() + path; }; Spree.ajax = function(url, options) { if (typeof url === "object") { options = url; url = undefined; } options = options || {}; options = $.extend(options, { headers: { 'Authorization': 'Bearer ' + Spree.api_key } }); return $.ajax(url, options); }; Spree.getJSON = function(url, data, success) { if (typeof data === 'function') { success = data; data = undefined; } return Spree.ajax({ dataType: "json", url: url, data: data, success: success }); };
Version data entries
67 entries across 67 versions & 1 rubygems