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
c450681d
Commit
c450681d
authored
Mar 19, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
48a79cb0
503ba106
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
109 additions
and
38 deletions
+109
-38
links.css
dist/css/links.css
+2
-0
links.less
dist/css/links.less
+22
-0
index.html
dist/index.html
+11
-1
kityminder.all.js
dist/kityminder.all.js
+34
-14
kityminder.all.min.js
dist/kityminder.all.min.js
+5
-5
publish
publish
+20
-8
social.js
social/social.js
+2
-2
kityminder.js
src/core/kityminder.js
+1
-1
minder.data.js
src/core/minder.data.js
+12
-7
No files found.
dist/css/links.css
View file @
c450681d
...
...
@@ -3,3 +3,5 @@
#github-url
:after
{
content
:
' '
;
display
:
block
;
position
:
absolute
;
width
:
130px
;
height
:
130px
;
background
:
url(../img/github_mark.png)
no-repeat
5px
4px
}
#github-url
a
{
display
:
block
;
position
:
absolute
;
top
:
40px
;
font-size
:
18px
;
width
:
300px
;
height
:
40px
;
padding
:
10px
0
10px
20px
;
line-height
:
40px
;
color
:
#000
;
left
:
120px
;
border-radius
:
0
25px
25px
0
;
background-color
:
#fff
}
#about
{
position
:
absolute
;
bottom
:
10px
;
right
:
10px
;
height
:
24px
;
line-height
:
24px
;
color
:
#888
;
font-family
:
Arial
;
font-size
:
13px
;
font-weight
:
normal
;
margin
:
0
;
text-shadow
:
0
1px
1px
#000
}
#about
a
{
color
:
#888
}
#about
a
:hover
{
color
:
#fff
}
#km-version
.new-version
{
position
:
relative
;
padding-right
:
30px
}
#km-version
.new-version
:after
{
content
:
'NEW'
;
color
:
#ff0
;
position
:
absolute
;
top
:
-10px
;
right
:
-5px
;
display
:
block
;
background
:
#f00
;
padding
:
0
5px
;
border-radius
:
4px
;
text-shadow
:
none
;
box-shadow
:
-1px
1px
3px
rgba
(
0
,
0
,
0
,
0.3
);
-webkit-transform
:
scale
(
.6
);
-moz-transform
:
scale
(
.6
);
-ms-transform
:
scale
(
.6
);
transform
:
scale
(
.6
)}
dist/css/links.less
View file @
c450681d
...
...
@@ -80,4 +80,26 @@
color: white;
}
}
}
#km-version.new-version {
position: relative;
padding-right: 30px;
}
#km-version.new-version:after {
content: 'NEW';
color: yellow;
position: absolute;
top: -10px;
right: -5px;
display: block;
background: red;
padding: 0 5px;
border-radius: 4px;
text-shadow: none;
box-shadow: -1px 1px 3px rgba(0,0,0,.3);
-webkit-transform: scale(.6);
-moz-transform: scale(.6);
-ms-transform: scale(.6);
transform: scale(.6);
}
\ No newline at end of file
dist/index.html
View file @
c450681d
...
...
@@ -27,7 +27,7 @@
<a
href=
"https://github.com/fex-team/kityminder.git"
target=
"_blank"
>
Fork me on Github
</a>
</div>
<p
id=
"about"
>
Powered by f-cube,
<a
href=
"http://fex.baidu.com"
target=
"_blank"
>
FEX
</a>
|
KityMinder
<a
id=
"km-version"
href=
"https://github.com/fex-team/kityminder/blob/dev/CHANGELOG.md"
target=
"blank"
></a>
,
Powered by f-cube,
<a
href=
"http://fex.baidu.com"
target=
"_blank"
>
FEX
</a>
|
<a
href=
"https://github.com/fex-team/kityminder/issues/new"
target=
"_blank"
>
Report a Bug
</a>
|
<a
href=
"mailto:kity@baidu.com"
target=
"_blank"
>
Contact Us
</a>
</p>
...
...
@@ -36,5 +36,15 @@
<script>
// create km instance
window
.
km
=
KM
.
getKityMinder
(
'kityminder'
);
$
(
function
()
{
var
lastVersion
=
localStorage
.
lastKMVersion
;
$
(
'#km-version'
).
text
(
'v'
+
KM
.
version
);
if
(
lastVersion
!=
KM
.
version
)
{
$
(
'#km-version'
).
addClass
(
'new-version'
);
localStorage
.
lastKMVersion
=
KM
.
version
;
}
});
</script>
</html>
\ No newline at end of file
dist/kityminder.all.js
View file @
c450681d
/*!
* ====================================================
* kityminder - v1.0.0 - 2014-03-1
8
* kityminder - v1.0.0 - 2014-03-1
9
* https://github.com/fex-team/kityminder
* GitHub: https://github.com/fex-team/kityminder.git
* Copyright (c) 2014 f-cube @ FEX; Licensed MIT
...
...
@@ -12,7 +12,7 @@
var
KityMinder
=
window
.
KM
=
window
.
KityMinder
=
function
()
{
var
instanceMap
=
{},
instanceId
=
0
;
return
{
version
:
'1.
0
.0'
,
version
:
'1.
1
.0'
,
createMinder
:
function
(
renderTarget
,
options
)
{
options
=
options
||
{};
options
.
renderTo
=
Utils
.
isString
(
renderTarget
)
?
document
.
getElementById
(
renderTarget
)
:
renderTarget
;
...
...
@@ -968,9 +968,9 @@ Utils.extend( KityMinder, {
return
KityMinder
.
_protocals
[
name
]
||
null
;
},
getSupportedProtocals
:
function
()
{
return
Utils
.
keys
(
KityMinder
.
_protocals
).
sort
(
function
(
a
,
b
)
{
return
KityMinder
.
_protocals
[
b
].
recognizePriority
-
KityMinder
.
_protocals
[
a
].
recognizePriority
;
});
return
Utils
.
keys
(
KityMinder
.
_protocals
).
sort
(
function
(
a
,
b
)
{
return
KityMinder
.
_protocals
[
b
].
recognizePriority
-
KityMinder
.
_protocals
[
a
].
recognizePriority
;
}
);
},
getAllRegisteredProtocals
:
function
()
{
return
KityMinder
.
_protocals
;
...
...
@@ -991,18 +991,23 @@ function exportNode( node ) {
return
exported
;
}
function
importNode
(
node
,
json
)
{
var
DEFAULT_TEXT
=
{
'root'
:
'maintopic'
,
'main'
:
'topic'
};
function
importNode
(
node
,
json
,
km
)
{
var
data
=
json
.
data
;
for
(
var
field
in
data
)
{
node
.
setData
(
field
,
data
[
field
]
);
}
node
.
setText
(
data
.
text
);
node
.
setText
(
data
.
text
||
km
.
getLang
(
DEFAULT_TEXT
[
data
.
type
]
)
);
var
childrenTreeData
=
json
.
children
;
if
(
!
childrenTreeData
)
return
;
for
(
var
i
=
0
;
i
<
childrenTreeData
.
length
;
i
++
)
{
var
childNode
=
new
MinderNode
();
importNode
(
childNode
,
childrenTreeData
[
i
]
);
importNode
(
childNode
,
childrenTreeData
[
i
]
,
km
);
node
.
appendChild
(
childNode
);
}
return
node
;
...
...
@@ -1061,7 +1066,7 @@ kity.extendClass( Minder, {
this
.
_root
.
removeChild
(
0
);
}
importNode
(
this
.
_root
,
json
);
importNode
(
this
.
_root
,
json
,
this
);
this
.
_fire
(
new
MinderEvent
(
'import'
,
params
,
false
)
);
this
.
_firePharse
(
{
...
...
@@ -4700,16 +4705,27 @@ Minder.Receiver = kity.createClass('Receiver',{
return
false
;
}
if
(
offset
.
x
>=
v
.
x
&&
offset
.
x
<=
v
.
x
+
v
.
width
){
if
(
me
.
index
==
i
){
if
(
i
==
0
){
me
.
selection
.
setStartOffset
(
i
)
}
me
.
selection
.
setEndOffset
(
i
+
(
dir
==
1
?
1
:
0
))
if
(
offset
.
x
<=
v
.
x
+
v
.
width
/
2
){
me
.
selection
.
collapse
()
}
else
{
me
.
selection
.
setEndOffset
(
i
+
(
me
.
selection
.
endOffset
>
i
||
dir
==
1
?
1
:
0
))
}
}
else
if
(
i
>
me
.
index
){
me
.
selection
.
setStartOffset
(
me
.
index
);
me
.
selection
.
setEndOffset
(
i
+
(
dir
==
1
?
1
:
0
)
)
me
.
selection
.
setEndOffset
(
i
+
1
)
}
else
{
me
.
selection
.
setStartOffset
(
i
+
(
dir
==
1
?
1
:
0
));
if
(
dir
==
1
){
me
.
selection
.
setStartOffset
(
i
+
(
offset
.
x
>=
v
.
x
+
v
.
width
/
2
?
1
:
0
));
}
else
{
me
.
selection
.
setStartOffset
(
i
);
}
me
.
selection
.
setEndOffset
(
me
.
index
)
}
...
...
@@ -4723,7 +4739,6 @@ Minder.Receiver = kity.createClass('Receiver',{
endOffset
=
this
.
textData
[
this
.
selection
.
endOffset
],
width
=
0
;
if
(
this
.
selection
.
collapsed
){
this
.
selection
.
updateShow
(
startOffset
||
this
.
textData
[
this
.
textData
.
length
-
1
],
0
);
return
this
;
}
...
...
@@ -4819,6 +4834,12 @@ Minder.Selection = kity.createClass( 'Selection', {
this
.
setShowHold
();
}
this
.
setPosition
(
offset
).
setWidth
(
width
);
//解决在框选内容时,出现很窄的光标
if
(
width
==
0
){
this
.
setOpacity
(
0
);
}
else
{
this
.
setOpacity
(
0.5
);
}
return
this
;
},
setPosition
:
function
(
offset
)
{
...
...
@@ -4829,7 +4850,6 @@ Minder.Selection = kity.createClass( 'Selection', {
}
catch
(
e
)
{
console
.
log
(
e
)
}
return
this
.
update
();
},
setHeight
:
function
(
height
)
{
...
...
dist/kityminder.all.min.js
View file @
c450681d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
publish
View file @
c450681d
git stash
git checkout gh-pages
git merge dev -m "merge from dev"
grunt
echo -e "\033[0;33;1mPublish start."
echo -e "\033[0;33;1m> Checking out gh-pages\033[0m"
git checkout -q gh-pages
echo -e "\033[0;33;1m> Merging dev commits\033[0m"
git merge dev -qm "merge from dev"
echo -e "\033[0;33;1m> Building dist js files\033[0m"
grunt -q > GRUNT_OUTPUT
rm -f GRUNT_OUTPUT
git add dist
git commit -m "publish"
git push origin gh-pages
git checkout dev
git stash pop
echo -e "\033[0;33;1m> Commit dist js files\033[0m"
git commit -qm "publish"
echo -e "\033[0;33;1m> Pusing to git...\033[0m"
git push -q origin gh-pages
git checkout -q dev
echo -e "\033[0;33;1mPublish done.\033[0m"
\ No newline at end of file
social/social.js
View file @
c450681d
...
...
@@ -67,10 +67,10 @@ $( function () {
$user_menu
.
attachTo
(
$user_btn
);
$save_btn
=
$
(
'<button>保存</button>'
).
click
(
saveThisFile
)
$save_btn
=
$
(
'<button
id="save-btn"
>保存</button>'
).
click
(
saveThisFile
)
.
addClass
(
'baidu-cloud'
).
appendTo
(
$panel
).
disabled
(
true
);
$share_btn
=
$
(
'<button>分享</button>'
).
click
(
shareThisFile
)
$share_btn
=
$
(
'<button
id="share-btn"
>分享</button>'
).
click
(
shareThisFile
)
.
addClass
(
'share'
).
appendTo
(
$panel
).
disabled
(
true
);
...
...
src/core/kityminder.js
View file @
c450681d
var
KityMinder
=
window
.
KM
=
window
.
KityMinder
=
function
()
{
var
instanceMap
=
{},
instanceId
=
0
;
return
{
version
:
'1.
0
.0'
,
version
:
'1.
1
.0'
,
createMinder
:
function
(
renderTarget
,
options
)
{
options
=
options
||
{};
options
.
renderTo
=
Utils
.
isString
(
renderTarget
)
?
document
.
getElementById
(
renderTarget
)
:
renderTarget
;
...
...
src/core/minder.data.js
View file @
c450681d
...
...
@@ -7,9 +7,9 @@ Utils.extend( KityMinder, {
return
KityMinder
.
_protocals
[
name
]
||
null
;
},
getSupportedProtocals
:
function
()
{
return
Utils
.
keys
(
KityMinder
.
_protocals
).
sort
(
function
(
a
,
b
)
{
return
KityMinder
.
_protocals
[
b
].
recognizePriority
-
KityMinder
.
_protocals
[
a
].
recognizePriority
;
});
return
Utils
.
keys
(
KityMinder
.
_protocals
).
sort
(
function
(
a
,
b
)
{
return
KityMinder
.
_protocals
[
b
].
recognizePriority
-
KityMinder
.
_protocals
[
a
].
recognizePriority
;
}
);
},
getAllRegisteredProtocals
:
function
()
{
return
KityMinder
.
_protocals
;
...
...
@@ -30,18 +30,23 @@ function exportNode( node ) {
return
exported
;
}
function
importNode
(
node
,
json
)
{
var
DEFAULT_TEXT
=
{
'root'
:
'maintopic'
,
'main'
:
'topic'
};
function
importNode
(
node
,
json
,
km
)
{
var
data
=
json
.
data
;
for
(
var
field
in
data
)
{
node
.
setData
(
field
,
data
[
field
]
);
}
node
.
setText
(
data
.
text
);
node
.
setText
(
data
.
text
||
km
.
getLang
(
DEFAULT_TEXT
[
data
.
type
]
)
);
var
childrenTreeData
=
json
.
children
;
if
(
!
childrenTreeData
)
return
;
for
(
var
i
=
0
;
i
<
childrenTreeData
.
length
;
i
++
)
{
var
childNode
=
new
MinderNode
();
importNode
(
childNode
,
childrenTreeData
[
i
]
);
importNode
(
childNode
,
childrenTreeData
[
i
]
,
km
);
node
.
appendChild
(
childNode
);
}
return
node
;
...
...
@@ -100,7 +105,7 @@ kity.extendClass( Minder, {
this
.
_root
.
removeChild
(
0
);
}
importNode
(
this
.
_root
,
json
);
importNode
(
this
.
_root
,
json
,
this
);
this
.
_fire
(
new
MinderEvent
(
'import'
,
params
,
false
)
);
this
.
_firePharse
(
{
...
...
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