Commit 00eb48b2 authored by Akikonata's avatar Akikonata

added 2icons

parent ae2fa565
window.KITYMINDER_CONFIG = { window.KITYMINDER_CONFIG = {
//定义工具栏 //定义工具栏
toolbars: [ toolbars: [
'hand | undo redo | bold italic | fontfamily fontsize forecolor | saveto' 'hand flag clock | undo redo | bold italic | fontfamily fontsize forecolor | saveto'
] ]
//设置主题 //设置主题
//,defaultlayoutstyle : 'default' //设置默认的主题 //,defaultlayoutstyle : 'default' //设置默认的主题
//,layoutstyle : [] //添加有那些主图 //,layoutstyle : [] //添加有那些主图
......
...@@ -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'
); );
......
...@@ -15,6 +15,7 @@ KityMinder.LANG[ 'zh-cn' ] = { ...@@ -15,6 +15,7 @@ KityMinder.LANG[ 'zh-cn' ] = {
'standardColor': '标准颜色', 'standardColor': '标准颜色',
'themeColor': '主题颜色' 'themeColor': '主题颜色'
}, },
'hand': '允许拖拽' 'hand': '允许拖拽',
'flag': '优先级',
'clock': '完成度'
}; };
\ 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
/*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
...@@ -17,3 +17,9 @@ ...@@ -17,3 +17,9 @@
.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