diff --git a/bower.json b/bower.json index 10589e3..c6ab77e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "react-swf", - "version": "1.0.3", + "version": "1.0.4", "license": "MIT", "description": "Shockwave Flash Player component for React", "authors": ["Andreas Svensson "], diff --git a/npm-react-swf/compat.js b/npm-react-swf/compat.js index 2a6f8b8..4a3cbc0 100644 --- a/npm-react-swf/compat.js +++ b/npm-react-swf/compat.js @@ -1,4 +1,4 @@ -/*! react-swf v1.0.3 | @syranide | MIT license */ +/*! react-swf v1.0.4 | @syranide | MIT license */ 'use strict'; @@ -29,12 +29,12 @@ ReactSWFCompat.propTypes = { }; ReactSWFCompat.prototype._createSWFElement = function() { - var swfProps = Object.assign({}, this.props); - swfProps.container = undefined; - swfProps.movie = swfProps.src; - swfProps.ref = this._swfRefCallback; + var props = Object.assign({}, this.props); + delete props.container; + props.movie = props.src; + props.ref = this._swfRefCallback; - return React.createElement(ReactSWF, swfProps); + return React.createElement(ReactSWF, props); }; ReactSWFCompat.prototype.getFPDOMNode = function() { diff --git a/npm-react-swf/package.json b/npm-react-swf/package.json index cfe2f55..bf925d6 100644 --- a/npm-react-swf/package.json +++ b/npm-react-swf/package.json @@ -1,6 +1,6 @@ { "name": "react-swf", - "version": "1.0.3", + "version": "1.0.4", "license": "MIT", "description": "Shockwave Flash Player component for React", "author": "Andreas Svensson ", diff --git a/npm-react-swf/react-swf.js b/npm-react-swf/react-swf.js index 3b7558c..3e53e04 100644 --- a/npm-react-swf/react-swf.js +++ b/npm-react-swf/react-swf.js @@ -1,4 +1,4 @@ -/*! react-swf v1.0.3 | @syranide | MIT license */ +/*! react-swf v1.0.4 | @syranide | MIT license */ 'use strict'; diff --git a/package.json b/package.json index cfe2f55..bf925d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-swf", - "version": "1.0.3", + "version": "1.0.4", "license": "MIT", "description": "Shockwave Flash Player component for React", "author": "Andreas Svensson ", diff --git a/react-swf-compat.js b/react-swf-compat.js index ce4561c..3c68be3 100644 --- a/react-swf-compat.js +++ b/react-swf-compat.js @@ -1,4 +1,4 @@ -/*! react-swf v1.0.3 | @syranide | MIT license */ +/*! react-swf v1.0.4 | @syranide | MIT license */ (function(root, factory) { if (typeof define === 'function' && define.amd) { @@ -34,12 +34,12 @@ }; ReactSWFCompat.prototype._createSWFElement = function() { - var swfProps = Object.assign({}, this.props); - swfProps.container = undefined; - swfProps.movie = swfProps.src; - swfProps.ref = this._swfRefCallback; + var props = Object.assign({}, this.props); + delete props.container; + props.movie = props.src; + props.ref = this._swfRefCallback; - return React.createElement(ReactSWF, swfProps); + return React.createElement(ReactSWF, props); }; ReactSWFCompat.prototype.getFPDOMNode = function() { diff --git a/react-swf-compat.min.js b/react-swf-compat.min.js index ea9809c..e1ff84a 100644 --- a/react-swf-compat.min.js +++ b/react-swf-compat.min.js @@ -1,2 +1,2 @@ -/*! react-swf v1.0.3 | @syranide | MIT license */ -!function(e,t){"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server","react-swf"],t):"object"==typeof exports?module.exports=t(require("react"),require("react-dom"),require("react-dom-server"),require("react-swf")):e.ReactSWFCompat=t(e.React,e.ReactDOM,e.ReactDOMServer,e.ReactSWF)}(this,function(e,t,r,n){"use strict";function o(t){e.Component.call(this,t);var r=this;this._containerRefCallback=function(e){r._container=e},this._swfRefCallback=function(e){r._swf=e}}var c=e.PropTypes;return o.prototype=Object.create(e.Component.prototype),o.prototype.constructor=o,Object.assign(o,e.Component),o.propTypes={container:c.element.isRequired},o.prototype._createSWFElement=function(){var t=Object.assign({},this.props);return t.container=void 0,t.movie=t.src,t.ref=this._swfRefCallback,e.createElement(n,t)},o.prototype.getFPDOMNode=function(){return this._swf.getFPDOMNode()},o.prototype.componentDidMount=function(){var e=this._createSWFElement();this._container.innerHTML=r.renderToString(e),t.render(e,this._container)},o.prototype.componentDidUpdate=function(){var e=this._createSWFElement();t.render(e,this._container)},o.prototype.render=function(){var t={ref:this._containerRefCallback};return e.cloneElement(this.props.container,t,null)},o}); +/*! react-swf v1.0.4 | @syranide | MIT license */ +!function(e,t){"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server","react-swf"],t):"object"==typeof exports?module.exports=t(require("react"),require("react-dom"),require("react-dom-server"),require("react-swf")):e.ReactSWFCompat=t(e.React,e.ReactDOM,e.ReactDOMServer,e.ReactSWF)}(this,function(e,t,r,n){"use strict";function o(t){e.Component.call(this,t);var r=this;this._containerRefCallback=function(e){r._container=e},this._swfRefCallback=function(e){r._swf=e}}var c=e.PropTypes;return o.prototype=Object.create(e.Component.prototype),o.prototype.constructor=o,Object.assign(o,e.Component),o.propTypes={container:c.element.isRequired},o.prototype._createSWFElement=function(){var t=Object.assign({},this.props);return delete t.container,t.movie=t.src,t.ref=this._swfRefCallback,e.createElement(n,t)},o.prototype.getFPDOMNode=function(){return this._swf.getFPDOMNode()},o.prototype.componentDidMount=function(){var e=this._createSWFElement();this._container.innerHTML=r.renderToString(e),t.render(e,this._container)},o.prototype.componentDidUpdate=function(){var e=this._createSWFElement();t.render(e,this._container)},o.prototype.render=function(){var t={ref:this._containerRefCallback};return e.cloneElement(this.props.container,t,null)},o}); diff --git a/react-swf.js b/react-swf.js index acdc93e..488e8ad 100644 --- a/react-swf.js +++ b/react-swf.js @@ -1,4 +1,4 @@ -/*! react-swf v1.0.3 | @syranide | MIT license */ +/*! react-swf v1.0.4 | @syranide | MIT license */ (function(root, factory) { if (typeof define === 'function' && define.amd) { diff --git a/react-swf.min.js b/react-swf.min.js index be10a1d..6000c1c 100644 --- a/react-swf.min.js +++ b/react-swf.min.js @@ -1,2 +1,2 @@ -/*! react-swf v1.0.3 | @syranide | MIT license */ +/*! react-swf v1.0.4 | @syranide | MIT license */ !function(e,r){"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?module.exports=r(require("react")):e.ReactSWF=r(e.React)}(this,function(e){"use strict";function r(e){return c[e]}function o(e){return(""+e).replace(i,r)}function n(e){var r=[];for(var n in e)if(e.hasOwnProperty(n)){var a=e[n];null!=a&&r.push(o(n)+"="+o(a))}return r.join("&")}function a(r){e.Component.call(this,r);var o=this;this._refCallback=function(e){o._node=e};var a={};for(var t in l)if(l.hasOwnProperty(t)&&r.hasOwnProperty(t)){var i=r[t];if(null!=i){var c=l[t];"flashvars"===c&&"object"==typeof i?i=n(i):s.hasOwnProperty(t)&&(i=!!i),a[c]=""+i}}this._node=null,this.state={src:r.src,params:a}}var t=e.PropTypes,l={flashVars:"flashvars",allowFullScreen:"allowfullscreen",allowFullScreenInteractive:"allowfullscreeninteractive",allowNetworking:"allownetworking",allowScriptAccess:"allowscriptaccess",align:"align",base:"base",bgcolor:"bgcolor",browserZoom:"browserzoom",fullScreenAspectRatio:"fullscreenaspectratio",loop:"loop",menu:"menu",play:"play",quality:"quality",salign:"salign",scale:"scale",seamlessTabbing:"seamlesstabbing",wmode:"wmode"},s={allowFullScreen:!0,allowFullScreenInteractive:!0,loop:!0,menu:!0,play:!0,seamlessTabbing:!0},i=/[\r%&+=]/g,c={"\r":"%0D","%":"%25","&":"%26","+":"%2B","=":"%3D"};return a.prototype=Object.create(e.Component.prototype),a.prototype.constructor=a,Object.assign(a,e.Component),a.propTypes={src:t.string.isRequired,flashVars:t.oneOfType([t.object,t.string]),allowFullScreen:t.bool,allowFullScreenInteractive:t.bool,allowNetworking:t.oneOf(["all","internal","none"]),allowScriptAccess:t.oneOf(["always","sameDomain","never"]),align:t.oneOf(["l","t","r"]),base:t.string,bgcolor:t.string,browserZoom:t.oneOf(["scale","noscale"]),fullScreenAspectRatio:t.oneOf(["portrait","landscape"]),loop:t.bool,menu:t.bool,play:t.bool,quality:t.oneOf(["low","autolow","autohigh","medium","high","best"]),salign:t.oneOf(["l","t","r","tl","tr"]),scale:t.oneOf(["default","noborder","exactfit","noscale"]),seamlessTabbing:t.bool,wmode:t.oneOf(["window","direct","opaque","transparent","gpu"])},a.prototype.getFPDOMNode=function(){return this._node},a.prototype.shouldComponentUpdate=function(e){var r=this.props;for(var o in r)if(r.hasOwnProperty(o)&&!l.hasOwnProperty(o)&&(!e.hasOwnProperty(o)||!Object.is(r[o],e[o])))return!0;for(var o in e)if(e.hasOwnProperty(o)&&!l.hasOwnProperty(o)&&!r.hasOwnProperty(o))return!0;return!1},a.prototype.render=function(){var r=this.props,o=this.state,n={ref:this._refCallback,children:[],type:"application/x-shockwave-flash",data:o.src,src:null};for(var a in r)!r.hasOwnProperty(a)||l.hasOwnProperty(a)||n.hasOwnProperty(a)||(n[a]=r[a]);var t=n.children;for(var s in o.params)t.push(e.createElement("param",{key:s,name:s,value:o.params[s]}));return null!=r.children&&t.push(r.children),e.createElement("object",n)},a});