Skip to content

Commit

Permalink
[#900 #2027] Upgrade to React v0.14.7
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Mar 3, 2016
1 parent 78da4fa commit d4adf66
Show file tree
Hide file tree
Showing 36 changed files with 8,506 additions and 8,349 deletions.
960 changes: 0 additions & 960 deletions akvo/rsr/static/lib/scripts/react-typeahead-1.0.8.js

This file was deleted.

File renamed without changes.
649 changes: 343 additions & 306 deletions akvo/rsr/static/scripts-src/my-details-employments.js

Large diffs are not rendered by default.

649 changes: 343 additions & 306 deletions akvo/rsr/static/scripts-src/my-details-employments.jsx

Large diffs are not rendered by default.

53 changes: 44 additions & 9 deletions akvo/rsr/static/scripts-src/my-iati.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,57 @@ function loadComponent(component_id) {
React.DOM.p(null,
React.DOM.button( {onClick:this.handleClick, className:"btn btn-primary"}, i18n.perform_checks)
)
);
);
} else {
return (
React.DOM.p(null)
);
React.DOM.p(null )
);
}
}
});

React.render(
Container(null ),
document.getElementById(component_id)
ReactDOM.render(
React.createElement(Container), document.getElementById(component_id)
);
}

i18n = JSON.parse(document.getElementById("perform-checks-text").innerHTML);
if (document.getElementById('react_iati_checks')) {
loadComponent('react_iati_checks');
var loadJS = function(url, implementationCode, location){
//url is URL of external file, implementationCode is the code
//to be called from the file, location is the location to
//insert the <script> element

var scriptTag = document.createElement('script');
scriptTag.src = url;

scriptTag.onload = implementationCode;
scriptTag.onreadystatechange = implementationCode;

location.appendChild(scriptTag);
};

function loadAndRenderReact() {
function initReact() {
loadComponent('react_iati_checks');
}

function loadReactDOM() {
var reactDOMSrc = document.getElementById('react-dom').src;
loadJS(reactDOMSrc, initReact, document.body);
}

console.log('No React, load again.');
var reactSrc = document.getElementById('react').src;
loadJS(reactSrc, loadReactDOM, document.body);
}

document.addEventListener('DOMContentLoaded', function() {
i18n = JSON.parse(document.getElementById("perform-checks-text").innerHTML);

if (document.getElementById('react_iati_checks')) {
if (typeof React !== 'undefined' && typeof ReactDOM !== 'undefined') {
loadComponent('react_iati_checks');
} else {
loadAndRenderReact();
}
}
});
53 changes: 44 additions & 9 deletions akvo/rsr/static/scripts-src/my-iati.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,57 @@ function loadComponent(component_id) {
<p>
<button onClick={this.handleClick} className='btn btn-primary'>{i18n.perform_checks}</button>
</p>
);
);
} else {
return (
<p></p>
);
<p />
);
}
}
});

React.render(
<Container />,
document.getElementById(component_id)
ReactDOM.render(
React.createElement(Container), document.getElementById(component_id)
);
}

i18n = JSON.parse(document.getElementById("perform-checks-text").innerHTML);
if (document.getElementById('react_iati_checks')) {
loadComponent('react_iati_checks');
var loadJS = function(url, implementationCode, location){
//url is URL of external file, implementationCode is the code
//to be called from the file, location is the location to
//insert the <script> element

var scriptTag = document.createElement('script');
scriptTag.src = url;

scriptTag.onload = implementationCode;
scriptTag.onreadystatechange = implementationCode;

location.appendChild(scriptTag);
};

function loadAndRenderReact() {
function initReact() {
loadComponent('react_iati_checks');
}

function loadReactDOM() {
var reactDOMSrc = document.getElementById('react-dom').src;
loadJS(reactDOMSrc, initReact, document.body);
}

console.log('No React, load again.');
var reactSrc = document.getElementById('react').src;
loadJS(reactSrc, loadReactDOM, document.body);
}

document.addEventListener('DOMContentLoaded', function() {
i18n = JSON.parse(document.getElementById("perform-checks-text").innerHTML);

if (document.getElementById('react_iati_checks')) {
if (typeof React !== 'undefined' && typeof ReactDOM !== 'undefined') {
loadComponent('react_iati_checks');
} else {
loadAndRenderReact();
}
}
});
Loading

0 comments on commit d4adf66

Please sign in to comment.