Commit 01ce0443 authored by campaign's avatar campaign

Merge branch 'dev' into gh-pages

parents 52a72af9 cc6e3076
...@@ -884,7 +884,8 @@ baidu.frontia = {}, function(e) { ...@@ -884,7 +884,8 @@ baidu.frontia = {}, function(e) {
var i = []; var i = [];
t.response_params.users.forEach(function(t) { t.response_params.users.forEach(function(t) {
var r = new e.User({socialId: t.user_id,mediaType: t.media_type,name: t.username}); var r = new e.User({socialId: t.user_id,mediaType: t.media_type,name: t.username});
i.push(r) r.extra = t;
i.push(r);
}), u.options.success({result: i,count: t.response_params.count}), c.err_code = 0 }), u.options.success({result: i,count: t.response_params.count}), c.err_code = 0
} }
c.restimestamp = n(), r(c) c.restimestamp = n(), r(c)
......
This diff is collapsed.
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
<script src="social.js" charset="utf-8"></script> <script src="social.js" charset="utf-8"></script>
<script src="../kity/dist/kitygraph.all.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="../configure.js" charset="utf-8"></script>
<script src="../dist/dev.js" charset="utf-8"></script> <script src="../dist/dev.php" charset="utf-8"></script>
<script src="../lang/zh-cn/zh-cn.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 href="../themes/default/css/import.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="social.css">
<style> <style>
.km_receiver{ .km_receiver{
width:0; width:0;
...@@ -26,37 +27,9 @@ ...@@ -26,37 +27,9 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#social { html, body, div.kmui-editor-body {
position: absolute; height: 100%;
right: 10px; -moz-user-select: none;
top: 10px;
line-height: 20px;
text-align: right;
overflow: hidden;
}
#social button {
outline: none;
display: inline-block;
bottom: 20px;
right: 30px;
background: #0099f2;
padding: 0 15px;
height: 35px;
font-size: 13px;
line-height: 35px;
text-align: center;
border-radius: 5px;
color: #ffffff;
text-decoration: none;
border: none;
margin-left: 5px;
cursor: pointer;
}
#social button:hover {
background: #009fff;
}
#social button[disabled] {
background-color: #AAA;
} }
</style> </style>
</head> </head>
......
#social {
position: absolute;
right: 10px;
top: 10px;
line-height: 20px;
text-align: right;
overflow: hidden;
}
#social button {
font-family: Arial, "Heiti SC", "Microsoft Yahei";
outline: none;
display: inline-block;
padding: 0 15px;
height: 35px;
font-size: 13px;
line-height: 35px;
text-align: center;
border-radius: 5px;
color: #ffffff;
text-decoration: none;
border: none;
margin-left: 5px;
cursor: pointer;
background: #0099f2;
/* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwOTlmMiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjNDA5NmVlIiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwNzZkZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(top, #0099f2 0%, #4096ee 0%, #0076dd 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #0099f2), color-stop(0%, #4096ee), color-stop(100%, #0076dd));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #0099f2 0%, #4096ee 0%, #0076dd 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #0099f2 0%, #4096ee 0%, #0076dd 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #0099f2 0%, #4096ee 0%, #0076dd 100%);
/* IE10+ */
background: linear-gradient(to bottom, #0099f2 0%, #4096ee 0%, #0076dd 100%);
/* W3C */
}
#social button:hover {
background: #009fff;
}
#social button[disabled] {
background: #AAA;
}
#social button.baidu-cloud {
padding-left: 35px;
position: relative;
}
#social button.baidu-cloud:before {
content: ' ';
display: block;
width: 24px;
height: 24px;
background: url(../themes/default/images/baiducloud.png);
position: absolute;
left: 7px;
top: 5px;
}
#social button.share {
padding-left: 35px;
position: relative;
}
#social button.share:before {
content: ' ';
display: block;
width: 24px;
height: 24px;
background: url(../themes/default/images/share.png) no-repeat;
position: absolute;
left: 7px;
top: 5px;
}
#social button img {
position: relative;
top: 3px;
border-radius: 2px;
margin-right: 7px;
}
#social button.user-file {
padding-right: 28px;
position: relative;
}
#social button.user-file:after {
content: ' ';
display: block;
position: absolute;
right: 10px;
top: 15px;
width: 0;
height: 0;
border: solid;
border-width: 4px 5px;
border-color: #FFFFFF transparent transparent transparent;
}
.user-file-menu {
margin-top: 20px;
margin-left: 1px;
}
This diff is collapsed.
#social {
position: absolute;
right: 10px;
top: 10px;
line-height: 20px;
text-align: right;
overflow: hidden;
button {
font-family: Arial, "Heiti SC", "Microsoft Yahei";
outline: none;
display: inline-block;
padding: 0 15px;
height: 35px;
font-size: 13px;
line-height: 35px;
text-align: center;
border-radius: 5px;
color: #ffffff;
text-decoration: none;
border: none;
margin-left: 5px;
cursor: pointer;background: #0099f2; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwOTlmMiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjNDA5NmVlIiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwNzZkZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(top, #0099f2 0%, #4096ee 0%, #0076dd 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#0099f2), color-stop(0%,#4096ee), color-stop(100%,#0076dd)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* IE10+ */
background: linear-gradient(to bottom, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* W3C */
&:hover {
background: #009fff;
}
&[disabled] {
background: #AAA;
}
&.baidu-cloud {
padding-left: 35px;
position: relative;
&:before {
content: ' ';
display: block;
width: 24px;
height: 24px;
background: url(../themes/default/images/baiducloud.png);
position: absolute;
left: 7px;
top: 5px;
}
}
&.share {
padding-left: 35px;
position: relative;
&:before {
content: ' ';
display: block;
width: 24px;
height: 24px;
background: url(../themes/default/images/share.png) no-repeat;
position: absolute;
left: 7px;
top: 5px;
}
}
img {
position: relative;
top: 3px;
border-radius: 2px;
margin-right: 7px;
}
&.user-file {
padding-right: 28px;
position: relative;
&:after {
content: ' ';
display: block;
position: absolute;
right: 10px;
top: 15px;
width: 0;
height: 0;
border: solid;
border-width: 4px 5px;
border-color: #FFFFFF transparent transparent transparent;
}
}
}
}
.user-file-menu {
margin-top: 20px;
margin-left: 1px;
}
\ No newline at end of file
Subproject commit a9630e638b29633f62cdc2df239bc702118b231a Subproject commit 48128c2e87fb9c8f2f93e64fc2df3f04ffa0a692
...@@ -95,8 +95,7 @@ KM.registerToolbarUI( 'fontfamily fontsize', function ( name ) { ...@@ -95,8 +95,7 @@ KM.registerToolbarUI( 'fontfamily fontsize', function ( name ) {
temp = options.items[ i ]; temp = options.items[ i ];
tempItems.push( temp ); tempItems.push( temp );
options.itemStyles.push( 'font-size: ' + temp + 'px' ); options.itemStyles.push( 'font-size: ' + temp + 'px; height:' + (temp+2) + 'px; line-height: ' + (temp + 2) + 'px' );
} }
options.value = options.items; options.value = options.items;
......
...@@ -27,6 +27,9 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", { ...@@ -27,6 +27,9 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this._paper = new kity.Paper(); this._paper = new kity.Paper();
this._paper.getNode().setAttribute( 'contenteditable', true ); this._paper.getNode().setAttribute( 'contenteditable', true );
this._paper.getNode().ondragstart = function(e) {
e.preventDefault();
};
this._addRenderContainer(); this._addRenderContainer();
......
...@@ -12,7 +12,6 @@ kity.extendClass( Minder, { ...@@ -12,7 +12,6 @@ kity.extendClass( Minder, {
rc.addShape( current.getRenderContainer() ); rc.addShape( current.getRenderContainer() );
} ); } );
}, },
handelNodeRemove: function ( node ) { handelNodeRemove: function ( node ) {
var rc = this._rc; var rc = this._rc;
node.traverse( function ( current ) { node.traverse( function ( current ) {
...@@ -29,6 +28,9 @@ kity.extendClass( Minder, { ...@@ -29,6 +28,9 @@ kity.extendClass( Minder, {
} else { } else {
km.renderNode( nodes ); km.renderNode( nodes );
} }
},
getMinderTitle: function() {
return this.getRoot().getText();
} }
} ); } );
\ No newline at end of file
...@@ -67,6 +67,39 @@ kity.extendClass( Minder, function () { ...@@ -67,6 +67,39 @@ kity.extendClass( Minder, function () {
}, },
isSingleSelect: function () { isSingleSelect: function () {
return this._selectedNodes.length == 1; return this._selectedNodes.length == 1;
},
getSelectedAncestors: function() {
var nodes = this.getSelectedNodes().slice( 0 ),
ancestors = [],
judge;
// 根节点不参与计算
var rootIndex = nodes.indexOf( this.getRoot() );
if ( ~rootIndex ) {
nodes.splice( rootIndex, 1 );
}
// 判断 nodes 列表中是否存在 judge 的祖先
function hasAncestor( nodes, judge ) {
for ( var i = nodes.length - 1; i >= 0; --i ) {
if ( nodes[ i ].isAncestorOf( judge ) ) return true;
}
return false;
}
// 按照拓扑排序
nodes.sort( function ( node1, node2 ) {
return node1.getLevel() - node2.getLevel();
} );
// 因为是拓扑有序的,所以只需往上查找
while ( ( judge = nodes.pop() ) ) {
if ( !hasAncestor( nodes, judge ) ) {
ancestors.push( judge );
}
}
return ancestors;
} }
}; };
}() ); }() );
\ No newline at end of file
...@@ -75,36 +75,7 @@ var DragBox = kity.createClass( "DragBox", { ...@@ -75,36 +75,7 @@ var DragBox = kity.createClass( "DragBox", {
// 2. 从后往前枚举排序的结果,如果发现枚举目标之前存在其祖先, // 2. 从后往前枚举排序的结果,如果发现枚举目标之前存在其祖先,
// 则排除枚举目标作为拖放源,否则加入拖放源 // 则排除枚举目标作为拖放源,否则加入拖放源
_calcDragSources: function () { _calcDragSources: function () {
var nodes = this._minder.getSelectedNodes().slice( 0 ), this._dragSources = this._minder.getSelectedAncestors();
ancestors = [],
judge;
// 根节点不参与计算
var rootIndex = nodes.indexOf( this._minder.getRoot() );
if ( ~rootIndex ) {
nodes.splice( rootIndex, 1 );
}
// 判断 nodes 列表中是否存在 judge 的祖先
function hasAncestor( nodes, judge ) {
for ( var i = nodes.length - 1; i >= 0; --i ) {
if ( nodes[ i ].isAncestorOf( judge ) ) return true;
}
return false;
}
// 按照拓扑排序
nodes.sort( function ( node1, node2 ) {
return node1.getLevel() - node2.getLevel();
} );
// 因为是拓扑有序的,所以只需往上查找
while ( ( judge = nodes.pop() ) ) {
if ( !hasAncestor( nodes, judge ) ) {
ancestors.push( judge );
}
}
this._dragSources = ancestors;
}, },
......
...@@ -32,7 +32,9 @@ Minder.Receiver = kity.createClass('Receiver',{ ...@@ -32,7 +32,9 @@ Minder.Receiver = kity.createClass('Receiver',{
var text = this.container.firstChild; var text = this.container.firstChild;
this.range = range; this.range = range;
range.setStart(text || this.container, this.index).collapse(true); range.setStart(text || this.container, this.index).collapse(true);
var me = this;
setTimeout(function(){ setTimeout(function(){
me.container.focus();
range.select() range.select()
}); });
return this; return this;
......
...@@ -29,6 +29,7 @@ var ViewDragger = kity.createClass( "ViewDragger", { ...@@ -29,6 +29,7 @@ var ViewDragger = kity.createClass( "ViewDragger", {
if ( dragger.isEnabled() ) { if ( dragger.isEnabled() ) {
lastPosition = e.getPosition(); lastPosition = e.getPosition();
e.stopPropagation(); e.stopPropagation();
e.originEvent.preventDefault();
} }
// 点击未选中的根节点临时开启 // 点击未选中的根节点临时开启
else if ( e.getTargetNode() == this.getRoot() && else if ( e.getTargetNode() == this.getRoot() &&
......
...@@ -614,9 +614,11 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -614,9 +614,11 @@ KityMinder.registerModule( "LayoutDefault", function () {
Layout.connect = null; Layout.connect = null;
Layout.shicon = null; Layout.shicon = null;
} else { } else {
try {
_buffer[ 0 ].getRenderContainer().remove(); _buffer[ 0 ].getRenderContainer().remove();
Layout.connect.remove(); Layout.connect.remove();
if ( Layout.shicon ) Layout.shicon.remove(); if ( Layout.shicon ) Layout.shicon.remove();
} catch ( error ) {}
} }
_buffer = _buffer.concat( _buffer[ 0 ].getChildren() ); _buffer = _buffer.concat( _buffer[ 0 ].getChildren() );
_buffer.shift(); _buffer.shift();
......
KityMinder.registerModule( "pasteModule", function () {
var km = this;
//getSelectedTopNodes
return {
};
} );
\ No newline at end of file
...@@ -69,7 +69,8 @@ KityMinder.registerModule( 'Zoom', function () { ...@@ -69,7 +69,8 @@ KityMinder.registerModule( 'Zoom', function () {
'ready': function () { 'ready': function () {
this._zoomValue = 1; this._zoomValue = 1;
}, },
'mousewheel': function ( e ) { // disable mouse wheel
'mousewheel_': function ( e ) {
var delta = e.originEvent.wheelDelta; var delta = e.originEvent.wheelDelta;
var me = this; var me = this;
......
/*
http://www.xmind.net/developer/
Parsing XMind file
XMind files are generated in XMind Workbook (.xmind) format, an open format that is based on the principles of OpenDocument. It consists of a ZIP compressed archive containing separate XML documents for content and styles, a .jpg image file for thumbnails, and directories for related attachments.
*/
KityMinder.registerProtocal( 'xmind', {
fileExtension: '.xmind',
} );
\ No newline at end of file
# XMind 文件格式
## 官方说明
官方上对 XMind 文件的介绍是这样的:
> XMind files are generated in XMind Workbook (.xmind) format, an open format that is based on the principles of OpenDocument. It consists of a ZIP compressed archive containing separate XML documents for content and styles, a .jpg image file for thumbnails, and directories for related attachments.
整体来说这是一个 zip 包,里面有两个 XML 文档,一个存放内容,一个存放样式,还有一个 jpg 格式的缩略图。如果有附件,还会有存放附件的目录。
## 解析和生成目标
只解析 KityMinder 支持部分的文件内容;只生成 KityMinder 和 XMind 都支持的文件内容
\ No newline at end of file
//dropmenu 类 //dropmenu 类
KM.ui.define('dropmenu', { KM.ui.define('dropmenu', {
tmpl: '<ul class="kmui-dropdown-menu" aria-labelledby="dropdownMenu" >' + tmpl: '<ul class="kmui-dropdown-menu" aria-labelledby="dropdownMenu" >' +
this.subTmpl + '<%if(data && data.length){for(var i=0,ci;ci=data[i++];){%>' +
'<%if(ci.divider){%><li class="kmui-divider"></li><%}else{%>' +
'<li <%if(ci.active||ci.disabled){%>class="<%= ci.active|| \'\' %> <%=ci.disabled||\'\' %>" <%}%> data-value="<%= ci.value%>" data-label="<%= ci.label%>">' +
'<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= ci.label%></a>' +
'</li><%}}%>' +
'<%}%>'+
'</ul>', '</ul>',
subTmpl: '<%if(data && data.length){for(var i=0,ci;ci=data[i++];){%>' + subTmpl:'<%if(data && data.length){for(var i=0,ci;ci=data[i++];){%>' +
'<%if(ci.divider){%><li class="kmui-divider"></li><%}else{%>' + '<%if(ci.divider){%><li class="kmui-divider"></li><%}else{%>' +
'<li <%if(ci.active||ci.disabled){%>class="<%= ci.active|| \'\' %> <%=ci.disabled||\'\' %>" <%}%> data-value="<%= ci.value%>" data-label="<%= ci.label%>">' + '<li <%if(ci.active||ci.disabled){%>class="<%= ci.active|| \'\' %> <%=ci.disabled||\'\' %>" <%}%> data-value="<%= ci.value%>" data-label="<%= ci.label%>">' +
'<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= ci.label%></a>' + '<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= ci.label%></a>' +
...@@ -16,7 +21,7 @@ KM.ui.define('dropmenu', { ...@@ -16,7 +21,7 @@ KM.ui.define('dropmenu', {
}, },
setData:function(items){ setData:function(items){
this.root().html($.parseTmpl(this.subTmpl,items)) this.root().html($.parseTmpl(this.subTmpl,items));
return this; return this;
}, },
...@@ -56,9 +61,15 @@ KM.ui.define('dropmenu', { ...@@ -56,9 +61,15 @@ KM.ui.define('dropmenu', {
}) })
}) })
} }
}) });
}, },
_initEvent:function(){
this.root().on('mouseover','li[class="kmui-dropdown-submenu',function(e){
var $submenu = $(this).data('widget');
$submenu.kmui().show($(this),'right','position',5,2)
});
},
disabled: function (cb) { disabled: function (cb) {
$('li[class!=kmui-divider]', this.root()).each(function () { $('li[class!=kmui-divider]', this.root()).each(function () {
var $el = $(this); var $el = $(this);
...@@ -89,12 +100,21 @@ KM.ui.define('dropmenu', { ...@@ -89,12 +100,21 @@ KM.ui.define('dropmenu', {
return currentVal return currentVal
} }
}, },
appendItem: function ( item ) {
var itemTpl = '<%if(item.divider){%><li class="kmui-divider"></li><%}else{%>' +
'<li <%if(item.active||item.disabled){%>class="<%= item.active|| \'\' %> <%=item.disabled||\'\' %>" <%}%> data-value="<%= item.value%>" data-label="<%= item.label%>">' +
'<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= item.label%></a>' +
'</li><%}%>';
var html = $.parseTmpl( itemTpl, item );
var $item = $( html ).click( item.click );
this.root().append( $item );
},
addSubmenu: function (label, menu, index) { addSubmenu: function (label, menu, index) {
index = index || 0; index = index || 0;
var $list = $('li[class!=kmui-divider]', this.root()); var $list = $('li[class!=kmui-divider]', this.root());
var $node = $('<li class="kmui-dropdown-submenu"><a tabindex="-1" href="#">' + label + '</a></li>').append(menu); var $node = $('<li class="kmui-dropdown-submenu"><a tabindex="-1" href="#">' + label + '</a></li>').append(menu);
$node.data('widget',menu);
if (index >= 0 && index < $list.length) { if (index >= 0 && index < $list.length) {
$node.insertBefore($list[index]); $node.insertBefore($list[index]);
} else if (index < 0) { } else if (index < 0) {
......
//menu 类 //menu 类
KM.ui.define('menu',{ KM.ui.define('menu',{
show : function($obj,dir,fnname,topOffset,leftOffset){ show : function($obj,dir,fnname,topOffset,leftOffset){
fnname = fnname || 'position'; fnname = fnname || 'position';
if(this.trigger('beforeshow') === false){ if(this.trigger('beforeshow') === false){
return; return;
}else{ }else{
this.root().css($.extend({display:'block'},$obj ? { this.root().css($.extend({display:'block'},$obj ? {
top : $obj[fnname]().top + ( dir == 'right' ? 0 : $obj.outerHeight()) - (topOffset || 0), top : $obj[fnname]().top + ( dir == 'right' ? 0 : $obj.outerHeight()) - (topOffset || 0),
left : $obj[fnname]().left + (dir == 'right' ? $obj.outerWidth() : 0) - (leftOffset || 0) left : $obj[fnname]().left + (dir == 'right' ? $obj.outerWidth() : 0) - (leftOffset || 0)
...@@ -31,9 +31,16 @@ KM.ui.define('menu',{ ...@@ -31,9 +31,16 @@ KM.ui.define('menu',{
var me = this; var me = this;
if(!$obj.data('$mergeObj')){ if(!$obj.data('$mergeObj')){
$obj.data('$mergeObj',me.root()); $obj.data('$mergeObj',me.root());
if($obj.kmui()){
$obj.on('wrapclick',function(evt){ $obj.on('wrapclick',function(evt){
me.show() me.supper.show.call(me,$obj,'','offset',15)
}); });
}else{
$obj.on('click',function(evt){
me.supper.show.call(me,$obj,'','offset',15)
})
}
me.register('click',$obj,function(evt){ me.register('click',$obj,function(evt){
me.hide() me.hide()
}); });
......
.kmui-combobox-menu{ .kmui-combobox-menu{
position: absolute; position: absolute;
top: 100%;
left: 2px;
display: none; display: none;
list-style: none; list-style: none;
text-decoration: none; text-decoration: none;
margin: 0; margin: 0;
padding:5px; padding: 5px 0;
background-color: #ffffff; background-color: #ffffff;
font-size: 12px; font-size: 12px;
box-shadow: 2px 2px 5px rgba(0, 0, 0, .5); box-shadow: 2px 5px 15px rgba(0, 0, 0, .5);
border-radius: 3px;
min-width: 160px; min-width: 160px;
_width: 160px; _width: 160px;
-webkit-transform: translateX(2px); -webkit-transform: translateX(2px);
...@@ -18,38 +17,55 @@ ...@@ -18,38 +17,55 @@
.kmui-combobox-menu .kmui-combobox-item { .kmui-combobox-menu .kmui-combobox-item {
display: block; display: block;
border: 1px solid white; padding: 2px 15px 2px 2px;
white-space:nowrap; white-space:nowrap;
} }
.kmui-combobox-menu .kmui-combobox-item:first-child:last-child {
border-radius: 2px;
}
.kmui-combobox-menu .kmui-combobox-item-label { .kmui-combobox-menu .kmui-combobox-item-label {
height: 25px; height: 25px;
line-height: 25px; line-height: 25px;
display: inline-block; display: inline-block;
vertical-align: middle;
_display: inline; _display: inline;
_zoom: 1; _zoom: 1;
margin-left: 10px;
} }
.kmui-combobox-menu .kmui-combobox-item:hover, .kmui-combobox-menu .kmui-combobox-stack-item:hover, .kmui-combobox-menu .kmui-combobox-item-hover { .kmui-combobox-menu .kmui-combobox-item:hover, .kmui-combobox-menu .kmui-combobox-stack-item:hover, .kmui-combobox-menu .kmui-combobox-item-hover {
background-color: #d5e1f2; background: #0099f2; /* Old browsers */
padding: 0; /* IE9 SVG, needs conditional override of 'filter' to 'none' */
border: 1px solid #a3bde3; background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwOTlmMiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjNDA5NmVlIiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwNzZkZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(top, #0099f2 0%, #4096ee 0%, #0076dd 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#0099f2), color-stop(0%,#4096ee), color-stop(100%,#0076dd)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* IE10+ */
background: linear-gradient(to bottom, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0099f2', endColorstr='#0076dd',GradientType=0 ); /* IE6-8 */
color: white;
/*border: 1px solid #a3bde3;*/
} }
.kmui-combobox-menu .kmui-combobox-item .kmui-combobox-icon { .kmui-combobox-menu .kmui-combobox-item .kmui-combobox-icon {
display: inline-block; display: inline-block;
*zoom: 1; *zoom: 1;
*display: inline; *display: inline;
width: 24px; width: 30px;
height: 25px; height: 12px;
background: red; line-height: 12px;
vertical-align: bottom; vertical-align: middle;
background: url(../images/ok.gif) no-repeat 1000px 1000px; background: url(../images/check.png) no-repeat 1000px 1000px;
} }
.kmui-combobox-menu .kmui-combobox-checked .kmui-combobox-icon { .kmui-combobox-menu .kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 7px; background-position: center 0;
}
.kmui-combobox-menu .kmui-combobox-checked:hover .kmui-combobox-icon {
background-position: center -12px;
} }
...@@ -65,133 +81,13 @@ ...@@ -65,133 +81,13 @@
/* 字体样式校正 */ /* 字体样式校正 */
.kmui-combobox-fontsize .kmui-combobox-item-0.kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 7px;
}
.kmui-combobox-fontsize .kmui-combobox-item-1.kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 7px;
}
.kmui-combobox-fontsize .kmui-combobox-item-2.kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 7px;
}
.kmui-combobox-fontsize .kmui-combobox-item-3.kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 7px;
}
/* 24 */
.kmui-combobox-fontsize .kmui-combobox-item-4 .kmui-combobox-item-label {
height: 27px;
line-height: 27px;
}
.kmui-combobox-fontsize .kmui-combobox-item-4.kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 5px;
}
/* 32 */
.kmui-combobox-fontsize .kmui-combobox-item-5 .kmui-combobox-item-label {
height: 31px;
line-height: 31px;
}
.kmui-combobox-fontsize .kmui-combobox-item-5.kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 4px;
}
/* 48 */
.kmui-combobox-fontsize .kmui-combobox-item-6 .kmui-combobox-item-label {
height: 47px;
line-height: 47px;
}
/*.kmui-combobox-fontsize .kmui-combobox-item-6 .kmui-combobox-icon {*/
/*height: 25px;*/
/*margin-bottom: 11px;*/
/*}*/
/*.kmui-combobox-fontsize .kmui-combobox-item-6.kmui-combobox-checked .kmui-combobox-icon {*/
/*background-position: 10px 7px;*/
/*}*/
/* 段落样式校正 */
/* h1 */
.kmui-combobox-paragraph .kmui-combobox-item-1 .kmui-combobox-item-label {
font-size: 32px;
height: 36px;
line-height: 36px;
}
.kmui-combobox-paragraph .kmui-combobox-item-1 .kmui-combobox-icon {
height: 25px;
margin-bottom: 5px;
}
.kmui-combobox-paragraph .kmui-combobox-item-1.kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 7px;
}
/* h2 */
.kmui-combobox-paragraph .kmui-combobox-item-2 .kmui-combobox-item-label {
font-size: 28px;
height: 27px;
line-height: 27px;
}
.kmui-combobox-paragraph .kmui-combobox-item-2 .kmui-combobox-icon {
margin-bottom: 5px;
}
.kmui-combobox-paragraph .kmui-combobox-item-2.kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 10px;
}
/* h3 */
.kmui-combobox-paragraph .kmui-combobox-item-3 .kmui-combobox-item-label {
font-size: 24px;
height: 25px;
line-height: 25px;
}
.kmui-combobox-paragraph .kmui-combobox-item-3 .kmui-combobox-icon {
height: 25px;
margin-bottom: 5px;
}
.kmui-combobox-paragraph .kmui-combobox-item-3.kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 11px;
}
/* h4 */
.kmui-combobox-paragraph .kmui-combobox-item-4 .kmui-combobox-item-label {
font-size: 18px;
height: 25px;
line-height: 25px;
}
.kmui-combobox-paragraph .kmui-combobox-item-4.kmui-combobox-checked .kmui-combobox-icon {
background-position: 10px 6px;
}
/* h5 */
.kmui-combobox-paragraph .kmui-combobox-item-5 .kmui-combobox-item-label {
font-size: 16px;
}
/* h6 */
.kmui-combobox-paragraph .kmui-combobox-item-6 .kmui-combobox-item-label {
font-size: 12px;
}
.kmui-combobox-menu .kmui-combobox-item-disabled { .kmui-combobox-menu .kmui-combobox-item-disabled {
color: black;
opacity: 0.3; opacity: 0.3;
} }
.kmui-combobox-menu .kmui-combobox-item-disabled:HOVER { .kmui-combobox-menu .kmui-combobox-item-disabled:hover {
border-color: #fff; border-color: #fff;
background-color: #fff; background: #fff;
color: black;
} }
\ No newline at end of file
.kmui-modal { .kmui-modal {
position: fixed; position: fixed;
top: 10px; top: 60px;
right:10px; right:10px;
background-color: #ffffff; background-color: #ffffff;
outline: 0; outline: 0;
......
.kmui-dropdown-menu { .kmui-dropdown-menu {
position: absolute; position: absolute;
top: 100%;
left: 0;
z-index: 1000; z-index: 1000;
display: none; display: none;
float: left;
min-width: 160px; min-width: 160px;
padding:5px; padding: 5px 0;
margin: 2px 0 0; font-size: 12px;
font-size: 14px;
list-style: none; list-style: none;
background-color: #ffffff; background-color: #ffffff;
border: 1px solid #cccccc; border-radius: 3px;
border: 1px solid rgba(0, 0, 0, 0.15); box-shadow: 2px 5px 15px rgba(0, 0, 0, .5);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box; background-clip: padding-box;
font-family: Arial, "Heiti SC", "Microsoft Yahei";
} }
.kmui-dropdown-menu.pull-right { .kmui-dropdown-menu.pull-right {
...@@ -27,17 +20,22 @@ ...@@ -27,17 +20,22 @@
.kmui-dropdown-menu .kmui-divider { .kmui-dropdown-menu .kmui-divider {
height: 1px; height: 1px;
margin: 9px 0; margin: 5px 0;
overflow: hidden; overflow: hidden;
background-color: #e5e5e5; background-color: #e5e5e5;
} }
.kmui-dropdown-menu .kmui-divider:first-child,
.kmui-dropdown-menu .kmui-divider:last-child {
display: none;
}
.kmui-dropdown-menu > li > a { .kmui-dropdown-menu > li > a {
display: block; display: block;
padding: 3px 20px; padding: 2px 15px 2px 30px;
height: 25px;
line-height: 25px;
clear: both; clear: both;
font-weight: normal; font-weight: normal;
line-height: 1.428571429;
color: #333333; color: #333333;
white-space: nowrap; white-space: nowrap;
text-decoration: none; text-decoration: none;
...@@ -45,8 +43,18 @@ ...@@ -45,8 +43,18 @@
.kmui-dropdown-menu > li > a:hover, .kmui-dropdown-menu > li > a:hover,
.kmui-dropdown-menu > li > a:focus { .kmui-dropdown-menu > li > a:focus {
color: #262626; background: #0099f2; /* Old browsers */
background-color: #d5e1f2; /* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwOTlmMiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjNDA5NmVlIiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwNzZkZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(top, #0099f2 0%, #4096ee 0%, #0076dd 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#0099f2), color-stop(0%,#4096ee), color-stop(100%,#0076dd)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* IE10+ */
background: linear-gradient(to bottom, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0099f2', endColorstr='#0076dd',GradientType=0 ); /* IE6-8 */
color: white;
} }
.kmui-dropdown-menu > .active > a, .kmui-dropdown-menu > .active > a,
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
border-radius: 4px; border-radius: 4px;
box-shadow: 3px 3px 8px rgba(0,0,0, .5); box-shadow: 3px 3px 8px rgba(0,0,0, .5);
} }
.kmui-container .kmui-editor-body{ .kmui-container .kmui-editor-body {
background: rgb(50, 60, 61) url(../images/grid.png) repeat; background: rgb(50, 60, 61) url(../images/grid.png) repeat;
line-height: 0; /*line-height: 0;*/
overflow: hidden; overflow: hidden;
} }
svg { svg {
......
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