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
;
var
utils
=
KM
.
utils
;
function
hrefStartWith
(
href
,
arr
)
{
href
=
href
.
replace
(
/^
\s
+|
\s
+$/g
,
''
);
function
hrefStartWith
(
href
,
arr
)
{
for
(
var
i
=
0
,
ai
;
ai
=
arr
[
i
++
];)
{
href
=
href
.
replace
(
/^
\s
+|
\s
+$/g
,
''
);
if
(
href
.
indexOf
(
ai
)
==
0
)
{
for
(
var
i
=
0
,
ai
;
ai
=
arr
[
i
++
];
)
{
if
(
href
.
indexOf
(
ai
)
==
0
)
{
return
true
;
return
true
;
}
}
}
}
return
false
;
return
false
;
}
}
KM
.
registerWidget
(
'markers'
,
{
KM
.
registerWidget
(
'markers'
,
{
tpl
:
"<style type=
\"
text/css
\"
>"
+
tpl
:
'<div class="kmui-modal" tabindex="-1" >'
+
".kmui-dialog-link .kmui-link-table{font-size: 12px;margin: 10px;line-height: 30px}"
+
'<div class="kmui-modal-header">'
+
".kmui-dialog-link .kmui-link-txt{width:300px;height:21px;line-height:21px;border:1px solid #d7d7d7;}"
+
'<div class="kmui-close" data-hide="modal"></div>'
+
"</style>"
+
'<h3 class="kmui-title"><%=title%></h3>'
+
"<table class=
\"
kmui-link-table
\"
>"
+
'</div>'
+
"<tr>"
+
'<div>'
+
"<td><label for=
\"
href
\"
><%=lang_input_url%></label></td>"
+
'<h3>优先级</h3>'
+
"<td><input class=
\"
kmui-link-txt
\"
id=
\"
kmui-link-Jhref
\"
type=
\"
text
\"
/></td>"
+
'<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>'
+
"</tr>"
+
'<h3>进程</h3>'
+
"<tr>"
+
'<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>'
+
"<td><label for=
\"
title
\"
><%=lang_input_title%></label></td>"
+
'</div>'
+
"<td><input class=
\"
kmui-link-txt
\"
id=
\"
kmui-link-Jtitle
\"
type=
\"
text
\"
/></td>"
+
'</div>'
,
"</tr>"
+
initContent
:
function
(
km
)
{
"<tr>"
+
var
lang
=
km
.
getLang
(
'dialogs.markers'
);
"<td colspan=
\"
2
\"
>"
+
if
(
lang
)
{
"<label for=
\"
target
\"
><%=lang_input_target%></label>"
+
var
html
=
$
.
parseTmpl
(
this
.
tpl
,
lang
.
static
);
"<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
);
}
}
this
.
root
().
html
(
html
);
this
.
root
().
html
(
html
);
},
},
initEvent
:
function
(
km
,
$w
)
{
initEvent
:
function
(
km
,
$w
)
{
var
link
=
km
.
queryCommandValue
(
'link'
);
var
link
=
km
.
queryCommandValue
(
'link'
);
if
(
link
)
{
if
(
link
)
{
$
(
'#kmui-link-Jhref'
,
$w
).
val
(
utils
.
html
(
$
(
link
).
attr
(
'href'
))
);
$
(
'#kmui-link-Jhref'
,
$w
).
val
(
utils
.
html
(
$
(
link
).
attr
(
'href'
)
)
);
$
(
'#kmui-link-Jtitle'
,
$w
).
val
(
$
(
link
).
attr
(
'title'
)
);
$
(
'#kmui-link-Jtitle'
,
$w
).
val
(
$
(
link
).
attr
(
'title'
)
);
$
(
link
).
attr
(
'target'
)
==
'_blank'
&&
$
(
'#kmui-link-Jtarget'
).
attr
(
'checked'
,
true
)
$
(
link
).
attr
(
'target'
)
==
'_blank'
&&
$
(
'#kmui-link-Jtarget'
).
attr
(
'checked'
,
true
)
}
}
},
},
buttons
:
{
buttons
:
{
'ok'
:
{
'ok'
:
{
exec
:
function
(
km
,
$w
)
{
exec
:
function
(
km
,
$w
)
{
var
href
=
$
(
'#kmui-link-Jhref'
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
);
var
href
=
$
(
'#kmui-link-Jhref'
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
);
if
(
href
)
{
if
(
href
)
{
km
.
execCommand
(
'link'
,
{
km
.
execCommand
(
'link'
,
{
'href'
:
href
,
'href'
:
href
,
'target'
:
$
(
"#kmui-link-Jtarget:checked"
).
length
?
"_blank"
:
'_self'
,
'target'
:
$
(
"#kmui-link-Jtarget:checked"
).
length
?
"_blank"
:
'_self'
,
'title'
:
$
(
"#kmui-link-Jtitle"
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
),
'title'
:
$
(
"#kmui-link-Jtitle"
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
),
'_href'
:
href
'_href'
:
href
});
}
);
}
}
}
}
},
},
'cancel'
:{}
'cancel'
:
{}
},
},
width
:
400
width
:
400
})
}
)
})();
}
)();
\ No newline at end of file
src/adapter/dialog.js
View file @
c949ffd1
...
@@ -37,10 +37,10 @@ KM.registerUI( 'markers', function ( name ) {
...
@@ -37,10 +37,10 @@ KM.registerUI( 'markers', function ( name ) {
var
$this
=
$
(
this
);
var
$this
=
$
(
this
);
var
val
=
$this
.
val
();
var
val
=
$this
.
val
();
me
.
execCommand
(
"changeicon"
,
"PriorityIcon"
,
val
);
me
.
execCommand
(
"changeicon"
,
"PriorityIcon"
,
val
);
}
).
on
(
"click"
,
"#icon-pr
ogress
li"
,
function
()
{
}
).
on
(
"click"
,
"#icon-pr
iority
li"
,
function
()
{
var
$this
=
$
(
this
);
var
$this
=
$
(
this
);
var
val
=
$this
.
val
();
var
val
=
$this
.
val
();
me
.
execCommand
(
"changeicon"
,
"Pr
ogress
Icon"
,
val
);
me
.
execCommand
(
"changeicon"
,
"Pr
iority
Icon"
,
val
);
}
);
}
);
}
).
attachTo
(
$btn
)
}
).
attachTo
(
$btn
)
}
);
}
);
...
...
src/module/icon.js
View file @
c949ffd1
...
@@ -40,25 +40,25 @@ KityMinder.registerModule( "IconModule", function () {
...
@@ -40,25 +40,25 @@ KityMinder.registerModule( "IconModule", function () {
if
(
val
<
5
)
d
.
close
();
if
(
val
<
5
)
d
.
close
();
_percent
.
fill
(
"#29A6BD"
);
_percent
.
fill
(
"#29A6BD"
);
};
};
var
ChangeIconCommand
=
kity
.
createClass
(
"AddIcon
Command"
,
(
function
()
{
var
setPriorityCommand
=
kity
.
createClass
(
"SetPriority
Command"
,
(
function
()
{
return
{
return
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
,
iconType
,
value
)
{
execute
:
function
(
km
,
value
)
{
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getSelectedNodes
();
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
nodes
[
i
].
setData
(
iconType
,
value
);
nodes
[
i
].
setData
(
"PriorityIcon"
,
value
);
km
.
updateLayout
(
nodes
[
i
]
);
km
.
updateLayout
(
nodes
[
i
]
);
}
}
}
}
};
};
}
)()
);
}
)()
);
var
RemoveIconCommand
=
kity
.
createClass
(
"RemoveIcon
Command"
,
(
function
()
{
var
setProgressCommand
=
kity
.
createClass
(
"SetProgress
Command"
,
(
function
()
{
return
{
return
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
,
iconTyp
e
)
{
execute
:
function
(
km
,
valu
e
)
{
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getSelectedNodes
();
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
nodes
[
i
].
setData
(
iconType
,
null
);
nodes
[
i
].
setData
(
"ProgressIcon"
,
value
);
km
.
updateLayout
(
nodes
[
i
]
);
km
.
updateLayout
(
nodes
[
i
]
);
}
}
}
}
...
@@ -66,13 +66,10 @@ KityMinder.registerModule( "IconModule", function () {
...
@@ -66,13 +66,10 @@ KityMinder.registerModule( "IconModule", function () {
}
)()
);
}
)()
);
return
{
return
{
"commands"
:
{
"commands"
:
{
"
changeicon"
:
ChangeIcon
Command
,
"
setpriority"
:
setPriority
Command
,
"
removeicon"
:
RemoveIcon
Command
"
setprogress"
:
setProgress
Command
},
},
"events"
:
{
"events"
:
{
""
:
function
(
e
)
{
},
"RenderNode"
:
function
(
e
)
{
"RenderNode"
:
function
(
e
)
{
var
node
=
e
.
node
;
var
node
=
e
.
node
;
var
iconRc
=
node
.
getIconRc
();
var
iconRc
=
node
.
getIconRc
();
...
...
src/ui/modal.js
View file @
c949ffd1
...
@@ -5,13 +5,16 @@ KM.ui.define( 'modal', {
...
@@ -5,13 +5,16 @@ KM.ui.define( 'modal', {
'<div class="kmui-close" data-hide="modal"></div>'
+
'<div class="kmui-close" data-hide="modal"></div>'
+
'<h3 class="kmui-title"><%=title%></h3>'
+
'<h3 class="kmui-title"><%=title%></h3>'
+
'</div>'
+
'</div>'
+
'<div>'
+
'<div class="kmui-modal-body" style="<%if(width){%>width:<%=width%>px;<%}%>'
+
'<h3>优先级</h3>'
+
'<%if(height){%>height:<%=height%>px;<%}%>">'
+
'<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>'
+
' </div>'
+
'<h3>进程</h3>'
+
'<% if(cancellabel || oklabel) {%>'
+
'<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-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>'
,
'<
%}%><
/div>'
,
defaultOpt
:
{
defaultOpt
:
{
title
:
""
,
title
:
""
,
cancellabel
:
""
,
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