-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 17abf9d
Showing
13 changed files
with
27,796 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.git | ||
node_modules/ |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# wp-admin React | ||
|
||
Readme Soon™. | ||
|
||
## Original Author | ||
|
||
[Inggo Espinosa](https://github.com/inggo) |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php namespace Inggo\WPAR; | ||
|
||
class Loader | ||
{ | ||
public function __construct($plugin_dir) | ||
{ | ||
if (!class_exists('Inggo\WPAR\TemplateOverrider')) { | ||
include_once($plugin_dir . 'classes/TemplateOverrider.php'); | ||
} | ||
$this->template_overrider = new TemplateOverrider($plugin_dir); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php namespace Inggo\WPAR; | ||
|
||
class TemplateOverrider | ||
{ | ||
protected $plugin_dir; | ||
|
||
public function __construct($plugin_dir) | ||
{ | ||
$this->plugin_dir = $plugin_dir; | ||
|
||
add_filter('template_include', array($this, 'load_template'), 99); | ||
} | ||
|
||
public function load_template($template) | ||
{ | ||
if ($this->maybe_load_template()) { | ||
$react_template = locate_template(array('wp-react.php')); | ||
if ($react_template !== '') { | ||
return $react_template; | ||
} else { | ||
return load_template($this->plugin_dir . '/templates/wp-react.php'); | ||
} | ||
} | ||
return $template; | ||
} | ||
|
||
public function maybe_load_template() | ||
{ | ||
return get_query_var('name') === 'react-admin'; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var gulp = require('gulp'); | ||
var browserify = require('browserify'); | ||
var babelify = require('babelify'); | ||
var source = require('vinyl-source-stream'); | ||
|
||
gulp.task('build', function () { | ||
return browserify('./src/js/app.jsx', { extensions: ['.jsx'], debug: true }) | ||
.transform("babelify", { | ||
presets: ['es2015', 'react'] | ||
}) | ||
.bundle() | ||
.pipe(source('app.js')) | ||
.pipe(gulp.dest('js')); | ||
}); | ||
|
||
gulp.task('watch', ['build'], function () { | ||
gulp.watch('./src/**/*.jsx', ['build']); | ||
}); | ||
|
||
gulp.task('default', ['watch']); |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
// Looking for something to read? Try http://eat.nyo.me :) |
Oops, something went wrong.