1
0
Fork 0

added source files

This commit is contained in:
Sangbum Kim 2016-04-02 03:47:54 +09:00
parent 6b08cf490e
commit e6b98492e7
10 changed files with 711 additions and 0 deletions

116
.bootstraprc Normal file
View File

@ -0,0 +1,116 @@
---
# Output debugging info
# loglevel: debug
# Major version of Bootstrap: 3 or 4
bootstrapVersion: 3
# If Bootstrap version 3 is used - turn on/off custom icon font path
useCustomIconFontPath: false
# Webpack loaders, order matters
styleLoaders:
- style
- css?sourceMap
- resolve-url?sourceMap
- sass?sourceMap
# Extract styles to stand-alone css file
# Different settings for different environments can be used,
# It depends on value of NODE_ENV environment variable
# This param can also be set in webpack config:
# entry: 'bootstrap-loader/extractStyles'
extractStyles: false
# env:
# development:
# extractStyles: false
# production:
# extractStyles: true
# Customize Bootstrap variables that get imported before the original Bootstrap variables.
# Thus, derived Bootstrap variables can depend on values from here.
# See the Bootstrap _variables.scss file for examples of derived Bootstrap variables.
#
preBootstrapCustomizations: ./src/main/scss/bootstrap/pre-customizations.scss
# This gets loaded after bootstrap/variables is loaded
# Thus, you may customize Bootstrap variables
# based on the values established in the Bootstrap _variables.scss file
#
bootstrapCustomizations: ./src/main/scss/bootstrap/customizations.scss
# Import your custom styles here
# Usually this endpoint-file contains list of @imports of your application styles
#
#appStyles: ./path/to/your/app/styles/endpoint.scss
### Bootstrap styles
styles:
# Mixins
mixins: true
# Reset and dependencies
normalize: true
print: true
glyphicons: true
# Core CSS
scaffolding: true
type: true
code: true
grid: true
tables: true
forms: true
buttons: true
# Components
component-animations: true
dropdowns: true
button-groups: true
input-groups: true
navs: true
navbar: true
breadcrumbs: true
pagination: true
pager: true
labels: true
badges: true
jumbotron: true
thumbnails: true
alerts: true
progress-bars: true
media: true
list-group: true
panels: true
wells: true
responsive-embed: true
close: true
# Components w/ JavaScript
modals: true
tooltip: true
popovers: true
carousel: true
# Utility classes
utilities: true
responsive-utilities: true
### Bootstrap scripts
scripts:
transition: true
alert: true
button: true
carousel: true
collapse: true
dropdown: true
modal: true
tooltip: true
popover: true
scrollspy: true
tab: true
affix: true

108
index.dev.html Normal file
View File

@ -0,0 +1,108 @@
<!doctype html>
<html lang="en" data-framework="backdonejs">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Starter Template for Bootstrap</title>
<script type="text/javascript" src="assets/vendor.js" charset="utf-8"></script>
<script type="text/javascript" src="assets/main.js" charset="utf-8"></script>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<div clas="row">
<h1>h1. Bootstrap heading <small>Secondary text</small></h1>
<h2>h2. Bootstrap heading <small>Secondary text</small></h2>
<h3>h3. Bootstrap heading <small>Secondary text</small></h3>
<h4>h4. Bootstrap heading <small>Secondary text</small></h4>
<h5>h5. Bootstrap heading <small>Secondary text</small></h5>
<h6>h6. Bootstrap heading <small>Secondary text</small></h6>
</div>
<div class="row">
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
</div>
<div class="row">
<div class="col-md-8">.col-md-8</div>
<div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
<div class="col-md-6">.col-md-6</div>
<div class="col-md-6">.col-md-6</div>
</div>
</div>
</body>
</html>

110
index.prod.html Normal file
View File

@ -0,0 +1,110 @@
<!doctype html>
<html lang="en" data-framework="backdonejs">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Starter Template for Bootstrap</title>
<link rel="stylesheet" type="text/css" href="assets/main.css">
<script type="text/javascript" src="assets/vendor.js" charset="utf-8"></script>
<script type="text/javascript" src="assets/main.js" charset="utf-8"></script>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<div clas="row">
<h1>h1. Bootstrap heading <small>Secondary text</small></h1>
<h2>h2. Bootstrap heading <small>Secondary text</small></h2>
<h3>h3. Bootstrap heading <small>Secondary text</small></h3>
<h4>h4. Bootstrap heading <small>Secondary text</small></h4>
<h5>h5. Bootstrap heading <small>Secondary text</small></h5>
<h6>h6. Bootstrap heading <small>Secondary text</small></h6>
</div>
<div class="row">
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
</div>
<div class="row">
<div class="col-md-8">.col-md-8</div>
<div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
<div class="col-md-6">.col-md-6</div>
<div class="col-md-6">.col-md-6</div>
</div>
</div>
</body>
</html>

48
package.json Normal file
View File

@ -0,0 +1,48 @@
{
"private": true,
"dependencies": {
"bootstrap-sass": "^3.3.6",
"consolelog": "^2.1.3",
"es5-shim": "^4.5.7",
"es6-shim": "^0.35.0",
"font-awesome": "^4.5.0",
"html5shiv": "^3.7.3",
"jquery": "^2.2.2",
"jquery.backstretch": "^2.1.13",
"json3": "^3.3.2",
"lodash": "^4.7.0",
"nprogress": "^0.2.0",
"tether": "^1.2.0"
},
"devDependencies": {
"autoprefixer": "^6.3.5",
"body-parser": "^1.15.0",
"bootstrap-loader": "^1.0.10",
"coffee-loader": "^0.7.2",
"coffee-script": "^1.10.0",
"css-loader": "^0.23.1",
"eslint": "^2.5.3",
"eslint-loader": "^1.3.0",
"express": "^4.13.4",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"font-awesome-loader": "0.0.1",
"html-loader": "^0.4.3",
"imports-loader": "^0.6.5",
"json-loader": "^0.5.4",
"markdown-loader": "^0.1.7",
"node-sass": "^3.4.2",
"postcss-loader": "^0.8.2",
"resolve-url-loader": "^1.4.3",
"sass-loader": "^3.2.0",
"style-loader": "^0.13.1",
"text-loader": "0.0.1",
"url-loader": "^0.5.7",
"webpack": "^1.12.14",
"webpack-dev-middleware": "^1.6.1",
"webpack-hot-middleware": "^2.10.0"
},
"scripts": {
"start": "node server.js"
}
}

56
server.js Normal file
View File

@ -0,0 +1,56 @@
'use strict';
require("coffee-script/register")
var express = require('express');
var url = require('url');
var webpack = require('webpack');
var webpackDevMiddleware = require('webpack-dev-middleware');
var webpackHotMiddleware = require('webpack-hot-middleware');
var bodyParser = require('body-parser');
var config = require('./webpack.config');
var host = '127.0.0.1';
var port = 8080;
var server = express();
var compiler = webpack(config);
server.use(webpackDevMiddleware(compiler, {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
stats: {
colors: true,
hash: false,
version: false,
chunks: false,
children: false,
},
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'X-Requested-With'
},
}));
server.use(webpackHotMiddleware(compiler));
server.use(bodyParser.json());
server.use(bodyParser.urlencoded({ extended: true }));
server.get('/', function(req, res) {
res.sendFile(config.resolve.root + '/index.dev.html');
});
server.listen(port, 'localhost', err => {
if (err) console.log(`=> OMG!!! 🙀 ${err}`);
console.log(`=> 🔥 Webpack dev server is running on port ${port}`);
});

View File

@ -0,0 +1,2 @@
logger=require('consolelog')
logger("hello World")

View File

@ -0,0 +1,12 @@
// Customize variables
// This gets loaded after bootstrap/variables is loaded, so you can refer to
// bootstrap variables configured by bootstrap. For example, the _variables.scss contains:
// $btn-primary-bg: $brand-primary !default;
// Here we're adjusting the hue of that default:
$btn-primary-bg: adjust-hue($btn-primary-bg, +20deg);
// NOTE: $gray-dark is defined in _variables.scss
$body-bg: #ffffff;

View File

@ -0,0 +1,26 @@
// Customize Bootstrap variables that get imported before the original Bootstrap variables.
// Thus original Bootstrap variables can depend on values from here.
//
//$font-family-sans-serif: 'OpenSans-Light', Tahoma, "Helvetica Neue", Helvetica, Arial, sans-serif;
//
//// This path is relative to this file!
//$fonts-url-path: '../fonts';
//
//@font-face {
// font-family: 'OpenSans-Light';
// src: url('#{$fonts-url-path}/OpenSans-Light.ttf') format('truetype');
//}
// Other font size variables are based on this on, so this absolutely should go into the
// pre-customizations.scss file.
// $font-size-base: 16px;
// Here is what is in the _variables.scss file of Bootstrap 3
// $font-size-base: 14px !default;
// $font-size-large: ceil(($font-size-base * 1.25)) !default; // ~18px
// $font-size-small: ceil(($font-size-base * 0.85)) !default; // ~12px
// If you're using a custom icon font path, specify it as follows
// $icon-font-path: ../fonts // This path is relative to this file
// $icon-font-name: 'glyphicons' // The name of the font you want to use
// And be sure to set useCustomIconFontPath to true in .bootstraprc.

115
webpack.config.coffee Normal file
View File

@ -0,0 +1,115 @@
'use strict'
path = require('path')
webpack = require('webpack')
autoprefixer = require('autoprefixer')
module.exports =
debug: true
resolve:
root: __dirname
modulesDirectories: [ 'node_modules' ]
extensions: [
''
'.coffee'
'.js'
]
alias: 'underscore': 'lodash'
entry:
main: [
'webpack-hot-middleware/client'
'tether'
'font-awesome-loader'
'bootstrap-loader'
'./src/main/coffee/main'
]
vendor: [
'consolelog'
'es5-shim'
'es5-shim/es5-sham'
'es6-shim'
'es6-shim/es6-sham'
'json3'
'html5shiv'
'html5shiv/dist/html5shiv-printshiv'
]
output:
path: path.join(__dirname, './assets')
filename: '[name].js'
publicPath: '/assets/'
pathinfo: true
devtool: '#cheap-module-eval-source-map'
plugins: [
new (webpack.HotModuleReplacementPlugin)
new (webpack.NoErrorsPlugin)
new (webpack.ProvidePlugin)(
'window.Tether': 'tether'
)
# new (webpack.optimize.CommonsChunkPlugin)(
# name: 'vendor',
# chunks: ['vensor'],
# filename: 'vendor.js',
# minChunks: Infinity
# )
]
module:
preLoaders: [
test: /\.coffee$/
loader: 'eslint'
exclude: /node_modules/
]
loaders: [
test: /\.coffee$/
loader: 'coffee-loader'
,
test: /\.scss$/
loaders: [
'style'
'css'
'postcss'
'sass'
]
,
test: /\.css$/
exclude: /.*\.min.css/
loaders: [
'style'
'css'
'postcss'
]
,
test: /\.png$/
loader: 'url?limit=8192&mimetype=image/png'
,
test: /\.jpe?g$/
loader: 'url?limit=8192&mimetype=image/jpg'
,
test: /\.gif$/
loader: 'url?limit=8192&mimetype=image/gif'
,
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/
loader: 'url?limit=8192&mimetype=image/svg+xml'
,
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/
loader: 'url?limit=8192&mimetype=application/font-woff2'
,
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/
loader: 'url?limit=8192&mimetype=application/font-woff'
,
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/
loader: 'url?limit=8192&mimetype=application/octet-stream'
,
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/
loader: 'file'
,
test:/bootstrap-sass[\/\\]assets[\/\\]javascripts[\/\\]/
loader: 'imports?jQuery=jquery'
]
postcss: [ autoprefixer ]
eslint:
emitErrors: true
reporter: (results) ->
results.map((result) ->
result.messages.map((msg) ->
' ' + msg.message + '(' + msg.ruleId + ')' + ' @ line ' + msg.line + ' column ' + msg.column + ' - ' + (if msg.fatal then 'fatal, ' else '') + 'severity: ' + msg.severity
).join '\n'
).join '\n'

118
webpack.prod.config.coffee Normal file
View File

@ -0,0 +1,118 @@
'use strict'
path = require('path')
webpack = require('webpack')
autoprefixer = require('autoprefixer')
extractTextPlugin = require('extract-text-webpack-plugin')
module.exports =
debug: false
resolve:
root: __dirname
modulesDirectories: ['node_modules']
extensions: [
''
'.coffee'
'.js'
]
alias:
'underscore': 'lodash'
entry:
main: [
'tether'
'font-awesome-loader'
'bootstrap-loader/extractStyles'
'./src/main/coffee/main'
]
vendor: [
'consolelog'
'es5-shim'
'es5-shim/es5-sham'
'es6-shim'
'es6-shim/es6-sham'
'json3'
'html5shiv'
'html5shiv/dist/html5shiv-printshiv'
]
output:
path: path.join(__dirname, './assets')
filename: '[name].js'
# filename: "[name]-[chunkhash].js"
# chunkFilename: "[name]-[chunkhash].js"
publicPath: '/assets/'
pathinfo: false
plugins: [
new (extractTextPlugin)('[name].css', { allChunks: true })
new (webpack.NoErrorsPlugin)
new (webpack.ProvidePlugin)(
'window.Tether': 'tether'
)
# new (webpack.optimize.CommonsChunkPlugin)(
# name: 'vendor',
# chunks: ['vendor'],
# filename: 'vendor.js',
# minChunks: Infinity,
# async: true
# )
new (webpack.optimize.DedupePlugin),
new (webpack.optimize.OccurrenceOrderPlugin)(true)
new (webpack.optimize.UglifyJsPlugin)(
mangle: true
output:
comments: false
compress:
warnings: false
)
]
module:
preLoaders: [
test: /\.coffee$/
loader: 'eslint'
exclude: /node_modules/
]
loaders: [
test: /\.coffee$/
loader: 'coffee-loader'
,
test: /\.scss$/
loader: extractTextPlugin.extract('style', 'css!postcss!sass')
,
test: /\.css$/
exclude: /.*\.min.css/
loader: extractTextPlugin.extract('style', 'css!postcss')
,
test: /\.png$/
loader: 'url?limit=8192&mimetype=image/png'
,
test: /\.jpe?g$/
loader: 'url?limit=8192&mimetype=image/jpg'
,
test: /\.gif$/
loader: 'url?limit=8192&mimetype=image/gif'
,
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/
loader: 'url?limit=8192&mimetype=image/svg+xml'
,
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/
loader: 'url?limit=8192&mimetype=application/font-woff2'
,
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/
loader: 'url?limit=8192&mimetype=application/font-woff'
,
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/
loader: 'url?limit=8192&mimetype=application/octet-stream'
,
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/
loader: 'file'
,
test: /bootstrap-sass[\/\\]assets[\/\\]javascripts[\/\\]/
loader: 'imports?jQuery=jquery'
]
postcss: [ autoprefixer ]
eslint:
emitErrors: true
reporter: (results) ->
results.map((result) ->
result.messages.map((msg) ->
' ' + msg.message + '(' + msg.ruleId + ')' + ' @ line ' + msg.line + ' column ' + msg.column + ' - ' + (if msg.fatal then 'fatal, ' else '') + 'severity: ' + msg.severity
).join '\n'
).join '\n'