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
1c5ab318
Commit
1c5ab318
authored
May 05, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://github.com/fex-team/kityminder
into dev
parents
4735257a
324518d3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
20 deletions
+97
-20
CHANGELOG.md
CHANGELOG.md
+2
-1
import.js
import.js
+1
-0
minder.js
src/core/minder.js
+14
-2
minder.preference.js
src/core/minder.preference.js
+74
-0
layout.js
src/module/layout.js
+5
-16
combobox.js
src/ui/combobox.js
+1
-1
No files found.
CHANGELOG.md
View file @
1c5ab318
...
...
@@ -4,7 +4,8 @@
###功能更新
1.
添加保存时可修改文件名
2.
添加超链接
3.
优化了当输入中文时,中文显示位置与光标距离过远的问题4.
3.
优化了当输入中文时,中文显示位置与光标距离过远的问题
4.
选中节点时,按F2直接进入文字编辑状态
###问题修复
1.
修复当滚动鼠标滚轮时,光标不跟着移动的问题
...
...
import.js
View file @
1c5ab318
...
...
@@ -18,6 +18,7 @@
,
'core/keymap.js'
,
'core/minder.lang.js'
,
'core/minder.defaultoptions.js'
,
'core/minder.preference.js'
,
'core/browser.js'
,
'module/geometry.js'
,
'module/history.js'
...
...
src/core/minder.js
View file @
1c5ab318
...
...
@@ -16,7 +16,18 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
fire
(
'ready'
);
},
getOptions
:
function
(
key
)
{
return
this
.
_options
[
key
];
var
val
;
if
(
key
){
val
=
this
.
getPreferences
(
key
);
return
val
===
null
||
val
===
undefined
?
this
.
_options
[
key
]
:
val
;
}
else
{
val
=
this
.
getPreferences
();
if
(
val
){
return
utils
.
extend
(
val
,
this
.
_options
,
true
)
}
else
{
return
this
.
_options
;
}
}
},
setDefaultOptions
:
function
(
key
,
val
,
cover
)
{
var
obj
=
{};
...
...
@@ -26,9 +37,10 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
obj
=
key
;
}
utils
.
extend
(
this
.
_options
,
obj
,
!
cover
);
},
setOptions
:
function
(
key
,
val
)
{
this
.
setDefaultOptions
(
key
,
val
,
true
)
this
.
setPreferences
(
key
,
val
)
},
_initMinder
:
function
()
{
...
...
src/core/minder.preference.js
0 → 100644
View file @
1c5ab318
kity
.
extendClass
(
Minder
,
function
(){
var
ROOTKEY
=
'kityminder_preference'
;
//创建存储机制
var
LocalStorage
=
(
function
()
{
var
storage
=
window
.
localStorage
,
LOCAL_FILE
=
"localStorage"
;
return
{
saveLocalData
:
function
(
key
,
data
)
{
if
(
storage
&&
data
)
{
storage
.
setItem
(
key
,
data
);
return
true
;
}
return
false
;
},
getLocalData
:
function
(
key
)
{
if
(
storage
)
{
return
storage
.
getItem
(
key
);
}
return
null
;
},
removeItem
:
function
(
key
)
{
storage
&&
storage
.
removeItem
(
key
);
}
};
}
)();
return
{
setPreferences
:
function
(
key
,
value
){
var
obj
=
{};
if
(
Utils
.
isString
(
key
)
)
{
obj
[
key
]
=
value
;
}
else
{
obj
=
key
;
}
var
data
=
LocalStorage
.
getLocalData
(
ROOTKEY
);
if
(
data
){
data
=
JSON
.
parse
(
data
);
utils
.
extend
(
data
,
obj
);
}
else
{
data
=
obj
;
}
LocalStorage
.
saveLocalData
(
ROOTKEY
,
JSON
.
stringify
(
data
));
},
getPreferences
:
function
(
key
){
var
data
=
LocalStorage
.
getLocalData
(
ROOTKEY
);
if
(
data
){
data
=
JSON
.
parse
(
data
);
return
key
?
data
[
key
]
:
data
}
return
null
;
},
resetPreferences
:
function
(
pres
){
var
str
=
pres
?
JSON
.
parse
(
pres
)
:
''
;
LocalStorage
.
saveLocalData
(
str
)
}
}
}()
);
\ No newline at end of file
src/module/layout.js
View file @
1c5ab318
...
...
@@ -212,7 +212,10 @@ KityMinder.registerModule( "LayoutModule", function () {
}
else
{
return
0
;
}
}
},
isNeedUndo
:
function
()
{
return
false
;
}
};
}
)()
);
...
...
@@ -228,21 +231,7 @@ KityMinder.registerModule( "LayoutModule", function () {
"ready"
:
function
()
{
this
.
setDefaultOptions
(
'layoutstyle'
,
this
.
getLayoutStyleItems
()
);
switchLayout
(
this
,
this
.
getOptions
(
'defaultlayoutstyle'
)
);
//读取cookies
var
getCookie
=
function
(
name
)
{
var
arr
,
reg
=
new
RegExp
(
"(^| )"
+
name
+
"=([^;]*)(;|$)"
);
if
(
arr
=
document
.
cookie
.
match
(
reg
)
)
return
unescape
(
arr
[
2
]
);
else
return
null
;
}
var
expand
=
getCookie
(
'expand'
);
if
(
expand
)
{
if
(
expand
===
'all'
)
{
this
.
setOptions
(
'defaultExpand'
,
{
'defaultLayer'
:
0
,
'defaultSubShow'
:
0
}
);
}
}
},
"click"
:
function
(
e
)
{
var
ico
=
e
.
kityEvent
.
targetShape
&&
e
.
kityEvent
.
targetShape
.
container
;
...
...
src/ui/combobox.js
View file @
1c5ab318
...
...
@@ -333,7 +333,7 @@
var
options
=
this
.
data
(
"options"
),
newStack
=
[];
debugger
if
(
this
.
data
(
'options'
).
enabledRecord
){
$
.
each
(
options
.
recordStack
,
function
(
i
,
item
){
...
...
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