mirror of https://github.com/perkeep/perkeep.git
21 lines
99 KiB
JavaScript
21 lines
99 KiB
JavaScript
|
/**
|
||
|
* React (with addons) v0.8.0
|
||
|
*
|
||
|
* Copyright 2013 Facebook, Inc.
|
||
|
*
|
||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
!function(t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):"undefined"!=typeof window?window.React=t():"undefined"!=typeof global?global.React=t():"undefined"!=typeof self&&(self.React=t())}(function(){return function t(e,n,o){function r(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return r(n?n:t)},c,c.exports,t,e,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<o.length;a++)r(o[a]);return r}({1:[function(t,e){function n(t){var e=o(t);if(!e)throw new Error(r('Tried to get element with id of "%s" but it is not present on the page.',t));return e}var o=t("./ge"),r=t("./ex");e.exports=n},{"./ex":96,"./ge":100}],2:[function(t,e){function n(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+t.className+" ").indexOf(" "+e+" ")>-1}var o=t("./invariant"),r={addClass:function(t,e){return o(!/\s/.test(e)),e&&(t.classList?t.classList.add(e):n(t,e)||(t.className=t.className+" "+e)),t},removeClass:function(t,e){return o(!/\s/.test(e)),e&&(t.classList?t.classList.remove(e):n(t,e)&&(t.className=t.className.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,""))),t},conditionClass:function(t,e,n){return(n?r.addClass:r.removeClass)(t,e)}};e.exports=r},{"./invariant":109}],3:[function(t,e){"use strict";var n={fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,zIndex:!0,zoom:!0},o={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},r={isUnitlessNumber:n,shorthandPropertyExpansions:o};e.exports=r},{}],4:[function(t,e){"use strict";var n=t("./CSSProperty"),o=t("./dangerousStyleValue"),r=t("./escapeTextForBrowser"),i=t("./hyphenate"),a=t("./memoizeStringOnly"),s=a(function(t){return r(i(t))}),u={createMarkupForStyles:function(t){var e="";for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];null!=r&&(e+=s(n)+":",e+=o(n,r)+";")}return e||null},setValueForStyles:function(t,e){var r=t.style;for(var i in e)if(e.hasOwnProperty(i)){var a=o(i,e[i]);if(a)r[i]=a;else{var s=n.shorthandPropertyExpansions[i];if(s)for(var u in s)r[u]="";else r[i]=""}}}};e.exports=u},{"./CSSProperty":3,"./dangerousStyleValue":93,"./escapeTextForBrowser":95,"./hyphenate":108,"./memoizeStringOnly":117}],5:[function(t,e){"use strict";var n={},o={putListener:function(t,e,o){var r=n[e]||(n[e]={});r[t]=o},getListener:function(t,e){var o=n[e];return o&&o[t]},deleteListener:function(t,e){var o=n[e];o&&delete o[t]},deleteAllListeners:function(t){for(var e in n)delete n[e][t]},__purge:function(){n={}}};e.exports=o},{}],6:[function(t,e){"use strict";function n(t){return"SELECT"===t.nodeName||"INPUT"===t.nodeName&&"file"===t.type}function o(t){var e=E.getPooled(x.change,N,t);C.accumulateTwoPhaseDispatches(e),g.enqueueEvents(e),g.processEventQueue()}function r(t,e){T=t,N=e,T.attachEvent("onchange",o)}function i(){T&&(T.detachEvent("onchange",o),T=null,N=null)}function a(t,e,n){return t===D.topChange?n:void 0}function s(t,e,n){t===D.topFocus?(i(),r(e,n)):t===D.topBlur&&i()}function u(t,e){T=t,N=e,S=t.value,_=Object.getOwnPropertyDescriptor(t.constructor.prototype,"value"),Object.defineProperty(T,"value",O),T.attachEvent("onpropertychange",l)}function c(){T&&(delete T.value,T.detachEvent("onpropertychange",l),T=null,N=null,S=null,_=null)}function l(t){if("value"===t.propertyName){var e=t.srcElement.value;e!==S&&(S=e,o(t))}}function p(t,e,n){return t===D.topInput?n:void 0}function d(t,e,n){t===D.topFocus?(c
|
||
|
},mountComponent:d.measure("ReactCompositeComponent","mountComponent",function(t,e,n){u.Mixin.mountComponent.call(this,t,e,n),this._compositeLifeCycleState=b.MOUNTING,this._defaultProps=this.getDefaultProps?this.getDefaultProps():null,this._processProps(this.props),this.__reactAutoBindMap&&this._bindAutoBindMethods(),this.state=this.getInitialState?this.getInitialState():null,this._pendingState=null,this._pendingForceUpdate=!1,this.componentWillMount&&(this.componentWillMount(),this._pendingState&&(this.state=this._pendingState,this._pendingState=null)),this._renderedComponent=this._renderValidatedComponent(),this._compositeLifeCycleState=null;var o=this._renderedComponent.mountComponent(t,e,n+1);return this.componentDidMount&&e.getReactMountReady().enqueue(this,this.componentDidMount),o}),unmountComponent:function(){this._compositeLifeCycleState=b.UNMOUNTING,this.componentWillUnmount&&this.componentWillUnmount(),this._compositeLifeCycleState=null,this._defaultProps=null,u.Mixin.unmountComponent.call(this),this._renderedComponent.unmountComponent(),this._renderedComponent=null,this.refs&&(this.refs=null)},setState:function(t,e){this.replaceState(g(this._pendingState||this.state,t),e)},replaceState:function(t,e){o(this),this._pendingState=t,f.enqueueUpdate(this,e)},_processProps:function(t){var e,n=this._defaultProps;for(e in n)e in t||(t[e]=n[e]);var o=this.constructor.propTypes;if(o){var r=this.constructor.displayName;for(e in o){var i=o[e];i&&i(t,e,r)}}},performUpdateIfNecessary:function(){var t=this._compositeLifeCycleState;t!==b.MOUNTING&&t!==b.RECEIVING_PROPS&&u.Mixin.performUpdateIfNecessary.call(this)},_performUpdateIfNecessary:function(t){if(null!=this._pendingProps||null!=this._pendingState||this._pendingForceUpdate){var e=this.props;null!=this._pendingProps&&(e=this._pendingProps,this._processProps(e),this._pendingProps=null,this._compositeLifeCycleState=b.RECEIVING_PROPS,this.componentWillReceiveProps&&this.componentWillReceiveProps(e,t)),this._compositeLifeCycleState=b.RECEIVING_STATE;var n=this._pendingState||this.state;this._pendingState=null,this._pendingForceUpdate||!this.shouldComponentUpdate||this.shouldComponentUpdate(e,n)?(this._pendingForceUpdate=!1,this._performComponentUpdate(e,n,t)):(this.props=e,this.state=n),this._compositeLifeCycleState=null}},_performComponentUpdate:function(t,e,n){var o=this.props,r=this.state;this.componentWillUpdate&&this.componentWillUpdate(t,e,n),this.props=t,this.state=e,this.updateComponent(n,o,r),this.componentDidUpdate&&n.getReactMountReady().enqueue(this,this.componentDidUpdate.bind(this,o,r))},updateComponent:d.measure("ReactCompositeComponent","updateComponent",function(t,e){u.Mixin.updateComponent.call(this,t,e);var n=this._renderedComponent,o=this._renderValidatedComponent();if(n.constructor===o.constructor)n.receiveComponent(o,t);else{var r=this._rootNodeID,i=n._rootNodeID;n.unmountComponent(),this._renderedComponent=o;var a=o.mountComponent(r,t,this._mountDepth+1);u.DOMIDOperations.dangerouslyReplaceNodeWithMarkupByID(i,a)}}),forceUpdate:function(t){var e=this._compositeLifeCycleState;m(this.isMounted()||e===b.MOUNTING),m(e!==b.RECEIVING_STATE&&e!==b.UNMOUNTING),this._pendingForceUpdate=!0,f.enqueueUpdate(this,t)},_renderValidatedComponent:function(){var t;c.current=this;try{t=this.render()}catch(e){throw e}finally{c.current=null}return m(u.isValidComponent(t)),t},_bindAutoBindMethods:function(){for(var t in this.__reactAutoBindMap)if(this.__reactAutoBindMap.hasOwnProperty(t)){var e=this.__reactAutoBindMap[t];this[t]=this._bindAutoBindMethod(l.guard(e,this.constructor.displayName+"."+t))}},_bindAutoBindMethod:function(t){var e=this,n=function(){return t.apply(e,arguments)};return n}},x=function(){};C(x,u.Mixin),C(x,p.Mixin),C(x,h.Mixin),C(x,D);var T={LifeCycle:b,Base:x,createClass:function(t){var e=function(){};e.prototype=new x,e.prototype.constructor=e,r(e,t),m(e.prototype.render);for(var n in M)e.prototype[n]||(e.prototype[n]=null);var o=function(){var t=new e;return t.construct.apply(t,arguments),t};return o.componentConstructor=e,o.originalSpec=t,o},isVal
|
||
|
a._mountImage=u,a._mountIndex=r,o.push(u),r++}}return o},updateTextContent:function(t){d++;try{var e=this._renderedChildren;for(var n in e)e.hasOwnProperty(n)&&e[n]&&this._unmountChildByName(e[n],n);this.setTextContent(t)}catch(o){throw d--,d||u(),o}d--,d||s()},updateChildren:function(t,e){d++;try{this._updateChildren(t,e)}catch(n){throw d--,d||u(),n}d--,d||s()},_updateChildren:function(t,e){var o=p(t),r=this._renderedChildren;if(o||r){var i,a=0,s=0;for(i in o)if(o.hasOwnProperty(i)){var u=r&&r[i],c=o[i];n(u,c)?(this.moveChild(u,s,a),a=Math.max(u._mountIndex,a),u.receiveComponent(c,e),u._mountIndex=s):(u&&(a=Math.max(u._mountIndex,a),this._unmountChildByName(u,i)),c&&this._mountChildByNameAtIndex(c,i,s,e)),c&&s++}for(i in r)!r.hasOwnProperty(i)||!r[i]||o&&o[i]||this._unmountChildByName(r[i],i)}},unmountChildren:function(){var t=this._renderedChildren;for(var e in t){var n=t[e];n&&n.unmountComponent&&n.unmountComponent()}this._renderedChildren=null},moveChild:function(t,e,n){t._mountIndex<n&&r(this._rootNodeID,t._mountIndex,e)},createChild:function(t){o(this._rootNodeID,t._mountImage,t._mountIndex)},removeChild:function(t){i(this._rootNodeID,t._mountIndex)},setTextContent:function(t){a(this._rootNodeID,t)},_mountChildByNameAtIndex:function(t,e,n,o){var r=this._rootNodeID+"."+e,i=t.mountComponent(r,o,this._mountDepth+1);t._mountImage=i,t._mountIndex=n,this.createChild(t),this._renderedChildren=this._renderedChildren||{},this._renderedChildren[e]=t},_unmountChildByName:function(t,e){c.isValidComponent(t)&&(this.removeChild(t),t._mountImage=null,t._mountIndex=null,t.unmountComponent(),delete this._renderedChildren[e])}}};e.exports=m},{"./ReactComponent":28,"./ReactMultiChildUpdateTypes":57,"./flattenChildren":98}],57:[function(t,e){var n=t("./keyMirror"),o=n({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});e.exports=o},{"./keyMirror":115}],58:[function(t,e){"use strict";var n=t("./invariant"),o={isValidOwner:function(t){return!(!t||"function"!=typeof t.attachRef||"function"!=typeof t.detachRef)},addComponentAsRefTo:function(t,e,r){n(o.isValidOwner(r)),r.attachRef(e,t)},removeComponentAsRefFrom:function(t,e,r){n(o.isValidOwner(r)),r.refs[e]===t&&r.detachRef(e)},Mixin:{attachRef:function(t,e){n(e.isOwnedBy(this));var o=this.refs||(this.refs={});o[t]=e},detachRef:function(t){delete this.refs[t]}}};e.exports=o},{"./invariant":109}],59:[function(t,e){"use strict";function n(t,e,n){return n}var o={enableMeasure:!1,storedMeasure:n,measure:function(t,e,n){return n},injection:{injectMeasure:function(t){o.storedMeasure=t}}};e.exports=o},{"./ExecutionEnvironment":21}],60:[function(t,e){"use strict";function n(t){return function(e,n,o){e[n]=e.hasOwnProperty(n)?t(e[n],o):o}}var o=t("./emptyFunction"),r=t("./invariant"),i=t("./joinClasses"),a=t("./merge"),s={children:o,className:n(i),ref:o,style:n(a)},u={TransferStrategies:s,Mixin:{transferPropsTo:function(t){r(t.props.__owner__===this);var e={};for(var n in t.props)t.props.hasOwnProperty(n)&&(e[n]=t.props[n]);for(var o in this.props)if(this.props.hasOwnProperty(o)){var i=s[o];i?i(e,o,this.props[o]):e.hasOwnProperty(o)||(e[o]=this.props[o])}return t.props=e,t}}};e.exports=u},{"./emptyFunction":94,"./invariant":109,"./joinClasses":114,"./merge":118}],61:[function(t,e){"use strict";function n(t){function e(e,n,o){var r=typeof e;"object"===r&&Array.isArray(e)&&(r="array"),s(r===t)}return i(e)}function o(t){function e(t,e,o){s(n[t])}var n=a(t);return i(e)}function r(t){function e(e,n,o){s(e instanceof t)}return i(e)}function i(t){function e(n){function o(e,o,r){var i=e[o];null!=i?t(i,o,r||c):s(!n)}return n||(o.isRequired=e(!0)),o}return e(!1)}var a=t("./createObjectFrom"),s=t("./invariant"),u={array:n("array"),bool:n("boolean"),func:n("function"),number:n("number"),object:n("object"),string:n("string"),oneOf:o,instanceOf:r},c="<<anonymous>>";e.exports=u},{"./createObjectFrom":91,"./invariant":109}],62:[function(t,e){"use strict";function n(){this.reinitializeTransaction(),this.reactMountReady=s.getPooled(null)}var o=t("./ExecutionEnvironment"),r=t("./PooledClass"),
|
||
|
},{}],112:[function(t,e){"use strict";function n(t){return t&&("INPUT"===t.nodeName&&o[t.type]||"TEXTAREA"===t.nodeName)}var o={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=n},{}],113:[function(t,e){function n(t){return o(t)&&3==t.nodeType}var o=t("./isNode");e.exports=n},{"./isNode":111}],114:[function(t,e){"use strict";function n(t){t||(t="");var e,n=arguments.length;if(n>1)for(var o=1;n>o;o++)e=arguments[o],e&&(t+=" "+e);return t}e.exports=n},{}],115:[function(t,e){"use strict";var n=t("./invariant"),o=function(t){var e,o={};n(t instanceof Object&&!Array.isArray(t));for(e in t)t.hasOwnProperty(e)&&(o[e]=e);return o};e.exports=o},{"./invariant":109}],116:[function(t,e){var n=function(t){var e;for(e in t)if(t.hasOwnProperty(e))return e;return null};e.exports=n},{}],117:[function(t,e){"use strict";function n(t){var e={};return function(n){return e.hasOwnProperty(n)?e[n]:e[n]=t.call(this,n)}}e.exports=n},{}],118:[function(t,e){"use strict";var n=t("./mergeInto"),o=function(t,e){var o={};return n(o,t),n(o,e),o};e.exports=o},{"./mergeInto":120}],119:[function(t,e){"use strict";var n=t("./invariant"),o=t("./keyMirror"),r=36,i=function(t){return"object"!=typeof t||null===t},a={MAX_MERGE_DEPTH:r,isTerminal:i,normalizeMergeArg:function(t){return void 0===t||null===t?{}:t},checkMergeArrayArgs:function(t,e){n(Array.isArray(t)&&Array.isArray(e))},checkMergeObjectArgs:function(t,e){a.checkMergeObjectArg(t),a.checkMergeObjectArg(e)},checkMergeObjectArg:function(t){n(!i(t)&&!Array.isArray(t))},checkMergeLevel:function(t){n(r>t)},checkArrayStrategy:function(t){n(void 0===t||t in a.ArrayStrategies)},ArrayStrategies:o({Clobber:!0,IndexByIndex:!0})};e.exports=a},{"./invariant":109,"./keyMirror":115}],120:[function(t,e){"use strict";function n(t,e){if(r(t),null!=e){r(e);for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}}var o=t("./mergeHelpers"),r=o.checkMergeObjectArg;e.exports=n},{"./mergeHelpers":119}],121:[function(t,e){"use strict";var n=function(t,e){var n;for(n in e)e.hasOwnProperty(n)&&(t.prototype[n]=e[n])};e.exports=n},{}],122:[function(t,e){"use strict";function n(t,e){i("html"===t.tagName.toLowerCase()),e=e.trim(),i(0===e.toLowerCase().indexOf("<html"));var n=e.indexOf(">")+1,a=e.lastIndexOf("<"),s=e.substring(0,n),u=e.substring(n,a),c=s.indexOf(" ")>-1,l=null;if(c){l=o(s.replace("html ","span ")+"</span>")[0];var p=r(l,function(e){return t.getAttributeNS(e.namespaceURI,e.name)!==e.value});p.forEach(function(e){t.setAttributeNS(e.namespaceURI,e.name,e.value)})}var d=r(t,function(t){return!(l&&l.hasAttributeNS(t.namespaceURI,t.name))});d.forEach(function(e){t.removeAttributeNS(e.namespaceURI,e.name)}),t.innerHTML=u}var o=t("./createNodesFromMarkup"),r=t("./filterAttributes"),i=t("./invariant");e.exports=n},{"./createNodesFromMarkup":90,"./filterAttributes":97,"./invariant":109}],123:[function(t,e){"use strict";function n(t,e,n){if(!t)return null;var o=0,r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=e.call(n,t[i],i,o++));return r}e.exports=n},{}],124:[function(t,e){"use strict";function n(t,e,n){if(!t)return null;var o=0,r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=e.call(n,i,t[i],o++));return r}e.exports=n},{}],125:[function(t,e){"use strict";var n=t("./ExecutionEnvironment"),o=null;n.canUseDOM&&(o=window.performance||window.webkitPerformance),o&&o.now||(o=Date);var r=o.now.bind(o);e.exports=r},{"./ExecutionEnvironment":21}],126:[function(t,e){"use strict";function n(t,e){if(t===e)return!0;var n;for(n in t)if(t.hasOwnProperty(n)&&(!e.hasOwnProperty(n)||t[n]!==e[n]))return!1;for(n in e)if(e.hasOwnProperty(n)&&!t.hasOwnProperty(n))return!1;return!0}e.exports=n},{}],127:[function(t,e){"use strict";function n(t,e,n){null!==t&&void 0!==t&&a(t,"",0,e,n)}var o=t("./ReactComponent"),r=t("./ReactTextComponent"),i=t("./invariant"),a=function(t,e,n,s,u){var c=0;if(Array.isArray(t))for(var l=0;l<t.length;l++){var p=t[l],d=e+o.getKey(p,l),h=n+c;c+=a(p,d,h,s,u)}else{var f=typeof t,m=""===e,v=m?o.getKey(t,0):e;if(null===t||void 0=
|