-
Notifications
You must be signed in to change notification settings - Fork 14
/
mtv.min.js
1 lines (1 loc) · 1.1 KB
/
mtv.min.js
1
(function(){var e,t=function(e,t){return function(){return e.apply(t,arguments)}},n=Array.prototype.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1};e||(e=jQuery),window.MTV=new Object({debugging:function(){return WordPress.DEBUG&&this.hasConsole()?!0:!1},hasConsole:function(){try{return"console"in window&&window.console!==null}catch(e){return!1}},do_ajax:function(n,r,i,s){var o,u;return o=JSON.stringify(r),u={url:WordPress.ajaxurl,type:"POST",data:{action:"mtv",path:n,data:o},dataType:"json",success:t(function(e,t,n){this.debugging()&&(console.log("do_ajax: "+t),console.log(e),console.log(n));if(i)return i(e,t,n)},this),error:t(function(e,t,n){this.debugging()&&(console.log("do_ajax: "+t),console.log(e),console.log(n));if(s)return s(e,t,n)},this)},this.debugging()?setTimeout(t(function(){return e.ajax(u)},this),2e3):e.ajax(u)}});if(n.call(window,Backbone)>=0||window.Backbone!==null)Backbone.sync=function(e,t,n){var r,i,s,o;return r=e==="create"||e==="update"?t.toJSON():null,o=e!=="read"?""+t.url()+"/"+e:t.url(),s=n.success,i=n.error,MTV.do_ajax(o,r,s,i)}}).call(this);