Commit 00eb48b2 authored by Akikonata's avatar Akikonata

added 2icons

parent ae2fa565
window.KITYMINDER_CONFIG = {
//定义工具栏
toolbars: [
'hand | undo redo | bold italic | fontfamily fontsize forecolor | saveto'
'hand flag clock | undo redo | bold italic | fontfamily fontsize forecolor | saveto'
]
//设置主题
//,defaultlayoutstyle : 'default' //设置默认的主题
//,layoutstyle : [] //添加有那些主图
......
......@@ -59,6 +59,7 @@ $dependency = Array(
,'src/adapter/combobox.js'
,'src/adapter/saveto.js'
,'src/adapter/hand.js'
,'src/adapter/icon.js'
,'src/protocal/plain.js'
,'src/protocal/json.js'
);
......
......@@ -15,6 +15,7 @@ KityMinder.LANG[ 'zh-cn' ] = {
'standardColor': '标准颜色',
'themeColor': '主题颜色'
},
'hand': '允许拖拽'
'hand': '允许拖拽',
'flag': '优先级',
'clock': '完成度'
};
\ No newline at end of file
KM.registerUI('bold italic redo undo',
function(name) {
KM.registerUI( 'bold italic redo undo',
function ( name ) {
var me = this;
var $btn = $.kmuibutton({
icon : name,
click : function(){
me.execCommand(name);
var $btn = $.kmuibutton( {
icon: name,
click: function () {
me.execCommand( name );
},
title: this.getLang('tooltips')[name] || ''
});
this.on('interactchange',function(){
var state = this.queryCommandState(name);
$btn.kmui().disabled(state == -1).active(state == 1)
});
title: this.getLang( 'tooltips' )[ name ] || ''
} );
this.on( 'interactchange', function () {
var state = this.queryCommandState( name );
$btn.kmui().disabled( state == -1 ).active( state == 1 );
} );
return $btn;
}
);
);
\ No newline at end of file
/*modal 类*/
KM.ui.define('modal', {
KM.ui.define( 'modal', {
tpl: '<div class="kmui-modal" tabindex="-1" >' +
'<div class="kmui-modal-header">' +
'<div class="kmui-close" data-hide="modal"></div>' +
......@@ -24,70 +24,70 @@ KM.ui.define('modal', {
backdrop: true,
keyboard: true
},
init: function (options) {
init: function ( options ) {
var me = this;
me.root($($.parseTmpl(me.tpl, options || {})));
me.root( $( $.parseTmpl( me.tpl, options || {} ) ) );
me.data("options", options);
if (options.okFn) {
me.on('ok', $.proxy(options.okFn, me))
me.data( "options", options );
if ( options.okFn ) {
me.on( 'ok', $.proxy( options.okFn, me ) )
}
if (options.cancelFn) {
me.on('beforehide', $.proxy(options.cancelFn, me))
if ( options.cancelFn ) {
me.on( 'beforehide', $.proxy( options.cancelFn, me ) )
}
me.root().delegate('[data-hide="modal"]', 'click', $.proxy(me.hide, me))
.delegate('[data-ok="modal"]', 'click', $.proxy(me.ok, me));
me.root().delegate( '[data-hide="modal"]', 'click', $.proxy( me.hide, me ) )
.delegate( '[data-ok="modal"]', 'click', $.proxy( me.ok, me ) );
$('[data-hide="modal"],[data-ok="modal"]',me.root()).hover(function(){
$(this).toggleClass('kmui-hover')
});
$( '[data-hide="modal"],[data-ok="modal"]', me.root() ).hover( function () {
$( this ).toggleClass( 'kmui-hover' )
} );
},
toggle: function () {
var me = this;
return me[!me.data("isShown") ? 'show' : 'hide']();
return me[ !me.data( "isShown" ) ? 'show' : 'hide' ]();
},
show: function () {
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.backdrop(function () {
me.backdrop( function () {
me.autoCenter();
me.root()
.show()
.focus()
.trigger('aftershow');
})
.trigger( 'aftershow' );
} )
},
showTip: function ( text ) {
$( '.kmui-modal-tip', this.root() ).html( text ).fadeIn();
},
hideTip: function ( text ) {
$( '.kmui-modal-tip', this.root() ).fadeOut( function (){
$(this).html('');
$( '.kmui-modal-tip', this.root() ).fadeOut( function () {
$( this ).html( '' );
} );
},
autoCenter: function () {
//ie6下不用处理了
!$.IE6 && this.root().css("margin-left", -(this.root().width() / 2));
!$.IE6 && this.root().css( "margin-left", -( this.root().width() / 2 ) );
},
hide: function () {
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();
......@@ -95,61 +95,58 @@ KM.ui.define('modal', {
},
escape: function () {
var me = this;
if (me.data("isShown") && me.data("options").keyboard) {
me.root().on('keyup', function (e) {
if ( me.data( "isShown" ) && me.data( "options" ).keyboard ) {
me.root().on( 'keyup', function ( e ) {
e.which == 27 && me.hide();
})
}
else if (!me.data("isShown")) {
me.root().off('keyup');
} )
} else if ( !me.data( "isShown" ) ) {
me.root().off( 'keyup' );
}
},
hideModal: function () {
var me = this;
me.root().hide();
me.backdrop(function () {
me.backdrop( function () {
me.removeBackdrop();
me.trigger('afterhide');
})
me.trigger( 'afterhide' );
} )
},
removeBackdrop: function () {
this.$backdrop && this.$backdrop.remove();
this.$backdrop = null;
},
backdrop: function (callback) {
backdrop: function ( callback ) {
var me = this;
if (me.data("isShown") && me.data("options").backdrop) {
me.$backdrop = $('<div class="kmui-modal-backdrop" />').click(
me.data("options").backdrop == 'static' ?
$.proxy(me.root()[0].focus, me.root()[0])
: $.proxy(me.hide, me)
if ( me.data( "isShown" ) && me.data( "options" ).backdrop ) {
me.$backdrop = $( '<div class="kmui-modal-backdrop" />' ).click(
me.data( "options" ).backdrop == 'static' ?
$.proxy( me.root()[ 0 ].focus, me.root()[ 0 ] ) : $.proxy( me.hide, me )
)
}
me.trigger('afterbackdrop');
me.trigger( 'afterbackdrop' );
callback && callback();
},
attachTo: function ($obj) {
attachTo: function ( $obj ) {
var me = this
if (!$obj.data('$mergeObj')) {
if ( !$obj.data( '$mergeObj' ) ) {
$obj.data('$mergeObj', me.root());
$obj.on('click', function () {
me.toggle($obj)
});
me.data('$mergeObj', $obj)
$obj.data( '$mergeObj', me.root() );
$obj.on( 'click', function () {
me.toggle( $obj )
} );
me.data( '$mergeObj', $obj )
}
},
ok: function () {
var me = this;
me.trigger('beforeok');
if (me.trigger("ok", me) === false) {
me.trigger( 'beforeok' );
if ( me.trigger( "ok", me ) === false ) {
return;
}
me.hide();
},
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 @@
}
.kmui-btn-toolbar .kmui-btn .kmui-icon-hand {
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