Skip to content

Commit 6793052

Browse files
author
huangxin03
committed
1.add bower support
2.optimize internal function
1 parent f9895d2 commit 6793052

10 files changed

+2003
-19
lines changed

Gruntfile.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,29 @@ module.exports = function(grunt) {
44
pkg: grunt.file.readJSON('package.json'),
55
concat: {
66
options: {
7-
separator: '\n\n'
7+
separator: '\n\n',
8+
banner: '/*! <%= pkg.name %> v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
89
},
9-
dist: {
10+
basic: {
1011
src: ['src/intro.js', 'src/utils.js', 'src/event.js', 'src/config.js', 'src/gestures.js', 'src/api.js', 'src/outro.js'],
11-
dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js'
12-
}
12+
dest: '<%= pkg.name.slice(0,-2) %>.js'
13+
},
14+
extras: {
15+
src: ['src/intro.js', 'src/utils.js', 'src/event.js', 'src/config.js', 'src/gestures.js', 'src/api.js', 'src/outro.js'],
16+
dest: 'dist/<%= pkg.name.slice(0,-2) %>-<%= pkg.version %>.js'
17+
}
1318
},
14-
1519
jshint: {
1620
files: ['Gruntfile.js', 'src/utils.js', 'src/event.js', 'src/config.js', 'src/gestures.js', 'src/api.js']
1721
},
18-
1922
uglify: {
2023
options: {
21-
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
24+
banner: '/*! <%= pkg.name %>.min v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
2225
},
2326
dist: {
2427
files: {
25-
'dist/<%= pkg.name %>-<%= pkg.version %>.min.js': ['<%= concat.dist.dest %>']
28+
'<%= pkg.name.slice(0,-2) %>.min.js': ['<%= concat.basic.dest %>'],
29+
'dist/<%= pkg.name.slice(0,-2) %>-<%= pkg.version %>.min.js': ['<%= concat.basic.dest %>'],
2630
}
2731
}
2832
}

bower.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "touchjs",
3+
"version": "0.2.13",
4+
"description": "clouda event and gesture lib touch.js",
5+
"main": "touch.js",
6+
"keywords": [
7+
"touchjs",
8+
"gesture",
9+
"clouda"
10+
],
11+
"authors": [
12+
"huangxin"
13+
],
14+
"license": "MIT",
15+
"homepage": "http://code.baidu.com",
16+
"ignore": [
17+
"**/.*",
18+
"node_modules",
19+
"bower_components",
20+
"test",
21+
"tests"
22+
]
23+
}

dist/touch-0.2.12.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*! touchjs v0.2.12 2014-02-24 */
12
'use strict';
23
(function(root, factory) {
34
if (typeof define === 'function' && (define.amd || define.cmd)) {
@@ -63,7 +64,7 @@ utils.forceReflow = function() {
6364
};
6465

6566
utils.simpleClone = function(obj) {
66-
return JSON.parse(JSON.stringify(obj));
67+
return Object.create(obj);
6768
};
6869

6970
utils.getPosOfEvent = function(ev) {

dist/touch-0.2.12.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)