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
0523e1d0
Commit
0523e1d0
authored
Feb 27, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into gh-pages
parents
7fce48b2
a4301c1c
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
196 additions
and
75 deletions
+196
-75
index.html
dist/index.html
+5
-1
social.css
dist/social.css
+108
-7
social.js
dist/social.js
+1
-1
social.less
dist/social.less
+2
-2
minder.js
src/core/minder.js
+3
-0
paste.js
src/module/paste.js
+8
-0
dropmenu.js
src/ui/dropmenu.js
+66
-61
dialog.css
themes/default/css/dialog.css
+1
-1
kityminder.css
themes/default/css/kityminder.css
+2
-2
No files found.
dist/index.html
View file @
0523e1d0
...
...
@@ -8,7 +8,7 @@
<script
src=
"social.js"
charset=
"utf-8"
></script>
<script
src=
"../kity/dist/kitygraph.all.js"
charset=
"utf-8"
></script>
<script
src=
"../configure.js"
charset=
"utf-8"
></script>
<script
src=
"../dist/dev.
js
"
charset=
"utf-8"
></script>
<script
src=
"../dist/dev.
php
"
charset=
"utf-8"
></script>
<script
src=
"../lang/zh-cn/zh-cn.js"
charset=
"utf-8"
></script>
<link
href=
"../themes/default/css/import.css"
type=
"text/css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"social.css"
>
...
...
@@ -27,6 +27,10 @@
margin
:
0
;
padding
:
0
;
}
html
,
body
,
div
.kmui-editor-body
{
height
:
100%
;
-moz-user-select
:
none
;
}
</style>
</head>
<body
>
...
...
dist/social.css
View file @
0523e1d0
#social
{
position
:
absolute
;
right
:
10px
;
top
:
10px
;
line-height
:
20px
;
text-align
:
right
;
overflow
:
hidden
}
#social
button
{
outline
:
none
;
display
:
inline-block
;
padding
:
0
15px
;
height
:
35px
;
font-size
:
13px
;
line-height
:
35px
;
text-align
:
center
;
border-radius
:
5px
;
color
:
#fff
;
text-decoration
:
none
;
border
:
none
;
margin-left
:
5px
;
cursor
:
pointer
;
background
:
#0099f2
;
background
:
url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwOTlmMiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjNDA5NmVlIiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwNzZkZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=)
;
background
:
-moz-linear-gradient
(
top
,
#0099f2
0
,
#4096ee
0
,
#0076dd
100%
);
background
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0
,
#0099f2
),
color-stop
(
0
,
#4096ee
),
color-stop
(
100%
,
#0076dd
));
background
:
-webkit-linear-gradient
(
top
,
#0099f2
0
,
#4096ee
0
,
#0076dd
100%
);
background
:
-o-linear-gradient
(
top
,
#0099f2
0
,
#4096ee
0
,
#0076dd
100%
);
background
:
-ms-linear-gradient
(
top
,
#0099f2
0
,
#4096ee
0
,
#0076dd
100%
);
background
:
linear-gradient
(
to
bottom
,
#0099f2
0
,
#4096ee
0
,
#0076dd
100%
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
startColorstr
=
'#0099f2'
,
endColorstr
=
'#0076dd'
,
GradientType
=
0
);}
#social
button
:hover
{
background
:
#009fff
}
#social
button
[
disabled
]
{
background
:
#aaa
}
#social
button
.baidu-cloud
{
padding-left
:
35px
;
position
:
relative
}
#social
button
.baidu-cloud
:before
{
content
:
' '
;
display
:
block
;
width
:
24px
;
height
:
24px
;
background
:
url(../themes/default/images/baiducloud.png)
;
position
:
absolute
;
left
:
7px
;
top
:
5px
}
#social
button
.share
{
padding-left
:
35px
;
position
:
relative
}
#social
button
.share
:before
{
content
:
' '
;
display
:
block
;
width
:
24px
;
height
:
24px
;
background
:
url(../themes/default/images/share.png)
no-repeat
;
position
:
absolute
;
left
:
7px
;
top
:
5px
}
#social
button
img
{
position
:
relative
;
top
:
3px
;
border-radius
:
2px
;
margin-right
:
7px
}
#social
button
.user-file
{
padding-right
:
28px
;
position
:
relative
}
#social
button
.user-file
:after
{
content
:
' '
;
display
:
block
;
position
:
absolute
;
right
:
10px
;
top
:
15px
;
width
:
0
;
height
:
0
;
border
:
solid
;
border-width
:
4px
5px
;
border-color
:
#fff
transparent
transparent
transparent
}
.user-file-menu
{
margin-top
:
20px
;
margin-left
:
1px
}
#social
{
position
:
absolute
;
right
:
10px
;
top
:
10px
;
line-height
:
20px
;
text-align
:
right
;
overflow
:
hidden
;
}
#social
button
{
font-family
:
Arial
,
"Heiti SC"
,
"Microsoft Yahei"
;
outline
:
none
;
display
:
inline-block
;
padding
:
0
15px
;
height
:
35px
;
font-size
:
13px
;
line-height
:
35px
;
text-align
:
center
;
border-radius
:
5px
;
color
:
#ffffff
;
text-decoration
:
none
;
border
:
none
;
margin-left
:
5px
;
cursor
:
pointer
;
background
:
#0099f2
;
/* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background
:
url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwOTlmMiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjNDA5NmVlIiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwNzZkZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=)
;
background
:
-moz-linear-gradient
(
top
,
#0099f2
0%
,
#4096ee
0%
,
#0076dd
100%
);
/* FF3.6+ */
background
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0%
,
#0099f2
),
color-stop
(
0%
,
#4096ee
),
color-stop
(
100%
,
#0076dd
));
/* Chrome,Safari4+ */
background
:
-webkit-linear-gradient
(
top
,
#0099f2
0%
,
#4096ee
0%
,
#0076dd
100%
);
/* Chrome10+,Safari5.1+ */
background
:
-o-linear-gradient
(
top
,
#0099f2
0%
,
#4096ee
0%
,
#0076dd
100%
);
/* Opera 11.10+ */
background
:
-ms-linear-gradient
(
top
,
#0099f2
0%
,
#4096ee
0%
,
#0076dd
100%
);
/* IE10+ */
background
:
linear-gradient
(
to
bottom
,
#0099f2
0%
,
#4096ee
0%
,
#0076dd
100%
);
/* W3C */
}
#social
button
:hover
{
background
:
#009fff
;
}
#social
button
[
disabled
]
{
background
:
#AAA
;
}
#social
button
.baidu-cloud
{
padding-left
:
35px
;
position
:
relative
;
}
#social
button
.baidu-cloud
:before
{
content
:
' '
;
display
:
block
;
width
:
24px
;
height
:
24px
;
background
:
url(../themes/default/images/baiducloud.png)
;
position
:
absolute
;
left
:
7px
;
top
:
5px
;
}
#social
button
.share
{
padding-left
:
35px
;
position
:
relative
;
}
#social
button
.share
:before
{
content
:
' '
;
display
:
block
;
width
:
24px
;
height
:
24px
;
background
:
url(../themes/default/images/share.png)
no-repeat
;
position
:
absolute
;
left
:
7px
;
top
:
5px
;
}
#social
button
img
{
position
:
relative
;
top
:
3px
;
border-radius
:
2px
;
margin-right
:
7px
;
}
#social
button
.user-file
{
padding-right
:
28px
;
position
:
relative
;
}
#social
button
.user-file
:after
{
content
:
' '
;
display
:
block
;
position
:
absolute
;
right
:
10px
;
top
:
15px
;
width
:
0
;
height
:
0
;
border
:
solid
;
border-width
:
4px
5px
;
border-color
:
#FFFFFF
transparent
transparent
transparent
;
}
.user-file-menu
{
margin-top
:
20px
;
margin-left
:
1px
;
}
dist/social.js
View file @
0523e1d0
...
...
@@ -141,7 +141,7 @@ $( function () {
}
function
addToRecentMenu
(
list
)
{
console
.
log
(
list
);
list
.
splice
(
8
);
list
.
forEach
(
function
(
file
)
{
$user_menu
.
appendItem
(
{
item
:
{
...
...
dist/social.less
View file @
0523e1d0
...
...
@@ -6,6 +6,7 @@
text-align: right;
overflow: hidden;
button {
font-family: Arial, "Heiti SC", "Microsoft Yahei";
outline: none;
display: inline-block;
padding: 0 15px;
...
...
@@ -27,7 +28,6 @@
background: -o-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* IE10+ */
background: linear-gradient(to bottom, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0099f2', endColorstr='#0076dd',GradientType=0 ); /* IE6-8 */
&:hover {
background: #009fff;
...
...
src/core/minder.js
View file @
0523e1d0
...
...
@@ -27,6 +27,9 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
_paper
=
new
kity
.
Paper
();
this
.
_paper
.
getNode
().
setAttribute
(
'contenteditable'
,
true
);
this
.
_paper
.
getNode
().
ondragstart
=
function
(
e
)
{
e
.
preventDefault
();
};
this
.
_addRenderContainer
();
...
...
src/module/paste.js
0 → 100644
View file @
0523e1d0
KityMinder
.
registerModule
(
"pasteModule"
,
function
()
{
var
km
=
this
;
//getSelectedTopNodes
return
{
};
}
);
\ No newline at end of file
src/ui/dropmenu.js
View file @
0523e1d0
//dropmenu 类
KM
.
ui
.
define
(
'dropmenu'
,
{
KM
.
ui
.
define
(
'dropmenu'
,
{
tmpl
:
'<ul class="kmui-dropdown-menu" aria-labelledby="dropdownMenu" >'
+
'<%if(data && data.length){for(var i=0,ci;ci=data[i++];){%>'
+
'<%if(ci.divider){%><li class="kmui-divider"></li><%}else{%>'
+
'<li <%if(ci.active||ci.disabled){%>class="<%= ci.active||
\'\'
%> <%=ci.disabled||
\'\'
%>" <%}%> data-value="<%= ci.value%>" data-label="<%= ci.label%>">'
+
'<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= ci.label%></a>'
+
'</li><%}}%>'
+
'<%}%>'
+
'<%}%>'
+
'</ul>'
,
subTmpl
:
'<%if(data && data.length){for(var i=0,ci;ci=data[i++];){%>'
+
subTmpl
:
'<%if(data && data.length){for(var i=0,ci;ci=data[i++];){%>'
+
'<%if(ci.divider){%><li class="kmui-divider"></li><%}else{%>'
+
'<li <%if(ci.active||ci.disabled){%>class="<%= ci.active||
\'\'
%> <%=ci.disabled||
\'\'
%>" <%}%> data-value="<%= ci.value%>" data-label="<%= ci.label%>">'
+
'<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= ci.label%></a>'
+
...
...
@@ -16,33 +16,32 @@ KM.ui.define( 'dropmenu', {
'<%}%>'
,
defaultOpt
:
{
data
:
[],
click
:
function
()
{}
click
:
function
()
{
}
},
setData
:
function
(
items
)
{
setData
:
function
(
items
)
{
this
.
root
().
html
(
$
.
parseTmpl
(
this
.
subTmpl
,
items
)
);
this
.
root
().
html
(
$
.
parseTmpl
(
this
.
subTmpl
,
items
)
);
return
this
;
},
position
:
function
(
offset
)
{
this
.
root
().
css
(
{
left
:
offset
.
x
,
top
:
offset
.
y
}
);
position
:
function
(
offset
)
{
this
.
root
().
css
({
left
:
offset
.
x
,
top
:
offset
.
y
});
return
this
;
},
show
:
function
()
{
if
(
this
.
trigger
(
'beforeshow'
)
===
false
)
{
show
:
function
()
{
if
(
this
.
trigger
(
'beforeshow'
)
===
false
)
{
return
;
}
else
{
this
.
root
().
css
(
{
display
:
'block'
}
);
this
.
trigger
(
'aftershow'
);
}
else
{
this
.
root
().
css
({
display
:
'block'
});
this
.
trigger
(
'aftershow'
);
}
return
this
;
},
init
:
function
(
options
)
{
init
:
function
(
options
)
{
var
me
=
this
;
var
eventName
=
{
click
:
1
,
...
...
@@ -50,48 +49,54 @@ KM.ui.define( 'dropmenu', {
mouseout
:
1
};
this
.
root
(
$
(
$
.
parseTmpl
(
this
.
tmpl
,
options
)
)
).
on
(
'click'
,
'li[class!="kmui-disabled kmui-divider kmui-dropdown-submenu"]'
,
function
(
evt
)
{
$
.
proxy
(
options
.
click
,
me
,
evt
,
$
(
this
).
data
(
'value'
),
$
(
this
).
data
(
'label'
),
$
(
this
)
)()
}
).
find
(
'li'
).
each
(
function
(
i
,
el
)
{
var
$this
=
$
(
this
);
if
(
!
$this
.
hasClass
(
"kmui-disabled kmui-divider kmui-dropdown-submenu"
)
)
{
var
data
=
options
.
data
[
i
];
$
.
each
(
eventName
,
function
(
k
)
{
data
[
k
]
&&
$this
[
k
](
function
(
evt
)
{
$
.
proxy
(
data
[
k
],
el
)(
evt
,
data
,
me
.
root
)
}
)
}
)
this
.
root
(
$
(
$
.
parseTmpl
(
this
.
tmpl
,
options
))).
on
(
'click'
,
'li[class!="kmui-disabled kmui-divider kmui-dropdown-submenu"]'
,
function
(
evt
)
{
$
.
proxy
(
options
.
click
,
me
,
evt
,
$
(
this
).
data
(
'value'
),
$
(
this
).
data
(
'label'
),
$
(
this
)
)()
}
).
find
(
'li'
).
each
(
function
(
i
,
el
)
{
var
$this
=
$
(
this
);
if
(
!
$this
.
hasClass
(
"kmui-disabled kmui-divider kmui-dropdown-submenu"
)
)
{
var
data
=
options
.
data
[
i
];
$
.
each
(
eventName
,
function
(
k
)
{
data
[
k
]
&&
$this
[
k
](
function
(
evt
)
{
$
.
proxy
(
data
[
k
],
el
)(
evt
,
data
,
me
.
root
)
}
)
}
)
}
}
)
});
},
disabled
:
function
(
cb
)
{
$
(
'li[class!=kmui-divider]'
,
this
.
root
()
).
each
(
function
()
{
var
$el
=
$
(
this
);
if
(
cb
===
true
)
{
$el
.
addClass
(
'kmui-disabled'
)
}
else
if
(
$
.
isFunction
(
cb
)
)
{
$el
.
toggleClass
(
'kmui-disabled'
,
cb
(
li
)
)
_initEvent
:
function
(){
this
.
root
().
on
(
'mouseover'
,
'li[class="kmui-dropdown-submenu'
,
function
(
e
){
var
$submenu
=
$
(
this
).
data
(
'widget'
);
$submenu
.
kmui
().
show
(
$
(
this
),
'right'
,
'position'
,
5
,
2
)
});
},
disabled
:
function
(
cb
)
{
$
(
'li[class!=kmui-divider]'
,
this
.
root
()).
each
(
function
()
{
var
$el
=
$
(
this
);
if
(
cb
===
true
)
{
$el
.
addClass
(
'kmui-disabled'
)
}
else
if
(
$
.
isFunction
(
cb
))
{
$el
.
toggleClass
(
'kmui-disabled'
,
cb
(
li
))
}
else
{
$el
.
removeClass
(
'kmui-disabled'
)
$el
.
removeClass
(
'kmui-disabled'
)
}
}
);
});
},
val
:
function
(
val
)
{
val
:
function
(
val
)
{
var
currentVal
;
$
(
'li[class!="kmui-divider kmui-disabled kmui-dropdown-submenu"]'
,
this
.
root
()
).
each
(
function
()
{
var
$el
=
$
(
this
);
if
(
val
===
undefined
)
{
if
(
$el
.
find
(
'em.kmui-dropmenu-checked'
).
length
)
{
currentVal
=
$el
.
data
(
'value'
);
$
(
'li[class!="kmui-divider kmui-disabled kmui-dropdown-submenu"]'
,
this
.
root
()).
each
(
function
()
{
var
$el
=
$
(
this
);
if
(
val
===
undefined
)
{
if
(
$el
.
find
(
'em.kmui-dropmenu-checked'
).
length
)
{
currentVal
=
$el
.
data
(
'value'
);
return
false
}
}
else
{
$el
.
find
(
'em'
).
toggleClass
(
'kmui-dropmenu-checked'
,
$el
.
data
(
'value'
)
==
val
)
$el
.
find
(
'em'
).
toggleClass
(
'kmui-dropmenu-checked'
,
$el
.
data
(
'value'
)
==
val
)
}
}
);
if
(
val
===
undefined
)
{
});
if
(
val
===
undefined
)
{
return
currentVal
}
},
...
...
@@ -104,18 +109,18 @@ KM.ui.define( 'dropmenu', {
var
$item
=
$
(
html
).
click
(
item
.
click
);
this
.
root
().
append
(
$item
);
},
addSubmenu
:
function
(
label
,
menu
,
index
)
{
addSubmenu
:
function
(
label
,
menu
,
index
)
{
index
=
index
||
0
;
var
$list
=
$
(
'li[class!=kmui-divider]'
,
this
.
root
()
);
var
$node
=
$
(
'<li class="kmui-dropdown-submenu"><a tabindex="-1" href="#">'
+
label
+
'</a></li>'
).
append
(
menu
);
if
(
index
>=
0
&&
index
<
$list
.
length
)
{
$node
.
insertBefore
(
$list
[
index
]
);
}
else
if
(
index
<
0
)
{
$node
.
insertBefore
(
$list
[
0
]
);
}
else
if
(
index
>=
$list
.
length
)
{
$node
.
appendTo
(
$list
);
var
$list
=
$
(
'li[class!=kmui-divider]'
,
this
.
root
()
);
var
$node
=
$
(
'<li class="kmui-dropdown-submenu"><a tabindex="-1" href="#">'
+
label
+
'</a></li>'
).
append
(
menu
);
$node
.
data
(
'widget'
,
menu
);
if
(
index
>=
0
&&
index
<
$list
.
length
)
{
$node
.
insertBefore
(
$list
[
index
]
);
}
else
if
(
index
<
0
)
{
$node
.
insertBefore
(
$list
[
0
]
);
}
else
if
(
index
>=
$list
.
length
)
{
$node
.
appendTo
(
$list
);
}
}
},
'menu'
);
\ No newline at end of file
},
'menu'
);
\ No newline at end of file
themes/default/css/dialog.css
View file @
0523e1d0
.kmui-modal
{
position
:
fixed
;
top
:
1
0px
;
top
:
6
0px
;
right
:
10px
;
background-color
:
#ffffff
;
outline
:
0
;
...
...
themes/default/css/kityminder.css
View file @
0523e1d0
...
...
@@ -14,9 +14,9 @@
border-radius
:
4px
;
box-shadow
:
3px
3px
8px
rgba
(
0
,
0
,
0
,
.5
);
}
.kmui-container
.kmui-editor-body
{
.kmui-container
.kmui-editor-body
{
background
:
rgb
(
50
,
60
,
61
)
url(../images/grid.png)
repeat
;
line-height
:
0
;
/*line-height: 0;*/
overflow
:
hidden
;
}
svg
{
...
...
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