e-lado
Version:
[](https://circleci.com/gh/sharetribe/sharetribe/tree/master) [](https://gemnasium.com/sharetribe/shar
1 lines • 7.02 kB
JavaScript
!function(){var a,b,c,d,e=[].slice;d=function(a,b,c){var d,f;return d=function(a){return a.length>0},f={indexOf:Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){var c,d,e,f;for(c=e=0,f=a.length;f>e;c=++e)if(d=a[c],b===d)return c;return-1}},a.$.Model=a.Model,c.fn.asEventStream=a.$.asEventStream,a.$.textFieldValue=function(b,c){var e,f,g;return g=function(){return b.val()},e=function(){return a.interval(50).take(10).map(g).filter(d).take(1)},f=b.asEventStream("keyup input").merge(b.asEventStream("cut paste").delay(1)).merge(e()),a.Binding({initValue:c,get:g,events:f,set:function(a){return b.val(a)}})},a.$.checkBoxValue=function(b,c){return a.Binding({initValue:c,get:function(){return b.is(":checked")},events:b.asEventStream("change"),set:function(a){return b.attr("checked",a)}})},a.$.selectValue=function(b,c){return a.Binding({initValue:c,get:function(){return b.val()},events:b.asEventStream("change"),set:function(a){return b.val(a)}})},a.$.radioGroupValue=function(b,d){return a.Binding({initValue:d,get:function(){return b.filter(":checked").first().val()},events:b.asEventStream("change"),set:function(a){return b.each(function(b,d){return d.value===a?c(d).attr("checked",!0):c(d).removeAttr("checked")})}})},a.$.checkBoxGroupValue=function(b,d){return a.Binding({initValue:d,get:function(){return b.filter(":checked").map(function(a,b){return c(b).val()}).toArray()},events:b.asEventStream("change"),set:function(a){return b.each(function(b,d){return c(d).attr("checked",f.indexOf(a,c(d).val())>=0)})}})},a.$.ajax=function(b,d){return a.fromPromise(c.ajax(b),d)},a.$.ajaxGet=function(b,c,d,e){return a.$.ajax({url:b,dataType:d,data:c},e)},a.$.ajaxGetJSON=function(b,c,d){return a.$.ajax({url:b,dataType:"json",data:c},d)},a.$.ajaxPost=function(b,c,d,e){return a.$.ajax({url:b,dataType:d,data:c,type:"POST"},e)},a.$.ajaxGetScript=function(b,c){return a.$.ajax({url:b,dataType:"script"},c)},a.$.lazyAjax=function(b){return a.once(b).flatMap(a.$.ajax)},a.Observable.prototype.ajax=function(){return this.flatMapLatest(a.$.ajax)},c.fn.extend({keydownE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["keydown"].concat(e.call(a)))},keyupE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["keyup"].concat(e.call(a)))},keypressE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["keypress"].concat(e.call(a)))},clickE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["click"].concat(e.call(a)))},dblclickE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["dblclick"].concat(e.call(a)))},mousedownE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["mousedown"].concat(e.call(a)))},mouseupE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["mouseup"].concat(e.call(a)))},mouseenterE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["mouseenter"].concat(e.call(a)))},mouseleaveE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["mouseleave"].concat(e.call(a)))},mousemoveE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["mousemove"].concat(e.call(a)))},mouseoutE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["mouseout"].concat(e.call(a)))},mouseoverE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["mouseover"].concat(e.call(a)))},resizeE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["resize"].concat(e.call(a)))},scrollE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["scroll"].concat(e.call(a)))},selectE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["select"].concat(e.call(a)))},changeE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["change"].concat(e.call(a)))},submitE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["submit"].concat(e.call(a)))},blurE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["blur"].concat(e.call(a)))},focusE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["focus"].concat(e.call(a)))},focusinE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["focusin"].concat(e.call(a)))},focusoutE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["focusout"].concat(e.call(a)))},loadE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["load"].concat(e.call(a)))},unloadE:function(){var a;return a=1<=arguments.length?e.call(arguments,0):[],this.asEventStream.apply(this,["unload"].concat(e.call(a)))}}),c.fn.extend({animateE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.animate.apply(this,b).promise())},showE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.show.apply(this,b).promise())},hideE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.hide.apply(this,b).promise())},toggleE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.toggle.apply(this,b).promise())},fadeInE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.fadeIn.apply(this,b).promise())},fadeOutE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.fadeOut.apply(this,b).promise())},fadeToE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.fadeTo.apply(this,b).promise())},fadeToggleE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.fadeToggle.apply(this,b).promise())},slideDownE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.slideDown.apply(this,b).promise())},slideUpE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.slideUp.apply(this,b).promise())},slideToggleE:function(){var b;return b=1<=arguments.length?e.call(arguments,0):[],a.fromPromise(this.slideToggle.apply(this,b).promise())}}),a.$},"undefined"!=typeof module&&null!==module?(b=require("baconjs"),c=require("bacon.model"),a=require("jquery"),module.exports=d(b,c,a)):"function"==typeof define&&define.amd?define(["bacon","bacon.model","jquery"],d):d(this.Bacon,this.BaconModel,this.$)}.call(this);