-
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
Hai Nguyen
committed
Oct 15, 2014
1 parent
9dd1156
commit e8a7a22
Showing
120 changed files
with
2,713 additions
and
27 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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
build | ||
node_modules | ||
npm-debug.log | ||
npm-debug.log |
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
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 @@ | ||
node_modules | ||
build |
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,16 @@ | ||
# [Material-UI](http://callemall.github.io/material-ui/) | ||
|
||
This is the documentation site for [Material-UI](http://callemall.github.io/material-ui/). | ||
|
||
## Development Installation Notes | ||
After cloning the repository, install dependencies: | ||
``` | ||
cd <project folder>/material-ui/docs | ||
npm install | ||
npm install -g gulp | ||
``` | ||
|
||
Now you can run your local server: | ||
``` | ||
gulp | ||
``` |
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,23 @@ | ||
module.exports = { | ||
AppBar: require('./js/app-bar.jsx'), | ||
AppCanvas: require('./js/app-canvas.jsx'), | ||
Checkbox: require('./js/checkbox.jsx'), | ||
DropDownIcon: require('./js/drop-down-icon.jsx'), | ||
DropDownMenu: require('./js/drop-down-menu.jsx'), | ||
Icon: require('./js/icon.jsx'), | ||
Input: require('./js/input.jsx'), | ||
LeftNav: require('./js/left-nav.jsx'), | ||
MenuItem: require('./js/menu-item.jsx'), | ||
Menu: require('./js/menu.jsx'), | ||
Mixins: { | ||
Classable: require('./js/mixins/classable.js'), | ||
ClickAwayable: require('./js/mixins/click-awayable.js') | ||
}, | ||
PaperButton: require('./js/paper-button.jsx'), | ||
Paper: require('./js/paper.jsx'), | ||
RadioButton: require('./js/radio-button.jsx'), | ||
Toggle: require('./js/toggle.jsx'), | ||
Toast: require('./js/toast.jsx'), | ||
Toolbar: require('./js/toolbar.jsx'), | ||
ToolbarGroup: require('./js/toolbar-group.jsx') | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,4 @@ | ||
var requireDir = require('require-dir'); | ||
|
||
// Require all tasks in gulp/tasks, including subfolders | ||
requireDir('./tasks', { recurse: true }); |
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,10 @@ | ||
var browserSync = require('browser-sync'); | ||
var gulp = require('gulp'); | ||
|
||
gulp.task('browserSync', ['build'], function() { | ||
browserSync.init(['build/**'], { | ||
server: { | ||
baseDir: ['build', 'src'] | ||
} | ||
}); | ||
}); |
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,45 @@ | ||
/* browserify task | ||
--------------- | ||
Bundle javascripty things with browserify! | ||
If the watch task is running, this uses watchify instead | ||
of browserify for faster bundling using caching. | ||
*/ | ||
|
||
var gulp = require('gulp'); | ||
var browserify = require('browserify'); | ||
var watchify = require('watchify'); | ||
var source = require('vinyl-source-stream'); | ||
var bundleLogger = require('../util/bundleLogger'); | ||
var handleErrors = require('../util/handleErrors'); | ||
|
||
|
||
gulp.task('browserify', function() { | ||
|
||
var bundler = watchify(browserify('./src/app/app.jsx', watchify.args)); | ||
|
||
var bundle = function(ids) { | ||
// Log when bundling starts | ||
bundleLogger.start(); | ||
|
||
return bundler | ||
.bundle() | ||
// Report compile errors | ||
.on('error', handleErrors) | ||
// Use vinyl-source-stream to make the | ||
// stream gulp compatible. Specifiy the | ||
// desired output filename here. | ||
.pipe(source('app.js')) | ||
// Specify the output destination | ||
.pipe(gulp.dest('./build/')) | ||
// Log when bundling completes! | ||
.on('end', bundleLogger.end); | ||
}; | ||
|
||
if(global.isWatching) { | ||
// Rebundle with watchify on changes. | ||
bundler.on('update', bundle); | ||
} | ||
|
||
return bundle(); | ||
}); |
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,3 @@ | ||
var gulp = require('gulp'); | ||
|
||
gulp.task('build', ['browserify', 'markup', 'less', 'fonts']); |
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,3 @@ | ||
var gulp = require('gulp'); | ||
|
||
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,6 @@ | ||
var gulp = require('gulp'); | ||
|
||
gulp.task('fonts', function() { | ||
return gulp.src('./dist/less/material-ui-icons/fonts/**') | ||
.pipe(gulp.dest('build/fonts')); | ||
}); |
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,11 @@ | ||
var gulp = require('gulp'), | ||
less = require('gulp-less'), | ||
sourcemaps = require('gulp-sourcemaps'); | ||
|
||
gulp.task('less', function() { | ||
return gulp.src('src/less/main.less') | ||
.pipe(sourcemaps.init()) | ||
.pipe(less()) | ||
.pipe(sourcemaps.write()) | ||
.pipe(gulp.dest('build')); | ||
}); |
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,6 @@ | ||
var gulp = require('gulp'); | ||
|
||
gulp.task('markup', function() { | ||
return gulp.src('src/www/**') | ||
.pipe(gulp.dest('build')); | ||
}); |
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,5 @@ | ||
var gulp = require('gulp'); | ||
|
||
gulp.task('setWatch', function() { | ||
global.isWatching = true; | ||
}); |
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,13 @@ | ||
/* Notes: | ||
- gulp/tasks/browserify.js handles js recompiling with watchify | ||
- gulp/tasks/browserSync.js automatically reloads any files | ||
that change within the directory it's serving from | ||
*/ | ||
|
||
var gulp = require('gulp'); | ||
|
||
gulp.task('watch', ['setWatch', 'browserSync'], function() { | ||
gulp.watch('src/www/**', ['markup']); | ||
gulp.watch('src/less/**', ['less']); | ||
gulp.watch('dist/less/**', ['less']); | ||
}); |
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,21 @@ | ||
/* bundleLogger | ||
------------ | ||
Provides gulp style logs to the bundle method in browserify.js | ||
*/ | ||
|
||
var gutil = require('gulp-util'); | ||
var prettyHrtime = require('pretty-hrtime'); | ||
var startTime; | ||
|
||
module.exports = { | ||
start: function() { | ||
startTime = process.hrtime(); | ||
gutil.log('Running', gutil.colors.green("'bundle'") + '...'); | ||
}, | ||
|
||
end: function() { | ||
var taskTime = process.hrtime(startTime); | ||
var prettyTime = prettyHrtime(taskTime); | ||
gutil.log('Finished', gutil.colors.green("'bundle'"), 'in', gutil.colors.magenta(prettyTime)); | ||
} | ||
}; |
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,15 @@ | ||
var notify = require("gulp-notify"); | ||
|
||
module.exports = function() { | ||
|
||
var args = Array.prototype.slice.call(arguments); | ||
|
||
// Send error to notification center with gulp-notify | ||
notify.onError({ | ||
title: "Compile Error", | ||
message: "<%= error.message %>" | ||
}).apply(this, args); | ||
|
||
// Keep gulp from hanging on this task | ||
this.emit('end'); | ||
}; |
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 @@ | ||
/* | ||
gulpfile.js | ||
=========== | ||
Rather than manage one giant configuration file responsible | ||
for creating multiple tasks, each task has been broken out into | ||
its own file in gulp/tasks. Any file in that folder gets automatically | ||
required by the loop in ./gulp/index.js (required below). | ||
To add a new task, simply add a new task file to gulp/tasks. | ||
*/ | ||
|
||
require('./gulp'); |
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,41 @@ | ||
{ | ||
"name": "material-ui-docs", | ||
"version": "0.0.1", | ||
"description": "Documentation site for material-ui", | ||
"private": true, | ||
"browser": { | ||
"mui": "./dist/index.js", | ||
"hljs": "./src/app/vendor/highlight-js/highlight.pack.js", | ||
"react": "react/addons" | ||
}, | ||
"browserify": { | ||
"transform": [ | ||
"reactify", | ||
"browserify-shim" | ||
] | ||
}, | ||
"browserify-shim": { | ||
"hljs": "hljs" | ||
}, | ||
"devDependencies": { | ||
"browser-sync": "^1.3.3", | ||
"browserify": "^5.9.1", | ||
"browserify-shim": "^3.6.0", | ||
"gulp": "^3.8.7", | ||
"gulp-less": "^1.3.3", | ||
"gulp-notify": "^1.4.2", | ||
"gulp-sourcemaps": "^1.1.1", | ||
"gulp-util": "^3.0.0", | ||
"pretty-hrtime": "^0.2.1", | ||
"reactify": "^0.14.0", | ||
"require-dir": "^0.1.0", | ||
"underscore": "^1.6.0", | ||
"vinyl-source-stream": "^0.1.1", | ||
"watchify": "^1.0.1" | ||
}, | ||
"dependencies": { | ||
"jquery": "^2.1.1", | ||
"backbone": "^1.1.2", | ||
"react": "^0.11.1" | ||
} | ||
} |
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 Dispatcher = require('./vendor/flux/dispatcher.js'); | ||
var copyProperties = require('react/lib/copyProperties'); | ||
|
||
var AppDispatcher = copyProperties(new Dispatcher(), { | ||
|
||
ActionTypes: { | ||
NAV_URL_CHANGE: 'nav-url-change', | ||
NAV_USER_CLICK: 'nav-user-click' | ||
}, | ||
|
||
dispatchAction: function(type, payload) { | ||
this.dispatch({ | ||
type: type, | ||
payload: payload | ||
}) | ||
} | ||
|
||
}); | ||
|
||
module.exports = AppDispatcher; |
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,29 @@ | ||
var _ = require('underscore'), | ||
Backbone = require('backbone'), | ||
Dispatcher = require('./app-dispatcher.js'), | ||
|
||
AppRouter = Backbone.Router.extend({ | ||
|
||
routes: { | ||
'*path': 'handleDefaultRoute' | ||
}, | ||
|
||
initialize: function() { | ||
this.dispatchToken = Dispatcher.register(_.bind(this.onDispatched, this)); | ||
}, | ||
|
||
handleDefaultRoute: function(url) { | ||
Dispatcher.dispatchAction(Dispatcher.ActionTypes.NAV_URL_CHANGE, { url: url }); | ||
}, | ||
|
||
onDispatched: function(action) { | ||
switch (action.type) { | ||
case Dispatcher.ActionTypes.NAV_USER_CLICK: | ||
this.navigate(action.payload.url); | ||
break; | ||
} | ||
} | ||
|
||
}); | ||
|
||
module.exports = new AppRouter(); |
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,25 @@ | ||
/** | ||
* @jsx React.DOM | ||
*/ | ||
|
||
(function () { | ||
|
||
var $ = require('jquery'), | ||
Backbone = require('backbone'), | ||
React = require('react'), | ||
AppRouter = require('./app-router.js'), | ||
MasterComponent = require('./components/master.jsx'); | ||
|
||
Backbone.$ = $; | ||
|
||
//Needed for React Developer Tools | ||
window.React = React; | ||
|
||
//Render the main app component | ||
React.renderComponent(<MasterComponent />, document.body); | ||
|
||
Backbone.history.start(); | ||
|
||
})(); | ||
|
||
|
Oops, something went wrong.