Commit fe784d12 authored by techird's avatar techird

use bower for dependencies

parent 51064510
{
"directory": "lib"
}
\ No newline at end of file
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
.DS_Store .DS_Store
*.sublime-project *.sublime-project
*.sublime-workspace *.sublime-workspace
dist/
release/
node_modules/ node_modules/
_drafts/ _drafts/
\ No newline at end of file bower_components
\ No newline at end of file
...@@ -10,6 +10,7 @@ module.exports = function(grunt) { ...@@ -10,6 +10,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-module-dependence'); grunt.loadNpmTasks('grunt-module-dependence');
grunt.loadNpmTasks('grunt-replace'); grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
...@@ -35,7 +36,7 @@ module.exports = function(grunt) { ...@@ -35,7 +36,7 @@ module.exports = function(grunt) {
pkg: pkg, pkg: pkg,
clean: { clean: {
last: 'release' last: 'dist'
}, },
// resolve dependence // resolve dependence
...@@ -47,20 +48,20 @@ module.exports = function(grunt) { ...@@ -47,20 +48,20 @@ module.exports = function(grunt) {
merge: { merge: {
files: [{ files: [{
src: 'src/**/*.js', src: 'src/**/*.js',
dest: 'release/kityminder.core.js' dest: 'dist/kityminder.core.js'
}] }]
} }
}, },
// concat // concat, just add closure
concat: { concat: {
closure: { options: {
options: { banner: banner + '(function () {\n',
banner: banner + '(function () {\n', footer: expose + '})();'
footer: expose + '})();' },
}, build: {
files: { files: {
'release/kityminder.core.js': ['release/kityminder.core.js'] 'dist/kityminder.core.js': ['dist/kityminder.core.js']
} }
} }
}, },
...@@ -70,23 +71,22 @@ module.exports = function(grunt) { ...@@ -70,23 +71,22 @@ module.exports = function(grunt) {
banner: banner banner: banner
}, },
minimize: { minimize: {
files: { src: 'dist/kityminder.core.js',
'release/kityminder.core.min.js': 'release/kityminder.core.js' dest: 'dist/kityminder.core.min.js'
}
} }
}, },
watch: { copy: {
less: { dist: {
files: ['ui/theme/**/*.less'], src: 'src/kityminder.css',
tasks: ['less:compile', 'autoprefixer'] dest: "dist/kityminder.core.css"
} }
}, }
}); });
// Build task(s). // Build task(s).
grunt.registerTask('default', ['clean', 'dependence', 'concat', 'uglify']); grunt.registerTask('build', ['clean', 'dependence', 'concat:build', 'uglify:minimize', 'copy']);
}; };
\ No newline at end of file
...@@ -39,7 +39,7 @@ KityMinder 基于 SVG 技术实现,支持绝大多数的 HTML5 浏览器,包 ...@@ -39,7 +39,7 @@ KityMinder 基于 SVG 技术实现,支持绝大多数的 HTML5 浏览器,包
## 依赖说明 ## 依赖说明
kityminder-core 依赖 Kity、库。需要二次开发 kityminder-core,需要初始化并更新子模块: kityminder-core 依赖 [Kity](https://github.com/fex-team/kity)库。需要二次开发 kityminder-core,需要初始化并更新子模块:
```bash ```bash
git submodule init git submodule init
......
...@@ -2,13 +2,19 @@ ...@@ -2,13 +2,19 @@
"name": "kityminder-core", "name": "kityminder-core",
"title": "Kity Minder Core", "title": "Kity Minder Core",
"description": "Powerful online mind graphic visualization and editor (command based)", "description": "Powerful online mind graphic visualization and editor (command based)",
"version": "1.3.6", "version": "1.4.0",
"main": "src/kityminder.js", "main": [
"release/kityminder.core.min.js",
"release/kityminder.core.css"
],
"keywords": ["kityminder", "kity", "svg"], "keywords": ["kityminder", "kity", "svg"],
"homepage": "https://github.com/fex-team/kityminder-core", "homepage": "https://github.com/fex-team/kityminder-core",
"devDependencies": { "devDependencies": {
"seajs": "~2.3.0" "seajs": "~2.3.0"
}, },
"dependencies": {
"kity": "~2.0.0"
},
"licenses": [{ "licenses": [{
"type": "BSD", "type": "BSD",
"url": "https://github.com/fex-team/kityminder-core/blob/dev/LICENSE" "url": "https://github.com/fex-team/kityminder-core/blob/dev/LICENSE"
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>KityMinder Example</title>
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" href="src/kityminder.css" rel="stylesheet">
<style type="text/css">
body {
margin: 0;
padding: 0;
height: 100%;
}
#minder-view {
position: absolute;
border: 1px solid #ccc;
left: 10px;
top: 10px;
bottom: 10px;
right: 10px;
}
</style>
<script type="text/javascript" src="bower_components/kity/dist/kity.js"></script>
</head>
<body>
<script id="minder-view" type="application/kityminder" minder-data-type="json">
{
"root": {
"data": {
"text": "百度产品",
"image": "https://ss0.bdstatic.com/5a21bjqh_Q23odCf/static/superplus/img/logo_white.png?v=md5",
"imageSize": { "width": 270, "height": 129 }
},
"children": [
{ "data": { "text": "新闻" } },
{ "data": { "text": "网页", "priority": 1 } },
{ "data": { "text": "贴吧", "priority": 2 } },
{ "data": { "text": "知道", "priority": 2 } },
{ "data": { "text": "音乐", "priority": 3 } },
{ "data": { "text": "图片", "priority": 3 } },
{ "data": { "text": "视频", "priority": 3 } },
{ "data": { "text": "地图", "priority": 3 } },
{ "data": { "text": "百科", "priority": 3 } },
{ "data": { "text": "更多", "hyperlink": "http://www.baidu.com/more" } }
]
}
}
</script>
</body>
<!-- *************************** Module 形式加载引入 **************************** -->
<script type="text/javascript" src="bower_components/seajs/dist/sea-debug.js"></script>
<script type="text/javascript">
/* global seajs */
seajs.config({
base: './src'
});
define('start', function(require) {
var Minder = require('kityminder').Minder;
// 创建 km 实例
var km = window.km = new Minder();
km.setup('#minder-view');
});
seajs.use('start');
</script>
</html>
\ No newline at end of file
.km-view {
font-family: "STHeitiSC-Light", "STHeiti", "Hei", "Heiti SC", "Microsoft Yahei", Arial, sans-serif;
-webkit-user-select: none;
user-select: none;
position: relative;
}
.km-view .km-receiver {
position: absolute;
left: -99999px;
top: -99999px;
width: 20px;
height: 20px;
outline: none;
margin: 0;
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
} }
</style> </style>
<script type="text/javascript" src="lib/kity/dist/kity.min.js"></script> <script type="text/javascript" src="bower_components/kity/dist/kity.min.js"></script>
</head> </head>
<body> <body>
<script id="minder-view" type="application/kityminder" minder-data-type="json"> <script id="minder-view" type="application/kityminder" minder-data-type="json">
...@@ -52,31 +52,14 @@ ...@@ -52,31 +52,14 @@
</script> </script>
</body> </body>
<!-- *************************** Module 形式加载引入 **************************** --> <script type="text/javascript" src="dist/kityminder.core.min.js"></script>
<script type="text/javascript" src="lib/seajs/dist/sea-debug.js"></script>
<script type="text/javascript"> <script type="text/javascript">
/* global seajs */
seajs.config({
base: './src'
});
define('start', function(require) {
var Minder = require('kityminder').Minder;
// 创建 km 实例 // 创建 km 实例
var km = window.km = new Minder(); /* global kityminder */
var km = window.km = new kityminder.Minder();
km.setup('#minder-view'); km.setup('#minder-view');
}); km.disable();
seajs.use('start'); km.execCommand('hand');
</script> </script>
<!-- *********************** 打包文件引入(需要先 grunt 发布) ************************* -->
<!-- <script type="text/javascript" src="release/kityminder.core.js"></script>
<script type="text/javascript">
// 创建 km 实例
/* global kityminder */
var km = window.km = new kityminder.Minder();
km.setup('#minder-view');
</script>
-->
</html> </html>
\ No newline at end of file
{
"name": "seajs",
"version": "2.3.0",
"main": "./dist/sea.js",
"ignore": [
"**/.*",
"docs",
"lib",
"src",
"tests",
"CNAME",
"component.json",
"CONTRIBUTING.md",
"index.html",
"Makefile",
"package.json",
"README.md"
],
"homepage": "https://github.com/seajs/seajs",
"_release": "2.3.0",
"_resolution": {
"type": "version",
"tag": "2.3.0",
"commit": "9c6299636991fbca73a9aa7b2eb152c6e8614854"
},
"_source": "git://github.com/seajs/seajs.git",
"_target": "~2.3.0",
"_originalSource": "seajs"
}
\ No newline at end of file
MIT LICENSE
Copyright (c) 2009 - 2099 Frank Wang, http://seajs.org/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
"name": "seajs",
"version": "2.3.0",
"main": "./dist/sea.js",
"ignore": [
"**/.*",
"docs",
"lib",
"src",
"tests",
"CNAME",
"component.json",
"CONTRIBUTING.md",
"index.html",
"Makefile",
"package.json",
"README.md"
]
}
{ {
"name": "kityminder", "name": "kityminder",
"title": "kityminder", "title": "kityminder",
"description": "KityMinder Core Implement", "description": "KityMinder Core Implement",
"version": "1.4.0", "version": "1.4.0",
"homepage": "https://github.com/fex-team/kityminder-core", "homepage": "https://github.com/fex-team/kityminder-core",
"author": { "author": {
"name": "Baidu FEX", "name": "Baidu FEX",
"url": "http://fex.baidu.com" "url": "http://fex.baidu.com"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/fex-team/kityminder-core.git" "url": "https://github.com/fex-team/kityminder-core.git"
}, },
"keywords": [ "keywords": [
"kityminder", "kityminder",
"kity", "kity",
"minder", "minder",
"svg", "svg",
"graphic", "graphic",
"javascript" "javascript"
], ],
"bugs": { "bugs": {
"url": "https://github.com/fex-team/kityminder-core/issues" "url": "https://github.com/fex-team/kityminder-core/issues"
}, },
"licenses": [ { "licenses": [
"type": "MIT", {
"url": "https://github.com/fex-team/kityminder-core/blob/dev/LICENSE" "type": "MIT",
} ], "url": "https://github.com/fex-team/kityminder-core/blob/dev/LICENSE"
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-module-dependence": "~0.2.0",
"grunt-contrib-concat": "~0.5.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-replace": "~0.8.0",
"grunt-contrib-clean": "~0.5.0"
} }
],
} "dependencies": {
\ No newline at end of file "grunt-contrib-copy": "^0.8.0"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-module-dependence": "~0.2.0",
"grunt-contrib-concat": "~0.5.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-replace": "~0.8.0",
"grunt-contrib-clean": "~0.5.0"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment