First React in Subscribers.
This commit is contained in:
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')
|
||||
);
|
||||
});
|
22
composer.lock
generated
22
composer.lock
generated
@ -1211,16 +1211,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "4.8.4",
|
||||
"version": "4.8.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "55bf1d6092b0e13a1f26bd5eaffeef3d8ad85ea7"
|
||||
"reference": "9b7417edaf28059ea63d86be941e6004dbfcc0cc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/55bf1d6092b0e13a1f26bd5eaffeef3d8ad85ea7",
|
||||
"reference": "55bf1d6092b0e13a1f26bd5eaffeef3d8ad85ea7",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b7417edaf28059ea63d86be941e6004dbfcc0cc",
|
||||
"reference": "9b7417edaf28059ea63d86be941e6004dbfcc0cc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1279,24 +1279,24 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2015-08-15 04:21:23"
|
||||
"time": "2015-08-19 09:20:57"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
"version": "2.3.6",
|
||||
"version": "2.3.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
||||
"reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42"
|
||||
"reference": "5e2645ad49d196e020b85598d7c97e482725786a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/18dfbcb81d05e2296c0bcddd4db96cade75e6f42",
|
||||
"reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5e2645ad49d196e020b85598d7c97e482725786a",
|
||||
"reference": "5e2645ad49d196e020b85598d7c97e482725786a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/instantiator": "~1.0,>=1.0.2",
|
||||
"doctrine/instantiator": "^1.0.2",
|
||||
"php": ">=5.3.3",
|
||||
"phpunit/php-text-template": "~1.2",
|
||||
"sebastian/exporter": "~1.2"
|
||||
@ -1335,7 +1335,7 @@
|
||||
"mock",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2015-07-10 06:54:24"
|
||||
"time": "2015-08-19 09:14:08"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-message",
|
||||
|
@ -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 %>
|
||||
|
@ -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'),
|
||||
|
Reference in New Issue
Block a user