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
c949ffd1
Commit
c949ffd1
authored
Feb 17, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed cmd
parent
f48b3d54
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
68 deletions
+59
-68
markers.js
dialogs/markers/markers.js
+40
-49
dialog.js
src/adapter/dialog.js
+2
-2
icon.js
src/module/icon.js
+8
-11
modal.js
src/ui/modal.js
+9
-6
flag.png
themes/default/images/flag.png
+0
-0
No files found.
dialogs/markers/markers.js
View file @
c949ffd1
(
function
()
{
(
function
()
{
var
utils
=
KM
.
utils
;
function
hrefStartWith
(
href
,
arr
)
{
href
=
href
.
replace
(
/^
\s
+|
\s
+$/g
,
''
);
for
(
var
i
=
0
,
ai
;
ai
=
arr
[
i
++
];)
{
if
(
href
.
indexOf
(
ai
)
==
0
)
{
function
hrefStartWith
(
href
,
arr
)
{
href
=
href
.
replace
(
/^
\s
+|
\s
+$/g
,
''
);
for
(
var
i
=
0
,
ai
;
ai
=
arr
[
i
++
];
)
{
if
(
href
.
indexOf
(
ai
)
==
0
)
{
return
true
;
}
}
return
false
;
}
KM
.
registerWidget
(
'markers'
,
{
tpl
:
"<style type=
\"
text/css
\"
>"
+
".kmui-dialog-link .kmui-link-table{font-size: 12px;margin: 10px;line-height: 30px}"
+
".kmui-dialog-link .kmui-link-txt{width:300px;height:21px;line-height:21px;border:1px solid #d7d7d7;}"
+
"</style>"
+
"<table class=
\"
kmui-link-table
\"
>"
+
"<tr>"
+
"<td><label for=
\"
href
\"
><%=lang_input_url%></label></td>"
+
"<td><input class=
\"
kmui-link-txt
\"
id=
\"
kmui-link-Jhref
\"
type=
\"
text
\"
/></td>"
+
"</tr>"
+
"<tr>"
+
"<td><label for=
\"
title
\"
><%=lang_input_title%></label></td>"
+
"<td><input class=
\"
kmui-link-txt
\"
id=
\"
kmui-link-Jtitle
\"
type=
\"
text
\"
/></td>"
+
"</tr>"
+
"<tr>"
+
"<td colspan=
\"
2
\"
>"
+
"<label for=
\"
target
\"
><%=lang_input_target%></label>"
+
"<input id=
\"
kmui-link-Jtarget
\"
type=
\"
checkbox
\"
/>"
+
"</td>"
+
"</tr>"
+
"</table>"
,
initContent
:
function
(
km
)
{
var
lang
=
km
.
getLang
(
'dialogs.markers'
);
if
(
lang
)
{
var
html
=
$
.
parseTmpl
(
this
.
tpl
,
lang
.
static
);
KM
.
registerWidget
(
'markers'
,
{
tpl
:
'<div class="kmui-modal" tabindex="-1" >'
+
'<div class="kmui-modal-header">'
+
'<div class="kmui-close" data-hide="modal"></div>'
+
'<h3 class="kmui-title"><%=title%></h3>'
+
'</div>'
+
'<div>'
+
'<h3>优先级</h3>'
+
'<ul class="icon-list" id="icon-priority"><li value="1">1</li><li value="2">2</li><li value="3">3</li><li value="4">4</li><li value="5">5</li></ul>'
+
'<h3>进程</h3>'
+
'<ul class="icon-list" id="icon-progress"><li value="1">1</li><li value="2">2</li><li value="3">3</li><li value="4">4</li><li value="5">5</li></ul>'
+
'</div>'
+
'</div>'
,
initContent
:
function
(
km
)
{
var
lang
=
km
.
getLang
(
'dialogs.markers'
);
if
(
lang
)
{
var
html
=
$
.
parseTmpl
(
this
.
tpl
,
lang
.
static
);
}
this
.
root
().
html
(
html
);
this
.
root
().
html
(
html
);
},
initEvent
:
function
(
km
,
$w
)
{
var
link
=
km
.
queryCommandValue
(
'link'
);
if
(
link
)
{
$
(
'#kmui-link-Jhref'
,
$w
).
val
(
utils
.
html
(
$
(
link
).
attr
(
'href'
))
);
$
(
'#kmui-link-Jtitle'
,
$w
).
val
(
$
(
link
).
attr
(
'title'
)
);
$
(
link
).
attr
(
'target'
)
==
'_blank'
&&
$
(
'#kmui-link-Jtarget'
).
attr
(
'checked'
,
true
)
initEvent
:
function
(
km
,
$w
)
{
var
link
=
km
.
queryCommandValue
(
'link'
);
if
(
link
)
{
$
(
'#kmui-link-Jhref'
,
$w
).
val
(
utils
.
html
(
$
(
link
).
attr
(
'href'
)
)
);
$
(
'#kmui-link-Jtitle'
,
$w
).
val
(
$
(
link
).
attr
(
'title'
)
);
$
(
link
).
attr
(
'target'
)
==
'_blank'
&&
$
(
'#kmui-link-Jtarget'
).
attr
(
'checked'
,
true
)
}
},
buttons
:
{
'ok'
:
{
exec
:
function
(
km
,
$w
)
{
var
href
=
$
(
'#kmui-link-Jhref'
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
);
exec
:
function
(
km
,
$w
)
{
var
href
=
$
(
'#kmui-link-Jhref'
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
);
if
(
href
)
{
km
.
execCommand
(
'link'
,
{
if
(
href
)
{
km
.
execCommand
(
'link'
,
{
'href'
:
href
,
'target'
:
$
(
"#kmui-link-Jtarget:checked"
).
length
?
"_blank"
:
'_self'
,
'title'
:
$
(
"#kmui-link-Jtitle"
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
),
'target'
:
$
(
"#kmui-link-Jtarget:checked"
).
length
?
"_blank"
:
'_self'
,
'title'
:
$
(
"#kmui-link-Jtitle"
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
),
'_href'
:
href
});
}
);
}
}
},
'cancel'
:{}
'cancel'
:
{}
},
width
:
400
})
})();
}
)
}
)();
\ No newline at end of file
src/adapter/dialog.js
View file @
c949ffd1
...
...
@@ -37,10 +37,10 @@ KM.registerUI( 'markers', function ( name ) {
var
$this
=
$
(
this
);
var
val
=
$this
.
val
();
me
.
execCommand
(
"changeicon"
,
"PriorityIcon"
,
val
);
}
).
on
(
"click"
,
"#icon-pr
ogress
li"
,
function
()
{
}
).
on
(
"click"
,
"#icon-pr
iority
li"
,
function
()
{
var
$this
=
$
(
this
);
var
val
=
$this
.
val
();
me
.
execCommand
(
"changeicon"
,
"Pr
ogress
Icon"
,
val
);
me
.
execCommand
(
"changeicon"
,
"Pr
iority
Icon"
,
val
);
}
);
}
).
attachTo
(
$btn
)
}
);
...
...
src/module/icon.js
View file @
c949ffd1
...
...
@@ -40,25 +40,25 @@ KityMinder.registerModule( "IconModule", function () {
if
(
val
<
5
)
d
.
close
();
_percent
.
fill
(
"#29A6BD"
);
};
var
ChangeIconCommand
=
kity
.
createClass
(
"AddIcon
Command"
,
(
function
()
{
var
setPriorityCommand
=
kity
.
createClass
(
"SetPriority
Command"
,
(
function
()
{
return
{
base
:
Command
,
execute
:
function
(
km
,
iconType
,
value
)
{
execute
:
function
(
km
,
value
)
{
var
nodes
=
km
.
getSelectedNodes
();
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
nodes
[
i
].
setData
(
iconType
,
value
);
nodes
[
i
].
setData
(
"PriorityIcon"
,
value
);
km
.
updateLayout
(
nodes
[
i
]
);
}
}
};
}
)()
);
var
RemoveIconCommand
=
kity
.
createClass
(
"RemoveIcon
Command"
,
(
function
()
{
var
setProgressCommand
=
kity
.
createClass
(
"SetProgress
Command"
,
(
function
()
{
return
{
base
:
Command
,
execute
:
function
(
km
,
iconTyp
e
)
{
execute
:
function
(
km
,
valu
e
)
{
var
nodes
=
km
.
getSelectedNodes
();
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
nodes
[
i
].
setData
(
iconType
,
null
);
nodes
[
i
].
setData
(
"ProgressIcon"
,
value
);
km
.
updateLayout
(
nodes
[
i
]
);
}
}
...
...
@@ -66,13 +66,10 @@ KityMinder.registerModule( "IconModule", function () {
}
)()
);
return
{
"commands"
:
{
"
changeicon"
:
ChangeIcon
Command
,
"
removeicon"
:
RemoveIcon
Command
"
setpriority"
:
setPriority
Command
,
"
setprogress"
:
setProgress
Command
},
"events"
:
{
""
:
function
(
e
)
{
},
"RenderNode"
:
function
(
e
)
{
var
node
=
e
.
node
;
var
iconRc
=
node
.
getIconRc
();
...
...
src/ui/modal.js
View file @
c949ffd1
...
...
@@ -5,13 +5,16 @@ KM.ui.define( 'modal', {
'<div class="kmui-close" data-hide="modal"></div>'
+
'<h3 class="kmui-title"><%=title%></h3>'
+
'</div>'
+
'<div>'
+
'<h3>优先级</h3>'
+
'<ul class="icon-list" id="icon-priority"><li value="1">1</li><li value="2">2</li><li value="3">3</li><li value="4">4</li><li value="5">5</li></ul>'
+
'<h3>进程</h3>'
+
'<ul class="icon-list" id="icon-progress"><li value="1">1</li><li value="2">2</li><li value="3">3</li><li value="4">4</li><li value="5">5</li></ul>'
+
'<div class="kmui-modal-body" style="<%if(width){%>width:<%=width%>px;<%}%>'
+
'<%if(height){%>height:<%=height%>px;<%}%>">'
+
' </div>'
+
'<% if(cancellabel || oklabel) {%>'
+
'<div class="kmui-modal-footer">'
+
'<div class="kmui-modal-tip"></div>'
+
'<%if(oklabel){%><div class="kmui-btn kmui-btn-primary" data-ok="modal"><%=oklabel%></div><%}%>'
+
'<%if(cancellabel){%><div class="kmui-btn" data-hide="modal"><%=cancellabel%></div><%}%>'
+
'</div>'
+
'</div>'
,
'<
%}%><
/div>'
,
defaultOpt
:
{
title
:
""
,
cancellabel
:
""
,
...
...
themes/default/images/flag.png
0 → 100644
View file @
c949ffd1
3.22 KB
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