Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
laispace committed Feb 1, 2015
1 parent 35d5ebd commit ff4e6e2
Show file tree
Hide file tree
Showing 48 changed files with 583 additions and 1,416 deletions.
251 changes: 128 additions & 123 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,146 +1,151 @@
var path = require('path');

module.exports = function(grunt){
grunt.initConfig({
// pkg: grunt.file.readJSON('package.json'),
module.exports = function (grunt) {
grunt.initConfig({
// pkg: grunt.file.readJSON('package.json'),

clean: ['dist/**/*', 'js/jmui.js'],
clean: ['dist/**/*', 'js/jmui.js'],

stylus: {
compile: {
options: {
compress: false
},
files: [{
expand: true,
cwd: 'stylus/',
src: ['**/*.styl'],
dest: 'css/',
ext: '.css'
}]
}
},
stylus: {
compile: {
options: {
compress: false
},
files: [{
expand: true,
cwd: 'stylus/',
src: ['**/*.styl'],
dest: 'css/',
ext: '.css'
}]
},
maincss: {
options: {
compress: false
},
files: {'css/jmui.css': 'stylus/jmui.styl'}
}
},

jshint: {
files: ['Gruntfile.js', 'js/**/*.js'],
options: {
// 允许多行字符拼接, 在 *.tpl 中常用
"multistr": true,
// 允许使用类似这种表达式 $.isFunction( fn ) && fn();
"expr": true,
// 允许使用类似这种函数 new Function("obj","return 123")
"evil": true
}
},
jshint: {
files: ['Gruntfile.js', 'js/**/*.js'],
options: {
// 允许多行字符拼接, 在 *.tpl 中常用
"multistr": true,
// 允许使用类似这种表达式 $.isFunction( fn ) && fn();
"expr": true,
// 允许使用类似这种函数 new Function("obj","return 123")
"evil": true
}
},

uglify: {
dist: {
files: [{
expand: true,
cwd: 'dist/',
src: ['**/*.js'],
dest: 'dist/',
ext: '.min.js'
}]
}
},
uglify: {
dist: {
files: [{
expand: true,
cwd: 'dist/',
src: ['**/*.js'],
dest: 'dist/',
ext: '.min.js'
}]
}
},

cssmin: {
target: {
files: [{
expand: true,
cwd: 'dist/',
src: ['**/*.css'],
dest: 'dist/',
ext: '.min.css'
}]
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: 'dist/',
src: ['**/*.css'],
dest: 'dist/',
ext: '.min.css'
}]
}
},

concat: {
// TODO 这里的 zepto 来自 coupon/js/lib/zepto 含业务代码,应抽离
zepto: {
src: ['lib/zeptojs/zepto.js',
'lib/zeptojs/event.js',
'lib/zeptojs/extend/touch.js', // modify fix ios 误点击
'lib/zeptojs/detect.js',
'lib/zeptojs/extend/util.js',
'lib/zeptojs/data.js'
//'lib/zeptojs/animate.js',
//'lib/zeptojs/extend/ajax.js', // modify fix 跨域ajax bort触发error
],
dest: 'lib/zeptojs/zepto.min.js'
},
js: {
src: [
'js/core/core.js',
'js/core/component.js',
'js/util/*.js',
'js/component/*.js',
'!js/component/carousel.js',
'!js/component/mult-selector.js'
],
dest: 'js/jmui.js'
}
},
concat: {
// TODO 这里的 zepto 来自 coupon/js/lib/zepto 含业务代码,应抽离
zepto: {
src: ['lib/zeptojs/zepto.js',
'lib/zeptojs/event.js',
'lib/zeptojs/extend/touch.js', // modify fix ios 误点击
'lib/zeptojs/detect.js',
'lib/zeptojs/extend/util.js',
'lib/zeptojs/data.js'
//'lib/zeptojs/animate.js',
//'lib/zeptojs/extend/ajax.js', // modify fix 跨域ajax bort触发error
],
dest: 'lib/zeptojs/zepto.min.js'
},
js: {
src: [
'js/core/core.js',
'js/core/component.js',
'js/util/*.js',
'js/component/*.js',
'!js/component/carousel.js',
'!js/component/mult-selector.js'
],
dest: 'js/jmui.js'
}
},

copy: {
dist: {
files: [
{src: 'index.html', dest: 'dist/'},
{src: 'demo/**', dest: 'dist/'},
{src: 'img/**', dest: 'dist/'},
{src: 'css/**', dest: 'dist/'},
{src: 'js/**', dest: 'dist/'},
{src: 'lib/**', dest: 'dist/'}
]
}
},
copy: {
dist: {
files: [
{src: 'index.html', dest: 'dist/'},
{src: 'demo/**', dest: 'dist/'},
{src: 'img/**', dest: 'dist/'},
{src: 'css/**', dest: 'dist/'},
{src: 'js/**', dest: 'dist/'},
{src: 'lib/**', dest: 'dist/'}
]
}
},

watch: {
//options: {
// livereload: true
//},
html: {
files: ['index.html', 'demo/*.html']
},
stylus:{
files: ['stylus/*.styl'],
tasks: ['newer:stylus']
},
css:{
files: ['css/*.css'],
tasks: ['stylus']
},
js:{
files: ['js/**/*.js', '!js/jmui.js'],
tasks: ['concat:js']
}
//options: {
// livereload: true
//},
html: {
files: ['index.html', 'demo/*.html']
},
stylus: {
files: ['stylus/*.styl'],
tasks: ['newer:stylus', 'stylus:maincss']
},
css: {
files: ['css/*.css']
},
js: {
files: ['js/**/*.js', '!js/jmui.js'],
tasks: ['concat:js']
}

},

jsdoc: {
dist: {
src: ['test/*.js'],
src: ['test/*.js'],
options: {
destination: 'doc'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-newer');
});

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-newer');

grunt.registerTask('default', ['clean', 'stylus', 'concat:js', 'copy:dist', 'uglify', 'cssmin']);
grunt.registerTask('build', ['clean', 'stylus', 'concat:js', 'copy:dist', 'uglify', 'cssmin']);
grunt.registerTask('dev', ['build', 'watch']);
grunt.registerTask('default', ['clean', 'stylus', 'concat:js', 'copy:dist', 'uglify', 'cssmin']);
grunt.registerTask('build', ['clean', 'stylus', 'concat:js', 'copy:dist', 'uglify', 'cssmin']);
grunt.registerTask('dev', ['build', 'watch']);
};
15 changes: 15 additions & 0 deletions css/base-1px.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,18 @@
-webkit-transform: scale(0.5);
}
}
.jmu-border-1px.border-all:after {
border: 1px solid #808080;
}
.jmu-border-1px.border-top:after {
border-top: 1px solid #808080;
}
.jmu-border-1px.border-bottom:after {
border-bottom: 1px solid #808080;
}
.jmu-border-1px.border-left:after {
border-left: 1px solid #808080;
}
.jmu-border-1px.border-right:after {
border-right: 1px solid #808080;
}
17 changes: 6 additions & 11 deletions css/checkbox.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.jmu-checkbox {
line-height: 26px;
display: inline-block;
margin: 5px 0;
}
.jmu-checkbox input {
display: inline-block;
width: 25px;
Expand All @@ -8,6 +13,7 @@
background: none;
-webkit-appearance: none;
outline: none;
margin-right: 8px;
vertical-align: middle;
}
.jmu-checkbox input:before {
Expand All @@ -24,14 +30,3 @@
.jmu-checkbox input:checked:before {
background-position: -25px -25px;
}
.jmu-checkbox-s {
width: 19px;
}
.jmu-checkbox-s input:before {
width: 19px;
height: 19px;
background-position: -100px -25px;
}
.jmu-checkbox-s input:checked:before {
background-position: -75px -25px;
}
Loading

0 comments on commit ff4e6e2

Please sign in to comment.