-凯发注册手机版官网

/** * react v0.13.1 */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.react = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new error("cannot find module '" o "'");throw f.code="module_not_found",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o -1) { if (typeof __react_devtools_global_hook__ === 'undefined') { console.debug( 'download the react devtools for a better development experience: ' 'http://fb.me/react-devtools' ); } } var expectedfeatures = [ // shims array.isarray, array.prototype.every, array.prototype.foreach, array.prototype.indexof, array.prototype.map, date.now, function.prototype.bind, object.keys, string.prototype.split, string.prototype.trim, // shams object.create, object.freeze ]; for (var i = 0; i < expectedfeatures.length; i ) { if (!expectedfeatures[i]) { console.error( 'one or more es5 shim/shams expected by react are not available: ' 'http://fb.me/react-warning-polyfills' ); break; } } } } react.version = '0.13.1'; module.exports = react; },{"117":117,"144":144,"19":19,"21":21,"27":27,"32":32,"33":33,"34":34,"38":38,"39":39,"40":40,"51":51,"54":54,"57":57,"58":58,"66":66,"70":70,"75":75,"78":78,"81":81,"84":84}],2:[function(_dereq_,module,exports){ /** * k8凯发官方网站 copyright 2013-2015, facebook, inc. * all rights reserved. * * this source code is licensed under the bsd-style license found in the * license file in the root directory of this source tree. an additional grant * of patent rights can be found in the patents file in the same directory. * * @providesmodule autofocusmixin * @typechecks static-only */ 'use strict'; var focusnode = _dereq_(119); var autofocusmixin = { componentdidmount: function() { if (this.props.autofocus) { focusnode(this.getdomnode()); } } }; module.exports = autofocusmixin; },{"119":119}],3:[function(_dereq_,module,exports){ /** * k8凯发官方网站 copyright 2013-2015 facebook, inc. * all rights reserved. * * this source code is licensed under the bsd-style license found in the * license file in the root directory of this source tree. an additional grant * of patent rights can be found in the patents file in the same directory. * * @providesmodule beforeinputeventplugin * @typechecks static-only */ 'use strict'; var eventconstants = _dereq_(15); var eventpropagators = _dereq_(20); var executionenvironment = _dereq_(21); var fallbackcompositionstate = _dereq_(22); var syntheticcompositionevent = _dereq_(93); var syntheticinputevent = _dereq_(97); var keyof = _dereq_(141); var end_keycodes = [9, 13, 27, 32]; // tab, return, esc, space var start_keycode = 229; var canusecompositionevent = ( executionenvironment.canusedom && 'compositionevent' in window ); var documentmode = null; if (executionenvironment.canusedom && 'documentmode' in document) { documentmode = document.documentmode; } // webkit offers a very useful `textinput` event that can be used to // directly represent `beforeinput`. the ie `textinput` event is not as // useful, so we don't use it. var canusetextinputevent = ( executionenvironment.canusedom && 'textevent' in window && !documentmode && !ispresto() ); // in ie9 , we have access to composition events, but the data supplied // by the native compositionend event may be incorrect. japanese ideographic // spaces, for instance (\u3000) are not recorded correctly. var usefallbackcompositiondata = ( executionenvironment.canusedom && ( (!canusecompositionevent || documentmode && documentmode > 8 && documentmode <= 11) ) ); /** * opera <= 12 includes textevent in window, but does not fire * text input events. rely on keypress instead. */ function ispresto() { var opera = window.opera; return ( typeof opera === 'object' && typeof opera.version === 'function' && parseint(opera.version(), 10) <= 12 ); } var spacebar_code = 32; var spacebar_char = string.fromcharcode(spacebar_code); var topleveltypes = eventconstants.topleveltypes; // events and their corresponding property names. var eventtypes = { beforeinput: { phasedregistrationnames: { bubbled: keyof({onbeforeinput: null}), captured: keyof({onbeforeinputcapture: null}) }, dependencies: [ topleveltypes.topcompositionend, topleveltypes.topkeypress, topleveltypes.toptextinput, topleveltypes.toppaste ] }, compositionend: { phasedregistrationnames: { bubbled: keyof({oncompositionend: null}), captured: keyof({oncompositionendcapture: null}) }, dependencies: [ topleveltypes.topblur, topleveltypes.topcompositionend, topleveltypes.topkeydown, topleveltypes.topkeypress, topleveltypes.topkeyup, topleveltypes.topmousedown ] }, compositionstart: { phasedregistrationnames: { bubbled: keyof({oncompositionstart: null}), captured: keyof({oncompositionstartcapture: null}) }, dependencies: [ topleveltypes.topblur, topleveltypes.topcompositionstart, topleveltypes.topkeydown, topleveltypes.topkeypress, topleveltypes.topkeyup, topleveltypes.topmousedown ] }, compositionupdate: { phasedregistrationnames: { bubbled: keyof({oncompositionupdate: null}), captured: keyof({oncompositionupdatecapture: null}) }, dependencies: [ topleveltypes.topblur, topleveltypes.topcompositionupdate, topleveltypes.topkeydown, topleveltypes.topkeypress, topleveltypes.topkeyup, topleveltypes.topmousedown ] } }; // track whether we've ever handled a keypress on the space key. var hasspacekeypress = false; /** * return whether a native keypress event is assumed to be a command. * this is required because firefox fires `keypress` events for key commands * (cut, copy, select-all, etc.) even though no character is inserted. */ function iskeypresscommand(nativeevent) { return ( (nativeevent.ctrlkey || nativeevent.altkey || nativeevent.metakey) && // ctrlkey && altkey is equivalent to altgr, and is not a command. !(nativeevent.ctrlkey && nativeevent.altkey) ); } /** * translate native top level events into event types. * * @param {string} topleveltype * @return {object} */ function getcompositioneventtype(topleveltype) { switch (topleveltype) { case topleveltypes.topcompositionstart: return eventtypes.compositionstart; case topleveltypes.topcompositionend: return eventtypes.compositionend; case topleveltypes.topcompositionupdate: return eventtypes.compositionupdate; } } /** * does our fallback best-guess model think this event signifies that * composition has begun? * * @param {string} topleveltype * @param {object} nativeevent * @return {boolean} */ function isfallbackcompositionstart(topleveltype, nativeevent) { return ( topleveltype === topleveltypes.topkeydown && nativeevent.keycode === start_keycode ); } /** * does our fallback mode think that this event is the end of composition? * * @param {string} topleveltype * @param {object} nativeevent * @return {boolean} */ function isfallbackcompositionend(topleveltype, nativeevent) { switch (topleveltype) { case topleveltypes.topkeyup: // command keys insert or clear ime input. return (end_keycodes.indexof(nativeevent.keycode) !== -1); case topleveltypes.topkeydown: // expect ime keycode on each keydown. if we get any other // code we must have exited earlier. return (nativeevent.keycode !== start_keycode); case topleveltypes.topkeypress: case topleveltypes.topmousedown: case topleveltypes.topblur: // events are not possible without cancelling ime. return true; default: return false; } } /** * google input tools provides composition data via a customevent, * with the `data` property populated in the `detail` object. if this * is available on the event object, use it. if not, this is a plain * composition event and we have nothing special to extract. * * @param {object} nativeevent * @return {?string} */ function getdatafromcustomevent(nativeevent) { var detail = nativeevent.detail; if (typeof detail === 'object' && 'data' in detail) { return detail.data; } return null; } // track the current ime composition fallback object, if any. var currentcomposition = null; /** * @param {string} topleveltype record from `eventconstants`. * @param {domeventtarget} topleveltarget the listening component root node. * @param {string} topleveltargetid id of `topleveltarget`. * @param {object} nativeevent native browser event. * @return {?object} a syntheticcompositionevent. */ function extractcompositionevent( topleveltype, topleveltarget, topleveltargetid, nativeevent ) { var eventtype; var fallbackdata; if (canusecompositionevent) { eventtype = getcompositioneventtype(topleveltype); } else if (!currentcomposition) { if (isfallbackcompositionstart(topleveltype, nativeevent)) { eventtype = eventtypes.compositionstart; } } else if (isfallbackcompositionend(topleveltype, nativeevent)) { eventtype = eventtypes.compositionend; } if (!eventtype) { return null; } if (usefallbackcompositiondata) { // the current composition is stored statically and must not be // overwritten while composition continues. if (!currentcomposition && eventtype === eventtypes.compositionstart) { currentcomposition = fallbackcompositionstate.getpooled(topleveltarget); } else if (eventtype === eventtypes.compositionend) { if (currentcomposition) { fallbackdata = currentcomposition.getdata(); } } } var event = syntheticcompositionevent.getpooled( eventtype, topleveltargetid, nativeevent ); if (fallbackdata) { // inject data generated from fallback path into the synthetic event. // this matches the property of native compositioneventinterface. event.data = fallbackdata; } else { var customdata = getdatafromcustomevent(nativeevent); if (customdata !== null) { event.data = customdata; } } eventpropagators.accumulatetwophasedispatches(event); return event; } /** * @param {string} topleveltype record from `eventconstants`. * @param {object} nativeevent native browser event. * @return {?string} the string corresponding to this `beforeinput` event. */ function getnativebeforeinputchars(topleveltype, nativeevent) { switch (topleveltype) { case topleveltypes.topcompositionend: return getdatafromcustomevent(nativeevent); case topleveltypes.topkeypress: /** * if native `textinput` events are available, our goal is to make * use of them. however, there is a special case: the spacebar key. * in webkit, preventing default on a spacebar `textinput` event * cancels character insertion, but it *also* causes the browser * to fall back to its default spacebar behavior of scrolling the * page. * * tracking at: * https://code.google.com/p/chromium/issues/detail?id=355103 * * to avoid this issue, use the keypress event as if no `textinput` * event is available. */ var which = nativeevent.which; if (which !== spacebar_code) { return null; } hasspacekeypress = true; return spacebar_char; case topleveltypes.toptextinput: // record the characters to be added to the dom. var chars = nativeevent.data; // if it's a spacebar character, assume that we have already handled // it at the keypress level and bail immediately. android chrome // doesn't give us keycodes, so we need to blacklist it. if (chars === spacebar_char && hasspacekeypress) { return null; } return chars; default: // for other native event types, do nothing. return null; } } /** * for browsers that do not provide the `textinput` event, extract the * appropriate string to use for syntheticinputevent. * * @param {string} topleveltype record from `eventconstants`. * @param {object} nativeevent native browser event. * @return {?string} the fallback string for this `beforeinput` event. */ function getfallbackbeforeinputchars(topleveltype, nativeevent) { // if we are currently composing (ime) and using a fallback to do so, // try to extract the composed characters from the fallback object. if (currentcomposition) { if ( topleveltype === topleveltypes.topcompositionend || isfallbackcompositionend(topleveltype, nativeevent) ) { var chars = currentcomposition.getdata(); fallbackcompositionstate.release(currentcomposition); currentcomposition = null; return chars; } return null; } switch (topleveltype) { case topleveltypes.toppaste: // if a paste event occurs after a keypress, throw out the input // chars. paste events should not lead to beforeinput events. return null; case topleveltypes.topkeypress: /** * as of v27, firefox may fire keypress events even when no character * will be inserted. a few possibilities: * * - `which` is `0`. arrow keys, esc key, etc. * * - `which` is the pressed key code, but no char is available. * ex: 'altgr d` in polish. there is no modified character for * this key combination and no character is inserted into the * document, but ff fires the keypress for char code `100` anyway. * no `input` event will occur. * * - `which` is the pressed key code, but a command combination is * being used. ex: `cmd c`. no character is inserted, and no * `input` event will occur. */ if (nativeevent.which && !iskeypresscommand(nativeevent)) { return string.fromcharcode(nativeevent.which); } return null; case topleveltypes.topcompositionend: return usefallbackcompositiondata ? null : nativeevent.data; default: return null; } } /** * extract a syntheticinputevent for `beforeinput`, based on either native * `textinput` or fallback behavior. * * @param {string} topleveltype record from `eventconstants`. * @param {domeventtarget} topleveltarget the listening component root node. * @param {string} topleveltargetid id of `topleveltarget`. * @param {object} nativeevent native browser event. * @return {?object} a syntheticinputevent. */ function extractbeforeinputevent( topleveltype, topleveltarget, topleveltargetid, nativeevent ) { var chars; if (canusetextinputevent) { chars = getnativebeforeinputchars(topleveltype, nativeevent); } else { chars = getfallbackbeforeinputchars(topleveltype, nativeevent); } // if no characters are being inserted, no beforeinput event should // be fired. if (!chars) { return null; } var event = syntheticinputevent.getpooled( eventtypes.beforeinput, topleveltargetid, nativeevent ); event.data = chars; eventpropagators.accumulatetwophasedispatches(event); return event; } /** * create an `onbeforeinput` event to match * http://www.w3.org/tr/2013/wd-dom-level-3-events-20131105/#events-inputevents. * * this event plugin is based on the native `textinput` event * available in chrome, safari, opera, and ie. this event fires after * `onkeypress` and `oncompositionend`, but before `oninput`. * * `beforeinput` is spec'd but not implemented in any browsers, and * the `input` event does not provide any useful information about what has * actually been added, contrary to the spec. thus, `textinput` is the best * available event to identify the characters that have actually been inserted * into the target node. * * this plugin is also responsible for emitting `composition` events, thus * allowing us to share composition fallback code for both `beforeinput` and * `composition` event types. */ var beforeinputeventplugin = { eventtypes: eventtypes, /** * @param {string} topleveltype record from `eventconstants`. * @param {domeventtarget} topleveltarget the listening component root node. * @param {string} topleveltargetid id of `topleveltarget`. * @param {object} nativeevent native browser event. * @return {*} an accumulation of synthetic events. * @see {eventpluginhub.extractevents} */ extractevents: function( topleveltype, topleveltarget, topleveltargetid, nativeevent ) { return [ extractcompositionevent( topleveltype, topleveltarget, topleveltargetid, nativeevent ), extractbeforeinputevent( topleveltype, topleveltarget, topleveltargetid, nativeevent ) ]; } }; module.exports = beforeinputeventplugin; },{"141":141,"15":15,"20":20,"21":21,"22":22,"93":93,"97":97}],4:[function(_dereq_,module,exports){ /** * k8凯发官方网站 copyright 2013-2015, facebook, inc. * all rights reserved. * * this source code is licensed under the bsd-style license found in the * license file in the root directory of this source tree. an additional grant * of patent rights can be found in the patents file in the same directory. * * @providesmodule cssproperty */ 'use strict'; /** * css properties which accept numbers but are not in units of "px". */ var isunitlessnumber = { boxflex: true, boxflexgroup: true, columncount: true, flex: true, flexgrow: true, flexshrink: true, fontweight: true, lineclamp: true, lineheight: true, opacity: true, order: true, orphans: true, widows: true, zindex: true, zoom: true, // svg-related properties fillopacity: true, strokeopacity: true }; /** * @param {string} prefix vendor-specific prefix, eg: webkit * @param {string} key style name, eg: transitionduration * @return {string} style name prefixed with `prefix`, properly camelcased, eg: * webkittransitionduration */ function prefixkey(prefix, key) { return prefix key.charat(0).touppercase() key.substring(1); } /** * support style names that may come passed in prefixed by adding permutations * of vendor prefixes. */ var prefixes = ['webkit', 'ms', 'moz', 'o']; // using object.keys here, or else the vanilla for-in loop makes ie8 go into an // infinite loop, because it iterates over the newly added props too. object.keys(isunitlessnumber).foreach(function(prop) { prefixes.foreach(function(prefix) { isunitlessnumber[prefixkey(prefix, prop)] = isunitlessnumber[prop]; }); }); /** * most style properties can be unset by doing .style[prop] = '' but ie8 * doesn't like doing that with shorthand properties so for the properties that * ie8 breaks on, which are listed here, we instead unset each of the * individual properties. see http://bugs.jquery.com/ticket/12385. * the 4-value 'clock' properties like margin, padding, border-width seem to * behave without any problems. curiously, list-style works too without any * special prodding. */ var shorthandpropertyexpansions = { background: { backgroundimage: true, backgroundposition: true, backgroundrepeat: true, backgroundcolor: true }, border: { borderwidth: true, borderstyle: true, bordercolor: true }, borderbottom: { borderbottomwidth: true, borderbottomstyle: true, borderbottomcolor: true }, borderleft: { borderleftwidth: true, borderleftstyle: true, borderleftcolor: true }, borderright: { borderrightwidth: true, borderrightstyle: true, borderrightcolor: true }, bordertop: { bordertopwidth: true, bordertopstyle: true, bordertopcolor: true }, font: { fontstyle: true, fontvariant: true, fontweight: true, fontsize: true, lineheight: true, fontfamily: true } }; var cssproperty = { isunitlessnumber: isunitlessnumber, shorthandpropertyexpansions: shorthandpropertyexpansions }; module.exports = cssproperty; },{}],5:[function(_dereq_,module,exports){ /** * k8凯发官方网站 copyright 2013-2015, facebook, inc. * all rights reserved. * * this source code is licensed under the bsd-style license found in the * license file in the root directory of this source tree. an additional grant * of patent rights can be found in the patents file in the same directory. * * @providesmodule csspropertyoperations * @typechecks static-only */ 'use strict'; var cssproperty = _dereq_(4); var executionenvironment = _dereq_(21); var camelizestylename = _dereq_(108); var dangerousstylevalue = _dereq_(113); var hyphenatestylename = _dereq_(133); var memoizestringonly = _dereq_(143); var warning = _dereq_(154); var processstylename = memoizestringonly(function(stylename) { return hyphenatestylename(stylename); }); var stylefloataccessor = 'cssfloat'; if (executionenvironment.canusedom) { // ie8 only supports accessing cssfloat (standard) as stylefloat if (document.documentelement.style.cssfloat === undefined) { stylefloataccessor = 'stylefloat'; } } if ("production" !== "development") { // 'mstransform' is correct, but the other prefixes should be capitalized var badvendoredstylenamepattern = /^(?:webkit|moz|o)[a-z]/; // style values shouldn't contain a semicolon var badstylevaluewithsemicolonpattern = /;\s*$/; var warnedstylenames = {}; var warnedstylevalues = {}; var warnhyphenatedstylename = function(name) { if (warnedstylenames.hasownproperty(name) && warnedstylenames[name]) { return; } warnedstylenames[name] = true; ("production" !== "development" ? warning( false, 'unsupported style property %s. did you mean %s?', name, camelizestylename(name) ) : null); }; var warnbadvendoredstylename = function(name) { if (warnedstylenames.hasownproperty(name) && warnedstylenames[name]) { return; } warnedstylenames[name] = true; ("production" !== "development" ? warning( false, 'unsupported vendor-prefixed style property %s. did you mean %s?', name, name.charat(0).touppercase() name.slice(1) ) : null); }; var warnstylevaluewithsemicolon = function(name, value) { if (warnedstylevalues.hasownproperty(value) && warnedstylevalues[value]) { return; } warnedstylevalues[value] = true; ("production" !== "development" ? warning( false, 'style property values shouldn\'t contain a semicolon. ' 'try "%s: %s" instead.', name, value.replace(badstylevaluewithsemicolonpattern, '') ) : null); }; /** * @param {string} name * @param {*} value */ var warnvalidstyle = function(name, value) { if (name.indexof('-') > -1) { warnhyphenatedstylename(name); } else if (badvendoredstylenamepattern.test(name)) { warnbadvendoredstylename(name); } else if (badstylevaluewithsemicolonpattern.test(value)) { warnstylevaluewithsemicolon(name, value); } }; } /** * operations for dealing with css properties. */ var csspropertyoperations = { /** * serializes a mapping of style properties for use as inline styles: * * > createmarkupforstyles({width: '200px', height: 0}) * "width:200px;height:0;" * * undefined values are ignored so that declarative programming is easier. * the result should be html-escaped before insertion into the dom. * * @param {object} styles * @return {?string} */ createmarkupforstyles: function(styles) { var serialized = ''; for (var stylename in styles) { if (!styles.hasownproperty(stylename)) { continue; } var stylevalue = styles[stylename]; if ("production" !== "development") { warnvalidstyle(stylename, stylevalue); } if (stylevalue != null) { serialized = processstylename(stylename) ':'; serialized = dangerousstylevalue(stylename, stylevalue) ';'; } } return serialized || null; }, /** * sets the value for multiple styles on a node. if a value is specified as * '' (empty string), the corresponding style property will be unset. * * @param {domelement} node * @param {object} styles */ setvalueforstyles: function(node, styles) { var style = node.style; for (var stylename in styles) { if (!styles.hasownproperty(stylename)) { continue; } if ("production" !== "development") { warnvalidstyle(stylename, styles[stylename]); } var stylevalue = dangerousstylevalue(stylename, styles[stylename]); if (stylename === 'float') { stylename = stylefloataccessor; } if (stylevalue) { style[stylename] = stylevalue; } else { var expansion = cssproperty.shorthandpropertyexpansions[stylename]; if (expansion) { // shorthand property that ie8 won't like unsetting, so unset each // component to placate it for (var individualstylename in expansion) { style[individualstylename] = ''; } } else { style[stylename] = ''; } } } } }; module.exports = csspropertyoperations; },{"108":108,"113":113,"133":133,"143":143,"154":154,"21":21,"4":4}],6:[function(_dereq_,module,exports){ /** * k8凯发官方网站 copyright 2013-2015, facebook, inc. * all rights reserved. * * this source code is licensed under the bsd-style license found in the * license file in the root directory of this source tree. an additional grant * of patent rights can be found in the patents file in the same directory. * * @providesmodule callbackqueue */ 'use strict'; var pooledclass = _dereq_(28); var assign = _dereq_(27); var invariant = _dereq_(135); /** * a specialized pseudo-event module to help keep track of components waiting to * be notified when their dom representations are available for use. * * this implements `pooledclass`, so you should never need to instantiate this. * instead, use `callbackqueue.getpooled()`. * * @class reactmountready * @implements pooledclass * @internal */ function callbackqueue() { this._callbacks = null; this._contexts = null; } assign(callbackqueue.prototype, { /** * enqueues a callback to be invoked when `notifyall` is invoked. * * @param {function} callback invoked when `notifyall` is invoked. * @param {?object} context context to call `callback` with. * @internal */ enqueue: function(callback, context) { this._callbacks = this._callbacks || []; this._contexts = this._contexts || []; this._callbacks.push(callback); this._contexts.push(context); }, /** * invokes all enqueued callbacks and clears the queue. this is invoked after * the dom representation of a component has been created or updated. * * @internal */ notifyall: function() { var callbacks = this._callbacks; var contexts = this._contexts; if (callbacks) { ("production" !== "development" ? invariant( callbacks.length === contexts.length, 'mismatched list of contexts in callback queue' ) : invariant(callbacks.length === contexts.length)); this._callbacks = null; this._contexts = null; for (var i = 0, l = callbacks.length; i < l; i ) { callbacks[i].call(contexts[i]); } callbacks.length = 0; contexts.length = 0; } }, /** * resets the internal queue. * * @internal */ reset: function() { this._callbacks = null; this._contexts = null; }, /** * `pooledclass` looks for this. */ destructor: function() { this.reset(); } }); pooledclass.addpoolingto(callbackqueue); module.exports = callbackqueue; },{"135":135,"27":27,"28":28}],7:[function(_dereq_,module,exports){ /** * k8凯发官方网站 copyright 2013-2015, facebook, inc. * all rights reserved. * * this source code is licensed under the bsd-style license found in the * license file in the root directory of this source tree. an additional grant * of patent rights can be found in the patents file in the same directory. * * @providesmodule changeeventplugin */ 'use strict'; var eventconstants = _dereq_(15); var eventpluginhub = _dereq_(17); var eventpropagators = _dereq_(20); var executionenvironment = _dereq_(21); var reactupdates = _dereq_(87); var syntheticevent = _dereq_(95); var iseventsupported = _dereq_(136); var istextinputelement = _dereq_(138); var keyof = _dereq_(141); var topleveltypes = eventconstants.topleveltypes; var eventtypes = { change: { phasedregistrationnames: { bubbled: keyof({onchange: null}), captured: keyof({onchangecapture: null}) }, dependencies: [ topleveltypes.topblur, topleveltypes.topchange, topleveltypes.topclick, topleveltypes.topfocus, topleveltypes.topinput, topleveltypes.topkeydown, topleveltypes.topkeyup, topleveltypes.topselectionchange ] } }; /** * for ie shims */ var activeelement = null; var activeelementid = null; var activeelementvalue = null; var activeelementvalueprop = null; /** * section: handle `change` event */ function shouldusechangeevent(elem) { return ( elem.nodename === 'select' || (elem.nodename === 'input' && elem.type === 'file') ); } var doeschangeeventbubble = false; if (executionenvironment.canusedom) { // see `handlechange` comment below doeschangeeventbubble = iseventsupported('change') && ( (!('documentmode' in document) || document.documentmode > 8) ); } function manualdispatchchangeevent(nativeevent) { var event = syntheticevent.getpooled( eventtypes.change, activeelementid, nativeevent ); eventpropagators.accumulatetwophasedispatches(event); // if change and propertychange bubbled, we'd just bind to it like all the // other events and have it go through reactbrowsereventemitter. since it // doesn't, we manually listen for the events and so we have to enqueue and // process the abstract event manually. // // batching is necessary here in order to ensure that all event handlers run // before the next rerender (including event handlers attached to ancestor // elements instead of directly on the input). without this, controlled // components don't work properly in conjunction with event bubbling because // the component is rerendered and the value reverted before all the event // handlers can run. see https://github.com/facebook/react/issues/708. reactupdates.batchedupdates(runeventinbatch, event); } function runeventinbatch(event) { eventpluginhub.enqueueevents(event); eventpluginhub.processeventqueue(); } function startwatchingforchangeeventie8(target, targetid) { activeelement = target; activeelementid = targetid; activeelement.attachevent('onchange', manualdispatchchangeevent); } function stopwatchingforchangeeventie8() { if (!activeelement) { return; } activeelement.detachevent('onchange', manualdispatchchangeevent); activeelement = null; activeelementid = null; } function gettargetidforchangeevent( topleveltype, topleveltarget, topleveltargetid) { if (topleveltype === topleveltypes.topchange) { return topleveltargetid; } } function handleeventsforchangeeventie8( topleveltype, topleveltarget, topleveltargetid) { if (topleveltype === topleveltypes.topfocus) { // stopwatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopwatchingforchangeeventie8(); startwatchingforchangeeventie8(topleveltarget, topleveltargetid); } else if (topleveltype === topleveltypes.topblur) { stopwatchingforchangeeventie8(); } } /** * section: handle `input` event */ var isinputeventsupported = false; if (executionenvironment.canusedom) { // ie9 claims to support the input event but fails to trigger it when // deleting text, so we ignore its input events isinputeventsupported = iseventsupported('input') && ( (!('documentmode' in document) || document.documentmode > 9) ); } /** * (for old ie.) replacement getter/setter for the `value` property that gets * set on the active element. */ var newvalueprop = { get: function() { return activeelementvalueprop.get.call(this); }, set: function(val) { // cast to a string so we can do equality checks. activeelementvalue = '' val; activeelementvalueprop.set.call(this, val); } }; /** * (for old ie.) starts tracking propertychange events on the passed-in element * and override the value property so that we can distinguish user events from * value changes in js. */ function startwatchingforvaluechange(target, targetid) { activeelement = target; activeelementid = targetid; activeelementvalue = target.value; activeelementvalueprop = object.getownpropertydescriptor( target.constructor.prototype, 'value' ); object.defineproperty(activeelement, 'value', newvalueprop); activeelement.attachevent('onpropertychange', handlepropertychange); } /** * (for old ie.) removes the event listeners from the currently-tracked element, * if any exists. */ function stopwatchingforvaluechange() { if (!activeelement) { return; } // delete restores the original property definition delete activeelement.value; activeelement.detachevent('onpropertychange', handlepropertychange); activeelement = null; activeelementid = null; activeelementvalue = null; activeelementvalueprop = null; } /** * (for old ie.) handles a propertychange event, sending a `change` event if * the value of the active element has changed. */ function handlepropertychange(nativeevent) { if (nativeevent.propertyname !== 'value') { return; } var value = nativeevent.srcelement.value; if (value === activeelementvalue) { return; } activeelementvalue = value; manualdispatchchangeevent(nativeevent); } /** * if a `change` event should be fired, returns the target's id. */ function gettargetidforinputevent( topleveltype, topleveltarget, topleveltargetid) { if (topleveltype === topleveltypes.topinput) { // in modern browsers (i.e., not ie8 or ie9), the input event is exactly // what we want so fall through here and trigger an abstract event return topleveltargetid; } } // for ie8 and ie9. function handleeventsforinputeventie( topleveltype, topleveltarget, topleveltargetid) { if (topleveltype === topleveltypes.topfocus) { // in ie8, we can capture almost all .value changes by adding a // propertychange handler and looking for events with propertyname // equal to 'value' // in ie9, propertychange fires for most input events but is buggy and // doesn't fire when text is deleted, but conveniently, selectionchange // appears to fire in all of the remaining cases so we catch those and // forward the event if the value has changed // in either case, we don't want to call the event handler if the value // is changed from js so we redefine a setter for `.value` that updates // our activeelementvalue variable, allowing us to ignore those changes // // stopwatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopwatchingforvaluechange(); startwatchingforvaluechange(topleveltarget, topleveltargetid); } else if (topleveltype === topleveltypes.topblur) { stopwatchingforvaluechange(); } } // for ie8 and ie9. function gettargetidforinputeventie( topleveltype, topleveltarget, topleveltargetid) { if (topleveltype === topleveltypes.topselectionchange || topleveltype === topleveltypes.topkeyup || topleveltype === topleveltypes.topkeydown) { // on the selectionchange event, the target is just document which isn't // helpful for us so just check activeelement instead. // // 99% of the time, keydown and keyup aren't necessary. ie8 fails to fire // propertychange on the first input event after setting `value` from a // script and fires only keydown, keypress, keyup. catching keyup usually // gets it and catching keydown lets us fire an event for the first // keystroke if user does a key repeat (it'll be a little delayed: right // before the second keystroke). other input methods (e.g., paste) seem to // fire selectionchange normally. if (activeelement && activeelement.value !== activeelementvalue) { activeelementvalue = activeelement.value; return activeelementid; } } } /** * section: handle `click` event */ function shoulduseclickevent(elem) { // use the `click` event to detect changes to checkbox and radio inputs. // this approach works across all browsers, whereas `change` does not fire // until `blur` in ie8. return ( elem.nodename === 'input' && (elem.type === 'checkbox' || elem.type === 'radio') ); } function gettargetidforclickevent( topleveltype, topleveltarget, topleveltargetid) { if (topleveltype === topleveltypes.topclick) { return topleveltargetid; } } /** * this plugin creates an `onchange` event that normalizes change events * across form elements. this event fires at a time when it's possible to * change the element's value without seeing a flicker. * * supported elements are: * - input (see `istextinputelement`) * - textarea * - select */ var changeeventplugin = { eventtypes: eventtypes, /** * @param {string} topleveltype record from `eventconstants`. * @param {domeventtarget} topleveltarget the listening component root node. * @param {string} topleveltargetid id of `topleveltarget`. * @param {object} nativeevent native browser event. * @return {*} an accumulation of synthetic events. * @see {eventpluginhub.extractevents} */ extractevents: function( topleveltype, topleveltarget, topleveltargetid, nativeevent) { var gettargetidfunc, handleeventfunc; if (shouldusechangeevent(topleveltarget)) { if (doeschangeeventbubble) { gettargetidfunc = gettargetidforchangeevent; } else { handleeventfunc = handleeventsforchangeeventie8; } } else if (istextinputelement(topleveltarget)) { if (isinputeventsupported) { gettargetidfunc = gettargetidforinputevent; } else { gettargetidfunc = gettargetidforinputeventie; handleeventfunc = handleeventsforinputeventie; } } else if (shoulduseclickevent(topleveltarget)) { gettargetidfunc = gettargetidforclickevent; } if (gettargetidfunc) { var targetid = gettargetidfunc( topleveltype, topleveltarget, topleveltargetid ); if (targetid) { var event = syntheticevent.getpooled( eventtypes.change, targetid, nativeevent ); eventpropagators.accumulatetwophasedispatches(event); return event; } } if (handleeventfunc) { handleeventfunc( topleveltype, topleveltarget, topleveltargetid ); } } }; module.exports = changeeventplugin; },{"136":136,"138":138,"141":141,"15":15,"17":17,"20":20,"21":21,"87":87,"95":95}],8:[function(_dereq_,module,exports){ /** * k8凯发官方网站 copyright 2013-2015, facebook, inc. * all rights reserved. * * this source code is licensed under the bsd-style license found in the * license file in the root directory of this source tree. an additional grant * of patent rights can be found in the patents file in the same directory. * * @providesmodule clientreactrootindex * @typechecks */ 'use strict'; var nextreactrootindex = 0; var clientreactrootindex = { createreactrootindex: function() { return nextreactrootindex ; } }; module.exports = clientreactrootindex; },{}],9:[function(_dereq_,module,exports){ /** * k8凯发官方网站 copyright 2013-2015, facebook, inc. * all rights reserved. * * this source code is licensed under the bsd-style license found in the * license file in the root directory of this source tree. an additional grant * of patent rights can be found in the patents file in the same directory. * * @providesmodule domchildrenoperations * @typechecks static-only */ 'use strict'; var danger = _dereq_(12); var reactmultichildupdatetypes = _dereq_(72); var settextcontent = _dereq_(149); var invariant = _dereq_(135); /** * inserts `childnode` as a child of `parentnode` at the `index`. * * @param {domelement} parentnode parent node in which to insert. * @param {domelement} childnode child node to insert. * @param {number} index index at which to insert the child. * @internal */ function insertchildat(parentnode, childnode, index) { // by exploiting arrays returning `undefined` for an undefined index, we can // rely exclusively on `insertbefore(node, null)` instead of also using // `appendchild(node)`. however, using `undefined` is not allowed by all // browsers so we must replace it with `null`. parentnode.insertbefore( childnode, parentnode.childnodes[index] || null ); } /** * operations for updating with dom children. */ var domchildrenoperations = { dangerouslyreplacenodewithmarkup: danger.dangerouslyreplacenodewithmarkup, updatetextcontent: settextcontent, /** * updates a component's children by processing a series of updates. the * update configurations are each expected to have a `parentnode` property. * * @param {array
网站地图