├── test ├── mocha.opts ├── app.js └── models.js ├── .travis.yml ├── public ├── fonts │ ├── ionicons.eot │ ├── ionicons.ttf │ ├── ionicons.woff │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ └── fontawesome-webfont.woff ├── css │ ├── lib │ │ ├── ionicons │ │ │ ├── ionicons.less │ │ │ ├── _ionicons-font.less │ │ │ └── _ionicons-animation.less │ │ ├── font-awesome │ │ │ ├── fixed-width.less │ │ │ ├── bordered-pulled.less │ │ │ ├── larger.less │ │ │ ├── core.less │ │ │ ├── list.less │ │ │ ├── font-awesome.less │ │ │ ├── stacked.less │ │ │ ├── rotated-flipped.less │ │ │ ├── spinning.less │ │ │ ├── path.less │ │ │ └── mixins.less │ │ ├── bootstrap │ │ │ ├── mixins │ │ │ │ ├── center-block.less │ │ │ │ ├── text-emphasis.less │ │ │ │ ├── size.less │ │ │ │ ├── background-variant.less │ │ │ │ ├── opacity.less │ │ │ │ ├── text-overflow.less │ │ │ │ ├── tab-focus.less │ │ │ │ ├── resize.less │ │ │ │ ├── labels.less │ │ │ │ ├── progress-bar.less │ │ │ │ ├── nav-divider.less │ │ │ │ ├── reset-filter.less │ │ │ │ ├── alerts.less │ │ │ │ ├── nav-vertical-align.less │ │ │ │ ├── responsive-visibility.less │ │ │ │ ├── pagination.less │ │ │ │ ├── border-radius.less │ │ │ │ ├── panels.less │ │ │ │ ├── list-group.less │ │ │ │ ├── hide-text.less │ │ │ │ ├── clearfix.less │ │ │ │ ├── table-row.less │ │ │ │ ├── image.less │ │ │ │ ├── buttons.less │ │ │ │ ├── forms.less │ │ │ │ ├── grid-framework.less │ │ │ │ ├── grid.less │ │ │ │ ├── gradients.less │ │ │ │ └── vendor-prefixes.less │ │ │ ├── .csslintrc │ │ │ ├── wells.less │ │ │ ├── breadcrumbs.less │ │ │ ├── responsive-embed.less │ │ │ ├── component-animations.less │ │ │ ├── close.less │ │ │ ├── thumbnails.less │ │ │ ├── utilities.less │ │ │ ├── media.less │ │ │ ├── pager.less │ │ │ ├── jumbotron.less │ │ │ ├── mixins.less │ │ │ ├── badges.less │ │ │ ├── bootstrap.less │ │ │ ├── labels.less │ │ │ ├── code.less │ │ │ ├── grid.less │ │ │ ├── alerts.less │ │ │ ├── print.less │ │ │ ├── pagination.less │ │ │ ├── progress-bars.less │ │ │ ├── tooltip.less │ │ │ ├── scaffolding.less │ │ │ ├── list-group.less │ │ │ ├── popovers.less │ │ │ ├── buttons.less │ │ │ ├── modals.less │ │ │ ├── input-groups.less │ │ │ ├── responsive-utilities.less │ │ │ ├── tables.less │ │ │ ├── dropdowns.less │ │ │ ├── carousel.less │ │ │ ├── navs.less │ │ │ ├── button-groups.less │ │ │ ├── panels.less │ │ │ ├── type.less │ │ │ └── theme.less │ │ ├── bootstrap-social.less │ │ └── datepicker3.less │ ├── themes │ │ ├── default.less │ │ └── modern.less │ └── styles.less └── js │ ├── application.js │ └── main.js ├── controllers ├── admin.js └── home.js ├── views ├── admin │ └── index.jade ├── 404.jade ├── partials │ ├── footer.jade │ ├── flash.jade │ └── navbar.jade ├── layout.jade ├── account │ ├── forgot.jade │ ├── reset.jade │ ├── login.jade │ ├── signup.jade │ └── profile.jade └── home.jade ├── .gitignore ├── models ├── Dates.js ├── Show.js └── User.js ├── README.md ├── .jshintrc ├── LICENSE ├── config ├── secrets.js └── passport.js ├── package.json └── app.js /test/mocha.opts: -------------------------------------------------------------------------------- 1 | --reporter spec 2 | --timeout 5000 -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | services: 4 | - mongodb 5 | 6 | node_js: 7 | - '0.10' -------------------------------------------------------------------------------- /public/fonts/ionicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pockry/tv-crawler/HEAD/public/fonts/ionicons.eot -------------------------------------------------------------------------------- /public/fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pockry/tv-crawler/HEAD/public/fonts/ionicons.ttf -------------------------------------------------------------------------------- /public/fonts/ionicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pockry/tv-crawler/HEAD/public/fonts/ionicons.woff -------------------------------------------------------------------------------- /public/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pockry/tv-crawler/HEAD/public/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pockry/tv-crawler/HEAD/public/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pockry/tv-crawler/HEAD/public/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pockry/tv-crawler/HEAD/public/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/css/lib/ionicons/ionicons.less: -------------------------------------------------------------------------------- 1 | @import "_ionicons-variables"; 2 | @import "_ionicons-font"; 3 | @import "_ionicons-animation"; 4 | @import "_ionicons-icons"; -------------------------------------------------------------------------------- /public/css/lib/font-awesome/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover { 6 | color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /controllers/admin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * GET / 3 | * Home page. 4 | */ 5 | 6 | exports.getAdminIndex = function(req, res) { 7 | res.render('admin/index', { 8 | title: '管理首页' 9 | }); 10 | }; 11 | -------------------------------------------------------------------------------- /views/admin/index.jade: -------------------------------------------------------------------------------- 1 | extends ../layout 2 | 3 | block content 4 | h1 Node Starter 5 | p.lead 为中文Nodejs开发者准备的样板项目。 6 | hr 7 | .row 8 | .col-sm-6 9 | h2 特性 10 | p 下面是NodeStarter支持的一些特性。 -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover { 6 | background-color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | *.swp 10 | *.bat 11 | 12 | pids 13 | logs 14 | results 15 | tmp 16 | 17 | npm-debug.log 18 | node_modules 19 | .idea 20 | *.iml 21 | .DS_Store 22 | .project 23 | Thumbs.db 24 | -------------------------------------------------------------------------------- /models/Dates.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | 3 | var datesSchema = new mongoose.Schema({ 4 | date: String, 5 | year: Number, 6 | month: Number, 7 | count: Number 8 | }); 9 | 10 | 11 | 12 | 13 | 14 | module.exports = mongoose.model('Dates', datesSchema); 15 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /views/404.jade: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .page-header.page404-head 5 | i.fa.fa-frown-o 6 | |  404 7 | .col-sm-8.col-sm-offset-1 8 | p Page Not Found! 9 | if content 10 | p #{content} 11 | else 12 | p   13 | p   14 | p   15 | p   -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /views/partials/footer.jade: -------------------------------------------------------------------------------- 1 | footer 2 | .container.text-center 3 | p.pull-left 4 | i.fa.fa-gear 5 | |  2014 Open Sourced by 6 | a(href='http://idlelife.org' target="_blank") pockry 7 | |  under MIT License 8 | ul.pull-right.list-inline 9 | li 10 | a(href='mailto://pockry@outlook.com') Email 11 | li 12 | a(href='http://weibo.com/pockry' target="_blank") Weibo -------------------------------------------------------------------------------- /public/css/lib/font-awesome/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .@{fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /public/css/lib/font-awesome/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /public/css/lib/font-awesome/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal 14px/1 FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | } 12 | -------------------------------------------------------------------------------- /public/css/lib/font-awesome/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/.csslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "adjoining-classes": false, 3 | "box-sizing": false, 4 | "box-model": false, 5 | "compatible-vendor-prefixes": false, 6 | "floats": false, 7 | "font-sizes": false, 8 | "gradients": false, 9 | "important": false, 10 | "known-properties": false, 11 | "outline-none": false, 12 | "qualified-headings": false, 13 | "regex-selectors": false, 14 | "shorthand": false, 15 | "text-indent": false, 16 | "unique-headings": false, 17 | "universal-selector": false, 18 | "unqualified-attributes": false 19 | } 20 | -------------------------------------------------------------------------------- /public/css/lib/font-awesome/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "spinning.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | .border-left-radius(@border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | .border-right-radius(@border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /public/css/lib/font-awesome/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /views/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1.0') 7 | meta(name='description', content='') 8 | meta(name='csrf-token', content=_csrf) 9 | meta(name='author', content='') 10 | title TV Crawler 11 | != css('styles') 12 | body 13 | include partials/navbar 14 | 15 | .container 16 | include partials/flash 17 | block content 18 | 19 | include partials/footer 20 | 21 | != js('application') 22 | -------------------------------------------------------------------------------- /views/account/forgot.jade: -------------------------------------------------------------------------------- 1 | extends ../layout 2 | 3 | block content 4 | .col-sm-8.col-sm-offset-2 5 | form(method='POST') 6 | legend 找回密码 7 | input(type='hidden', name='_csrf', value=_csrf) 8 | .form-group 9 | p Enter your email address below and we will send you password reset instructions. 10 | label.control-label(for='email') Email 11 | input.form-control(type='email', name='email', id='email', placeholder='Email', autofocus=true) 12 | .form-group 13 | button.btn.btn-primary(type='submit') 14 | i.fa.fa-key 15 | | Reset Password 16 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a& { 9 | color: @color; 10 | 11 | .list-group-item-heading { 12 | color: inherit; 13 | } 14 | 15 | &:hover, 16 | &:focus { 17 | color: @color; 18 | background-color: darken(@background, 5%); 19 | } 20 | &.active, 21 | &.active:hover, 22 | &.active:focus { 23 | color: #fff; 24 | background-color: @color; 25 | border-color: @color; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /views/account/reset.jade: -------------------------------------------------------------------------------- 1 | extends ../layout 2 | 3 | block content 4 | .col-sm-8.col-sm-offset-2 5 | form(method='POST') 6 | legend Reset Password 7 | input(type='hidden', name='_csrf', value=_csrf) 8 | .form-group 9 | label(for='password') New Password 10 | input.form-control(type='password', name='password', value='', placeholder='New password', autofocus=true) 11 | .form-group 12 | label(for='confirm') Confirm Password 13 | input.form-control(type='password', name='confirm', value='', placeholder='Confirm password') 14 | .form-group 15 | button.btn.btn-primary.btn-reset(type='submit') 16 | i.fa.fa-keyboard-o 17 | | Change Password 18 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /models/Show.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | 3 | var showSchema = new mongoose.Schema({ 4 | title: String, 5 | transName: String, 6 | url: String, //trakt.tv link 7 | year: Number, // onair year 8 | month: Number, // onair month 9 | day: Number, // onair day 10 | firstAir: String, // first on air iso date 11 | onAir: String, // this season first on air 12 | category: String, //美剧、英剧 13 | genre: Array, 14 | network: String, 15 | imdb_id: String, 16 | tvdb_id: String, 17 | poster: String, 18 | season: Number, 19 | episodes: [{ 20 | episode: Number, 21 | title: String, 22 | onAir: String 23 | }] 24 | }); 25 | 26 | 27 | 28 | 29 | 30 | module.exports = mongoose.model('Show', showSchema); 31 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object { 16 | position: absolute; 17 | top: 0; 18 | left: 0; 19 | bottom: 0; 20 | height: 100%; 21 | width: 100%; 22 | border: 0; 23 | } 24 | 25 | // Modifier class for 16:9 aspect ratio 26 | &.embed-responsive-16by9 { 27 | padding-bottom: 56.25%; 28 | } 29 | 30 | // Modifier class for 4:3 aspect ratio 31 | &.embed-responsive-4by3 { 32 | padding-bottom: 75%; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /public/css/lib/font-awesome/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /public/css/lib/font-awesome/spinning.less: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | @-webkit-keyframes fa-spin { 10 | 0% { 11 | -webkit-transform: rotate(0deg); 12 | transform: rotate(0deg); 13 | } 14 | 100% { 15 | -webkit-transform: rotate(359deg); 16 | transform: rotate(359deg); 17 | } 18 | } 19 | 20 | @keyframes fa-spin { 21 | 0% { 22 | -webkit-transform: rotate(0deg); 23 | transform: rotate(0deg); 24 | } 25 | 100% { 26 | -webkit-transform: rotate(359deg); 27 | transform: rotate(359deg); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition(height .35s ease); 31 | } 32 | -------------------------------------------------------------------------------- /public/css/lib/font-awesome/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 9 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 10 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 11 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | -------------------------------------------------------------------------------- /public/js/application.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a manifest file that will be compiled into application.js, which will 3 | * include all the files listed below. 4 | * 5 | * Any JavaScript file within this directory can be referenced here using a 6 | * relative path. 7 | * 8 | * It's not advisable to add code directly here, but if you do, it will appear 9 | * at the bottom of the compiled file. 10 | * 11 | * If you are planning to include all custom JavaScript inside main.js then 12 | * you don't have touch this file at all, otherwise "require" additional 13 | * scripts down below using //= filename.js notation. 14 | */ 15 | 16 | //= require lib/jquery-2.1.1.min 17 | //= require lib/bootstrap.min 18 | //= require lib/vue.min 19 | //= require lib/bootstrap-datepicker 20 | //= require main -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TV Crawler 2 | ======================= 3 | 4 | 一个英美剧的爬虫。使用trakt.tv提供的API。 5 | 6 | > 注: 本项目不以速度见长,仅为爬取和存储信息。 7 | 8 | ##Demo 9 | 10 | 在线demo: https://tvcrawler.herokuapp.com/ 11 | 12 | **Screenshot截图**: 13 | 14 | ![Screenshot](http://photo.u.qiniudn.com/tvcrawler20141130213255.png) 15 | 16 | **技术栈**: 17 | 18 | * Node.js 19 | * Mongoose 20 | * superagent 21 | * Vue.js 22 | 23 | ##依赖 24 | 25 | 你需要先安装MongoDB和Node.js。 26 | 27 | ##用法 28 | 29 | ```bash 30 | git clone https://XXXXX/pockry/tv-crawler.git tvcrawler 31 | 32 | cd tvcrawler 33 | 34 | npm install 35 | 36 | mongod -dbpath XXX 37 | 38 | npm start 39 | ``` 40 | 41 | 你还需要去[trakt.tv](http://www.trakt.tv/)注册,就会有一个`api key`,然后填到 `config/secrets.js` 中的对应位置: 42 | 43 | ``` 44 | ... 45 | 46 | trakt: 'api key' 47 | 48 | ``` 49 | 50 | License 51 | 52 | MIT. -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | // Get more infomation about this file from: 2 | // http://jshint.com/docs/options/ 3 | 4 | { 5 | //强制使用驼峰命名法 6 | "camelcase": true, 7 | 8 | // 条件句强制花括号 9 | "curly": true, 10 | 11 | // 使用 === 和 !== 而非 == 和 != 12 | "eqeqeq": true, 13 | 14 | // 当扩展js原生对象时发出警告 15 | "freeze": true, 16 | 17 | // 文本缩进为2字符 18 | "indent": 2, 19 | 20 | // 构造函数名首字母必须大写 21 | "newcap": true, 22 | 23 | // 字符串引号使用单引号 24 | "quotmark": "single", 25 | 26 | // 关闭逗号在前面的警告 27 | "laxcomma": true, 28 | 29 | // 嵌入{}的最大深度 30 | "maxdepth": 5, 31 | 32 | // 函数语句数量 33 | "maxstatements": 20, 34 | 35 | // 每行最大字符数 36 | "maxlen": 120, 37 | 38 | // 允许==null 39 | "eqnull": true, 40 | 41 | // 允许在控制体内定义变量而在外部使用 42 | "funcscope": true, 43 | 44 | // node环境 45 | "node": true 46 | } 47 | -------------------------------------------------------------------------------- /views/partials/flash.jade: -------------------------------------------------------------------------------- 1 | if messages.error 2 | .alert.alert-danger.fade.in 3 | button.close(type='button', data-dismiss='alert') 4 | span.ion-close-circled 5 | for e in messages.error 6 | div= e 7 | if messages.errors 8 | .alert.alert-danger.fade.in 9 | button.close(type='button', data-dismiss='alert') 10 | span.ion-close-circled 11 | for error in messages.errors 12 | div= error.msg 13 | if messages.info 14 | .alert.alert-info.fade.in 15 | button.close(type='button', data-dismiss='alert') 16 | span.ion-close-circled 17 | for info in messages.info 18 | div= info.msg 19 | if messages.success 20 | .alert.alert-success.fade.in 21 | button.close(type='button', data-dismiss='alert') 22 | span.ion-close-circled 23 | for success in messages.success 24 | div= success.msg -------------------------------------------------------------------------------- /public/css/lib/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /views/account/login.jade: -------------------------------------------------------------------------------- 1 | extends ../layout 2 | 3 | block content 4 | .page-header 5 | h3 登录 6 | form(method='POST') 7 | input(type='hidden', name='_csrf', value=_csrf) 8 | .col-sm-8.col-sm-offset-2 9 | .form-group 10 | label.control-label(for='email') 邮箱 11 | input.form-control(type='email', name='email', id='email', placeholder='邮箱', autofocus=true) 12 | .form-group 13 | label.control-label(for='password') 密码 14 | input.form-control(type='password', name='password', id='password', placeholder='******') 15 | .form-group 16 | button.btn.btn-primary(type='submit') 17 | span.ion-android-hand 18 | | 登录 19 | a.btn.btn-link(href='/forgot') 忘记密码? 20 | hr 21 | a.btn.btn-block.btn-danger.btn-social(href='/auth/weibo') 22 | i.fa.fa-weibo 23 | | 使用微博登录 24 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(all .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /public/css/lib/font-awesome/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal 14px/1 FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | } 12 | 13 | .fa-icon-rotate(@degrees, @rotation) { 14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation); 15 | -webkit-transform: rotate(@degrees); 16 | -ms-transform: rotate(@degrees); 17 | transform: rotate(@degrees); 18 | } 19 | 20 | .fa-icon-flip(@horiz, @vert, @rotation) { 21 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1); 22 | -webkit-transform: scale(@horiz, @vert); 23 | -ms-transform: scale(@horiz, @vert); 24 | transform: scale(@horiz, @vert); 25 | } 26 | -------------------------------------------------------------------------------- /public/css/lib/ionicons/_ionicons-font.less: -------------------------------------------------------------------------------- 1 | // Ionicons Font Path 2 | // -------------------------- 3 | 4 | @font-face { 5 | font-family: @ionicons-font-family; 6 | src:url("@{ionicons-font-path}/ionicons.eot?v=@{ionicons-version}"); 7 | src:url("@{ionicons-font-path}/ionicons.eot?v=@{ionicons-version}#iefix") format("embedded-opentype"), 8 | url("@{ionicons-font-path}/ionicons.ttf?v=@{ionicons-version}") format("truetype"), 9 | url("@{ionicons-font-path}/ionicons.woff?v=@{ionicons-version}") format("woff"), 10 | url("@{ionicons-font-path}/ionicons.svg?v=@{ionicons-version}#Ionicons") format("svg"); 11 | font-weight: normal; 12 | font-style: normal; 13 | } 14 | 15 | .ion { 16 | display: inline-block; 17 | font-family: @ionicons-font-family; 18 | speak: none; 19 | font-style: normal; 20 | font-weight: normal; 21 | font-variant: normal; 22 | text-transform: none; 23 | text-rendering: auto; 24 | line-height: 1; 25 | -webkit-font-smoothing: antialiased; 26 | -moz-osx-font-smoothing: grayscale; 27 | } -------------------------------------------------------------------------------- /views/account/signup.jade: -------------------------------------------------------------------------------- 1 | extends ../layout 2 | 3 | block content 4 | .page-header 5 | h3 Sign up 6 | form.form-horizontal(id='signup-form', method='POST') 7 | input(type='hidden', name='_csrf', value=_csrf) 8 | .form-group 9 | label.col-sm-3.control-label(for='email') Email 10 | .col-sm-7 11 | input.form-control(type='email', name='email', id='email', placeholder='Email', autofocus) 12 | .form-group 13 | label.col-sm-3.control-label(for='password') Password 14 | .col-sm-7 15 | input.form-control(type='password', name='password', id='password', placeholder='Password') 16 | .form-group 17 | label.col-sm-3.control-label(for='confirmPassword') Confirm Password 18 | .col-sm-7 19 | input.form-control(type='password', name='confirmPassword', id='confirmPassword', placeholder='Confirm Password') 20 | .form-group 21 | .col-sm-offset-3.col-sm-7 22 | button.btn.btn-success(type='submit') 23 | span.ion-person-add 24 | | Signup 25 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | .translate3d(0, 0, 0); 57 | } 58 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | // Media objects 2 | // Source: http://stubbornella.org/content/?p=497 3 | // -------------------------------------------------- 4 | 5 | 6 | // Common styles 7 | // ------------------------- 8 | 9 | // Clear the floats 10 | .media, 11 | .media-body { 12 | overflow: hidden; 13 | zoom: 1; 14 | } 15 | 16 | // Proper spacing between instances of .media 17 | .media, 18 | .media .media { 19 | margin-top: 15px; 20 | } 21 | .media:first-child { 22 | margin-top: 0; 23 | } 24 | 25 | // For images and videos, set to block 26 | .media-object { 27 | display: block; 28 | } 29 | 30 | // Reset margins on headings for tighter default spacing 31 | .media-heading { 32 | margin: 0 0 5px; 33 | } 34 | 35 | 36 | // Media image alignment 37 | // ------------------------- 38 | 39 | .media { 40 | > .pull-left { 41 | margin-right: 10px; 42 | } 43 | > .pull-right { 44 | margin-left: 10px; 45 | } 46 | } 47 | 48 | 49 | // Media list variation 50 | // ------------------------- 51 | 52 | // Undo default ul/ol styles 53 | .media-list { 54 | padding-left: 0; 55 | list-style: none; 56 | } 57 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: not-allowed; 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding; 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | p { 17 | margin-bottom: (@jumbotron-padding / 2); 18 | font-size: @jumbotron-font-size; 19 | font-weight: 200; 20 | } 21 | 22 | > hr { 23 | border-top-color: darken(@jumbotron-bg, 10%); 24 | } 25 | 26 | .container & { 27 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 28 | } 29 | 30 | .container { 31 | max-width: 100%; 32 | } 33 | 34 | @media screen and (min-width: @screen-sm-min) { 35 | padding-top: (@jumbotron-padding * 1.6); 36 | padding-bottom: (@jumbotron-padding * 1.6); 37 | 38 | .container & { 39 | padding-left: (@jumbotron-padding * 2); 40 | padding-right: (@jumbotron-padding * 2); 41 | } 42 | 43 | h1, 44 | .h1 { 45 | font-size: (@font-size-base * 4.5); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /test/app.js: -------------------------------------------------------------------------------- 1 | var request = require('supertest'); 2 | var app = require('../app.js'); 3 | 4 | describe('GET /', function() { 5 | it('should return 200 OK', function(done) { 6 | request(app) 7 | .get('/') 8 | .expect(200, done); 9 | }); 10 | }); 11 | 12 | describe('GET /login', function() { 13 | it('should return 200 OK', function(done) { 14 | request(app) 15 | .get('/login') 16 | .expect(200, done); 17 | }); 18 | }); 19 | 20 | describe('GET /signup', function() { 21 | it('should return 200 OK', function(done) { 22 | request(app) 23 | .get('/signup') 24 | .expect(200, done); 25 | }); 26 | }); 27 | 28 | describe('GET /api', function() { 29 | it('should return 200 OK', function(done) { 30 | request(app) 31 | .get('/api') 32 | .expect(200, done); 33 | }); 34 | }); 35 | 36 | describe('GET /contact', function() { 37 | it('should return 200 OK', function(done) { 38 | request(app) 39 | .get('/contact') 40 | .expect(200, done); 41 | }); 42 | }); 43 | 44 | describe('GET /random-url', function() { 45 | it('should return 404', function(done) { 46 | request(app) 47 | .get('/reset') 48 | .expect(404, done); 49 | }); 50 | }); -------------------------------------------------------------------------------- /test/models.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var should = chai.should(); 3 | var User = require('../models/User'); 4 | 5 | describe('User Model', function() { 6 | it('should create a new user', function(done) { 7 | var user = new User({ 8 | email: 'test@gmail.com', 9 | password: 'password' 10 | }); 11 | user.save(function(err) { 12 | if (err) return done(err); 13 | done(); 14 | }) 15 | }); 16 | 17 | it('should not create a user with the unique email', function(done) { 18 | var user = new User({ 19 | email: 'test@gmail.com', 20 | password: 'password' 21 | }); 22 | user.save(function(err) { 23 | if (err) err.code.should.equal(11000); 24 | done(); 25 | }); 26 | }); 27 | 28 | it('should find user by email', function(done) { 29 | User.findOne({ email: 'test@gmail.com' }, function(err, user) { 30 | if (err) return done(err); 31 | user.email.should.equal('test@gmail.com'); 32 | done(); 33 | }); 34 | }); 35 | 36 | it('should delete a user', function(done) { 37 | User.remove({ email: 'test@gmail.com' }, function(err) { 38 | if (err) return done(err); 39 | done(); 40 | }); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /config/secrets.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 重要信息 * 重要信息 * 重要信息 * 重要信息 * 重要信息 * 重要信息 * 3 | * 4 | * 本文件包含你的个人隐私和财产,不要将本文件上传到网站或公开的git仓库! 5 | * 6 | * 下面的初始化信息如需用于生产环境,请务必修改后使用。 7 | * 8 | * 如需推送到公开仓库,请用下述命令移除本文件的提交: 9 | * 10 | * git rm --cached config/secrets.js 11 | * 12 | * 如果你已经将包含你的账号和密钥的本文件提交到Github上,请参考下述链接移除 13 | * https://help.github.com/articles/remove-sensitive-data 14 | */ 15 | 16 | module.exports = { 17 | 18 | db: process.env.MONGOLAB_URI || process.env.MONGODB || 'mongodb://localhost:27017/nodestarter', 19 | 20 | sessionSecret: process.env.SESSION_SECRET || 'Session Secret加密字段', 21 | 22 | mandrill: { 23 | user: process.env.MANDRILL_USER || 'accout', 24 | password: process.env.MANDRILL_PASSWORD || 'password' 25 | }, 26 | 27 | sendgrid: { 28 | user: process.env.SENDGRID_USER || 'accout', 29 | password: process.env.SENDGRID_PASSWORD || 'password' 30 | }, 31 | 32 | weibo: { 33 | clientID: 'app key' 34 | , clientSecret: 'app secret' 35 | , callbackURL: 'http://127.0.0.1:3000/auth/weibo/callback' 36 | , passReqToCallback: true 37 | // , requireState: true // for csrf, default: true 38 | // , scope: ['statuses_to_me_read' 39 | // , 'follow_app_official_microblog'] 40 | }, 41 | 42 | trakt: 'api key' 43 | }; 44 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | 18 | // Components 19 | @import "mixins/alerts.less"; 20 | @import "mixins/buttons.less"; 21 | @import "mixins/panels.less"; 22 | @import "mixins/pagination.less"; 23 | @import "mixins/list-group.less"; 24 | @import "mixins/nav-divider.less"; 25 | @import "mixins/forms.less"; 26 | @import "mixins/progress-bar.less"; 27 | @import "mixins/table-row.less"; 28 | 29 | // Skins 30 | @import "mixins/background-variant.less"; 31 | @import "mixins/border-radius.less"; 32 | @import "mixins/gradients.less"; 33 | 34 | // Layout 35 | @import "mixins/clearfix.less"; 36 | @import "mixins/center-block.less"; 37 | @import "mixins/nav-vertical-align.less"; 38 | @import "mixins/grid-framework.less"; 39 | @import "mixins/grid.less"; 40 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | width: 100% \9; // Force IE10 and below to size SVG images correctly 12 | max-width: 100%; // Part 1: Set a maximum relative to the parent 13 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 14 | } 15 | 16 | 17 | // Retina image 18 | // 19 | // Short retina mixin for setting background-image and -size. Note that the 20 | // spelling of `min--moz-device-pixel-ratio` is intentional. 21 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 22 | background-image: url("@{file-1x}"); 23 | 24 | @media 25 | only screen and (-webkit-min-device-pixel-ratio: 2), 26 | only screen and ( min--moz-device-pixel-ratio: 2), 27 | only screen and ( -o-min-device-pixel-ratio: 2/1), 28 | only screen and ( min-device-pixel-ratio: 2), 29 | only screen and ( min-resolution: 192dpi), 30 | only screen and ( min-resolution: 2dppx) { 31 | background-image: url("@{file-2x}"); 32 | background-size: @width-1x @height-1x; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:hover, 12 | &:focus, 13 | &:active, 14 | &.active, 15 | .open > .dropdown-toggle& { 16 | color: @color; 17 | background-color: darken(@background, 10%); 18 | border-color: darken(@border, 12%); 19 | } 20 | &:active, 21 | &.active, 22 | .open > .dropdown-toggle& { 23 | background-image: none; 24 | } 25 | &.disabled, 26 | &[disabled], 27 | fieldset[disabled] & { 28 | &, 29 | &:hover, 30 | &:focus, 31 | &:active, 32 | &.active { 33 | background-color: @background; 34 | border-color: @border; 35 | } 36 | } 37 | 38 | .badge { 39 | color: @background; 40 | background-color: @color; 41 | } 42 | } 43 | 44 | // Button sizes 45 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 46 | padding: @padding-vertical @padding-horizontal; 47 | font-size: @font-size; 48 | line-height: @line-height; 49 | border-radius: @border-radius; 50 | } 51 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NodeStarter", 3 | "version": "0.1.0", 4 | "repository": { 5 | "type": "git", 6 | "url": "https://github.com/pockry/NodeStarter.git" 7 | }, 8 | "scripts": { 9 | "start": "node app.js", 10 | "test": "mocha" 11 | }, 12 | "dependencies": { 13 | "async": "^0.9.0", 14 | "bcrypt-nodejs": "^0.0.3", 15 | "body-parser": "^1.9.1", 16 | "compression": "^1.2.0", 17 | "connect-assets": "^4.3.3", 18 | "connect-mongo": "^0.4.1", 19 | "cookie-parser": "^1.3.3", 20 | "csso": "^1.3.11", 21 | "errorhandler": "^1.2.2", 22 | "express": "^4.10.0", 23 | "express-flash": "^0.0.2", 24 | "express-session": "^1.9.1", 25 | "express-validator": "^2.6.0", 26 | "jade": "^1.7.0", 27 | "less": "^1.7.5", 28 | "lodash": "^2.4.1", 29 | "lusca": "^1.0.2", 30 | "method-override": "^2.3.0", 31 | "mongoose": "^3.8.18", 32 | "morgan": "^1.4.0", 33 | "nodemailer": "^1.3.0", 34 | "passport": "^0.2.1", 35 | "passport-local": "^1.0.0", 36 | "passport-sina": "^0.1.0", 37 | "request": "^2.46.0", 38 | "superagent": "^0.21.0", 39 | "uglify-js": "^2.4.15", 40 | "validator": "^3.22.0" 41 | }, 42 | "devDependencies": { 43 | "chai": "^1.9.2", 44 | "mocha": "^2.0.1", 45 | "supertest": "^0.14.0" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | .btn-xs & { 32 | top: 0; 33 | padding: 1px 5px; 34 | } 35 | 36 | // Hover state, but only for links 37 | a& { 38 | &:hover, 39 | &:focus { 40 | color: @badge-link-hover-color; 41 | text-decoration: none; 42 | cursor: pointer; 43 | } 44 | } 45 | 46 | // Account for badges in navs 47 | a.list-group-item.active > &, 48 | .nav-pills > .active > a > & { 49 | color: @badge-active-color; 50 | background-color: @badge-active-bg; 51 | } 52 | .nav-pills > li > a > & { 53 | margin-left: 3px; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset and dependencies 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | @import "glyphicons.less"; 9 | 10 | // Core CSS 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | @import "tables.less"; 16 | @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "responsive-embed.less"; 39 | @import "wells.less"; 40 | @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | @import "modals.less"; 44 | @import "tooltip.less"; 45 | @import "popovers.less"; 46 | @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /views/partials/navbar.jade: -------------------------------------------------------------------------------- 1 | .navbar.navbar-default.navbar-fixed-top 2 | .container 3 | .navbar-header 4 | button.navbar-toggle(type='button', data-toggle='collapse', data-target='.navbar-collapse') 5 | span.sr-only Toggle navigation 6 | span.icon-bar 7 | span.icon-bar 8 | span.icon-bar 9 | a.navbar-brand(href='/') 10 | i.fa.fa-desktop 11 | | TV Crawler 12 | .collapse.navbar-collapse 13 | ul.nav.navbar-nav 14 | li(class=title=='Home'?'active':undefined) 15 | a(href='/') 主页 16 | ul.nav.navbar-nav.navbar-right 17 | if !user 18 | li(class=title=='Login'?'active':undefined) 19 | a(href='/login') 登录 20 | li(class=title=='Create Account'?'active':undefined) 21 | a(href='/signup') 注册 22 | else 23 | li.dropdown(class=title=='Account Management'?'active':undefined) 24 | a.dropdown-toggle(href='#', data-toggle='dropdown') 25 | if user.profile.picture 26 | img(src='#{user.profile.picture}') 27 | else 28 | img(src='#{user.gravatar(60)}') 29 | | #{user.profile.name || user.email || user.id}  30 | i.caret 31 | ul.dropdown-menu 32 | li 33 | a(href='/account') 34 | span.ion-person 35 | | 账号设置 36 | li.divider 37 | li 38 | a(href='/logout') 39 | span.ion-log-out 40 | | 注销 -------------------------------------------------------------------------------- /public/css/lib/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | box-shadow: none; 36 | } 37 | } 38 | 39 | // Blocks of code 40 | pre { 41 | display: block; 42 | padding: ((@line-height-computed - 1) / 2); 43 | margin: 0 0 (@line-height-computed / 2); 44 | font-size: (@font-size-base - 1); // 14px to 13px 45 | line-height: @line-height-base; 46 | word-break: break-all; 47 | word-wrap: break-word; 48 | color: @pre-color; 49 | background-color: @pre-bg; 50 | border: 1px solid @pre-border-color; 51 | border-radius: @border-radius-base; 52 | 53 | // Account for some code outputs that place code tags in pre tags 54 | code { 55 | padding: 0; 56 | font-size: inherit; 57 | color: inherit; 58 | white-space: pre-wrap; 59 | background-color: transparent; 60 | border-radius: 0; 61 | } 62 | } 63 | 64 | // Enable scrollable blocks of code 65 | .pre-scrollable { 66 | max-height: @pre-scrollable-max-height; 67 | overflow-y: scroll; 68 | } 69 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissible alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 41 | .alert-dismissible { 42 | padding-right: (@alert-padding + 20); 43 | 44 | // Adjust close link position 45 | .close { 46 | position: relative; 47 | top: -2px; 48 | right: -21px; 49 | color: inherit; 50 | } 51 | } 52 | 53 | // Alternate styles 54 | // 55 | // Generate contextual modifier classes for colorizing the alert. 56 | 57 | .alert-success { 58 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 59 | } 60 | .alert-info { 61 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 62 | } 63 | .alert-warning { 64 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 65 | } 66 | .alert-danger { 67 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 68 | } 69 | -------------------------------------------------------------------------------- /views/home.jade: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .row 5 | .col-sm-12 6 | p 英美剧 TV Show 信息爬虫。 7 | p 技术栈:nodejs + mongoose + superagent + Vue.js. 源码:( 8 | a(href='https://github.com/pockry/tv-crawler',target='_blank') Github 9 | | ,  10 | a(href='https://coding.net/u/pockry/p/TV-Crawler',target='_blank') Coding.net 11 | | ,  12 | a(href='http://git.oschina.net/pockry/tvcrawler',target='_blank') git@osc 13 | | ) 14 | hr 15 | .clearfix 16 | .col-sm-3.leftnav 17 | .input-group.date 18 | input.form-control(type="text", readonly) 19 | span.input-group-addon 20 | i.fa.fa-th 21 | ul#dateData 22 | li(v-repeat="dateData") 23 | .btn-group 24 | span.btn.btn-primary.date(title='/date/{{date}}', v-on="click: onClick",v-class='disabled: !count') {{date}} 25 | span.btn.btn-danger.pull-right.getshows(title='/getShows?date={{date}}' v-class='disabled: got') {{count | isTrue GET}} 26 | .col-sm-9#showinfo 27 | template(v-if="init") 28 | p 选择左边的时间,以获得对应时间的TV信息。 29 | p 本API暂只收录美剧和英剧每一季的首播信息。 30 | template(v-if="!init") 31 | ul.showinfo.shoinfo-head 32 | li 类别 33 | li.show-title 节目名称 34 | li.show-season 季数 35 | li.show-network network 36 | li.show-poster poster 37 | li IMDB 38 | ul.showinfo(v-repeat="showData") 39 | li 40 | span {{category}} 41 | li.show-title 42 | span.title-text {{title}} 43 | br 44 | span.btn.btn-primary.btn-xs.disabled(v-repeat="genre") {{$value}} 45 | li.show-season 46 | span {{season}} 47 | li.show-network 48 | span {{network}} 49 | li.show-poster 50 | span 51 | a(href='{{poster}}', target='_blank') poster 52 | li 53 | span 54 | a(href='http://www.imdb.com/title/{{imdb_id}}', target='_blank') IMDB 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/print.less: -------------------------------------------------------------------------------- 1 | // 2 | // Basic print styles 3 | // -------------------------------------------------- 4 | // Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css 5 | 6 | @media print { 7 | 8 | * { 9 | text-shadow: none !important; 10 | color: #000 !important; // Black prints faster: h5bp.com/s 11 | background: transparent !important; 12 | box-shadow: none !important; 13 | } 14 | 15 | a, 16 | a:visited { 17 | text-decoration: underline; 18 | } 19 | 20 | a[href]:after { 21 | content: " (" attr(href) ")"; 22 | } 23 | 24 | abbr[title]:after { 25 | content: " (" attr(title) ")"; 26 | } 27 | 28 | // Don't show links for images, or javascript/internal links 29 | a[href^="javascript:"]:after, 30 | a[href^="#"]:after { 31 | content: ""; 32 | } 33 | 34 | pre, 35 | blockquote { 36 | border: 1px solid #999; 37 | page-break-inside: avoid; 38 | } 39 | 40 | thead { 41 | display: table-header-group; // h5bp.com/t 42 | } 43 | 44 | tr, 45 | img { 46 | page-break-inside: avoid; 47 | } 48 | 49 | img { 50 | max-width: 100% !important; 51 | } 52 | 53 | p, 54 | h2, 55 | h3 { 56 | orphans: 3; 57 | widows: 3; 58 | } 59 | 60 | h2, 61 | h3 { 62 | page-break-after: avoid; 63 | } 64 | 65 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 66 | // Once fixed, we can just straight up remove this. 67 | select { 68 | background: #fff !important; 69 | } 70 | 71 | // Bootstrap components 72 | .navbar { 73 | display: none; 74 | } 75 | .table { 76 | td, 77 | th { 78 | background-color: #fff !important; 79 | } 80 | } 81 | .btn, 82 | .dropup > .btn { 83 | > .caret { 84 | border-top-color: #000 !important; 85 | } 86 | } 87 | .label { 88 | border: 1px solid #000; 89 | } 90 | 91 | .table { 92 | border-collapse: collapse !important; 93 | } 94 | .table-bordered { 95 | th, 96 | td { 97 | border: 1px solid #ddd !important; 98 | } 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /models/User.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | var bcrypt = require('bcrypt-nodejs'); 3 | var crypto = require('crypto'); 4 | 5 | var userSchema = new mongoose.Schema({ 6 | email: { type: String, unique: true, lowercase: true }, 7 | password: String, 8 | weibo: String, 9 | qq: String, 10 | thirdParty:[{ 11 | provider: { type: String, default: '' }, 12 | accessToken: { type: String, default: '' }, 13 | tokenSecret: { type: String, default: '' } 14 | }], 15 | 16 | group: { type: String, default: 'member' }, //superadmin, admin, member 17 | 18 | profile: { 19 | name: { type: String, default: '' }, 20 | gender: { type: String, default: '' }, 21 | location: { type: String, default: '' }, 22 | website: { type: String, default: '' }, 23 | picture: { type: String, default: '' } 24 | }, 25 | 26 | resetPasswordToken: String, 27 | resetPasswordExpires: Date 28 | }); 29 | 30 | /** 31 | * Hash the password for security. 32 | * "Pre" is a Mongoose middleware that executes before each user.save() call. 33 | */ 34 | 35 | userSchema.pre('save', function(next) { 36 | var user = this; 37 | 38 | if (!user.isModified('password')) {return next();} 39 | 40 | bcrypt.genSalt(5, function(err, salt) { 41 | if (err) {return next(err);} 42 | 43 | bcrypt.hash(user.password, salt, null, function(err, hash) { 44 | if (err) {return next(err);} 45 | user.password = hash; 46 | next(); 47 | }); 48 | }); 49 | }); 50 | 51 | /** 52 | * Validate user's password. 53 | * Used by Passport-Local Strategy for password validation. 54 | */ 55 | 56 | userSchema.methods.comparePassword = function(candidatePassword, cb) { 57 | bcrypt.compare(candidatePassword, this.password, function(err, isMatch) { 58 | if (err) {return cb(err);} 59 | cb(null, isMatch); 60 | }); 61 | }; 62 | 63 | /** 64 | * Get URL to a user's gravatar. 65 | * Used in Navbar and Account Management page. 66 | */ 67 | 68 | userSchema.methods.gravatar = function(size) { 69 | if (!size) {size = 200;} 70 | 71 | if (!this.email) { 72 | return 'https://gravatar.com/avatar/?s=' + size + '&d=retro'; 73 | } 74 | 75 | var md5 = crypto.createHash('md5').update(this.email).digest('hex'); 76 | return 'https://gravatar.com/avatar/' + md5 + '?s=' + size + '&d=retro'; 77 | }; 78 | 79 | module.exports = mongoose.model('User', userSchema); 80 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | color: @pagination-color; 20 | background-color: @pagination-bg; 21 | border: 1px solid @pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | .border-left-radius(@border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | .border-right-radius(@border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | color: @pagination-hover-color; 44 | background-color: @pagination-hover-bg; 45 | border-color: @pagination-hover-border; 46 | } 47 | } 48 | 49 | > .active > a, 50 | > .active > span { 51 | &, 52 | &:hover, 53 | &:focus { 54 | z-index: 2; 55 | color: @pagination-active-color; 56 | background-color: @pagination-active-bg; 57 | border-color: @pagination-active-border; 58 | cursor: default; 59 | } 60 | } 61 | 62 | > .disabled { 63 | > span, 64 | > span:hover, 65 | > span:focus, 66 | > a, 67 | > a:hover, 68 | > a:focus { 69 | color: @pagination-disabled-color; 70 | background-color: @pagination-disabled-bg; 71 | border-color: @pagination-disabled-border; 72 | cursor: not-allowed; 73 | } 74 | } 75 | } 76 | 77 | // Sizing 78 | // -------------------------------------------------- 79 | 80 | // Large 81 | .pagination-lg { 82 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large); 83 | } 84 | 85 | // Small 86 | .pagination-sm { 87 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small); 88 | } 89 | -------------------------------------------------------------------------------- /public/css/lib/ionicons/_ionicons-animation.less: -------------------------------------------------------------------------------- 1 | // Animation Icons 2 | // -------------------------- 3 | 4 | .spin() { 5 | -webkit-animation: spin 1s infinite linear; 6 | -moz-animation: spin 1s infinite linear; 7 | -o-animation: spin 1s infinite linear; 8 | animation: spin 1s infinite linear; 9 | } 10 | 11 | .@{ionicons-prefix}loading-a, 12 | .@{ionicons-prefix}loading-b, 13 | .@{ionicons-prefix}loading-c, 14 | .@{ionicons-prefix}loading-d, 15 | .@{ionicons-prefix}looping, 16 | .@{ionicons-prefix}refreshing, 17 | .@{ionicons-prefix}ios7-reloading { 18 | &:extend(.ion); 19 | } 20 | 21 | .@{ionicons-prefix}spin, 22 | .@{ionicons-prefix}loading-a, 23 | .@{ionicons-prefix}loading-b, 24 | .@{ionicons-prefix}loading-c, 25 | .@{ionicons-prefix}loading-d, 26 | .@{ionicons-prefix}looping, 27 | .@{ionicons-prefix}refreshing, 28 | .@{ionicons-prefix}ios7-reloading { 29 | .spin() 30 | } 31 | 32 | @-moz-keyframes spin { 33 | 0% { -moz-transform: rotate(0deg); } 34 | 100% { -moz-transform: rotate(359deg); } 35 | } 36 | @-webkit-keyframes spin { 37 | 0% { -webkit-transform: rotate(0deg); } 38 | 100% { -webkit-transform: rotate(359deg); } 39 | } 40 | @-o-keyframes spin { 41 | 0% { -o-transform: rotate(0deg); } 42 | 100% { -o-transform: rotate(359deg); } 43 | } 44 | @-ms-keyframes spin { 45 | 0% { -ms-transform: rotate(0deg); } 46 | 100% { -ms-transform: rotate(359deg); } 47 | } 48 | @keyframes spin { 49 | 0% { transform: rotate(0deg); } 50 | 100% { transform: rotate(359deg); } 51 | } 52 | 53 | .@{ionicons-prefix}loading-a { 54 | -webkit-animation-timing-function: steps(8, start); 55 | -moz-animation-timing-function: steps(8, start); 56 | animation-timing-function: steps(8, start); 57 | } 58 | 59 | .@{ionicons-prefix}loading-a:before { 60 | &:extend(.@{ionicons-prefix}load-a:before); 61 | } 62 | 63 | .@{ionicons-prefix}loading-b:before { 64 | &:extend(.@{ionicons-prefix}load-b:before); 65 | } 66 | 67 | .@{ionicons-prefix}loading-c:before { 68 | &:extend(.@{ionicons-prefix}load-c:before); 69 | } 70 | 71 | .@{ionicons-prefix}loading-d:before { 72 | &:extend(.@{ionicons-prefix}load-d:before); 73 | } 74 | 75 | .@{ionicons-prefix}looping:before { 76 | &:extend(.@{ionicons-prefix}loop:before); 77 | } 78 | 79 | .@{ionicons-prefix}refreshing:before { 80 | &:extend(.@{ionicons-prefix}refresh:before); 81 | } 82 | 83 | .@{ionicons-prefix}ios7-reloading:before { 84 | &:extend(.@{ionicons-prefix}ios7-reload:before); 85 | } 86 | -------------------------------------------------------------------------------- /public/css/themes/default.less: -------------------------------------------------------------------------------- 1 | // Brand Colors 2 | // ------------------------- 3 | 4 | @brand-primary: #4d90fc; 5 | @brand-success: #60bf60; 6 | @brand-warning: #ff9800; 7 | @brand-danger: #de4b33; 8 | @brand-info: #5bc0dd; 9 | 10 | // Typography 11 | // ------------------------- 12 | 13 | @headings-font-family: "HelveticaNeue-CondensedBold", "Helvetica Neue", "Arial Narrow", Arial, sans-serif; 14 | 15 | // Buttons 16 | // ------------------------- 17 | 18 | @btn-primary-border: darken(@btn-primary-bg, 3.2%); 19 | @btn-success-border: darken(@btn-success-bg, 3.2%); 20 | @btn-warning-border: darken(@btn-warning-bg, 3.2%); 21 | @btn-danger-border: darken(@btn-danger-bg, 3.2%); 22 | @btn-info-border: darken(@btn-info-bg, 3.2%); 23 | 24 | .btn { 25 | border-radius: 0; 26 | box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.11), 1px 1px 0 rgba(255, 255, 255, 0.21) inset; 27 | 28 | &:focus { 29 | outline: none; 30 | } 31 | } 32 | 33 | .btn-link { 34 | box-shadow: none; 35 | } 36 | 37 | .btn-default, .btn-default:focus { 38 | background-image: linear-gradient(to bottom, #ffffff 60%, #f8f8f8 100%); 39 | } 40 | 41 | // Forms 42 | // ------------------------- 43 | 44 | @input-border-radius: 0; 45 | @input-border-focus: #2598f9; 46 | 47 | .form-control:focus { 48 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1) inset; 49 | } 50 | 51 | // Form states and alerts 52 | // ------------------------- 53 | 54 | @state-success-text: #569845; 55 | @state-success-bg: #dbf5d3; 56 | @state-success-border: #aed3a5; 57 | 58 | @state-info-text: #3a87ad; 59 | @state-info-bg: #d9edf7; 60 | @state-info-border: #98cce7; 61 | 62 | @state-warning-text: #bf9853; 63 | @state-warning-bg: #fdf8e2; 64 | @state-warning-border: #f2daab; 65 | 66 | @state-danger-text: #b94a48; 67 | @state-danger-bg: #f2dede; 68 | @state-danger-border: #e0b1b8; 69 | 70 | // Alerts 71 | // ------------------------- 72 | 73 | .alert { 74 | border-radius: 0; 75 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10); 76 | } 77 | 78 | // Navbar 79 | // ------------------------- 80 | 81 | @navbar-default-bg: rgba(255, 255, 255, 0.9); 82 | @navbar-default-link-color: #252525; 83 | @navbar-default-link-hover-color: #4da5f4; 84 | @navbar-default-link-active-color: #4da5f4; 85 | @navbar-default-link-hover-bg: transparent; 86 | @navbar-default-link-active-bg: transparent; 87 | @navbar-default-color: #fafafa; 88 | @navbar-default-brand-hover-color: #4da5f4; 89 | 90 | .navbar-default { 91 | border: 0; 92 | box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); 93 | 94 | .navbar-nav { 95 | > li > a { 96 | font-size: 12px; 97 | font-weight: 500; 98 | text-transform: uppercase; 99 | transition: all 0.2s linear; 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /public/css/lib/bootstrap/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | 23 | // Bar itself 24 | // ------------------------- 25 | 26 | // Outer container 27 | .progress { 28 | overflow: hidden; 29 | height: @line-height-computed; 30 | margin-bottom: @line-height-computed; 31 | background-color: @progress-bg; 32 | border-radius: @border-radius-base; 33 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 34 | } 35 | 36 | // Bar of progress 37 | .progress-bar { 38 | float: left; 39 | width: 0%; 40 | height: 100%; 41 | font-size: @font-size-small; 42 | line-height: @line-height-computed; 43 | color: @progress-bar-color; 44 | text-align: center; 45 | background-color: @progress-bar-bg; 46 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 47 | .transition(width .6s ease); 48 | } 49 | 50 | // Striped bars 51 | // 52 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 53 | // `.progress-bar-striped` class, which you just add to an existing 54 | // `.progress-bar`. 55 | .progress-striped .progress-bar, 56 | .progress-bar-striped { 57 | #gradient > .striped(); 58 | background-size: 40px 40px; 59 | } 60 | 61 | // Call animation for the active one 62 | // 63 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 64 | // `.progress-bar.active` approach. 65 | .progress.active .progress-bar, 66 | .progress-bar.active { 67 | .animation(progress-bar-stripes 2s linear infinite); 68 | } 69 | 70 | // Account for lower percentages 71 | .progress-bar { 72 | &[aria-valuenow="1"], 73 | &[aria-valuenow="2"] { 74 | min-width: 30px; 75 | } 76 | 77 | &[aria-valuenow="0"] { 78 | color: @gray-light; 79 | min-width: 30px; 80 | background-color: transparent; 81 | background-image: none; 82 | box-shadow: none; 83 | } 84 | } 85 | 86 | 87 | 88 | // Variations 89 | // ------------------------- 90 | 91 | .progress-bar-success { 92 | .progress-bar-variant(@progress-bar-success-bg); 93 | } 94 | 95 | .progress-bar-info { 96 | .progress-bar-variant(@progress-bar-info-bg); 97 | } 98 | 99 | .progress-bar-warning { 100 | .progress-bar-variant(@progress-bar-warning-bg); 101 | } 102 | 103 | .progress-bar-danger { 104 | .progress-bar-variant(@progress-bar-danger-bg); 105 | } 106 | -------------------------------------------------------------------------------- /public/css/lib/bootstrap/mixins/forms.less: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline { 14 | color: @text-color; 15 | } 16 | // Set the border and box shadow on specific inputs to match 17 | .form-control { 18 | border-color: @border-color; 19 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work 20 | &:focus { 21 | border-color: darken(@border-color, 10%); 22 | @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); 23 | .box-shadow(@shadow); 24 | } 25 | } 26 | // Set validation states also for addons 27 | .input-group-addon { 28 | color: @text-color; 29 | border-color: @border-color; 30 | background-color: @background-color; 31 | } 32 | // Optional feedback icon 33 | .form-control-feedback { 34 | color: @text-color; 35 | } 36 | } 37 | 38 | 39 | // Form control focus state 40 | // 41 | // Generate a customized focus state and for any input with the specified color, 42 | // which defaults to the `@input-border-focus` variable. 43 | // 44 | // We highly encourage you to not customize the default value, but instead use 45 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 46 | // WebKit's default styles, but applicable to a wider range of browsers. Its 47 | // usability and accessibility should be taken into account with any change. 48 | // 49 | // Example usage: change the default blue border and shadow to white for better 50 | // contrast against a dark gray background. 51 | .form-control-focus(@color: @input-border-focus) { 52 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 53 | &:focus { 54 | border-color: @color; 55 | outline: 0; 56 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 57 | } 58 | } 59 | 60 | // Form control sizing 61 | // 62 | // Relative text size, padding, and border-radii changes for form controls. For 63 | // horizontal sizing, wrap controls in the predefined grid classes. `