Commit 98d365b4 authored by techird's avatar techird

tag hot-fix as v1.1.3.1

parent 81bcb60f
......@@ -7,26 +7,26 @@
<meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。">
<script src="lib/jquery-2.1.0.min.js?_=1399893922286" charset="utf-8"></script>
<script src="lib/ZeroClipboard.min.js?_=1399893922286" charset="utf-8"></script>
<script src="lib/jquery-2.1.0.min.js?_=1400151442820" charset="utf-8"></script>
<script src="lib/ZeroClipboard.min.js?_=1400151442820" charset="utf-8"></script>
<script type="text/javascript">
ZeroClipboard.setDefaults( { moviePath: 'lib/ZeroClipboard.swf' } );
</script>
<script src="lib/kitygraph.all.min.js?_=1399893922286" charset="utf-8"></script>
<script src="kityminder.all.min.js?_=1399893922286" charset="utf-8"></script>
<script src="kityminder.config.js?_=1399893922286" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js?_=1399893922286" charset="utf-8"></script>
<script src="lib/kitygraph.all.min.js?_=1400151442820" charset="utf-8"></script>
<script src="kityminder.all.min.js?_=1400151442820" charset="utf-8"></script>
<script src="kityminder.config.js?_=1400151442820" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js?_=1400151442820" charset="utf-8"></script>
<script src="lib/zip.js?_=1399893922286" charset="utf-8"></script>
<script src="lib/zip.js?_=1400151442820" charset="utf-8"></script>
<script>
zip.inflateJSPath = 'lib/inflate.js';
</script>
<script src="lib/jquery.xml2json.js?_=1399893922286" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js?_=1399893922286" charset="utf-8"></script>
<script src="social/draftmanager.js?_=1399893922286" charset="utf-8"></script>
<script src="social/social.js?_=1399893922286" charset="utf-8"></script>
<script src="lib/jquery.xml2json.js?_=1400151442820" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js?_=1400151442820" charset="utf-8"></script>
<script src="social/draftmanager.js?_=1400151442820" charset="utf-8"></script>
<script src="social/social.js?_=1400151442820" charset="utf-8"></script>
<link href="social/social.css" rel="stylesheet">
<link href="themes/default/css/import.css" type="text/css" rel="stylesheet" />
......@@ -53,7 +53,7 @@
</div>
<p id="about">
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> |
KityMinder <a id="km-version" href="https://github.com/fex-team/kityminder/blob/dev/CHANGELOG.md" target="blank"></a> under <a href="https://raw.githubusercontent.com/fex-team/kityminder/dev/LICENSE" target="_blank">BSD License</a>. Powered by f-cube, <a href="http://fex.baidu.com" target="_blank">FEX</a> |
<a href="https://github.com/fex-team/kityminder.git" target="_blank">Source</a>
<a href="https://github.com/fex-team/kityminder/issues/new" target="_blank">Bug</a> |
<a href="mailto:kity@baidu.com" target="_blank">Contact Us</a>
......
/*!
* ====================================================
* kityminder - v1.1.3 - 2014-05-12
* kityminder - v1.1.3.1 - 2014-05-15
* https://github.com/fex-team/kityminder
* GitHub: https://github.com/fex-team/kityminder.git
* Copyright (c) 2014 f-cube @ FEX; Licensed MIT
......@@ -10,9 +10,10 @@
(function(kity, window) {
var KityMinder = window.KM = window.KityMinder = function () {
var instanceMap = {}, instanceId = 0;
var instanceMap = {},
instanceId = 0;
return {
version: '1.1.3',
version: '1.1.3.1',
createMinder: function ( renderTarget, options ) {
options = options || {};
options.renderTo = Utils.isString( renderTarget ) ? document.getElementById( renderTarget ) : renderTarget;
......@@ -5402,6 +5403,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
this.range && this.range.nativeSel.removeAllRanges();
this.index = 0;
this.inputLength = 0;
this.isTypeText = false;
return this;
},
setTextEditStatus: function ( status ) {
......@@ -5486,17 +5488,19 @@ Minder.Receiver = kity.createClass( 'Receiver', {
if ( me.textShape.getOpacity() == 0 ) {
me.textShape.setOpacity( 1 );
}
//#46 修复在ff下定位到文字后方空格光标不移动问题
if ( browser.gecko && /\s$/.test( text ) ) {
text += "\u200b";
}
me.textShape.setContent( text );
me.setContainerStyle();
me.minderNode.setText( text );
if ( text.length == 0 ) {
me.minderNode.setText( 'a' );
me.minderNode.setText( '|' );
}
me.setContainerStyle();
me.km.updateLayout( me.minderNode );
......@@ -5514,15 +5518,13 @@ Minder.Receiver = kity.createClass( 'Receiver', {
me.selection.setShow()
}, 500 );
}
var isTypeText = false;
var isKeypress = false;
switch ( e.type ) {
case 'keydown':
isTypeText = false;
isKeypress = false;
switch ( e.originEvent.keyCode ) {
this.isTypeText = keyCode == 229 || keyCode === 0 ;
switch ( keyCode ) {
case keys.Enter:
case keys.Tab:
this.selection.setHide();
......@@ -5550,29 +5552,21 @@ Minder.Receiver = kity.createClass( 'Receiver', {
var index = me.container.textContent.indexOf( '$$_kityminder_bookmark_$$' );
me.container.textContent = me.container.textContent.replace( '$$_kityminder_bookmark_$$', '' );
me.range.setStart( me.container.firstChild, index ).collapse( true ).select();
setTextToContainer()
setTextToContainer();
}, 100 );
}
//剪切
if ( keyCode == keymap.x ) {
setTimeout( function () {
setTextToContainer()
setTextToContainer();
}, 100 );
}
return;
}
isTypeText = true;
setTimeout(function(){
setTextToContainer();
break;
case 'keypress':
if ( isTypeText )
// setTextToContainer();
isKeypress = true;
});
break;
case 'beforekeyup':
......@@ -5580,6 +5574,9 @@ Minder.Receiver = kity.createClass( 'Receiver', {
case keymap.Enter:
case keymap.Tab:
case keymap.F2:
if(keymap.Enter == keyCode && (this.isTypeText || browser.mac && browser.gecko)){
setTextToContainer();
}
if ( this.keydownNode === this.minderNode ) {
this.rollbackStatus();
this.setTextEditStatus( false );
......@@ -5587,17 +5584,21 @@ Minder.Receiver = kity.createClass( 'Receiver', {
}
e.preventDefault();
return;
case keymap.Del:
case keymap.Backspace:
case keymap.Spacebar:
setTextToContainer();
return;
}
if ( !isKeypress ) {
if(this.isTypeText){
setTextToContainer();
}
if(browser.mac && browser.gecko)
setTextToContainer();
return true;
}
},
updateIndex: function () {
......@@ -5647,7 +5648,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
},
setContainerStyle: function () {
var textShapeBox = this.getBaseOffset( 'screen' );
this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y - 5 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;';
this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y + textShapeBox.height *.1 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;';
if ( !this.selection.isShow() ) {
var paperContainer = this.km.getPaper();
......@@ -6951,7 +6952,7 @@ 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%>">' +
'<li id="<%= ci.id%>" <%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><%}}%>' +
'<%}%>' +
......@@ -7054,12 +7055,13 @@ KM.ui.define( 'dropmenu', {
},
appendItem: function ( item ) {
var itemTpl = '<%if(item.divider){%><li class="kmui-divider"></li><%}else{%>' +
'<li <%if(item.active||item.disabled){%>class="<%= item.active|| \'\' %> <%=item.disabled||\'\' %>" <%}%> data-value="<%= item.value%>" data-label="<%= item.label%>">' +
'<li id="<%= item.id%>" <%if(item.active||item.disabled){%>class="<%= item.active|| \'\' %> <%=item.disabled||\'\' %>" <%}%> data-value="<%= item.value%>" data-label="<%= item.label%>">' +
'<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= item.label%></a>' +
'</li><%}%>';
var html = $.parseTmpl( itemTpl, item );
var $item = $( html ).click( item.click );
this.root().append( $item );
return $item;
},
addSubmenu: function ( label, menu, index ) {
index = index || 0;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,7 +11,7 @@ KityMinder.LANG[ 'zh-cn' ] = {
'fontsize': '字号',
'layoutstyle': '主题',
'node': '节点操作',
'saveto': '导出',
'saveto': '另存为',
'hand': '允许拖拽',
'zoom': '放大缩小',
'markers': '添加标签',
......
......@@ -99,7 +99,7 @@ $( function () {
loadShare();
bindShortCuts();
bindDraft();
draftManager && watchChanges();
if ( draftManager ) watchChanges();
if ( draftManager && !loadPath() && !isShareLink ) loadDraft( 0 );
}
......@@ -183,12 +183,6 @@ $( function () {
} );
}
function initPreferneceSync() {
if ( currentAccount ) {
}
}
// 检查 URL 是否分享连接,是则加载分享内容
function loadShare() {
......@@ -335,27 +329,45 @@ $( function () {
// 加载用户最近使用的文件
function loadUserFiles() {
if ( loadUserFiles.tryCount ) {
console.warn( '加载用户最近使用的文件失败:第 ' + loadUserFiles.tryCount + '次' );
}
if ( loadUserFiles.tryCount > 3 ) {
notice( '加载最近脑图失败!' );
loadUserFiles.tryCount = 0;
}
var sto = baidu.frontia.personalStorage;
//$user_btn.loading( '加载最近脑图...' );
if ( loadUserFiles.tryCount === 0 ) {
loadUserFiles.$loadingMenuItem = $user_menu.appendItem( {
item: {
label: '正在加载最近脑图...',
disabled: 'disabled'
}
} );
}
sto.listFile( 'apps/kityminder/', {
by: 'time',
success: function ( result ) {
if ( result.list.length ) {
//$user_btn.loading( false );
loadUserFiles.$loadingMenuItem.remove();
addToRecentMenu( result.list.filter( function ( file ) {
return getFileFormat( file.path ) in fileLoader;
} ) );
syncPreference( result.list );
}
},
error: function () {
notice( '加载最近脑图失败!' );
//$user_btn.loading( false );
}
error: loadUserFiles
} );
loadUserFiles.tryCount++;
}
loadUserFiles.tryCount = 0;
// 同步用户配置文件
function syncPreference( fileList ) {
......@@ -460,6 +472,15 @@ $( function () {
// 加载当前 remoteUrl 中制定的文件
function loadRemote() {
if ( loadRemote.tryCount ) {
console.warn( '加载用户文件失败:第 ' + loadUserFiles.tryCount + '次' );
}
// 失败重试判断
if ( loadRemote.tryCount > 3 ) {
notice( '加载脑图失败!' );
loadRemote.tryCount = 0;
}
var sto = baidu.frontia.personalStorage;
$user_btn.loading( '加载“' + getFileName( remotePath ) + '”...' );
......@@ -471,11 +492,16 @@ $( function () {
if ( format in fileLoader ) {
fileLoader[ format ]( url );
}
loadRemote.tryCount = 0;
},
error: notice
error: loadRemote
} );
loadRemote.tryCount++;
}
loadRemote.tryCount = 0;
function getFileFormat( fileUrl ) {
return fileUrl.split( '.' ).pop();
}
......@@ -617,20 +643,33 @@ $( function () {
}
function save() {
if ( !currentAccount ) return;
if ( !currentAccount || save.busy ) return;
save.busy = true;
var data = minder.exportData( 'json' );
var sto = baidu.frontia.personalStorage;
function error( reason ) {
notice( reason + '\n建议您将脑图以 .km 格式导出到本地!' );
notice( '保存到云盘失败,可能是网络问题导致!\n建议您将脑图以 .km 格式导出到本地!' );
$save_btn.loading( false );
clearTimeout( timeout );
save.busy = false;
}
var timeout = setTimeout( function () {
error( '保存到云盘超时,可能是网络不稳定导致。' );
}, 15000 );
function upload() {
if ( upload.tryCount ) {
console.warn( '保存文件失败!(第 ' + upload.tryCount + ' 次)' );
}
if ( upload.tryCount > 3 ) {
error();
upload.tryCount = 0;
return;
}
sto.uploadTextFile( data, remotePath || generateRemotePath(), {
ondup: remotePath ? sto.constant.ONDUP_OVERWRITE : sto.constant.ONDUP_NEWCOPY,
success: function ( savedFile ) {
......@@ -644,14 +683,20 @@ $( function () {
draftManager.sync();
}
clearTimeout( timeout );
save.busy = false;
upload.tryCount = 0;
} else {
error( '保存到云盘失败,可能是网络问题导致!' );
upload();
}
},
error: function ( e ) {
error( '保存到云盘失败' );
}
error: upload
} );
upload.tryCount++;
}
upload.tryCount = 0;
upload();
$save_btn.loading( '正在保存...' );
}
......@@ -677,7 +722,7 @@ $( function () {
$share_btn.loading( '正在分享...' );
$.ajax({
$.ajax( {
url: 'http://naotu.baidu.com/mongo.php',
type: 'POST',
data: {
......@@ -697,8 +742,8 @@ $( function () {
$share_url.val( shareUrl )[ 0 ].select();
}
},
error: function() {
notice('分享失败,可能是当前的环境不支持该操作。');
error: function () {
notice( '分享失败,可能是当前的环境不支持该操作。' );
}
} );
......
......@@ -53,7 +53,7 @@
</div>
<p id="about">
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> |
KityMinder <a id="km-version" href="https://github.com/fex-team/kityminder/blob/dev/CHANGELOG.md" target="blank"></a> under <a href="https://raw.githubusercontent.com/fex-team/kityminder/dev/LICENSE" target="_blank">BSD License</a>. Powered by f-cube, <a href="http://fex.baidu.com" target="_blank">FEX</a> |
<a href="https://github.com/fex-team/kityminder.git" target="_blank">Source</a>
<a href="https://github.com/fex-team/kityminder/issues/new" target="_blank">Bug</a> |
<a href="mailto:kity@baidu.com" target="_blank">Contact Us</a>
......
......@@ -2,7 +2,7 @@
"name": "kityminder",
"title": "kityminder",
"description": "Kity Minder",
"version": "1.1.3",
"version": "1.1.3.1",
"homepage": "https://github.com/fex-team/kityminder",
"author": {
"name": "f-cube @ FEX",
......
var KityMinder = window.KM = window.KityMinder = function () {
var instanceMap = {}, instanceId = 0;
var instanceMap = {},
instanceId = 0;
return {
version: '1.1.3',
version: '1.1.3.1',
createMinder: function ( renderTarget, options ) {
options = options || {};
options.renderTo = Utils.isString( renderTarget ) ? document.getElementById( renderTarget ) : renderTarget;
......
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