Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Rasch
committed
Jul 9, 2015
1 parent
3fbd5a7
commit 003e38c
Showing
10 changed files
with
88 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"directory": "app/static/libs", | ||
"directory": "rfs/static/libs", | ||
"json": "bower.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,6 @@ Flask-SQLAlchemy | |
Flask-WTF | ||
satchless | ||
#trafaret | ||
Flask-Mail | ||
#Flask-Assets | ||
#Flask-Login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,16 @@ | ||
'use strict'; | ||
var React = require('react'); | ||
var ProductData = require('./ProductData'); | ||
var CartAPI = require('./utils/CartAPI') | ||
var FluxCartApp = require('./components/FluxCartApp.react'); | ||
|
||
// Simple pure-React component so we don't have to remember | ||
// Bootstrap's classes | ||
var BootstrapButton = React.createClass({ | ||
render: function() { | ||
return ( | ||
<a {...this.props} | ||
href="javascript:;" | ||
role="button" | ||
className={(this.props.className || '') + ' btn'} /> | ||
); | ||
} | ||
}); | ||
// Load Mock Product Data into localStorage | ||
ProductData.init(); | ||
|
||
var BootstrapModal = React.createClass({ | ||
// The following two methods are the only places we need to | ||
// integrate Bootstrap or jQuery with the components lifecycle methods. | ||
componentDidMount: function() { | ||
// When the component is added, turn it into a modal | ||
$(React.findDOMNode(this)) | ||
.modal({backdrop: 'static', keyboard: false, show: false}); | ||
}, | ||
componentWillUnmount: function() { | ||
$(React.findDOMNode(this)).off('hidden', this.handleHidden); | ||
}, | ||
close: function() { | ||
$(React.findDOMNode(this)).modal('hide'); | ||
}, | ||
open: function() { | ||
$(React.findDOMNode(this)).modal('show'); | ||
}, | ||
render: function() { | ||
var confirmButton = null; | ||
var cancelButton = null; | ||
// Load Mock API Call | ||
CartAPI.getProductData(); | ||
|
||
if (this.props.confirm) { | ||
confirmButton = ( | ||
<BootstrapButton | ||
onClick={this.handleConfirm} | ||
className="btn-primary"> | ||
{this.props.confirm} | ||
</BootstrapButton> | ||
); | ||
} | ||
if (this.props.cancel) { | ||
cancelButton = ( | ||
<BootstrapButton onClick={this.handleCancel} className="btn-default"> | ||
{this.props.cancel} | ||
</BootstrapButton> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="modal fade"> | ||
<div className="modal-dialog"> | ||
<div className="modal-content"> | ||
<div className="modal-header"> | ||
<button | ||
type="button" | ||
className="close" | ||
onClick={this.handleCancel}> | ||
× | ||
</button> | ||
<h3>{this.props.title}</h3> | ||
</div> | ||
<div className="modal-body"> | ||
{this.props.children} | ||
</div> | ||
<div className="modal-footer"> | ||
{cancelButton} | ||
{confirmButton} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}, | ||
handleCancel: function() { | ||
if (this.props.onCancel) { | ||
this.props.onCancel(); | ||
} | ||
}, | ||
handleConfirm: function() { | ||
if (this.props.onConfirm) { | ||
this.props.onConfirm(); | ||
} | ||
} | ||
}); | ||
|
||
var Example = React.createClass({ | ||
handleCancel: function() { | ||
if (confirm('Are you sure you want to cancel?')) { | ||
this.refs.modal.close(); | ||
} | ||
}, | ||
render: function() { | ||
var modal = null; | ||
modal = ( | ||
<BootstrapModal | ||
ref="modal" | ||
confirm="OK" | ||
cancel="Cancel" | ||
onCancel={this.handleCancel} | ||
onConfirm={this.closeModal} | ||
title="Hello, Bootstrap!"> | ||
This is a React component powered by jQuery and Bootstrap! | ||
</BootstrapModal> | ||
); | ||
return ( | ||
<div className="example"> | ||
{modal} | ||
<BootstrapButton onClick={this.openModal} className="btn-default"> | ||
Open modal | ||
</BootstrapButton> | ||
</div> | ||
); | ||
}, | ||
openModal: function() { | ||
this.refs.modal.open(); | ||
}, | ||
closeModal: function() { | ||
this.refs.modal.close(); | ||
} | ||
}); | ||
|
||
React.render(<Example />, document.getElementById('jqueryexample')); | ||
// Render FluxCartApp Controller View | ||
React.render( | ||
<FluxCartApp />, | ||
document.getElementById('flux-cart') | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
Hoi | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<title>jQuery Integration</title> | ||
{% assets "css_all" %} | ||
<link rel="stylesheet" href="{{ ASSET_URL }}"> | ||
{% endassets %} | ||
|
||
</head> | ||
<body> | ||
<div id="jqueryexample"></div> | ||
|
||
{% assets "js_all" %} | ||
<script type="text/javascript" src="{{ ASSET_URL }}"></script> | ||
{% endassets %} | ||
|
||
<script type="text/javascript" src="/jsx/app.js"></script> | ||
|
||
</body> | ||
</html> |