Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
be73a534
Commit
be73a534
authored
May 08, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
04b2edfe
635f2491
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
37 deletions
+66
-37
CHANGELOG.md
CHANGELOG.md
+5
-3
social.js
social/social.js
+44
-23
minder.data.js
src/core/minder.data.js
+5
-5
dragtree.js
src/module/dragtree.js
+3
-0
layout.js
src/module/layout.js
+2
-1
view.js
src/module/view.js
+7
-5
No files found.
CHANGELOG.md
View file @
be73a534
...
...
@@ -2,11 +2,13 @@
# KityMinder 更新日志
##1.1.3
###功能更新
1.
添加保存时可修改
文件名
2.
添加
超链接功能
1.
保存时可自定义
文件名
2.
添加
/删除超链接,导入第三方格式支持超链接
3.
选中节点时,按F2直接进入文字编辑状态
4.
添加展开收起节点
4.
"展开全部节点""收起全部节点"功能
5.
当前选中的高亮的节点可直接进行文字编辑
6.
添加右键选中节点,显示编辑节点的快捷键和菜单
##问题修复
1.
修复当滚动鼠标滚轮时,光标不跟着移动的问题
...
...
social/social.js
View file @
be73a534
...
...
@@ -79,7 +79,7 @@ $( function () {
minder
=
window
.
km
,
// 草稿箱实例
draftManager
=
window
.
draftManager
||
(
window
.
draftManager
=
new
window
.
DraftManager
(
minder
)
)
,
draftManager
,
// 当前是否要检测文档内容是否变化的开关
watchingChanges
=
true
,
...
...
@@ -99,8 +99,8 @@ $( function () {
loadShare
();
bindShortCuts
();
bindDraft
();
watchChanges
();
if
(
!
loadPath
()
&&
!
isShareLink
)
loadDraft
(
0
);
draftManager
&&
watchChanges
();
if
(
draftManager
&&
!
loadPath
()
&&
!
isShareLink
)
loadDraft
(
0
);
}
// 创建 UI
...
...
@@ -159,14 +159,16 @@ $( function () {
},
30
);
}
);
var
clip
=
new
window
.
ZeroClipboard
(
$copy_url_btn
,
{
hoverClass
:
'hover'
,
activeClass
:
'active'
}
);
clip
.
on
(
'dataRequested'
,
function
(
client
,
args
)
{
$copy_url_btn
.
loading
(
'已复制'
);
clearTimeout
(
copyTrickTimer
);
}
);
if
(
window
.
ZeroClipboard
)
{
var
clip
=
new
window
.
ZeroClipboard
(
$copy_url_btn
,
{
hoverClass
:
'hover'
,
activeClass
:
'active'
}
);
clip
.
on
(
'dataRequested'
,
function
(
client
,
args
)
{
$copy_url_btn
.
loading
(
'已复制'
);
clearTimeout
(
copyTrickTimer
);
}
);
}
}
// 初始化云平台 frontia
...
...
@@ -207,11 +209,16 @@ $( function () {
$share_btn
.
loading
(
false
);
return
notice
(
'加载分享内容失败!请确认分享链接正确。'
);
}
var
draft
=
draftManager
.
openByPath
(
'share/'
+
shareId
);
if
(
draft
)
{
draftManager
.
load
();
if
(
draftManager
)
{
var
draft
=
draftManager
.
openByPath
(
'share/'
+
shareId
);
if
(
draft
)
{
draftManager
.
load
();
}
else
{
draftManager
.
create
(
'share/'
+
shareId
);
minder
.
importData
(
ret
.
result
[
0
].
obj
.
shareMinder
.
data
,
'json'
);
}
}
else
{
draftManager
.
create
(
'share/'
+
shareId
);
minder
.
importData
(
ret
.
result
[
0
].
obj
.
shareMinder
.
data
,
'json'
);
}
setRemotePath
(
null
,
false
);
...
...
@@ -537,11 +544,14 @@ $( function () {
minder
.
importData
(
data
,
format
);
if
(
!
draftManager
.
openByPath
(
remotePath
)
)
{
draftManager
.
create
();
if
(
draftManager
)
{
if
(
!
draftManager
.
openByPath
(
remotePath
)
)
{
draftManager
.
create
();
}
draftManager
.
save
(
remotePath
);
draftManager
.
sync
();
}
draftManager
.
save
(
remotePath
);
draftManager
.
sync
();
minder
.
execCommand
(
'camera'
,
minder
.
getRoot
()
);
$user_btn
.
loading
(
false
).
text
(
getFileName
(
remotePath
)
);
...
...
@@ -570,13 +580,13 @@ $( function () {
// 点击文件菜单
function
openFile
(
e
)
{
var
path
=
$
(
this
).
data
(
'value'
);
var
draft
=
draftManager
.
getCurrent
();
var
draft
=
draftManager
&&
draftManager
.
getCurrent
();
if
(
draft
&&
draft
.
path
==
path
)
{
if
(
!
draft
.
sync
&&
window
.
confirm
(
'“'
+
getFileName
(
path
)
+
'”在草稿箱包含未保存的更改,确定加载网盘版本覆盖草稿箱中的版本吗?'
)
)
{
setRemotePath
(
path
,
true
);
loadRemote
();
}
}
else
{
}
else
if
(
draftManager
)
{
draft
=
draftManager
.
openByPath
(
path
);
setRemotePath
(
path
,
!
draft
||
draft
.
sync
);
if
(
draft
)
{
...
...
@@ -586,6 +596,9 @@ $( function () {
}
else
{
loadRemote
();
}
}
else
{
setRemotePath
(
path
,
true
);
loadRemote
();
}
}
...
...
@@ -625,8 +638,10 @@ $( function () {
addToRecentMenu
(
[
savedFile
]
);
}
setRemotePath
(
savedFile
.
path
,
true
);
draftManager
.
save
(
remotePath
);
draftManager
.
sync
();
if
(
draftManager
)
{
draftManager
.
save
(
remotePath
);
draftManager
.
sync
();
}
clearTimeout
(
timeout
);
}
else
{
error
(
'保存到云盘失败,可能是网络问题导致!'
);
...
...
@@ -751,6 +766,12 @@ $( function () {
}
function
bindDraft
()
{
if
(
!
draftManager
)
{
if
(
window
.
DraftManager
)
{
draftManager
=
new
window
.
DraftManager
(
minder
);
}
}
$draft_menu
.
delegate
(
'a.delete'
,
'click'
,
function
(
e
)
{
var
$li
=
$
(
this
).
closest
(
'li.draft-item'
);
draftManager
.
remove
(
+
$li
.
data
(
'draft-index'
)
);
...
...
src/core/minder.data.js
View file @
be73a534
...
...
@@ -120,7 +120,7 @@ kity.extendClass( Minder, {
return
d
;
}
var
t1
=
ts
(
new
Date
(),
'开始解析'
);
//
var t1 = ts( new Date(), '开始解析' );
//*******************
json
=
params
.
json
||
(
params
.
json
=
protocal
.
decode
(
local
)
);
...
...
@@ -129,20 +129,20 @@ kity.extendClass( Minder, {
var
self
=
this
;
json
.
then
(
local
,
function
(
data
)
{
//*******************
var
t2
=
ts
(
new
Date
(),
'解压解析耗时'
,
t1
);
//
var t2 = ts( new Date(), '解压解析耗时', t1 );
//*******************
self
.
_afterImportData
(
data
,
params
);
//*******************
ts
(
new
Date
(),
'渲染耗时'
,
t2
);
//
ts( new Date(), '渲染耗时', t2 );
//*******************
}
);
}
else
{
//*******************
var
t2
=
ts
(
new
Date
(),
'解压解析耗时'
,
t1
);
//
var t2 = ts( new Date(), '解压解析耗时', t1 );
//*******************
this
.
_afterImportData
(
json
,
params
);
//*******************
ts
(
new
Date
(),
'渲染耗时'
,
t2
);
//
ts( new Date(), '渲染耗时', t2 );
//*******************
}
return
this
;
...
...
src/module/dragtree.js
View file @
be73a534
...
...
@@ -22,6 +22,9 @@ var MoveToParentCommand = kity.createClass( 'MoveToParentCommand', {
node
=
nodes
[
i
];
if
(
node
.
getParent
()
)
{
minder
.
removeNode
(
[
node
]
);
if
(
!
parent
.
isExpanded
()
&&
parent
.
getChildren
().
length
>
0
&&
parent
.
getType
()
!==
'root'
)
{
minder
.
expandNode
(
parent
);
}
minder
.
appendChildNode
(
parent
,
node
);
}
}
...
...
src/module/layout.js
View file @
be73a534
...
...
@@ -210,7 +210,7 @@ KityMinder.registerModule( "LayoutModule", function () {
return
null
;
}
km
.
select
(
selectedNode
,
true
);
km
.
textEditNode
(
selectedNode
);
km
.
textEditNode
(
selectedNode
);
},
queryState
:
function
(
km
)
{
var
selectedNode
=
km
.
getSelectedNode
();
...
...
@@ -244,6 +244,7 @@ KityMinder.registerModule( "LayoutModule", function () {
var
ico
=
e
.
kityEvent
.
targetShape
&&
e
.
kityEvent
.
targetShape
.
container
;
if
(
ico
&&
ico
.
class
===
"shicon"
)
{
this
.
expandNode
(
ico
);
this
.
fire
(
'contentchange'
);
}
},
"resize"
:
function
(
e
)
{
...
...
src/module/view.js
View file @
be73a534
...
...
@@ -27,13 +27,14 @@ var ViewDragger = kity.createClass( "ViewDragger", {
lastPosition
=
null
,
currentPosition
=
null
;
this
.
_minder
.
on
(
'normal.beforemousedown readonly.beforemousedown'
,
function
(
e
)
{
this
.
_minder
.
on
(
'normal.beforemousedown readonly.beforemousedown
readonly.beforetouchstart
'
,
function
(
e
)
{
// 点击未选中的根节点临时开启
if
(
e
.
getTargetNode
()
==
this
.
getRoot
()
&&
(
!
this
.
getRoot
().
isSelected
()
||
!
this
.
isSingleSelect
()
)
)
{
lastPosition
=
e
.
getPosition
();
dragger
.
setEnabled
(
true
);
isRootDrag
=
true
;
e
.
originEvent
.
preventDefault
();
var
me
=
this
;
setTimeout
(
function
()
{
me
.
setStatus
(
'hand'
);
...
...
@@ -41,16 +42,15 @@ var ViewDragger = kity.createClass( "ViewDragger", {
}
}
)
.
on
(
'hand.beforemousedown'
,
function
(
e
)
{
.
on
(
'hand.beforemousedown
hand.beforetouchend
'
,
function
(
e
)
{
// 已经被用户打开拖放模式
if
(
dragger
.
isEnabled
()
)
{
lastPosition
=
e
.
getPosition
();
e
.
stopPropagation
();
e
.
originEvent
.
preventDefault
();
}
}
)
.
on
(
'hand.beforemousemove'
,
function
(
e
)
{
.
on
(
'hand.beforemousemove
hand.beforetouchmove
'
,
function
(
e
)
{
if
(
lastPosition
)
{
currentPosition
=
e
.
getPosition
();
...
...
@@ -58,6 +58,8 @@ var ViewDragger = kity.createClass( "ViewDragger", {
var
offset
=
kity
.
Vector
.
fromPoints
(
lastPosition
,
currentPosition
);
dragger
.
move
(
offset
);
e
.
stopPropagation
();
e
.
preventDefault
();
e
.
originEvent
.
preventDefault
();
lastPosition
=
currentPosition
;
}
}
)
...
...
@@ -102,7 +104,7 @@ KityMinder.registerModule( 'View', function () {
base
:
Command
,
execute
:
function
(
km
,
focusNode
)
{
var
viewport
=
km
.
getPaper
().
getViewPort
();
var
offset
=
focusNode
.
getRenderContainer
().
getRenderBox
(
'
paper
'
);
var
offset
=
focusNode
.
getRenderContainer
().
getRenderBox
(
'
view
'
);
var
dx
=
viewport
.
center
.
x
-
offset
.
x
-
offset
.
width
/
2
,
dy
=
viewport
.
center
.
y
-
offset
.
y
;
km
.
getRenderContainer
().
fxTranslate
(
dx
,
dy
,
1000
,
"easeOutQuint"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment