From 1af55cd9de2e2eb0ee00c65f2145a963091f5a6c Mon Sep 17 00:00:00 2001 From: Joe Hudson Date: Sun, 20 Jul 2014 17:31:48 -0400 Subject: [PATCH] v0.8.0 --- backbone-reaction.js | 2 +- backbone-reaction.min.js | 4 ++-- bower.json | 2 +- package.json | 2 +- release-notes.md | 8 +++++++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/backbone-reaction.js b/backbone-reaction.js index 1e96919..d29cfd3 100644 --- a/backbone-reaction.js +++ b/backbone-reaction.js @@ -1,5 +1,5 @@ /*! - * reactbone v0.7.0 + * backbone-reaction v0.8.0 * https://github.com/jhudson8/backbone-reaction * * Copyright (c) 2014 Joe Hudson diff --git a/backbone-reaction.min.js b/backbone-reaction.min.js index e0b9a29..3196c84 100644 --- a/backbone-reaction.min.js +++ b/backbone-reaction.min.js @@ -1,4 +1,4 @@ /*! - * https://github.com/jhudson8/backbone-reaction v0.7.1; MIT license; Joe Hudson + * https://github.com/jhudson8/backbone-reaction v0.8.0; MIT license; Joe Hudson */ -!function(e){"function"==typeof define&&define.amd?define(["react","backbone","underscore"],e):"undefined"!=typeof exports&&"undefined"!=typeof require?module.exports=function(t,n){e(t,n,require("underscore"))}:e(React,Backbone,_)}(function(React,Backbone,_){!function(){var e=Backbone.sync;Backbone.async=_.extend({},Backbone.Events),Backbone.sync=function(t,n,i){function a(e){var t=i[e];i[e]=function(){var a=arguments;t&&t.apply(this,a);var o=r.indexOf(s);o>=0&&r.splice(o,1);var c="success"===e?[e,n,i]:[e,n,a[1],a[2],i];s.trigger.apply(s,c),c.splice(0,0,"complete"),s.trigger.apply(s,c),0===r.length&&n.trigger("async:load-complete")}}i=i||{},i.url||(i.url=_.result(n,"url"));var r=n._pendingAsyncEvents=n._pendingAsyncEvents||[],o=i&&i.event||t,s=_.extend({},Backbone.Events);r.push(s),s.method=t,s.options=i,s.model=n,n.trigger("async",o,s,i),n.trigger("async:"+o,s,i),_.each([Backbone.async,Backbone.asyncHandler],function(e){e&&(e.trigger("async",o,n,s,i),e.trigger("async:"+o,n,s,i))}),a("success"),a("error");var c=i.intercept;if(c){if("function"==typeof c)return c(i);throw"intercept must be function(options)"}e.call(this,t,n,i)},_.each([Backbone.Model,Backbone.Collection],function(e){e.prototype.isLoading=function(){return this._pendingAsyncEvents&&this._pendingAsyncEvents.length>0?this._pendingAsyncEvents:!1}}),Backbone.async.on("async:read",function(e,t){t.on("success",function(){e.hasBeenFetched=!0,e.hadFetchError=!1}),t.on("error",function(){e.hadFetchError=!0})})}(),function(){function get(values,index,rtn){function addTo(name){var indexName=name,match=name.match(/^([^\(]*)\s*\(([^\)]*)\)\s*/),params=match&&match[2];if(name=match&&match[1]||name,!index[indexName]){params&&(params=eval("["+params+"]"));var mixin=React.mixins._mixins[name],checkAgain=!1;if(!mixin)throw new Error('invalid mixin "'+name+'"');if("function"==typeof mixin)mixin=mixin.apply(this,params||[]),checkAgain=!0;else if(params)throw new Error('the mixin "'+name+'" does not support parameters');get(React.mixins._dependsOn[name],index,rtn),get(React.mixins._dependsInjected[name],index,rtn),index[indexName]=!0,checkAgain?get([mixin],index,rtn):rtn.push(mixin)}}function handleMixin(e){e&&(Array.isArray(e)?get(e,index,rtn):"string"==typeof e?addTo(e):rtn.push(e))}if(Array.isArray(values))for(var i=0;i=0,u=c[s]),!u)throw'no callback function exists for "'+s+'"';s=function(){return u.apply(c,d?[]:arguments)}}var f=o.match(a);if(f){var h=f[1],m=f[2].split(/\s*,\s*/),p=f[3],v=React.events.specials[h];if(v)return 1===m.length&&""===m[0]&&(m=[]),s=v.call(c,s,m),e(p,s,c,!0);throw new Error('invalid special event handler "'+h+"'")}var g=o.match(i),y=g[1];path=g[2],handler=t[y];for(var x=0;!handler&&x0?Array.prototype.slice.call(arguments,0):void 0;return{getInitialState:function(){e=n(e||"loadOn",this,"async:{key}",function(e){this.setState({loading:!0}),e.on("complete",function(){this.isMounted()&&this.setState({loading:!1})},this)});var t=this.getModel();if(t){var i,a=t.isLoading();if(a)for(var r=function(){this.isMounted()&&this.setState({loading:!1})},o=0;o=0)return i=e[s],a[o].on("complete",r,this),{loading:!0}}}return{}}}},"modelEventAware"),React.mixins.add("modelUpdateOn",function(){var e=arguments.length>0?Array.prototype.slice.call(arguments,0):void 0;return{getInitialState:function(){n(e||"updateOn",this,"{key}",function(){this.deferUpdate()})}}},"modelEventAware","deferUpdate"),React.events){React.events.mixin=React.events.mixin||Backbone.Events;var r=/^model(\[.+\])?$/;React.events.handle(r,function(e,t){var n=e.key.match(r),i=n[1]&&n[1].substring(1,n[1].length-1),a=i&&(this.props[i]||this.refs[i]);if(!a&&i)throw new Error('no model found with "'+i+'"');var o={model:a,event:e.path,callback:t};return{on:function(){this.modelOn(o)},off:function(){}}});var o=React.events.specials;if(o){var s=["memoize","delay","defer","throttle","debounce","once"];_.each(s,function(e){o[e]=o[e]||function(t,n){return n=a(n),n.splice(0,0,t),_[e].apply(_,n)}})}}}()}); \ No newline at end of file +!function(e){"function"==typeof define&&define.amd?define(["react","backbone","underscore"],e):"undefined"!=typeof exports&&"undefined"!=typeof require?module.exports=function(t,n){e(t,n,require("underscore"))}:e(React,Backbone,_)}(function(React,Backbone,_){!function(){var e=Backbone.sync;Backbone.async=_.extend({},Backbone.Events),Backbone.sync=function(t,n,i){function a(e){var t=i[e];i[e]=function(){var a=arguments;t&&t.apply(this,a);var o=r.indexOf(s);o>=0&&r.splice(o,1);var c="success"===e?[e,n,i]:[e,n,a[1],a[2],i];s.trigger.apply(s,c),c.splice(0,0,"complete"),s.trigger.apply(s,c),0===r.length&&n.trigger("async:load-complete")}}i=i||{},i.url||(i.url=_.result(n,"url"));var r=n._pendingAsyncEvents=n._pendingAsyncEvents||[],o=i&&i.event||t,s=_.extend({},Backbone.Events);r.push(s),s.method=t,s.options=i,s.model=n,n.trigger("async",o,s,i),n.trigger("async:"+o,s,i),_.each([Backbone.async,Backbone.asyncHandler],function(e){e&&(e.trigger("async",o,n,s,i),e.trigger("async:"+o,n,s,i))}),a("success"),a("error");var c=i.intercept;if(c){if("function"==typeof c)return c(i);throw"intercept must be function(options)"}e.call(this,t,n,i)},_.each([Backbone.Model,Backbone.Collection],function(e){e.prototype.isLoading=function(){return this._pendingAsyncEvents&&this._pendingAsyncEvents.length>0?this._pendingAsyncEvents:!1}}),Backbone.async.on("async:read",function(e,t){t.on("success",function(){e.hasBeenFetched=!0,e.hadFetchError=!1}),t.on("error",function(){e.hadFetchError=!0})})}(),function(){function get(values,index,rtn){function addTo(name){var indexName=name,match=name.match(/^([^\(]*)\s*\(([^\)]*)\)\s*/),params=match&&match[2];if(name=match&&match[1]||name,!index[indexName]){params&&(params=eval("["+params+"]"));var mixin=React.mixins._mixins[name],checkAgain=!1;if(!mixin)throw new Error('invalid mixin "'+name+'"');if("function"==typeof mixin)mixin=mixin.apply(this,params||[]),checkAgain=!0;else if(params)throw new Error('the mixin "'+name+'" does not support parameters');get(React.mixins._dependsOn[name],index,rtn),get(React.mixins._dependsInjected[name],index,rtn),index[indexName]=!0,checkAgain?get([mixin],index,rtn):rtn.push(mixin)}}function handleMixin(e){e&&(Array.isArray(e)?get(e,index,rtn):"string"==typeof e?addTo(e):rtn.push(e))}if(Array.isArray(values))for(var i=0;i=0,u=c[s]),!u)throw'no callback function exists for "'+s+'"';s=function(){return u.apply(c,l?[]:arguments)}}var f=o.match(a);if(f){var h=f[1],m=f[2].split(/\s*,\s*/),p=f[3],v=React.events.specials[h];if(v)return 1===m.length&&""===m[0]&&(m=[]),s=v.call(c,s,m),e(p,s,c,!0);throw new Error('invalid special event handler "'+h+"'")}var g=o.match(i),x=g[1];path=g[2],handler=t[x];for(var y=0;!handler&&y0?Array.prototype.slice.call(arguments,0):void 0;return{getInitialState:function(){e=n(e||"loadOn",this,"async:{key}",function(e){this.setState({loading:!0}),e.on("complete",function(){this.isMounted()&&this.setState({loading:!1})},this)});var t=this.getModel();if(t){var i,a=t.isLoading();if(a)for(var r=function(){this.isMounted()&&this.setState({loading:!1})},o=0;o=0)return i=e[s],a[o].on("complete",r,this),{loading:!0}}}return{}}}},"modelEventAware"),React.mixins.add("modelUpdateOn",function(){var e=arguments.length>0?Array.prototype.slice.call(arguments,0):void 0;return{getInitialState:function(){n(e||"updateOn",this,"{key}",function(){this.deferUpdate()})}}},"modelEventAware","deferUpdate"),React.events){React.events.mixin=React.events.mixin||Backbone.Events;var r=/^model(\[.+\])?$/;React.events.handle(r,function(e,t){var n=e.key.match(r),i=n[1]&&n[1].substring(1,n[1].length-1),a=i&&(this.props[i]||this.refs[i]);if(!a&&i)throw new Error('no model found with "'+i+'"');var o={model:a,event:e.path,callback:t};return{on:function(){this.modelOn(o)},off:function(){}}});var o=React.events.specials;if(o){var s=["memoize","delay","defer","throttle","debounce","once"];_.each(s,function(e){o[e]=o[e]||function(t,n){return n=a(n),n.splice(0,0,t),_[e].apply(_,n)}})}}var c=function(e,t,n,i){return React.createClass(_.extend({mixins:["modelValueAware"],render:function(){var i={},a=this.getModelValue();return n?i.defaultChecked=a:i.defaultValue=a,React.DOM[e](_.extend(i,t,this.props),this.props.children)},getUIModelValue:function(){if(this.isMounted()){if(!n)return $(this.getDOMNode()).val();var e=this.getDOMNode();if(e.checked)return e.value||!0}}},i))};Backbone.input=Backbone.input||{},_.defaults(Backbone.input,{Text:c("input",{type:"text"}),TextArea:c("textarea"),Select:c("select",void 0,void 0),CheckBox:c("input",{type:"checkbox"},!0),RadioGroup:React.createClass({mixins:["modelValueAware"],render:function(){var e=this.props;return React.DOM[e.tag||"span"](e,e.children)},componentDidMount:function(){var e=this.getModelValue();if(e){var t='input[value="'+e.replace('"','\\"')+'"]',n=$(this.getDOMNode()).find(t);n.attr("checked","checked")}},getUIModelValue:function(){if(this.isMounted())for(var e='input[type="radio"]',t=$(this.getDOMNode()).find(e),n=0;n" diff --git a/package.json b/package.json index d8433fc..520e72c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "backbone-reaction", - "version": "0.7.1", + "version": "0.8.0", "author": "Joe Hudson ", "description": "react, backbone and then some", "repository": { diff --git a/release-notes.md b/release-notes.md index 711261b..a3d8119 100644 --- a/release-notes.md +++ b/release-notes.md @@ -2,7 +2,13 @@ ## Development -[Commits](https://github.com/jhudson8/backbone-reaction/compare/v0.7.1...master) +[Commits](https://github.com/jhudson8/backbone-reaction/compare/v0.8.0...master) + +## v0.8.0 - July 20th, 2014 +- move from react-backbone 0.8.0 to 0.9.0 - 599ae71 +- rename reactbone references in README - e7ca5b9 + +[Commits](https://github.com/jhudson8/backbone-reaction/compare/v0.7.1...v0.8.0) ## v0.7.1 - July 20th, 2014 - rename to backbone-reaction as reactbone was already taken in registries - bbea235