Commit 02961137 authored by Akikonata's avatar Akikonata

Merge branch 'dev' of https://github.com/fex-team/kityminder into dev

parents f35ccc5f df1fe011
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
7. 去掉了“导出”菜单上的打勾 7. 去掉了“导出”菜单上的打勾
8. 修复了firefox下光标定位到文字最后空格,光标不跟着移动问题 8. 修复了firefox下光标定位到文字最后空格,光标不跟着移动问题
9. 修复在页面失去焦点时光标不消失 9. 修复在页面失去焦点时光标不消失
10. 优化了光标定位和闪烁时常
## v1.1.1 ## v1.1.1
......
...@@ -20,7 +20,8 @@ module.exports = function ( grunt ) { ...@@ -20,7 +20,8 @@ module.exports = function ( grunt ) {
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n' + ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n' +
' * ====================================================\n' + ' * ====================================================\n' +
' */\n\n', ' */\n\n',
buildPath = 'dev/import.php'; buildPath = 'dev/import.php',
distPath = 'dist/';
var getPath = function ( readFile ) { var getPath = function ( readFile ) {
...@@ -43,7 +44,6 @@ module.exports = function ( grunt ) { ...@@ -43,7 +44,6 @@ module.exports = function ( grunt ) {
pkg: grunt.file.readJSON( 'package.json' ), pkg: grunt.file.readJSON( 'package.json' ),
concat: { concat: {
js: { js: {
options: { options: {
banner: banner + '(function(kity, window) {\n\n', banner: banner + '(function(kity, window) {\n\n',
...@@ -53,19 +53,39 @@ module.exports = function ( grunt ) { ...@@ -53,19 +53,39 @@ module.exports = function ( grunt ) {
} }
}, },
src: getPath( buildPath ), src: getPath( buildPath ),
dest: 'dist/kityminder.all.js' dest: distPath + 'kityminder.all.js'
} }
}, },
uglify: { uglify: {
minimize: { minimize: {
options: { options: {
banner: banner banner: banner
}, },
files: { files: (function(){
'dist/kityminder.all.min.js': 'dist/kityminder.all.js' var files = {};
} files[distPath + 'kityminder.all.js'] = distPath + 'kityminder.all.min.js';
return files;
})()
}
},
copy: {
dir: {
files: [
{
src: [ 'dialogs/**', 'lang/**', 'lib/**', 'social/**', 'themes/**' ],
dest: distPath
}
]
}
},
replace: {
online: {
src: distPath+'index.html',
overwrite: true,
replacements: [ {
from: /1234567890/ig,
to: '1234567890'
}]
} }
}, },
...@@ -103,8 +123,10 @@ module.exports = function ( grunt ) { ...@@ -103,8 +123,10 @@ module.exports = function ( grunt ) {
/* [Build plugin & task ] ------------------------------------*/ /* [Build plugin & task ] ------------------------------------*/
grunt.loadNpmTasks( 'grunt-contrib-concat' ); grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' ); grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-text-replace');
// Build task(s). // Build task(s).
grunt.registerTask( 'default', [ 'concat:js', 'uglify:minimize' ] ); grunt.registerTask( 'default', [ 'concat', 'uglify', 'copy', 'replace' ] );
/* [liverload plugin & task ] ------------------------------------*/ /* [liverload plugin & task ] ------------------------------------*/
grunt.loadNpmTasks( 'grunt-regarde' ); grunt.loadNpmTasks( 'grunt-regarde' );
......
#social{position:absolute;right:10px;top:10px;line-height:20px;text-align:right;overflow:hidden} #social{position:absolute;right:10px;top:10px;line-height:20px;text-align:right;overflow:hidden}
.dropdown{padding-right:28px}.dropdown: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} .dropdown{padding-right:28px}.dropdown: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}
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:#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%);}button:hover,button.hover{background:#009fff} button{font-family:Arial,"Heiti SC","Microsoft Yahei";outline:none;display:inline-block;vertical-align:middle;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%);}button:hover,button.hover{background:#009fff}
button:active,button.active{background:#007fcc;box-shadow:inset 0 2px 3px rgba(0,0,0,0.2)} button:active,button.active{background:#007fcc;box-shadow:inset 0 2px 3px rgba(0,0,0,0.2)}
button[disabled]{background:#aaa;cursor:default} button[disabled]{background:#aaa;cursor:default}
button.baidu-cloud{padding-left:35px;position:relative}button.baidu-cloud:before{content:' ';display:block;width:24px;height:24px;background:url(../themes/default/images/baiducloud.png);position:absolute;left:7px;top:5px} button.baidu-cloud{padding-left:35px;position:relative}button.baidu-cloud:before{content:' ';display:block;width:24px;height:24px;background:url(../themes/default/images/baiducloud.png);position:absolute;left:7px;top:5px}
button.share{padding-left:35px;position:relative}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} button.share{padding-left:35px;position:relative}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}
button img{position:relative;top:3px;border-radius:2px;margin-right:7px} button img{position:relative;top:3px;border-radius:2px;margin-right:7px}
button.user-file{position:relative;padding-right:28px}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} button.user-file{position:relative;padding-right:28px}button.user-file img{border:none;outline:none}
button.user-file span.text{display:inline-block;height:24px;line-height:24px}
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}
#draft-btn{position:absolute;left:10px;bottom:10px;padding-left:35px;padding-right:28px}#draft-btn:before{content:' ';display:block;width:24px;height:24px;background:url(../themes/default/images/draft.png) no-repeat;position:absolute;left:7px;top:5px} #draft-btn{position:absolute;left:10px;bottom:10px;padding-left:35px;padding-right:28px}#draft-btn:before{content:' ';display:block;width:24px;height:24px;background:url(../themes/default/images/draft.png) no-repeat;position:absolute;left:7px;top:5px}
#draft-btn: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} #draft-btn: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}
.draft-menu span.update-time{float:right;color:#ccc;margin-left:20px;padding-right:16px} .draft-menu span.update-time{float:right;color:#ccc;margin-left:20px;padding-right:16px}
......
...@@ -91,8 +91,10 @@ $( function () { ...@@ -91,8 +91,10 @@ $( function () {
function start() { function start() {
initUI(); initUI();
initFrontia(); initFrontia();
if ( checkLogin() ) {
return;
}
loadShare(); loadShare();
checkLogin();
bindShortCuts(); bindShortCuts();
bindDraft(); bindDraft();
watchChanges(); watchChanges();
...@@ -260,8 +262,10 @@ $( function () { ...@@ -260,8 +262,10 @@ $( function () {
function checkLogin() { function checkLogin() {
var account = baidu.frontia.getCurrentAccount(); var account = baidu.frontia.getCurrentAccount();
if ( account ) { if ( account ) {
setAccount( account ); login();
return true;
} }
return false;
} }
// 用户点击登录按钮主动登录 // 用户点击登录按钮主动登录
...@@ -299,14 +303,16 @@ $( function () { ...@@ -299,14 +303,16 @@ $( function () {
// 加载用户头像 // 加载用户头像
function loadAvator() { function loadAvator() {
var $img = $( '<img />' ).attr( {
'src': '../social/loading.gif',
'width': 16,
'height': 16
} ).prependTo( $user_btn );
currentAccount.getDetailInfo( { currentAccount.getDetailInfo( {
success: function ( user ) { success: function ( user ) {
var $img = $( '<img />' ).attr( { $img.attr( {
'src': user.extra.tinyurl, 'src': user.extra.tinyurl
'width': 16,
'height': 16
} ); } );
$img.prependTo( $user_btn );
} }
} ); } );
} }
......
...@@ -27,6 +27,7 @@ button { ...@@ -27,6 +27,7 @@ button {
font-family: Arial, "Heiti SC", "Microsoft Yahei"; font-family: Arial, "Heiti SC", "Microsoft Yahei";
outline: none; outline: none;
display: inline-block; display: inline-block;
vertical-align: middle;
padding: 0 15px; padding: 0 15px;
height: 35px; height: 35px;
font-size: 13px; font-size: 13px;
...@@ -47,7 +48,7 @@ button { ...@@ -47,7 +48,7 @@ button {
background: -o-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Opera 11.10+ */ 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: -ms-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* IE10+ */
background: linear-gradient(to bottom, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* W3C */ background: linear-gradient(to bottom, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* W3C */
&:hover, &.hover { &:hover, &.hover {
background: #009fff; background: #009fff;
} }
...@@ -99,6 +100,15 @@ button { ...@@ -99,6 +100,15 @@ button {
} }
&.user-file { &.user-file {
position: relative; position: relative;
img {
border: none;
outline: none;
}
span.text {
display: inline-block;
height: 24px;
line-height: 24px;
}
.dropdown; .dropdown;
} }
} }
......
...@@ -53,6 +53,7 @@ function importNode( node, json, km ) { ...@@ -53,6 +53,7 @@ function importNode( node, json, km ) {
return node; return node;
} }
// 导入导出 // 导入导出
kity.extendClass( Minder, { kity.extendClass( Minder, {
exportData: function ( protocalName ) { exportData: function ( protocalName ) {
...@@ -60,6 +61,13 @@ kity.extendClass( Minder, { ...@@ -60,6 +61,13 @@ kity.extendClass( Minder, {
json = exportNode( this.getRoot() ); json = exportNode( this.getRoot() );
protocal = KityMinder.findProtocal( protocalName ); protocal = KityMinder.findProtocal( protocalName );
if(this._fire( new MinderEvent( 'beforeexport', {
json:json,
protocalName: protocalName,
protocal: protocal
},true ) ) === true) return;
if ( protocal ) { if ( protocal ) {
return protocal.encode( json, this ); return protocal.encode( json, this );
} else { } else {
......
...@@ -245,11 +245,6 @@ Minder.Receiver = kity.createClass('Receiver',{ ...@@ -245,11 +245,6 @@ Minder.Receiver = kity.createClass('Receiver',{
me.index = 0; me.index = 0;
return false; return false;
} }
if(i == me.textData.length -1 && offset.x >= v.x){
me.index = me.textData.length;
return false;
}
if(offset.x >= v.x && offset.x <= v.x + v.width){ if(offset.x >= v.x && offset.x <= v.x + v.width){
if(offset.x - v.x > v.width/2){ if(offset.x - v.x > v.width/2){
me.index = i + 1; me.index = i + 1;
...@@ -261,7 +256,12 @@ Minder.Receiver = kity.createClass('Receiver',{ ...@@ -261,7 +256,12 @@ Minder.Receiver = kity.createClass('Receiver',{
hadChanged = true; hadChanged = true;
return false; return false;
} }
if(i == me.textData.length -1 && offset.x >= v.x){
me.index = me.textData.length;
return false;
}
}); });
return this; return this;
}, },
......
...@@ -98,13 +98,12 @@ Minder.Selection = kity.createClass( 'Selection', { ...@@ -98,13 +98,12 @@ Minder.Selection = kity.createClass( 'Selection', {
clearInterval( this.timer ); clearInterval( this.timer );
var me = this, var me = this,
state = ''; state = '';
me.setStyle( 'display', '' );
if(this.collapsed){ if(this.collapsed){
this.timer = setInterval( function () { this.timer = setInterval( function () {
me.setStyle( 'display', state ); me.setStyle( 'display', state );
state = state ? '' : 'none'; state = state ? '' : 'none';
}, 300 ); }, 400 );
}else{
me.setStyle( 'display', '' );
} }
return this; return this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment