First React in Subscribers.

This commit is contained in:
marco 2015-08-20 20:13:12 +02:00
parent eda2188611
commit ec0c20a1c5
4 changed files with 2978 additions and 2982 deletions

View File

@ -0,0 +1,15 @@
define('subscribers', ['react'], function(React) {
var CommentBox = React.createClass({
render: function() {
return (
<div className="commentBox">
Hello, world! I am a CommentBox.
</div>
);
}
});
React.render(
<CommentBox />,
document.getElementById('subscribers-container')
);
});

5918
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -2,25 +2,6 @@
<% block content %>
<h1><%= 'Subscribers' %></h1>
<script type="text/javascript">
jQuery(function($) {
// dom loaded
$(function() {
MailPoet.Ajax.post({
endpoint: 'subscribers',
action: 'get',
data: {
first_name: 'John'
},
onSuccess: function(response) {
// console.log(response);
}
});
});
});
</script>
<div id="subscribers-container">
</div>
<% endblock %>

View File

@ -34,7 +34,7 @@ config.push(_.extend({}, baseConfig, {
entry: {
vendor: ['handlebars', 'handlebars_helpers'],
mailpoet: ['mailpoet', 'ajax', 'modal', 'notice'],
admin: ['settings.jsx']
admin: ['settings.jsx', 'subscribers.jsx']
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
@ -74,4 +74,4 @@ config.push(_.extend({}, baseConfig, {
}
}));
module.exports = config;
module.exports = config;