Commit 6761bdd8 authored by campaign's avatar campaign

Merge remote-tracking branch 'origin/dev' into dev

Conflicts:
	configure.js
	lang/zh-cn/zh-cn.js
parents 219afeb1 2e7c0f6c
...@@ -59,6 +59,7 @@ $dependency = Array( ...@@ -59,6 +59,7 @@ $dependency = Array(
,'src/adapter/combobox.js' ,'src/adapter/combobox.js'
,'src/adapter/saveto.js' ,'src/adapter/saveto.js'
,'src/adapter/hand.js' ,'src/adapter/hand.js'
,'src/adapter/icon.js'
,'src/protocal/plain.js' ,'src/protocal/plain.js'
,'src/protocal/json.js' ,'src/protocal/json.js'
); );
......
...@@ -9,14 +9,13 @@ KityMinder.LANG[ 'zh-cn' ] = { ...@@ -9,14 +9,13 @@ KityMinder.LANG[ 'zh-cn' ] = {
'fontsize': '字号', 'fontsize': '字号',
'layoutstyle': '主题', 'layoutstyle': '主题',
'saveto': '导出', 'saveto': '导出',
'markers':'标示' 'hand': '允许拖拽'
}, },
'popupcolor': { 'popupcolor': {
'clearColor': '清空颜色', 'clearColor': '清空颜色',
'standardColor': '标准颜色', 'standardColor': '标准颜色',
'themeColor': '主题颜色' 'themeColor': '主题颜色'
}, },
'hand': '允许拖拽',
'dialogs':{ 'dialogs':{
'markers':{ 'markers':{
'static':{ 'static':{
...@@ -29,4 +28,5 @@ KityMinder.LANG[ 'zh-cn' ] = { ...@@ -29,4 +28,5 @@ KityMinder.LANG[ 'zh-cn' ] = {
'httpPrompt':'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀' 'httpPrompt':'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀'
} }
} }
}; };
\ No newline at end of file
KM.registerUI('bold italic redo undo', KM.registerUI( 'bold italic redo undo',
function(name) { function ( name ) {
var me = this; var me = this;
var $btn = $.kmuibutton({ var $btn = $.kmuibutton( {
icon : name, icon: name,
click : function(){ click: function () {
me.execCommand(name); me.execCommand( name );
}, },
title: this.getLang('tooltips')[name] || '' title: this.getLang( 'tooltips' )[ name ] || ''
}); } );
this.on('interactchange',function(){ this.on( 'interactchange', function () {
var state = this.queryCommandState(name); var state = this.queryCommandState( name );
$btn.kmui().disabled(state == -1).active(state == 1) $btn.kmui().disabled( state == -1 ).active( state == 1 );
}); } );
return $btn; return $btn;
} }
); );
\ No newline at end of file
KityMinder.registerModule( "IconModule", function () { KityMinder.registerModule( "IconModule", function () {
var renderPriorityIcon = function ( node, val ) { var renderPriorityIcon = function ( node, val ) {
var colors = [ "", "red", "blue", "green", "orange", "purple" ]; var colors = [ "", "#A92E24", "#29A6BD", "#1E8D54", "orange", "#876DDA" ];
var _bg = new kity.Rect().fill( colors[ val ] ).setRadius( 3 ).setWidth( 20 ).setHeight( 20 ); var _bg = new kity.Rect().fill( colors[ val ] ).setRadius( 3 ).setWidth( 20 ).setHeight( 20 );
var _number = new kity.Text().setContent( val ).fill( "white" ).setSize( 12 ); var _number = new kity.Text().setContent( val ).fill( "white" ).setSize( 12 );
var _rc = new kity.Group(); var _rc = new kity.Group();
...@@ -10,7 +10,7 @@ KityMinder.registerModule( "IconModule", function () { ...@@ -10,7 +10,7 @@ KityMinder.registerModule( "IconModule", function () {
}; };
var renderProgressIcon = function ( node, val, left ) { var renderProgressIcon = function ( node, val, left ) {
var _rc = new kity.Group(); var _rc = new kity.Group();
var _bg = new kity.Circle().setRadius( 8 ).fill( "white" ).stroke( new kity.Pen( "blue", 2 ) ); var _bg = new kity.Circle().setRadius( 8 ).fill( "white" ).stroke( new kity.Pen( "#29A6BD", 2 ) );
var _percent, d; var _percent, d;
if ( val < 5 ) { if ( val < 5 ) {
_percent = new kity.Path(); _percent = new kity.Path();
...@@ -34,11 +34,11 @@ KityMinder.registerModule( "IconModule", function () { ...@@ -34,11 +34,11 @@ KityMinder.registerModule( "IconModule", function () {
d.carcTo( 6, 0, 6, 1, 0 ); d.carcTo( 6, 0, 6, 1, 0 );
break; break;
case 5: case 5:
_percent.addShape( new kity.Circle().setRadius( 6 ).fill( "blue" ) ); _percent.addShape( new kity.Circle().setRadius( 6 ).fill( "#29A6BD" ) );
break; break;
} }
if ( val < 5 ) d.close(); if ( val < 5 ) d.close();
_percent.fill( "blue" ); _percent.fill( "#29A6BD" );
}; };
var ChangeIconCommand = kity.createClass( "AddIconCommand", ( function () { var ChangeIconCommand = kity.createClass( "AddIconCommand", ( function () {
return { return {
...@@ -70,6 +70,9 @@ KityMinder.registerModule( "IconModule", function () { ...@@ -70,6 +70,9 @@ KityMinder.registerModule( "IconModule", function () {
"removeicon": RemoveIconCommand "removeicon": RemoveIconCommand
}, },
"events": { "events": {
"": function ( e ) {
},
"RenderNode": function ( e ) { "RenderNode": function ( e ) {
var node = e.node; var node = e.node;
var iconRc = node.getIconRc(); var iconRc = node.getIconRc();
......
/*modal 类*/ /*modal 类*/
KM.ui.define('modal', { KM.ui.define( 'modal', {
tpl: '<div class="kmui-modal" tabindex="-1" >' + tpl: '<div class="kmui-modal" tabindex="-1" >' +
'<div class="kmui-modal-header">' + '<div class="kmui-modal-header">' +
'<div class="kmui-close" data-hide="modal"></div>' + '<div class="kmui-close" data-hide="modal"></div>' +
...@@ -24,70 +24,70 @@ KM.ui.define('modal', { ...@@ -24,70 +24,70 @@ KM.ui.define('modal', {
backdrop: true, backdrop: true,
keyboard: true keyboard: true
}, },
init: function (options) { init: function ( options ) {
var me = this; var me = this;
me.root($($.parseTmpl(me.tpl, options || {}))); me.root( $( $.parseTmpl( me.tpl, options || {} ) ) );
me.data("options", options); me.data( "options", options );
if (options.okFn) { if ( options.okFn ) {
me.on('ok', $.proxy(options.okFn, me)) me.on( 'ok', $.proxy( options.okFn, me ) )
} }
if (options.cancelFn) { if ( options.cancelFn ) {
me.on('beforehide', $.proxy(options.cancelFn, me)) me.on( 'beforehide', $.proxy( options.cancelFn, me ) )
} }
me.root().delegate('[data-hide="modal"]', 'click', $.proxy(me.hide, me)) me.root().delegate( '[data-hide="modal"]', 'click', $.proxy( me.hide, me ) )
.delegate('[data-ok="modal"]', 'click', $.proxy(me.ok, me)); .delegate( '[data-ok="modal"]', 'click', $.proxy( me.ok, me ) );
$('[data-hide="modal"],[data-ok="modal"]',me.root()).hover(function(){ $( '[data-hide="modal"],[data-ok="modal"]', me.root() ).hover( function () {
$(this).toggleClass('kmui-hover') $( this ).toggleClass( 'kmui-hover' )
}); } );
}, },
toggle: function () { toggle: function () {
var me = this; var me = this;
return me[!me.data("isShown") ? 'show' : 'hide'](); return me[ !me.data( "isShown" ) ? 'show' : 'hide' ]();
}, },
show: function () { show: function () {
var me = this; var me = this;
me.trigger("beforeshow"); me.trigger( "beforeshow" );
if (me.data("isShown")) return; if ( me.data( "isShown" ) ) return;
me.data("isShown", true); me.data( "isShown", true );
me.escape(); me.escape();
me.backdrop(function () { me.backdrop( function () {
me.autoCenter(); me.autoCenter();
me.root() me.root()
.show() .show()
.focus() .focus()
.trigger('aftershow'); .trigger( 'aftershow' );
}) } )
}, },
showTip: function ( text ) { showTip: function ( text ) {
$( '.kmui-modal-tip', this.root() ).html( text ).fadeIn(); $( '.kmui-modal-tip', this.root() ).html( text ).fadeIn();
}, },
hideTip: function ( text ) { hideTip: function ( text ) {
$( '.kmui-modal-tip', this.root() ).fadeOut( function (){ $( '.kmui-modal-tip', this.root() ).fadeOut( function () {
$(this).html(''); $( this ).html( '' );
} ); } );
}, },
autoCenter: function () { autoCenter: function () {
//ie6下不用处理了 //ie6下不用处理了
!$.IE6 && this.root().css("margin-left", -(this.root().width() / 2)); !$.IE6 && this.root().css( "margin-left", -( this.root().width() / 2 ) );
}, },
hide: function () { hide: function () {
var me = this; var me = this;
me.trigger("beforehide"); me.trigger( "beforehide" );
if (!me.data("isShown")) return; if ( !me.data( "isShown" ) ) return;
me.data("isShown", false); me.data( "isShown", false );
me.escape(); me.escape();
...@@ -95,61 +95,58 @@ KM.ui.define('modal', { ...@@ -95,61 +95,58 @@ KM.ui.define('modal', {
}, },
escape: function () { escape: function () {
var me = this; var me = this;
if (me.data("isShown") && me.data("options").keyboard) { if ( me.data( "isShown" ) && me.data( "options" ).keyboard ) {
me.root().on('keyup', function (e) { me.root().on( 'keyup', function ( e ) {
e.which == 27 && me.hide(); e.which == 27 && me.hide();
}) } )
} } else if ( !me.data( "isShown" ) ) {
else if (!me.data("isShown")) { me.root().off( 'keyup' );
me.root().off('keyup');
} }
}, },
hideModal: function () { hideModal: function () {
var me = this; var me = this;
me.root().hide(); me.root().hide();
me.backdrop(function () { me.backdrop( function () {
me.removeBackdrop(); me.removeBackdrop();
me.trigger('afterhide'); me.trigger( 'afterhide' );
}) } )
}, },
removeBackdrop: function () { removeBackdrop: function () {
this.$backdrop && this.$backdrop.remove(); this.$backdrop && this.$backdrop.remove();
this.$backdrop = null; this.$backdrop = null;
}, },
backdrop: function (callback) { backdrop: function ( callback ) {
var me = this; var me = this;
if (me.data("isShown") && me.data("options").backdrop) { if ( me.data( "isShown" ) && me.data( "options" ).backdrop ) {
me.$backdrop = $('<div class="kmui-modal-backdrop" />').click( me.$backdrop = $( '<div class="kmui-modal-backdrop" />' ).click(
me.data("options").backdrop == 'static' ? me.data( "options" ).backdrop == 'static' ?
$.proxy(me.root()[0].focus, me.root()[0]) $.proxy( me.root()[ 0 ].focus, me.root()[ 0 ] ) : $.proxy( me.hide, me )
: $.proxy(me.hide, me)
) )
} }
me.trigger('afterbackdrop'); me.trigger( 'afterbackdrop' );
callback && callback(); callback && callback();
}, },
attachTo: function ($obj) { attachTo: function ( $obj ) {
var me = this var me = this
if (!$obj.data('$mergeObj')) { if ( !$obj.data( '$mergeObj' ) ) {
$obj.data('$mergeObj', me.root()); $obj.data( '$mergeObj', me.root() );
$obj.on('click', function () { $obj.on( 'click', function () {
me.toggle($obj) me.toggle( $obj )
}); } );
me.data('$mergeObj', $obj) me.data( '$mergeObj', $obj )
} }
}, },
ok: function () { ok: function () {
var me = this; var me = this;
me.trigger('beforeok'); me.trigger( 'beforeok' );
if (me.trigger("ok", me) === false) { if ( me.trigger( "ok", me ) === false ) {
return; return;
} }
me.hide(); me.hide();
}, },
getBodyContainer: function () { getBodyContainer: function () {
return this.root().find('.kmui-modal-body') return this.root().find( '.kmui-modal-body' )
} }
}); } );
\ No newline at end of file
...@@ -16,4 +16,10 @@ ...@@ -16,4 +16,10 @@
} }
.kmui-btn-toolbar .kmui-btn .kmui-icon-hand { .kmui-btn-toolbar .kmui-btn .kmui-icon-hand {
background: url(../images/hand.png) no-repeat 2px 2px; background: url(../images/hand.png) no-repeat 2px 2px;
}
.kmui-btn-toolbar .kmui-btn .kmui-icon-flag {
background: url(../images/flag.png) no-repeat 2px 2px;
}
.kmui-btn-toolbar .kmui-btn .kmui-icon-clock {
background: url(../images/clock.png) no-repeat 2px 2px;
} }
\ No newline at end of file
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