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
f4caeabb
Commit
f4caeabb
authored
Feb 07, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
by zhanyi
parent
8cf56d08
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
0 deletions
+95
-0
basestyle.js
src/module/basestyle.js
+58
-0
font.js
src/module/font.js
+37
-0
No files found.
src/module/basestyle.js
0 → 100644
View file @
f4caeabb
KityMinder
.
registerModule
(
"basestylemodule"
,
function
()
{
return
{
"commands"
:
{
"bold"
:
kity
.
createClass
(
"boldCommand"
,
{
base
:
Command
,
execute
:
function
(
km
)
{
var
nodes
=
km
.
getSelectedNodes
();
if
(
this
.
queryState
(
'bold'
)
==
1
){
utils
.
each
(
nodes
,
function
(
i
,
n
){
n
.
setData
(
'bold'
);
n
.
getTextShape
().
setAttr
(
'font-weight'
);
})
}
else
{
utils
.
each
(
nodes
,
function
(
i
,
n
){
n
.
setData
(
'bold'
,
true
);
n
.
getTextShape
().
setAttr
(
'font-weight'
,
'bold'
);
})
}
},
queryState
:
function
(
km
)
{
var
nodes
=
km
.
getSelectedNodes
(),
result
=
0
;
utils
.
each
(
nodes
,
function
(
i
,
n
){
if
(
n
.
setData
(
'bold'
)){
result
=
1
;
return
false
;
}
});
return
result
;
}
}
),
"italic"
:
kity
.
createClass
(
"italicCommand"
,
{
base
:
Command
,
execute
:
function
(
km
)
{
},
queryState
:
function
(
km
)
{
}
}
)
},
addShortcutKeys
:
{
"bold"
:
"ctrl+90"
,
//undo
"italic"
:
"ctrl+89"
//redo
},
"events"
:
{
"beforerendernode"
:
function
(
e
)
{
}
}
};
}
);
\ No newline at end of file
src/module/font.js
0 → 100644
View file @
f4caeabb
KityMinder
.
registerModule
(
"fontmodule"
,
function
()
{
return
{
"commands"
:
{
"fontcolor"
:
kity
.
createClass
(
"fontcolorCommand"
,
{
base
:
Command
,
execute
:
function
(
km
,
color
)
{
var
nodes
=
km
.
getSelectedNodes
();
utils
.
each
(
nodes
,
function
(
i
,
n
){
n
.
setData
(
'fontcolor'
,
color
);
n
.
getTextShape
().
fill
(
color
)
})
}
}
),
"fontfamily"
:
kity
.
createClass
(
"fontfamilyCommand"
,
{
base
:
Command
,
execute
:
function
(
km
,
family
)
{
var
nodes
=
km
.
getSelectedNodes
();
utils
.
each
(
nodes
,
function
(
i
,
n
){
n
.
setData
(
'fontfamily'
,
family
);
n
.
getTextShape
().
setAttr
(
'font-family'
,
family
);
})
}
}
)
},
"events"
:
{
"beforerendernode"
:
function
(
e
)
{
}
}
};
}
);
\ 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