Skip to content

Instantly share code, notes, and snippets.

@cloudrck
Created January 26, 2015 00:42
Show Gist options
  • Save cloudrck/12ea90e82b5f6d4d417c to your computer and use it in GitHub Desktop.
Save cloudrck/12ea90e82b5f6d4d417c to your computer and use it in GitHub Desktop.
Line 17 Error
}),w.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},w.isNaN=function(e){return w.isNumber(e)&&e!=+e},w.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==c.call(e)},w.isNull=function(e){return null===e},w.isUndefined=function(e){return void 0===e},w.has=function(e,t){return h.call(e,t)},w.noConflict=function(){return e._=t,this},w.identity=function(e){return e},w.times=function(e,t,n){for(var i=Array(e),s=0;e>s;s++)i[s]=t.call(n,s);return i},w.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var N={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};N.unescape=w.invert(N.escape);var I={escape:new RegExp("["+w.keys(N.escape).join("")+"]","g"),unescape:new RegExp("("+w.keys(N.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(e){w[e]=function(t){return null==t?"":(""+t).replace(I[e],function(t){return N[e][t]})}}),w.result=function(e,t){if(null==e)return null;var n=e[t];return w.isFunction(n)?n.call(e):n},w.mixin=function(e){j(w.functions(e),function(t){var n=w[t]=e[t];w.prototype[t]=function(){var e=[this._wrapped];return a.apply(e,arguments),H.call(this,n.apply(w,e))}})};var P=0;w.uniqueId=function(e){var t=++P+"";return e?e+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,M={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(e,t,n){var i;n=w.defaults({},n,w.templateSettings);var s=new RegExp([(n.escape||A).source,(n.interpolate||A).source,(n.evaluate||A).source].join("|")+"|$","g"),r=0,a="__p+='";e.replace(s,function(t,n,i,s,o){return a+=e.slice(r,o).replace(O,function(e){return"\\"+M[e]}),n&&(a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),i&&(a+="'+\n((__t=("+i+"))==null?'':__t)+\n'"),s&&(a+="';\n"+s+"\n__p+='"),r=o+t.length,t}),a+="';\n",n.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{i=new Function(n.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return i(t,w);var l=function(e){return i.call(this,e,w)};return l.source="function("+(n.variable||"obj")+"){\n"+a+"}",l},w.chain=function(e){return w(e).chain()};var H=function(e){return this._chain?w(e).chain():e};w.mixin(w),j(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=i[e];w.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!=e&&"splice"!=e||0!==n.length||delete n[0],H.call(this,n)}}),j(["concat","join","slice"],function(e){var t=i[e];w.prototype[e]=function(){return H.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),function(){jQuery(function(){return $(".track_inventory_checkbox").on("click",function(){return $(this).siblings(".variant_track_inventory").val($(this).is(":checked")),$(this).parent("form").submit()}),$(".toggle_variant_track_inventory").on("submit",function(){return $.ajax({type:this.method,url:this.action,data:$(this).serialize()}),!1})})}.call(this),function(){var e,t;$(function(){return $("#country_based").click(function(){return e()}),$("#state_based").click(function(){return t()}),$("#country_based").is(":checked")?e():$("#state_based").is(":checked")?t():(t(),$("#state_based").click())}),e=function(){return $("#state_members :input").each(function(){return $(this).prop("disabled",!0)}),$("#state_members").hide(),$("#zone_members :input").each(function(){return $(this).prop("disabled",!0)}),$("#zone_members").hide(),$("#country_members :input").each(function(){return $(this).prop("disabled",!1)}),$("#country_members").show()},t=function(){return $("#country_members :input").each(function(){return $(this).prop("disabled",!0)}),$("#country_members").hide(),$("#zone_members :input").each(function(){return $(this).prop("disabled",!0)}),$("#zone_members").hide(),$("#state_members :input").each(function(){return $(this).prop("disabled",!1)}),$("#state_members").show()}}.call(this),Spree.routes.checkouts_api=Spree.pathFor("api/checkouts"),Spree.routes.classifications_api=Spree.pathFor("api/classifications"),Spree.routes.option_type_search=Spree.pathFor("api/option_types"),Spree.routes.orders_api=Spree.pathFor("api/orders"),Spree.routes.product_search=Spree.pathFor("api/products"),Spree.routes.shipments_api=Spree.pathFor("api/shipments"),Spree.routes.checkouts_api=Spree.pathFor("api/checkouts"),Spree.routes.stock_locations_api=Spree.pathFor("api/stock_locations"),Spree.routes.taxon_products_api=Spree.pathFor("api/taxons/products"),Spree.routes.taxons_search=Spree.pathFor("api/taxons"),Spree.routes.user_search=Spree.pathFor("admin/search/users"),Spree.routes.variants_api=Spree.pathFor("api/variants"),Spree.routes.payments_api=function(e){return Spree.pathFor("api/orders/"+e+"/payments")},Spree.routes.stock_items_api=function(e){return Spree.pathFor("api/stock_locations/"+e+"/stock_items")},SpreePaypalExpress={hideSettings:function(e){SpreePaypalExpress.paymentMethodID&&e.val()==SpreePaypalExpress.paymentMethodID?($(".payment-method-settings").children().hide(),$("#payment_amount").prop("disabled","disabled"),$('button[type="submit"]').prop("disabled","disabled"),$("#paypal-warning").show()):SpreePaypalExpress.paymentMethodID&&($(".payment-method-settings").children().show(),$("button[type=submit]").prop("disabled",""),$("#payment_amount").prop("disabled",""),$("#paypal-warning").hide())}},$(document).ready(function(){checkedPaymentMethod=$('[data-hook="payment_method_field"] input[type="radio"]:checked'),SpreePaypalExpress.hideSettings(checkedPaymentMethod),paymentMethods=$('[data-hook="payment_method_field"] input[type="radio"]').click(function(e){SpreePaypalExpress.hideSettings($(e.target))})}),$(document).ready(function(){$("#sku").focus(),$("#pos-tabs").tabs(),$("#associate_user_toggle").click(function(){$("#associate_user").slideToggle("slow",function(){})}),$("#update_payment input[type=radio]").click(function(){$("#card_name_options").val(""),$("#card_name_options").hide()}),$("#update_payment input[type=radio][data-name ~= card],#update_payment input[type=radio][data-name ~= Card]").click(function(){$("#card_name_options").show()}),$("#update_payment input[name='payment_method_id']:first").click(),$("#associate_user").toggle()});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment