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
8f055633
Commit
8f055633
authored
Mar 25, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
草稿箱大小限制;文件编辑状态调整
parent
8057635b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
15 deletions
+13
-15
draftmanager.js
social/draftmanager.js
+5
-3
social.js
social/social.js
+7
-12
view.js
src/module/view.js
+1
-0
No files found.
social/draftmanager.js
View file @
8f055633
function
DraftManager
(
minder
)
{
var
current
=
null
,
localStorage
=
window
.
localStorage
,
drafts
;
drafts
,
MAX_SIZE
=
15
;
init
();
...
...
@@ -32,7 +33,7 @@ function DraftManager( minder ) {
}
function
store
()
{
localStorage
.
setItem
(
'drafts'
,
JSON
.
stringify
(
drafts
)
);
localStorage
.
setItem
(
'drafts'
,
JSON
.
stringify
(
drafts
.
slice
(
0
,
MAX_SIZE
)
)
);
}
function
create
(
path
)
{
...
...
@@ -84,6 +85,7 @@ function DraftManager( minder ) {
current
.
update
=
new
Date
();
store
();
}
return
current
;
}
function
sync
()
{
...
...
@@ -92,7 +94,7 @@ function DraftManager( minder ) {
}
function
list
()
{
return
drafts
.
slice
();
return
drafts
.
slice
(
0
,
15
);
}
function
remove
(
remove_index
)
{
...
...
social/social.js
View file @
8f055633
...
...
@@ -328,7 +328,9 @@ $( function () {
draft
=
draftManager
.
openByPath
(
path
);
setRemotePath
(
path
,
!
draft
||
draft
.
sync
);
if
(
draft
)
{
watchingChanges
=
false
;
draftManager
.
load
();
watchingChanges
=
true
;
}
else
{
loadRemote
();
}
...
...
@@ -338,12 +340,9 @@ $( function () {
// 新建文件
function
newFile
()
{
setRemotePath
(
null
,
true
);
watchingChanges
=
false
;
minder
.
importData
(
'新建脑图'
,
'plain'
);
draftManager
.
create
();
watchingChanges
=
true
;
minder
.
importData
(
'新建脑图'
,
'plain'
)
;
minder
.
execCommand
(
'camera'
,
minder
.
getRoot
()
);
$user_btn
.
text
(
'<新建脑图>'
);
}
function
generateRemotePath
()
{
...
...
@@ -471,14 +470,10 @@ $( function () {
function
watchChanges
()
{
minder
.
on
(
'contentchange'
,
function
()
{
if
(
!
watchingChanges
)
return
;
var
currentData
=
minder
.
exportData
(
'json'
);
if
(
watchChanges
.
lastData
!=
currentData
)
{
if
(
currentAccount
)
{
$save_btn
.
disabled
(
false
).
text
(
'保存'
);
watchChanges
.
lastData
=
currentData
;
setRemotePath
(
remotePath
,
false
);
}
draftManager
.
save
();
var
current
=
draftManager
.
save
();
if
(
currentAccount
)
{
$save_btn
.
disabled
(
current
.
sync
).
text
(
'保存'
);
setRemotePath
(
remotePath
,
current
.
sync
);
}
}
);
}
...
...
src/module/view.js
View file @
8f055633
...
...
@@ -89,6 +89,7 @@ KityMinder.registerModule( 'View', function () {
}
else
{
minder
.
rollbackStatus
();
}
this
.
setContentChanged
(
false
);
},
queryState
:
function
(
minder
)
{
...
...
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