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
e9d87fe6
Commit
e9d87fe6
authored
Sep 16, 2014
by
zhangbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rediret && bug fix
parent
1e41f4c8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
24 deletions
+54
-24
_share.less
ui/theme/default/css/_share.less
+12
-11
switch-view.js
ui/topbar/switch-view.js
+23
-13
viewshare.html
viewshare.html
+19
-0
No files found.
ui/theme/default/css/_share.less
View file @
e9d87fe6
...
...
@@ -229,8 +229,7 @@
font-size: 16px;
padding-left: 15px;
border-bottom: none;
position: absolute;
width: 100%;
.dock;
}
.priority {
height: 20px;
...
...
@@ -310,16 +309,18 @@
padding: 3px 5px;
border-radius: 2px;
font-size: 12px;
line-height: 16px;
color: rgb(77, 65, 0);
vertical-align: middle;
margin-left: 8px;
margin: 14px 8px;
float: right;
}
.hyperlink {
display:
inline-
block;
/* float: left; */
display: block;
float: right;
width: 30px;
height: 20px;
margin
-left
: 15px;
margin: 15px;
padding: 0;
background: url(../images/icons.png) no-repeat 0 -80px;
background-size: 20px;
...
...
@@ -355,11 +356,11 @@
.dock;
}
.text {
width:12em;
white-space:nowrap;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
overflow:hidden;
display: block;
white-space:
nowrap;
text-overflow:
ellipsis;
-o-text-overflow:
ellipsis;
overflow:
hidden;
vertical-align: middle;
}
}
\ No newline at end of file
ui/topbar/switch-view.js
View file @
e9d87fe6
...
...
@@ -14,16 +14,16 @@ KityMinder.registerUI('topbar/switch-view', function(minder) {
$
(
'<div class="back"></div>'
).
appendTo
(
'#m-logo'
);
var
treeData
;
var
$curView
=
$
(
'<div>'
);
var
$preView
=
$
(
'<div>'
);
var
$curView
=
$
(
'<div
id="curView"
>'
);
var
$preView
=
$
(
'<div
id="preView"
>'
);
minder
.
on
(
'uiready'
,
function
()
{
var
shareView
=
minder
.
getUI
(
'menu/share/m-share'
);
shareView
.
ready
.
then
(
function
(){
treeData
=
addParentPointer
(
minder
);
$curView
=
renderNodeData
(
treeData
,
minder
,
$curView
);
$preView
=
renderNodeData
(
treeData
,
minder
,
$preView
);
renderNodeData
(
treeData
,
minder
,
$curView
);
renderNodeData
(
treeData
,
minder
,
$preView
);
$
(
'#km-list-view'
).
append
(
$curView
);
$
(
'#km-list-view'
).
append
(
$preView
);
$preView
.
css
(
'x'
,
'100%'
);
...
...
@@ -48,11 +48,16 @@ KityMinder.registerUI('topbar/switch-view', function(minder) {
$
(
'#km-list-view'
).
delegate
(
'li'
,
'click'
,
function
(){
var
preViewData
=
$
(
this
).
data
();
renderNodeData
(
preViewData
,
minder
,
$preView
);
if
(
preViewData
.
children
)
{
renderNodeData
(
preViewData
,
minder
,
$preView
);
// $curView.css('x');
// console.log($preView.css('x'));
$preView
.
css
(
'x'
,
parseInt
(
$curView
.
css
(
'x'
))
+
100
+
'%'
);
// console.log($preView.css('x'));
// $('#km-list-view').css('x', '0');
$
(
'#km-list-view'
).
transition
({
x
:
'-100
%'
,
x
:
parseInt
(
$
(
'#km-list-view'
).
css
(
'x'
))
-
100
+
'
%'
,
duration
:
200
,
easing
:
'ease'
,
complete
:
function
(){
...
...
@@ -70,11 +75,14 @@ KityMinder.registerUI('topbar/switch-view', function(minder) {
});
$
(
'.back'
).
on
(
'click'
,
function
(){
var
parentViewData
=
$
(
'.cur-root'
).
data
();
$preView
.
css
(
'x'
,
'0'
);
var
parentViewData
=
$
(
'.cur-root'
,
$curView
).
data
();
renderNodeData
(
parentViewData
,
minder
,
$preView
);
$preView
.
css
(
'x'
,
parseInt
(
$curView
.
css
(
'x'
))
-
100
+
'%'
);
// $curView.css('x');
// $('#km-list-view').css('x', '-100%');
$
(
'#km-list-view'
).
transition
({
x
:
'0
'
,
x
:
parseInt
(
$
(
'#km-list-view'
).
css
(
'x'
))
+
100
+
'%
'
,
duration
:
200
,
easing
:
'ease'
,
complete
:
function
(){
...
...
@@ -135,6 +143,7 @@ function renderNodeData(node, minder, $target){
});
}
// debugger;
return
$target
.
html
(
$curRoot
.
add
(
$curList
));
}
...
...
@@ -167,7 +176,7 @@ function createListNode(node, minder){
// 处理子节点
if
(
node
.
children
){
$list
.
addClass
(
'clickable'
);
$list
.
append
(
'<span class="next-level"></span>'
);
$list
.
children
().
first
().
before
(
'<span class="next-level"></span>'
);
$list
.
data
(
node
);
}
...
...
@@ -193,8 +202,6 @@ function getNodeHtml (node, minder){
html
+=
'<div class="progress progress-'
+
data
.
progress
+
'"></div>'
}
// 处理文字
html
+=
'<span class="text">'
+
(
data
.
text
||
''
)
+
'</span>'
;
// 处理超链接
if
(
data
.
hyperlink
)
{
html
+=
'<a class="hyperlink" href="'
+
data
.
hyperlink
+
'" target="_blank"></a>'
;
...
...
@@ -206,6 +213,9 @@ function getNodeHtml (node, minder){
});
}
// 处理文字
if
(
data
.
text
)
{
html
+=
'<span class="text">'
+
(
data
.
text
||
''
)
+
'</span>'
;
}
return
html
;
}
viewshare.html
View file @
e9d87fe6
...
...
@@ -9,6 +9,25 @@
<title>
百度脑图 - 便捷的思维导图工具
</title>
<!--Judge whether it is mobile visited -->
<script>
function
browserRedirect
()
{
var
sUserAgent
=
navigator
.
userAgent
.
toLowerCase
();
var
bIsIpad
=
sUserAgent
.
match
(
/ipad/i
)
==
"ipad"
;
var
bIsIphoneOs
=
sUserAgent
.
match
(
/iphone os/i
)
==
"iphone os"
;
var
bIsMidp
=
sUserAgent
.
match
(
/midp/i
)
==
"midp"
;
var
bIsUc7
=
sUserAgent
.
match
(
/rv:1.2.3.4/i
)
==
"rv:1.2.3.4"
;
var
bIsUc
=
sUserAgent
.
match
(
/ucweb/i
)
==
"ucweb"
;
var
bIsAndroid
=
sUserAgent
.
match
(
/android/i
)
==
"android"
;
var
bIsCE
=
sUserAgent
.
match
(
/windows ce/i
)
==
"windows ce"
;
var
bIsWM
=
sUserAgent
.
match
(
/windows mobile/i
)
==
"windows mobile"
;
if
(
bIsIpad
||
bIsIphoneOs
||
bIsMidp
||
bIsUc7
||
bIsUc
||
bIsAndroid
||
bIsCE
||
bIsWM
)
{
window
.
location
.
href
=
window
.
location
.
href
.
replace
(
'viewshare.html'
,
'm-share.html'
);
}
}
browserRedirect
();
</script>
<script
src=
"import.share.js"
charset=
"utf-8"
></script>
<script
src=
"kityminder.config.js"
charset=
"utf-8"
></script>
<script
src=
"lang/zh-cn/zh-cn.js"
charset=
"utf-8"
></script>
...
...
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