react-frame-component
Advanced tools
Comparing version 0.1.1 to 0.1.2
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Frame=e()}}(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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | ||
/** @jsx React.DOM */ | ||
var Frame = React.createClass({displayName: 'Frame', | ||
propTypes: { | ||
style: React.PropTypes.object, | ||
head: React.PropTypes.object | ||
}, | ||
render: function() { | ||
@@ -5,0 +9,0 @@ return this.transferPropsTo(React.DOM.iframe(null )); |
{ | ||
"name": "react-frame-component", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "React component to wrap your application or component in an iFrame for encapsulation purposes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,3 +20,3 @@ # React <Frame /> component | ||
Go check out the demos. | ||
Go check out the [demo] [demo-url]. | ||
@@ -62,1 +62,3 @@ ```html | ||
[demo-url]: http://ryanseddon.github.io/react-frame-component/ | ||
@@ -5,3 +5,3 @@ /** @jsx React.DOM */ | ||
var ReactTestUtils; | ||
var ReactTestUtils, div; | ||
@@ -13,2 +13,9 @@ describe("Frame test",function(){ | ||
afterEach(function() { | ||
if(div) { | ||
div.parentNode.removeChild(div); | ||
div = null; | ||
} | ||
}); | ||
it("should create an empty iFrame", function () { | ||
@@ -27,4 +34,4 @@ var frame = ReactTestUtils.renderIntoDocument(<Frame />); | ||
it("should create an iFrame with a <link> tag inside", function () { | ||
var div = document.body.appendChild(document.createElement('div')), | ||
frame = React.renderComponent(<Frame head={ | ||
div = document.body.appendChild(document.createElement('div')); | ||
var frame = React.renderComponent(<Frame head={ | ||
<link href='styles.css' /> | ||
@@ -39,4 +46,4 @@ } />, div), | ||
it("should create an iFrame with a <script> and insert children", function () { | ||
var div = document.body.appendChild(document.createElement('div')), | ||
frame = React.renderComponent(<Frame head={ | ||
div = document.body.appendChild(document.createElement('div')); | ||
var frame = React.renderComponent(<Frame head={ | ||
<script src="foo.js"></script> | ||
@@ -56,4 +63,4 @@ }> | ||
it("should encapsulate styles and not effect elements outside", function () { | ||
var div = document.body.appendChild(document.createElement('div')), | ||
component = React.renderComponent(<div> | ||
div = document.body.appendChild(document.createElement('div')); | ||
var component = React.renderComponent(<div> | ||
<p>Some text</p> | ||
@@ -60,0 +67,0 @@ <Frame head={ |
644906
17861
63