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
60602081
Commit
60602081
authored
May 17, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
layout
parent
7497dff9
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
444 additions
and
442 deletions
+444
-442
markers.js
dialogs/markers/markers.js
+2
-2
kityminder.config.js
kityminder.config.js
+23
-23
layout.js
src/adapter/layout.js
+33
-33
layout.bottom.js
src/module/layout.bottom.js
+275
-272
layout.js
src/module/layout.js
+111
-112
No files found.
dialogs/markers/markers.js
View file @
60602081
...
@@ -49,8 +49,8 @@
...
@@ -49,8 +49,8 @@
},
lang
));
},
lang
));
}
}
this
.
root
().
html
(
html
);
this
.
root
().
html
(
html
);
var
valPri
=
km
.
queryCommandValue
(
"priority"
);
var
valPri
=
km
.
queryCommandValue
(
"priority"
)
||
0
;
var
valPro
=
km
.
queryCommandValue
(
"progress"
);
var
valPro
=
km
.
queryCommandValue
(
"progress"
)
||
0
;
$w
.
find
(
"li[type='priority']"
).
removeClass
(
"active"
);
$w
.
find
(
"li[type='priority']"
).
removeClass
(
"active"
);
$w
.
find
(
"li[type='priority'][value='"
+
valPri
+
"']"
).
addClass
(
"active"
);
$w
.
find
(
"li[type='priority'][value='"
+
valPri
+
"']"
).
addClass
(
"active"
);
$w
.
find
(
"li[type='progress']"
).
removeClass
(
"active"
);
$w
.
find
(
"li[type='progress']"
).
removeClass
(
"active"
);
...
...
kityminder.config.js
View file @
60602081
(
function
()
{
(
function
()
{
function
getKMBasePath
(
docUrl
,
confUrl
)
{
function
getKMBasePath
(
docUrl
,
confUrl
)
{
return
getBasePath
(
docUrl
||
self
.
document
.
URL
||
self
.
location
.
href
,
confUrl
||
getConfigFilePath
()
);
return
getBasePath
(
docUrl
||
self
.
document
.
URL
||
self
.
location
.
href
,
confUrl
||
getConfigFilePath
()
);
}
}
function
getConfigFilePath
()
{
function
getConfigFilePath
()
{
var
configPath
=
document
.
getElementsByTagName
(
'script'
);
var
configPath
=
document
.
getElementsByTagName
(
'script'
);
return
configPath
[
configPath
.
length
-
1
].
src
;
return
configPath
[
configPath
.
length
-
1
].
src
;
}
}
function
getBasePath
(
docUrl
,
confUrl
)
{
function
getBasePath
(
docUrl
,
confUrl
)
{
var
basePath
=
confUrl
;
var
basePath
=
confUrl
;
if
(
/^
(\/
|
\\\\)
/
.
test
(
confUrl
)
)
{
if
(
/^
(\/
|
\\\\)
/
.
test
(
confUrl
)
)
{
basePath
=
/^.+
?\w(\/
|
\\\\)
/
.
exec
(
docUrl
)[
0
]
+
confUrl
.
replace
(
/^
(\/
|
\\\\)
/
,
''
);
basePath
=
/^.+
?\w(\/
|
\\\\)
/
.
exec
(
docUrl
)[
0
]
+
confUrl
.
replace
(
/^
(\/
|
\\\\)
/
,
''
);
}
else
if
(
!
/^
[
a-z
]
+:/i
.
test
(
confUrl
)
)
{
}
else
if
(
!
/^
[
a-z
]
+:/i
.
test
(
confUrl
)
)
{
docUrl
=
docUrl
.
split
(
"#"
)[
0
].
split
(
"?"
)[
0
].
replace
(
/
[^\\\/]
+$/
,
''
);
docUrl
=
docUrl
.
split
(
"#"
)[
0
].
split
(
"?"
)[
0
].
replace
(
/
[^\\\/]
+$/
,
''
);
basePath
=
docUrl
+
""
+
confUrl
;
basePath
=
docUrl
+
""
+
confUrl
;
}
}
return
optimizationPath
(
basePath
);
return
optimizationPath
(
basePath
);
}
}
function
optimizationPath
(
path
)
{
function
optimizationPath
(
path
)
{
var
protocol
=
/^
[
a-z
]
+:
\/\/
/
.
exec
(
path
)[
0
],
var
protocol
=
/^
[
a-z
]
+:
\/\/
/
.
exec
(
path
)[
0
],
tmp
=
null
,
tmp
=
null
,
res
=
[];
res
=
[];
path
=
path
.
replace
(
protocol
,
""
).
split
(
"?"
)[
0
].
split
(
"#"
)[
0
];
path
=
path
.
replace
(
protocol
,
""
).
split
(
"?"
)[
0
].
split
(
"#"
)[
0
];
path
=
path
.
replace
(
/
\\
/g
,
'/'
).
split
(
/
\/
/
);
path
=
path
.
replace
(
/
\\
/g
,
'/'
).
split
(
/
\/
/
);
path
[
path
.
length
-
1
]
=
""
;
path
[
path
.
length
-
1
]
=
""
;
while
(
path
.
length
)
{
while
(
path
.
length
)
{
if
(
(
tmp
=
path
.
shift
()
)
===
".."
)
{
if
(
(
tmp
=
path
.
shift
())
===
".."
)
{
res
.
pop
();
res
.
pop
();
}
else
if
(
tmp
!==
"."
)
{
}
else
if
(
tmp
!==
"."
)
{
res
.
push
(
tmp
);
res
.
push
(
tmp
);
}
}
}
}
return
protocol
+
res
.
join
(
"/"
);
return
protocol
+
res
.
join
(
"/"
);
}
}
window
.
KITYMINDER_CONFIG
=
{
window
.
KITYMINDER_CONFIG
=
{
'KITYMINDER_HOME_URL'
:
getKMBasePath
(),
'KITYMINDER_HOME_URL'
:
getKMBasePath
(),
//定义工具栏
//定义工具栏
toolbars
:
[
toolbars
:
[
'hand | zoom-in zoom zoom-out | collapsenode expandnode | undo redo | bold italic | fontfamily fontsize forecolor | saveto | hyperlink unhyperlink image removeimage | markers resource | node | help'
'hand | zoom-in zoom zoom-out | collapsenode expandnode | undo redo | bold italic | fontfamily fontsize forecolor | saveto |
switchlayout |
hyperlink unhyperlink image removeimage | markers resource | node | help'
]
]
//只读模式,默认是false
//只读模式,默认是false
//readOnly: true
//readOnly: true
...
@@ -95,4 +95,4 @@
...
@@ -95,4 +95,4 @@
//,maxImageHeight: 200
//,maxImageHeight: 200
//
//
};
};
}
)();
})();
\ No newline at end of file
\ No newline at end of file
src/adapter/layout.js
View file @
60602081
KM
.
registerToolbarUI
(
'switchlayout'
,
function
(
name
)
{
KM
.
registerToolbarUI
(
'switchlayout'
,
function
(
name
)
{
var
me
=
this
,
var
me
=
this
,
label
=
me
.
getLang
(
'tooltips.'
+
name
),
label
=
me
.
getLang
(
'tooltips.'
+
name
),
options
=
{
options
=
{
label
:
label
,
label
:
label
,
title
:
label
,
title
:
label
,
...
@@ -13,54 +12,55 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
...
@@ -13,54 +12,55 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
enabledRecord
:
false
enabledRecord
:
false
},
},
$combox
=
null
;
$combox
=
null
;
if
(
options
.
items
.
length
==
0
)
{
if
(
options
.
items
.
length
==
0
)
{
return
null
;
return
null
;
}
}
utils
.
each
(
options
.
items
,
function
(
i
,
item
)
{
utils
.
each
(
options
.
items
,
function
(
i
,
item
)
{
options
.
items
[
i
]
=
me
.
getLang
(
'layout'
)[
item
];
options
.
items
[
i
]
=
me
.
getLang
(
'layout'
)[
item
];
}
);
});
//实例化
//实例化
$combox
=
$
.
kmuibuttoncombobox
(
options
).
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
1
);
$combox
=
$
.
kmuibuttoncombobox
(
options
).
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
1
);
var
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
);
}
).
on
(
"beforeshow"
,
function
()
{
me
.
initStyle
();
if
(
$combox
.
parent
().
length
===
0
)
{
}).
on
(
"beforeshow"
,
function
()
{
$combox
.
appendTo
(
me
.
$container
.
find
(
'.kmui-dialog-container'
)
);
if
(
$combox
.
parent
().
length
===
0
)
{
$combox
.
appendTo
(
me
.
$container
.
find
(
'.kmui-dialog-container'
));
}
}
}
);
});
//状态反射
//状态反射
me
.
on
(
'interactchange'
,
function
()
{
me
.
on
(
'interactchange'
,
function
()
{
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
)
{
//设置label
//设置label
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
=
[];
utils
.
each
(
me
.
getLayoutStyleItems
(),
function
(
i
,
v
)
{
utils
.
each
(
me
.
getLayoutStyleItems
(),
function
(
i
,
v
)
{
data
.
push
(
{
data
.
push
({
label
:
me
.
getLang
(
'tooltips.'
+
name
)
+
' '
+
v
,
label
:
me
.
getLang
(
'tooltips.'
+
name
)
+
' '
+
v
,
cmdName
:
'switchlayout'
,
cmdName
:
'switchlayout'
,
exec
:
function
()
{
exec
:
function
()
{
me
.
execCommand
(
'switchlayout'
,
v
);
me
.
execCommand
(
'switchlayout'
,
v
);
}
}
}
)
})
}
);
});
data
.
push
(
{
data
.
push
({
divider
:
1
divider
:
1
}
);
});
me
.
addContextmenu
(
data
);
me
.
addContextmenu
(
data
);
return
comboboxWidget
.
button
().
addClass
(
'kmui-combobox'
);
return
comboboxWidget
.
button
().
addClass
(
'kmui-combobox'
);
}
);
});
\ No newline at end of file
\ No newline at end of file
src/module/layout.bottom.js
View file @
60602081
This diff is collapsed.
Click to expand it.
src/module/layout.js
View file @
60602081
This diff is collapsed.
Click to expand it.
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