forked from MichaelYick/mailpoet
First React in Subscribers.
This commit is contained in:
parent
eda2188611
commit
ec0c20a1c5
15
assets/js/src/subscribers.jsx
Normal file
15
assets/js/src/subscribers.jsx
Normal 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
5918
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -2,25 +2,6 @@
|
|||||||
|
|
||||||
<% block content %>
|
<% block content %>
|
||||||
<h1><%= 'Subscribers' %></h1>
|
<h1><%= 'Subscribers' %></h1>
|
||||||
|
<div id="subscribers-container">
|
||||||
<script type="text/javascript">
|
</div>
|
||||||
jQuery(function($) {
|
|
||||||
|
|
||||||
// dom loaded
|
|
||||||
$(function() {
|
|
||||||
|
|
||||||
MailPoet.Ajax.post({
|
|
||||||
endpoint: 'subscribers',
|
|
||||||
action: 'get',
|
|
||||||
data: {
|
|
||||||
first_name: 'John'
|
|
||||||
},
|
|
||||||
onSuccess: function(response) {
|
|
||||||
// console.log(response);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<% endblock %>
|
<% endblock %>
|
||||||
|
@ -34,7 +34,7 @@ config.push(_.extend({}, baseConfig, {
|
|||||||
entry: {
|
entry: {
|
||||||
vendor: ['handlebars', 'handlebars_helpers'],
|
vendor: ['handlebars', 'handlebars_helpers'],
|
||||||
mailpoet: ['mailpoet', 'ajax', 'modal', 'notice'],
|
mailpoet: ['mailpoet', 'ajax', 'modal', 'notice'],
|
||||||
admin: ['settings.jsx']
|
admin: ['settings.jsx', 'subscribers.jsx']
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
|
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
|
||||||
@ -74,4 +74,4 @@ config.push(_.extend({}, baseConfig, {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user