Commit 9719d582 authored by techird's avatar techird

Merge branch 'dev1.1.0' of github.com:fex-team/kityminder into dev

parents a7af9d1f c3376bce
/*-----------------------------------------------------
* livereload Default Setting
*-----------------------------------------------------*/
'use strict';
var path = require('path');
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
/*-----------------------------------------------------
* Module Setting
*-----------------------------------------------------*/
module.exports = function (grunt) {
var banner = '/*!\n' +
' * ====================================================\n' +
' * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * GitHub: <%= pkg.repository.url %> \n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n' +
' * ====================================================\n' +
' */\n\n',
buildPath = 'dist/dev.php';
var getPath = function ( readFile) {
var sources = require("fs").readFileSync(readFile);
sources = /Array\(([^)]+)\)/.exec( sources );
sources = sources[1].replace( /\/\/.*\n/g, '\n' ).replace( /'|"|\n|\t|\s/g, '' );
sources = sources.split( "," );
sources.forEach( function ( filepath, index ) {
sources[ index ] = filepath;
});
return sources;
};
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
concat: {
js: {
options: {
banner: banner + '(function(kity, window) {\n\n',
footer: '\n\n})(kity, window)',
process: function(src, filepath) {
return src + "\n";
}
},
src: getPath( buildPath ),
dest: 'dist/kityminder.all.js'
}
},
uglify: {
minimize: {
files: {
'dist/kityminder.all.min.js': 'dist/kityminder.all.js'
}
}
},
/* Start [Task liverload] ------------------------------------*/
livereload: {
port: 35729 // Default livereload listening port.
},
connect: {
livereload: {
options: {
hostname: '*',
port: 9001,
base: '.',
middleware: function(connect, options, middlewares) {
return [
lrSnippet,
connect.static(options.base.toString()),
connect.directory(options.base.toString())
]
}
}
}
},
regarde: {
js:{
files: 'src/**/*.js',
tasks: ['default', 'livereload']
}
}
/* End [Task liverload] ------------------------------------*/
});
// These plugins provide necessary tasks.
/* [Build plugin & task ] ------------------------------------*/
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Build task(s).
grunt.registerTask( 'default', [ 'concat:js', 'uglify:minimize' ] );
/* [liverload plugin & task ] ------------------------------------*/
grunt.loadNpmTasks('grunt-regarde');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-livereload');
grunt.registerTask('live', ['livereload-start', 'connect', 'regarde']);
};
......@@ -8,7 +8,7 @@
<script src="social.js" charset="utf-8"></script>
<script src="../kity/dist/kitygraph.all.js" charset="utf-8"></script>
<script src="../configure.js" charset="utf-8"></script>
<script src="../dist/dev.php" charset="utf-8"></script>
<script src="./kityminder.all.min.js" charset="utf-8"></script>
<script src="../lang/zh-cn/zh-cn.js" charset="utf-8"></script>
<link href="../themes/default/css/import.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="social.css">
......
{
"name": "kityminder",
"title": "kityminder",
"description": "Kity Minder",
"version": "1.1.0",
"homepage": "https://github.com/kitygraph/kityminder",
"author": {
"name": "Baidu UEditor Group",
"url": "http://ueditor.baidu.com"
},
"repository": {
"type": "git",
"url": "https://github.com/kitygraph/kityminder.git"
},
"keywords": [
"kityminder",
"kity",
"minder",
"svg",
"graphic",
"javascript"
],
"bugs": {
"url": "https://github.com/kitygraph/kityminder/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/kitygraph/kityminder/blob/dev/LICENSE"
}
],
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.6",
"grunt-regarde": "latest",
"grunt-contrib-connect": "latest",
"grunt-contrib-livereload": "latest"
}
}
\ No newline at end of file
......@@ -37,7 +37,7 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
var renderBox = me.getRenderContainer().getRenderBox( "top" );
var renderContainer = me.getRenderContainer();
var transform = renderContainer.getTransform();
renderContainer.setTransform( new kity.Matrix().translate( -renderBox.x, -renderBox.y ) );
renderContainer.clearTransform();
var loop = 0;
var svg = $( svghtml ).attr( {
width: renderBox.width,
......
......@@ -77,10 +77,14 @@ kity.extendClass( Minder, {
if(callbacks.length == 0){
return;
}
var lastStatus = this.getStatus();
for ( var i = 0; i < callbacks.length; i++ ) {
callbacks[ i ].call( this, e );
if ( e.shouldStopPropagationImmediately() ) {
if ( this.getStatus() != lastStatus || e.shouldStopPropagationImmediately() ) {
break;
}
}
......
......@@ -236,8 +236,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
}
prt = prt.getParent();
}
//自顶向下更新受影响一侧的y值
var sideList = root.getLayout()[ appendside + "List" ];
}
//自顶向下更新受影响一侧的y值
var updateSide = function ( appendside ) {
var _buffer = [ root ];
while ( _buffer.length > 0 ) {
var _buffer0Layout = _buffer[ 0 ].getLayout();
......@@ -252,6 +253,13 @@ KityMinder.registerModule( "LayoutDefault", function () {
if ( _buffer[ 0 ] !== root ) effectSet.push( _buffer[ 0 ] );
_buffer.shift();
}
};
var sideList;
if ( appendside ) {
updateSide( appendside );
} else {
updateSide( "left" );
updateSide( "right" );
}
return effectSet;
};
......
......@@ -61,11 +61,21 @@ KityMinder.registerModule( 'Zoom', function () {
'zoom-in': ZoomInCommand,
'zoom-out': ZoomOutCommand
},
addShortcutKeys: {
"zoom-in": "=", //=
"zoom-out": "-" //-
},
events: {
'normal.keydown':function(e){
var me = this;
var originEvent = e.originEvent;
var keyCode = originEvent.keyCode || originEvent.which;
if(keymap['='] == keyCode){
me.execCommand('zoom-in');
}
if(keymap['-'] == keyCode){
me.execCommand('zoom-out');
}
},
'ready': function () {
this._zoomValue = 1;
},
......
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