Skip to content

Commit c7d35ee

Browse files
author
Hsiaoming Yang
committed
transport morris
1 parent ef49a99 commit c7d35ee

File tree

8 files changed

+1689
-6
lines changed

8 files changed

+1689
-6
lines changed

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131

3232
var modules = [
3333
'async', 'backbone', 'coffee', 'expect', 'handlebars',
34-
'iscroll', 'jquery', 'jquery-color', 'jsuri', 'keymaster',
34+
'iscroll', 'jquery', 'jsuri', 'keymaster',
3535
'labjs', 'less', 'marked', 'moment', 'mustache', 'selection',
36-
'socketio', 'store', 'swfobject', 'underscore', 'zepto', 'ztree',
37-
'juicer'
36+
'store', 'swfobject', 'underscore', 'zepto', 'ztree',
37+
'juicer', 'morris'
3838
]
3939

4040
var specs = []

jsuri/spec.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@ define(function(require) {
88
it('should has host www.test.com', function() {
99
expect(uri.host()).to.be.equal('www.test.com');
1010
});
11-
it('should has query q=books', function() {
12-
expect(uri.query()).to.be.equal('q=books');
13-
});
1411
});
1512
});

morris/Gruntfile.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
module.exports = function(grunt) {
2+
var pkg = grunt.file.readJSON('package.json');
3+
4+
function repl(code, filename) {
5+
code = code.trim();
6+
var id = pkg.family + '/' + pkg.name + '/' + pkg.version + '/' + filename;
7+
8+
var header = [
9+
'define("' + id + '", ["$", "gallery/raphael/2.1.0/raphael"], function(require, exports, module) {',
10+
'var jQuery = require("$"), Raphael = require("gallery/raphael/2.1.0/raphael");'
11+
].join('\n');
12+
var footer = '});';
13+
code = code.replace('window.Morris', 'module.exports');
14+
return [header, code, footer].join('\n');
15+
}
16+
17+
grunt.initConfig({
18+
pkg: pkg,
19+
20+
download: {
21+
options: {
22+
dest: 'dist',
23+
},
24+
src: {
25+
options: {
26+
transform: function(code) {
27+
return repl(code, 'morris-debug');
28+
}
29+
},
30+
url: 'https://raw.github.com/oesmith/morris.js/<%= pkg.version %>/morris.js',
31+
name: 'morris-debug.js'
32+
},
33+
34+
css: {
35+
url: 'https://raw.github.com/oesmith/morris.js/<%= pkg.version %>/morris.css',
36+
name: 'morris.css'
37+
},
38+
39+
min: {
40+
options: {
41+
transform: function(code) {
42+
return repl(code, 'morris');
43+
}
44+
},
45+
url: 'https://raw.github.com/oesmith/morris.js/<%= pkg.version %>/morris.min.js',
46+
name: 'morris.js'
47+
}
48+
}
49+
});
50+
51+
grunt.loadTasks('../_tasks/download/tasks');
52+
grunt.registerTask('build', ['download']);
53+
};

0 commit comments

Comments
 (0)