Browserify works
parent
2edee7d820
commit
e47a4bfd60
|
@ -1,4 +1,4 @@
|
|||
<div class="farm-designer" id="farm-designer-app">
|
||||
</div>
|
||||
|
||||
<%= javascript_include_tag "/js/development.js" %>
|
||||
<%= javascript_include_tag "/farm-designer.js" %>
|
||||
|
|
21
gulpfile.js
21
gulpfile.js
|
@ -11,18 +11,11 @@ var paths = {
|
|||
};
|
||||
|
||||
gulp.task('default', function () {
|
||||
var input = paths.jsIn;
|
||||
var output = gulp.dest(paths.jsOut);
|
||||
// return gulp.src(input)
|
||||
// .pipe(babel({ }))
|
||||
// .pipe(concat("development.js"))
|
||||
// .pipe(output);
|
||||
});
|
||||
|
||||
gulp.task("hmm", function() {
|
||||
var output = gulp.dest(paths.jsOut + '/whatever.js');
|
||||
browserify({entries: ['javascripts/farm_designer.jsx'], extensions: ['.jsx']})
|
||||
browserify({
|
||||
entries: ['javascripts/farm_designer.jsx'],
|
||||
extensions: ['.jsx']
|
||||
})
|
||||
.bundle()
|
||||
.pipe(source('bundle.js'))
|
||||
.pipe(gulp.dest('public/development.js'));
|
||||
})
|
||||
.pipe(source('farm-designer.js'))
|
||||
.pipe(gulp.dest('public/'));
|
||||
});
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
export class Crop {
|
||||
constructor(options) {
|
||||
this.name = (options.name || "Untitled Crop");
|
||||
this.age = (options.age || _.random(0, 5));
|
||||
this._id = (options._id || _.random(0, 1000));
|
||||
this.imgUrl = (options.imgUrl || "/designer_icons/unknown.svg");
|
||||
}
|
||||
};
|
||||
|
||||
export fakeCrops = [
|
||||
new Crop({name: "Blueberry", imgUrl: "/designer_icons/blueberry.svg"}),
|
||||
new Crop({name: "Cabbage", imgUrl: "/designer_icons/cabbage.svg"}),
|
||||
new Crop({name: "Pepper", imgUrl: "/designer_icons/pepper.svg"}),
|
||||
new Crop({name: "Cilantro", imgUrl: "/designer_icons/cilantro.svg"}),
|
||||
];
|
||||
|
|
@ -6,22 +6,8 @@
|
|||
//= require farmbot_app/react/menus/schedule_creation
|
||||
import { createStore } from 'redux';
|
||||
import { Provider, connect } from 'react-redux';
|
||||
import { Crop, fakeCrops } from './crops';
|
||||
|
||||
class Crop {
|
||||
constructor(options) {
|
||||
this.name = (options.name || "Untitled Crop");
|
||||
this.age = (options.age || _.random(0, 5));
|
||||
this._id = (options._id || _.random(0, 1000));
|
||||
this.imgUrl = (options.imgUrl || "/designer_icons/unknown.svg");
|
||||
}
|
||||
}
|
||||
|
||||
fakeCrops = [
|
||||
new Crop({name: "Blueberry", imgUrl: "/designer_icons/blueberry.svg"}),
|
||||
new Crop({name: "Cabbage", imgUrl: "/designer_icons/cabbage.svg"}),
|
||||
new Crop({name: "Pepper", imgUrl: "/designer_icons/pepper.svg"}),
|
||||
new Crop({name: "Cilantro", imgUrl: "/designer_icons/cilantro.svg"}),
|
||||
];
|
||||
|
||||
Fb.ToolTip = React.createClass({
|
||||
render: function(){
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue