Commit 37fe2751 authored by campaign's avatar campaign

Merge remote-tracking branch 'origin/release-1.3.0' into release-1.3.0

parents 4647bebe f1b00e74
......@@ -20,11 +20,14 @@ if (isset($_REQUEST['content'])) {
if (!$filename) {
$filename = "kikyminder";
}
if (isset($_REQUEST['iehack'])) {
$filename = urlencode($filename);
}
header("Content-type: application/octet-stream; charset=utf8; name=".urlencode($filename));
header("Accept-Length: ".strlen($content));
header("Content-Length: ".strlen($content));
header("Content-Disposition: attachment; filename=".urlencode($filename));
header("Content-Disposition: attachment; filename=".$filename);
header('Content-Description: File Transfer');
if (isset($_REQUEST['stamp'])) {
......
......@@ -20,7 +20,9 @@ var MinderEvent = kity.createClass('MindEvent', {
while (!findShape.minderNode && findShape.container) {
findShape = findShape.container;
}
return findShape.minderNode || null;
var node = findShape.minderNode;
if (node && findShape.getOpacity() < 1) return null;
return node || null;
},
stopPropagation: function() {
......@@ -151,7 +153,7 @@ kity.extendClass(Minder, {
callbacks[i].call(this, e);
/* this.getStatus() != lastStatus ||*/
if (e.shouldStopPropagationImmediately()) {
break;
}
......
......@@ -70,6 +70,7 @@ KityMinder.registerModule('TextEditModule', function() {
'normal.beforemousedown textedit.beforemousedown inputready.beforemousedown': function(e) {
//右键直接退出
if (e.isRightMB()) {
if (!e.getTargetNode()) this.setStatus('normal');
return;
}
......
......@@ -76,6 +76,10 @@ KityMinder.registerModule('Expand', function() {
if (!changed) return;
node.renderTree().getMinder().layout(100);
/* 如何加展开效果:
var vo = node.getVertexOut();
if (state == STATE_EXPAND) {
......@@ -99,6 +103,7 @@ KityMinder.registerModule('Expand', function() {
});
}
*/
}
// 将展开的操作和状态读取接口拓展到 MinderNode 上
......
......@@ -61,14 +61,13 @@ if (!kity.Browser.ie) {
// svg 含有 &nbsp; 符号导出报错 Entity 'nbsp' not defined
svgXml = svgXml.replace(/&nbsp;/g, '&#xa0;');
// blob = new Blob([svgXml], {
// type: 'image/svg+xml'
// });
blob = new Blob([svgXml], {
type: 'image/svg+xml'
});
// svgUrl = DomURL.createObjectURL(blob);
svgUrl = DomURL.createObjectURL(blob);
svgUrl = 'data:image/svg+xml;charset=utf-8,' + 
  encodeURIComponent(svgXml);
//svgUrl = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svgXml);
return {
width: width,
......
......@@ -118,7 +118,9 @@ KityMinder.registerUI('menu/save/download', function(minder) {
value: filename
}).appendTo($form);
$('<input name="iehack" value="&#9760;" />').appendTo($form);
if (kity.Browser.ie) {
$('<input name="iehack" value="1" />').appendTo($form);
}
$('<input name="stamp" />').val(stamp).appendTo($form);
var netdisk = minder.getUI('menu/save/netdisk');
......
......@@ -123,7 +123,7 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
var $title = minder.getUI('topbar/title').$title;
$filename.val(doc.title);
return doSave(doc.path, doc.protocol, doc, $title);
return doSave(doc.path, doc.protocol, doc, $title, 'leaveTheMenu');
}
function getSaveContext() {
......@@ -162,7 +162,7 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
var saving = 0;
function doSave(path, protocol, doc, $mask) {
function doSave(path, protocol, doc, $mask, leaveTheMenu) {
if (saving) return;
......@@ -202,7 +202,9 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
if ($mask) $mask.removeClass('loading');
if (!leaveTheMenu) {
$menu.hide();
}
doc.path = path;
doc.title = $filename.val();
......@@ -211,7 +213,9 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
$doc.save(doc);
setTimeout($finder.list, 500);
setTimeout(function() {
$finder.list($finder.pwd(), true);
}, 1499);
});
}
......
......@@ -19,6 +19,8 @@ KityMinder.registerUI('ribbon/idea/resource', function(minder) {
var $addInput = new FUI.Input().appendTo($resourcePanel);
$addInput.getElement().type = 'text';
var $addButton = new FUI.Button({
label: '添加'
}).appendTo($resourcePanel);
......@@ -31,8 +33,9 @@ KityMinder.registerUI('ribbon/idea/resource', function(minder) {
function addResource() {
var resource = $addInput.getValue();
var origin = minder.queryCommandValue('resource');
if (resource) {
if (!~origin.indexOf(resource)) origin.unshift(resource);
if (/\S/.test(resource)) {
if (!~origin.indexOf(resource)) origin.push(resource);
origin.sort();
minder.execCommand('resource', origin);
}
$addInput.setValue(null);
......@@ -68,6 +71,8 @@ KityMinder.registerUI('ribbon/idea/resource', function(minder) {
var resource = minder.queryCommandValue('resource');
var used = minder.getUsedResource();
used.sort();
switch (minder.queryCommandState('resource')) {
case 0:
$addInput.enable();
......
......@@ -80,6 +80,7 @@ input[type=text],
input[type=url] {
padding: 2px 5px;
height: 16px;
line-height: 16px;
outline: none;
border: 1px solid lighten(@tab-hover, 50%);
box-shadow: inset 0 1px 3px rgba(0,0,0,.05);
......
#resource-panel > .fui-panel-content > .fui-label-panel-content {
position: relative;
& > .fui-input {
width: 148px;
width: 140px;
margin: 2px 0 0;
vertical-align: middle;
box-sizing: content-box;
}
& > .fui-button {
......
......@@ -195,7 +195,7 @@
}
}
.shared-content {
.left, .right {
& > .left, & > .right {
float: left;
}
.m-logo {
......
......@@ -9,6 +9,14 @@
}
}
input::-ms-clear {
display: none;
}
input[type=search]::-ms-clear {
display: inline-block;
}
#tab-container .fui-button {
display: inline-block;
padding: 2px 5px 2px 3px;
......
......@@ -608,6 +608,7 @@ input[type=text],
input[type=url] {
padding: 2px 5px;
height: 16px;
line-height: 16px;
outline: none;
border: 1px solid #e5e7ec;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
......@@ -831,6 +832,12 @@ li {
.fui-disabled .fui-widget:active {
background-color: transparent;
}
input::-ms-clear {
display: none;
}
input[type=search]::-ms-clear {
display: inline-block;
}
#tab-container .fui-button {
display: inline-block;
padding: 2px 5px 2px 3px;
......@@ -2754,9 +2761,10 @@ body {
position: relative;
}
#resource-panel > .fui-panel-content > .fui-label-panel-content > .fui-input {
width: 148px;
width: 140px;
margin: 2px 0 0;
vertical-align: middle;
box-sizing: content-box;
}
#resource-panel > .fui-panel-content > .fui-label-panel-content > .fui-button {
left: auto;
......@@ -3180,8 +3188,8 @@ ul.resource-list li {
#public-share .share-body {
display: none;
}
.shared-content .left,
.shared-content .right {
.shared-content > .left,
.shared-content > .right {
float: left;
}
.shared-content .m-logo {
......
This diff is collapsed.
......@@ -66,7 +66,7 @@ KityMinder.registerUI('topbar/user', function(minder) {
window.open('http://i.baidu.com');
break;
case 'gotonetdisk':
window.open('http://pan.baidu.com');
window.open('http://pan.baidu.com/disk/home#path=/apps/kityminder');
break;
case 'switchuser':
switchUser();
......
......@@ -11,6 +11,8 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
var eve = minder.getUI('eve');
var instances = [];
/**
* 生成一个网盘的目录访问组件
*
......@@ -21,6 +23,8 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
var finder = eve.setup({});
instances.push(finder);
var base = '/apps/kityminder';
var currentPath = base;
......@@ -71,7 +75,6 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
});
});
function mkdir() {
if (mkdir.onprogress) {
return mkdir.onprogress.select();
......@@ -108,9 +111,13 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
fio.file.mkdir({
path: currentPath + name
}).then(function() {
return list(currentPath, true);
return new Promise(function(resolve) {
setTimeout(function() {
resolve(list(currentPath, true));
}, 200);
});
}, function(e) {
if (e.message.indexOf('31061') === 0) {
if (e.detail && e.detail.error_code == 31061) {
e.message = '已存在同名目录';
}
window.alert('创建目录失败:' + e.message);
......@@ -185,19 +192,9 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
});
}
function renderList(values) {
$list.empty();
var files = values[0];
files.sort(function(a, b) {
if (a.isDir > b.isDir) {
return -1;
} else if (a.isDir == b.isDir) {
return a.createTime > b.createTime ? -1 : 1;
} else return 1;
});
function renderFileList(files) {
$list.empty();
if (!files.length) {
$list.append('<li class="empty" disabled="disabled">' + minder.getLang('ui.emptydir') + '</li>');
} else {
......@@ -213,6 +210,30 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
.appendTo($list);
});
}
}
finder._renderFileList = renderFileList;
function renderList(values) {
var files = values[0];
files.sort(function(a, b) {
if (a.isDir > b.isDir) {
return -1;
} else if (a.isDir == b.isDir) {
return a.createTime > b.createTime ? -1 : 1;
} else return 1;
});
renderFileList(files);
// 通知其他 finder 更新
instances.forEach(function(instance) {
if (instance == finder) return;
if (instance.pwd() == currentPath)
instance._renderFileList(files);
});
fadeInList();
checkSelect();
......
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