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
b08e5af3
Commit
b08e5af3
authored
Apr 15, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
publish
parent
6e8a71ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
63 deletions
+80
-63
kityminder.all.js
dist/kityminder.all.js
+78
-61
kityminder.all.min.js
dist/kityminder.all.min.js
+2
-2
No files found.
dist/kityminder.all.js
View file @
b08e5af3
/*!
/*!
* ====================================================
* ====================================================
* kityminder - v1.0.0 - 2014-04-1
1
* kityminder - v1.0.0 - 2014-04-1
5
* https://github.com/fex-team/kityminder
* https://github.com/fex-team/kityminder
* GitHub: https://github.com/fex-team/kityminder.git
* GitHub: https://github.com/fex-team/kityminder.git
* Copyright (c) 2014 f-cube @ FEX; Licensed MIT
* Copyright (c) 2014 f-cube @ FEX; Licensed MIT
...
@@ -792,7 +792,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
...
@@ -792,7 +792,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
_initContextmenu
();
this
.
_initContextmenu
();
this
.
_initModules
();
this
.
_initModules
();
if
(
this
.
getOptions
(
'readOnly'
)
===
true
)
{
if
(
this
.
getOptions
(
'readOnly'
)
===
true
)
{
this
.
setDisabled
();
this
.
setDisabled
();
}
}
this
.
fire
(
'ready'
);
this
.
fire
(
'ready'
);
...
@@ -952,45 +952,45 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
...
@@ -952,45 +952,45 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
getStatus
:
function
()
{
getStatus
:
function
()
{
return
this
.
_status
;
return
this
.
_status
;
},
},
setDisabled
:
function
()
{
setDisabled
:
function
()
{
var
me
=
this
;
var
me
=
this
;
//禁用命令
//禁用命令
me
.
bkqueryCommandState
=
me
.
queryCommandState
;
me
.
bkqueryCommandState
=
me
.
queryCommandState
;
me
.
bkqueryCommandValue
=
me
.
queryCommandValue
;
me
.
bkqueryCommandValue
=
me
.
queryCommandValue
;
me
.
queryCommandState
=
function
(
type
)
{
me
.
queryCommandState
=
function
(
type
)
{
var
cmd
=
this
.
_getCommand
(
type
);
var
cmd
=
this
.
_getCommand
(
type
);
if
(
cmd
&&
cmd
.
enableReadOnly
===
false
)
{
if
(
cmd
&&
cmd
.
enableReadOnly
===
false
)
{
return
me
.
bkqueryCommandState
.
apply
(
me
,
arguments
);
return
me
.
bkqueryCommandState
.
apply
(
me
,
arguments
);
}
}
return
-
1
;
return
-
1
;
};
};
me
.
queryCommandValue
=
function
(
type
)
{
me
.
queryCommandValue
=
function
(
type
)
{
var
cmd
=
this
.
_getCommand
(
type
);
var
cmd
=
this
.
_getCommand
(
type
);
if
(
cmd
&&
cmd
.
enableReadOnly
===
false
)
{
if
(
cmd
&&
cmd
.
enableReadOnly
===
false
)
{
return
me
.
bkqueryCommandValue
.
apply
(
me
,
arguments
);
return
me
.
bkqueryCommandValue
.
apply
(
me
,
arguments
);
}
}
return
null
;
return
null
;
};
};
this
.
setStatus
(
'readonly'
);
this
.
setStatus
(
'readonly'
);
me
.
fire
(
'interactchange'
);
me
.
fire
(
'interactchange'
);
},
},
setEnabled
:
function
()
{
setEnabled
:
function
()
{
var
me
=
this
;
var
me
=
this
;
if
(
me
.
bkqueryCommandState
)
{
if
(
me
.
bkqueryCommandState
)
{
me
.
queryCommandState
=
me
.
bkqueryCommandState
;
me
.
queryCommandState
=
me
.
bkqueryCommandState
;
delete
me
.
bkqueryCommandState
;
delete
me
.
bkqueryCommandState
;
}
}
if
(
me
.
bkqueryCommandValue
)
{
if
(
me
.
bkqueryCommandValue
)
{
me
.
queryCommandValue
=
me
.
bkqueryCommandValue
;
me
.
queryCommandValue
=
me
.
bkqueryCommandValue
;
delete
me
.
bkqueryCommandValue
;
delete
me
.
bkqueryCommandValue
;
}
}
this
.
rollbackStatus
();
this
.
rollbackStatus
();
me
.
fire
(
'interactchange'
);
me
.
fire
(
'interactchange'
);
}
}
}
);
}
);
...
@@ -5125,75 +5125,74 @@ Minder.Selection = kity.createClass( 'Selection', {
...
@@ -5125,75 +5125,74 @@ Minder.Selection = kity.createClass( 'Selection', {
KityMinder
.
registerModule
(
"basestylemodule"
,
function
()
{
KityMinder
.
registerModule
(
"basestylemodule"
,
function
()
{
var
km
=
this
;
var
km
=
this
;
return
{
return
{
"commands"
:
{
"commands"
:
{
"bold"
:
kity
.
createClass
(
"boldCommand"
,
{
"bold"
:
kity
.
createClass
(
"boldCommand"
,
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
)
{
execute
:
function
()
{
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getSelectedNodes
();
if
(
this
.
queryState
(
'bold'
)
==
1
)
{
if
(
this
.
queryState
(
'bold'
)
==
1
)
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
n
.
setData
(
'bold'
);
n
.
setData
(
'bold'
);
n
.
getTextShape
().
setAttr
(
'font-weight'
);
n
.
getTextShape
().
setAttr
(
'font-weight'
);
km
.
updateLayout
(
n
)
km
.
updateLayout
(
n
)
})
}
)
}
else
{
}
else
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
n
.
setData
(
'bold'
,
true
);
n
.
setData
(
'bold'
,
true
);
n
.
getTextShape
().
setAttr
(
'font-weight'
,
'bold'
);
n
.
getTextShape
().
setAttr
(
'font-weight'
,
'bold'
);
km
.
updateLayout
(
n
)
km
.
updateLayout
(
n
)
})
}
)
}
}
},
},
queryState
:
function
(
)
{
queryState
:
function
()
{
var
nodes
=
km
.
getSelectedNodes
(),
var
nodes
=
km
.
getSelectedNodes
(),
result
=
0
;
result
=
0
;
if
(
nodes
.
length
==
0
)
{
if
(
nodes
.
length
==
0
)
{
return
-
1
;
return
-
1
;
}
}
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
if
(
n
&&
n
.
getData
(
'bold'
)
)
{
if
(
n
&&
n
.
getData
(
'bold'
)
)
{
result
=
1
;
result
=
1
;
return
false
;
return
false
;
}
}
});
}
);
return
result
;
return
result
;
}
}
}
),
}
),
"italic"
:
kity
.
createClass
(
"italicCommand"
,
{
"italic"
:
kity
.
createClass
(
"italicCommand"
,
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
)
{
execute
:
function
()
{
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getSelectedNodes
();
if
(
this
.
queryState
(
'italic'
)
==
1
)
{
if
(
this
.
queryState
(
'italic'
)
==
1
)
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
n
.
setData
(
'italic'
);
n
.
setData
(
'italic'
);
n
.
getTextShape
().
setAttr
(
'font-style'
);
n
.
getTextShape
().
setAttr
(
'font-style'
);
km
.
updateLayout
(
n
)
km
.
updateLayout
(
n
)
})
}
)
}
else
{
}
else
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
n
.
setData
(
'italic'
,
true
);
n
.
setData
(
'italic'
,
true
);
n
.
getTextShape
().
setAttr
(
'font-style'
,
'italic'
);
n
.
getTextShape
().
setAttr
(
'font-style'
,
'italic'
);
km
.
updateLayout
(
n
)
km
.
updateLayout
(
n
)
})
}
)
}
}
},
},
queryState
:
function
(
)
{
queryState
:
function
()
{
var
nodes
=
km
.
getSelectedNodes
(),
var
nodes
=
km
.
getSelectedNodes
(),
result
=
0
;
result
=
0
;
if
(
nodes
.
length
==
0
)
{
if
(
nodes
.
length
==
0
)
{
return
-
1
;
return
-
1
;
}
}
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
if
(
n
&&
n
.
getData
(
'italic'
)
)
{
if
(
n
&&
n
.
getData
(
'italic'
)
)
{
result
=
1
;
result
=
1
;
return
false
;
return
false
;
}
}
});
}
);
return
result
;
return
result
;
}
}
}
)
}
)
...
@@ -5205,12 +5204,12 @@ KityMinder.registerModule( "basestylemodule", function () {
...
@@ -5205,12 +5204,12 @@ KityMinder.registerModule( "basestylemodule", function () {
"events"
:
{
"events"
:
{
"beforeRenderNode"
:
function
(
e
)
{
"beforeRenderNode"
:
function
(
e
)
{
//加粗
//加粗
if
(
e
.
node
.
getData
(
'bold'
))
{
if
(
e
.
node
.
getData
(
'bold'
)
)
{
e
.
node
.
getTextShape
().
setAttr
(
'font-weight'
,
'bold'
);
e
.
node
.
getTextShape
().
setAttr
(
'font-weight'
,
'bold'
);
}
}
if
(
e
.
node
.
getData
(
'italic'
))
{
if
(
e
.
node
.
getData
(
'italic'
)
)
{
e
.
node
.
getTextShape
().
setAttr
(
'font-style'
,
'italic'
);
e
.
node
.
getTextShape
().
setAttr
(
'font-style'
,
'italic'
);
}
}
}
}
}
}
...
@@ -7121,8 +7120,11 @@ utils.extend( KityMinder, function () {
...
@@ -7121,8 +7120,11 @@ utils.extend( KityMinder, function () {
}
);
}
);
btns
.
length
&&
$toolbar
.
kmui
().
appendToBtnmenu
(
btns
);
btns
.
length
&&
$toolbar
.
kmui
().
appendToBtnmenu
(
btns
);
}
);
}
);
$toolbar
.
append
(
$
(
'<div class="kmui-dialog-container"></div>'
)
);
}
else
{
$toolbar
.
hide
()
}
}
$toolbar
.
append
(
$
(
'<div class="kmui-dialog-container"></div>'
)
);
},
},
_createStatusbar
:
function
(
$statusbar
,
km
)
{
_createStatusbar
:
function
(
$statusbar
,
km
)
{
...
@@ -7523,7 +7525,7 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
...
@@ -7523,7 +7525,7 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
});
});
//实例化
//实例化
$combox
=
$
.
kmuibuttoncombobox
(
options
).
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
1
);
$combox
=
$
.
kmuibuttoncombobox
(
options
).
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
1
);
comboboxWidget
=
$combox
.
kmui
();
var
comboboxWidget
=
$combox
.
kmui
();
comboboxWidget
.
on
(
'comboboxselect'
,
function
(
evt
,
res
)
{
comboboxWidget
.
on
(
'comboboxselect'
,
function
(
evt
,
res
)
{
me
.
execCommand
(
name
,
res
.
value
);
me
.
execCommand
(
name
,
res
.
value
);
...
@@ -7538,6 +7540,7 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
...
@@ -7538,6 +7540,7 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
var
state
=
this
.
queryCommandState
(
name
),
var
state
=
this
.
queryCommandState
(
name
),
value
=
this
.
queryCommandValue
(
name
);
value
=
this
.
queryCommandValue
(
name
);
//设置按钮状态
//设置按钮状态
comboboxWidget
.
button
().
kmui
().
disabled
(
state
==
-
1
).
active
(
state
==
1
);
comboboxWidget
.
button
().
kmui
().
disabled
(
state
==
-
1
).
active
(
state
==
1
);
if
(
value
)
{
if
(
value
)
{
...
@@ -7545,6 +7548,7 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
...
@@ -7545,6 +7548,7 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
value
=
value
.
replace
(
/
[
'"
]
/g
,
''
).
toLowerCase
().
split
(
/
[
'|"
]?\s
*,
\s
*
[\1]?
/
);
value
=
value
.
replace
(
/
[
'"
]
/g
,
''
).
toLowerCase
().
split
(
/
[
'|"
]?\s
*,
\s
*
[\1]?
/
);
comboboxWidget
.
selectItemByLabel
(
value
);
comboboxWidget
.
selectItemByLabel
(
value
);
}
}
}
);
}
);
var
data
=
[];
var
data
=
[];
...
@@ -7591,7 +7595,7 @@ KM.registerToolbarUI( 'node', function ( name ) {
...
@@ -7591,7 +7595,7 @@ KM.registerToolbarUI( 'node', function ( name ) {
//实例化
//实例化
$combox
=
$
.
kmuibuttoncombobox
(
transForInserttopic
(
options
)
).
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
1
);
$combox
=
$
.
kmuibuttoncombobox
(
transForInserttopic
(
options
)
).
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
1
);
comboboxWidget
=
$combox
.
kmui
();
var
comboboxWidget
=
$combox
.
kmui
();
comboboxWidget
.
on
(
'comboboxselect'
,
function
(
evt
,
res
)
{
comboboxWidget
.
on
(
'comboboxselect'
,
function
(
evt
,
res
)
{
me
.
execCommand
(
res
.
value
,
new
MinderNode
(
me
.
getLang
().
topic
),
true
);
me
.
execCommand
(
res
.
value
,
new
MinderNode
(
me
.
getLang
().
topic
),
true
);
...
@@ -7609,7 +7613,20 @@ KM.registerToolbarUI( 'node', function ( name ) {
...
@@ -7609,7 +7613,20 @@ KM.registerToolbarUI( 'node', function ( name ) {
}
}
}
)
}
)
}
);
}
);
//状态反射
me
.
on
(
'interactchange'
,
function
()
{
var
state
=
0
;
utils
.
each
(
shortcutKeys
,
function
(
k
){
state
=
me
.
queryCommandState
(
k
);
if
(
state
!=-
1
){
return
false
;
}
});
//设置按钮状态
comboboxWidget
.
button
().
kmui
().
disabled
(
state
==
-
1
).
active
(
state
==
1
);
}
);
//comboboxWidget.button().kmui().disabled(-1);
return
comboboxWidget
.
button
().
addClass
(
'kmui-combobox'
);
return
comboboxWidget
.
button
().
addClass
(
'kmui-combobox'
);
...
...
dist/kityminder.all.min.js
View file @
b08e5af3
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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