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
46595032
Commit
46595032
authored
Jul 03, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加光标的主题和修复粘贴节点死循环问题
parent
3af6dcd7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
10 deletions
+29
-10
editor.js
src/module/editor.js
+11
-5
editor.selection.js
src/module/editor.selection.js
+6
-1
paste.js
src/module/paste.js
+1
-1
default.js
src/theme/default.js
+3
-1
fresh.js
src/theme/fresh.js
+5
-1
snow.js
src/theme/snow.js
+3
-1
No files found.
src/module/editor.js
View file @
46595032
...
@@ -19,12 +19,16 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -19,12 +19,16 @@ KityMinder.registerModule('TextEditModule', function() {
function
inputStatusReady
(
node
){
function
inputStatusReady
(
node
){
if
(
node
&&
km
.
isSingleSelect
()
&&
node
.
isSelected
())
{
if
(
node
&&
km
.
isSingleSelect
()
&&
node
.
isSelected
())
{
var
color
=
node
.
getStyle
(
'text-selection-color'
);
//准备输入状态
//准备输入状态
var
textShape
=
node
.
getTextShape
();
var
textShape
=
node
.
getTextShape
();
sel
.
setHide
()
sel
.
setHide
()
.
setStartOffset
(
0
)
.
setStartOffset
(
0
)
.
setEndOffset
(
textShape
.
getContent
().
length
);
.
setEndOffset
(
textShape
.
getContent
().
length
)
.
setColor
(
color
);
receiver
receiver
.
setMinderNode
(
node
)
.
setMinderNode
(
node
)
...
@@ -78,7 +82,7 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -78,7 +82,7 @@ KityMinder.registerModule('TextEditModule', function() {
textShape
.
setStyle
(
'cursor'
,
'default'
);
textShape
.
setStyle
(
'cursor'
,
'default'
);
if
(
this
.
isSingleSelect
()
&&
node
.
isSelected
())
{
if
(
this
.
isSingleSelect
()
&&
node
.
isSelected
())
{
sel
.
collapse
();
sel
.
collapse
();
sel
.
setColor
(
node
.
getStyle
(
'text-selection-color'
));
receiver
receiver
.
setMinderNode
(
node
)
.
setMinderNode
(
node
)
...
@@ -138,6 +142,8 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -138,6 +142,8 @@ KityMinder.registerModule('TextEditModule', function() {
sel
.
collapse
();
sel
.
collapse
();
sel
.
setColor
(
node
.
getStyle
(
'text-selection-color'
));
node
.
getTextShape
().
setStyle
(
'cursor'
,
'text'
);
node
.
getTextShape
().
setStyle
(
'cursor'
,
'text'
);
receiver
.
updateSelection
();
receiver
.
updateSelection
();
...
@@ -234,9 +240,9 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -234,9 +240,9 @@ KityMinder.registerModule('TextEditModule', function() {
km
.
setStatus
(
'normal'
);
km
.
setStatus
(
'normal'
);
receiver
.
clear
();
receiver
.
clear
();
},
},
'blur'
:
function
()
{
//
'blur': function() {
receiver
.
clear
();
//
receiver.clear();
},
//
},
'import'
:
function
()
{
'import'
:
function
()
{
km
.
setStatus
(
'normal'
);
km
.
setStatus
(
'normal'
);
receiver
.
clear
();
receiver
.
clear
();
...
...
src/module/editor.selection.js
View file @
46595032
...
@@ -17,9 +17,13 @@ Minder.Selection = kity.createClass( 'Selection', {
...
@@ -17,9 +17,13 @@ Minder.Selection = kity.createClass( 'Selection', {
this
.
_show
=
false
;
this
.
_show
=
false
;
},
},
setColor
:
function
(
color
){
this
.
stroke
(
color
);
this
.
fill
(
color
);
},
collapse
:
function
(
toEnd
){
collapse
:
function
(
toEnd
){
this
.
stroke
(
'rgb(27,171,255)'
,
1
);
//
this.stroke( 'rgb(27,171,255)', 1 );
this
.
setOpacity
(
1
);
this
.
setOpacity
(
1
);
this
.
width
=
1
;
this
.
width
=
1
;
this
.
collapsed
=
true
;
this
.
collapsed
=
true
;
...
@@ -105,6 +109,7 @@ Minder.Selection = kity.createClass( 'Selection', {
...
@@ -105,6 +109,7 @@ Minder.Selection = kity.createClass( 'Selection', {
clearInterval
(
this
.
timer
);
clearInterval
(
this
.
timer
);
var
me
=
this
,
var
me
=
this
,
state
=
''
;
state
=
''
;
me
.
setStyle
(
'display'
,
''
);
me
.
setStyle
(
'display'
,
''
);
me
.
_show
=
true
;
me
.
_show
=
true
;
if
(
this
.
collapsed
){
if
(
this
.
collapsed
){
...
...
src/module/paste.js
View file @
46595032
...
@@ -53,7 +53,7 @@ KityMinder.registerModule( "pasteModule", function () {
...
@@ -53,7 +53,7 @@ KityMinder.registerModule( "pasteModule", function () {
if
(
node
){
if
(
node
){
km
.
fire
(
'saveScene'
);
km
.
fire
(
'saveScene'
);
for
(
var
i
=
0
,
ni
;
ni
=
_cacheNodes
[
i
++
];){
for
(
var
i
=
0
,
ni
;
ni
=
_cacheNodes
[
i
++
];){
appendChildNode
(
node
,
ni
);
appendChildNode
(
node
,
ni
.
clone
()
);
}
}
km
.
layout
(
300
);
km
.
layout
(
300
);
km
.
select
(
_selectedNodes
,
true
);
km
.
select
(
_selectedNodes
,
true
);
...
...
src/theme/default.js
View file @
46595032
...
@@ -49,5 +49,7 @@ KityMinder.registerTheme('classic', {
...
@@ -49,5 +49,7 @@ KityMinder.registerTheme('classic', {
'order-hint-area-color'
:
'rgba(0, 255, 0, .5)'
,
'order-hint-area-color'
:
'rgba(0, 255, 0, .5)'
,
'order-hint-path-color'
:
'#0f0'
,
'order-hint-path-color'
:
'#0f0'
,
'order-hint-path-width'
:
1
'order-hint-path-width'
:
1
,
'text-selection-color'
:
'rgb(27,171,255)'
});
});
\ No newline at end of file
src/theme/fresh.js
View file @
46595032
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
}
}
function
generate
(
h
)
{
function
generate
(
h
)
{
var
textSelectionColor
=
kity
.
Color
.
parse
(
'rgb(27,171,255)'
);
return
{
return
{
'background'
:
'#fbfbfb'
,
'background'
:
'#fbfbfb'
,
...
@@ -15,6 +16,7 @@
...
@@ -15,6 +16,7 @@
'root-margin'
:
[
30
,
100
],
'root-margin'
:
[
30
,
100
],
'root-radius'
:
5
,
'root-radius'
:
5
,
'root-space'
:
10
,
'root-space'
:
10
,
'root-text-selection-color'
:
textSelectionColor
.
set
(
'h'
,
h
).
set
(
'l'
,
20
),
'main-color'
:
'black'
,
'main-color'
:
'black'
,
...
@@ -52,7 +54,9 @@
...
@@ -52,7 +54,9 @@
'order-hint-area-color'
:
hsl
(
h
,
100
,
95
).
set
(
'a'
,
0.5
),
'order-hint-area-color'
:
hsl
(
h
,
100
,
95
).
set
(
'a'
,
0.5
),
'order-hint-path-color'
:
hsl
(
h
,
100
,
25
),
'order-hint-path-color'
:
hsl
(
h
,
100
,
25
),
'order-hint-path-width'
:
1
'order-hint-path-width'
:
1
,
'text-selection-color'
:
textSelectionColor
.
set
(
'h'
,
h
)
};
};
}
}
...
...
src/theme/snow.js
View file @
46595032
...
@@ -47,5 +47,7 @@ KityMinder.registerTheme('snow', {
...
@@ -47,5 +47,7 @@ KityMinder.registerTheme('snow', {
'order-hint-area-color'
:
'rgba(0, 255, 0, .5)'
,
'order-hint-area-color'
:
'rgba(0, 255, 0, .5)'
,
'order-hint-path-color'
:
'#0f0'
,
'order-hint-path-color'
:
'#0f0'
,
'order-hint-path-width'
:
1
'order-hint-path-width'
:
1
,
'text-selection-color'
:
'rgb(27,171,255)'
});
});
\ No newline at end of file
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