Commit 81d2f50f authored by techird's avatar techird

merge from dev

parents d9d921d1 cf67d28b
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
1. 添加了剪贴板操作的支持 1. 添加了剪贴板操作的支持
2. 添加了本地自动保存草稿的功能 2. 添加了本地自动保存草稿的功能
3. 发布版本上添加了 Github 地址 3. 优化了文字选中效果
4. 优化了文字选中效果 4. 改进了文字输入体验
### 功能调整 ### 功能调整
......
( function () {
var helpContent = '<div class="help-content" style="padding:20px;width:360px;">';
helpContent += '<h2>基本操作</h2>';
helpContent += '<p>编辑脑图的时候,最基本的操作是插入节点、编辑节点、删除节点、设置节点样式</p>';
helpContent += '<ul>';
helpContent += ' <li><h3>插入子节点:</h3>在选中的节点中按 Tab 键</li>';
helpContent += ' <li><h3>插入同级节点:</h3>在选中的节点中按 Enter/Return 键</li>';
helpContent += ' <li><h3>编辑节点:</h3>刚插入的子节点和同级节点会进入编辑模式;其他节点双击也能进入编辑模式;编辑模式下可以编辑节点的文本</li>';
helpContent += ' <li><h3>设置节点样式:</h3>你可以选中一个或多个节点后,在工具栏中改变选中节点的样式。也可以使用快捷键来使用这些功能:撤销(Ctrl+Z)、重做(Ctrl+Y)、加粗(Ctrl+B)、斜体(Ctrl+I)</li>';
helpContent += '</ul>';
helpContent += '<h2>导入导出</h2>';
helpContent += '<p>您可以导出你的脑图到本地,方法是点击工具栏上的导出按钮,然后选择要导出的格式。下面列出支持的格式列表:</p>';
helpContent += '<ul>';
helpContent += ' <li><h3>大纲文本:</h3>导出成以制表符界定大纲的文本,此格式可以被导入</li>';
helpContent += ' <li><h3>KityMinder格式:</h3>KityMinder自身的保存格式(JSON),此格式可以被导入</li>';
helpContent += ' <li><h3>PNG 图片:</h3>导出成 PNG 位图格式,此格式不可被导入</li>';
helpContent += ' <li><h3>SVG 矢量图:</h3>导出成 SVG 矢量图格式,可以被矢量工具二次加工,此格式不可被导入</li>';
helpContent += '</ul>';
helpContent += '<p>导出的文件可以直接拖放到 KityMinder 上直接打开</p>';
helpContent += '<h2>云盘功能</h2>';
helpContent += '<p>使用百度账号登录后,您可以使用云存储和分享功能</p>';
helpContent += '<ul>';
helpContent += ' <li><h3>登录:</h3>点击登录按钮</li>';
helpContent += ' <li><h3>保存:</h3>点击保存按钮,将会把文件保存到你的云盘里</li>';
helpContent += ' <li><h3>分享:</h3>点击分享按钮,会生成分享链接,该链接可以打开您分享的脑图</li>';
helpContent += ' <li><h3>打开:</h3>点击您账号的下拉按钮,会列出最近保存的脑图文件,点击即可打开</li>';
helpContent += '</ul>';
helpContent += '<h2>视野导航</h2>';
helpContent += '<p>视野导航包括以下几个功能:</p>';
helpContent += '<ul>';
helpContent += ' <li><h3>视野拖动:</h3>根节点未被选中的情况下,拖动根节点可以拖动视野;或者使用空格键切换拖动状态</li>';
helpContent += ' <li><h3>视野缩放:</h3>点击工具栏中的“放大”和“缩小”按钮可以缩放视野,或者按着 Ctrl 键使用滚轮缩放</li>';
helpContent += ' <li><h3>视野复位:</h3>双击空白处,可以将视野复位</li>';
helpContent += '</ul>';
helpContent += '</div>';
var utils = KM.utils;
KM.registerWidget( 'help', {
tpl: helpContent,
initContent: function ( km ) {
var lang = km.getLang( 'dialogs.markers' ),
html;
if ( lang ) {
html = $.parseTmpl( this.tpl, lang );
}
this.root().html( html );
},
initEvent: function ( km, $w ) {
$w.on( "click", "li", function () {
var $this = $( this );
$this.siblings().removeClass( "active" );
$this.toggleClass( "active" );
var val = $this.val();
if ( !$this.hasClass( "active" ) ) {
val = null;
}
var type = $this.attr( "type" );
km.execCommand( type, val );
} );
km.on( 'interactchange', function ( e ) {
var valPri = this.queryCommandValue( "priority" );
var valPro = this.queryCommandValue( "progress" );
$w.find( "li[type='priority']" ).removeClass( "active" );
$w.find( "li[type='priority'][value='" + valPri + "']" ).addClass( "active" );
$w.find( "li[type='progress']" ).removeClass( "active" );
$w.find( "li[type='progress'][value='" + valPro + "']" ).addClass( "active" );
} );
},
buttons: {
'ok': {
exec: function ( km, $w ) {
var href = $( '#kmui-link-Jhref' ).val().replace( /^\s+|\s+$/g, '' );
if ( href ) {
km.execCommand( 'link', {
'href': href,
'target': $( "#kmui-link-Jtarget:checked" ).length ? "_blank" : '_self',
'title': $( "#kmui-link-Jtitle" ).val().replace( /^\s+|\s+$/g, '' ),
'_href': href
} );
}
}
},
'cancel': {}
},
width: 400
} );
} )();
\ No newline at end of file
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
'KITYMINDER_HOME_URL': getKMBasePath(), 'KITYMINDER_HOME_URL': getKMBasePath(),
//定义工具栏 //定义工具栏
toolbars: [ toolbars: [
'hand zoom-in zoom-out | undo redo | bold italic | fontfamily fontsize forecolor | saveto | markers | node | switchlayout' 'hand zoom-in zoom-out | undo redo | bold italic | fontfamily fontsize forecolor | saveto | markers | node | switchlayout | help'
] ]
//设置主题 //设置主题
......
...@@ -16,7 +16,8 @@ KityMinder.LANG[ 'zh-cn' ] = { ...@@ -16,7 +16,8 @@ KityMinder.LANG[ 'zh-cn' ] = {
'zoom-in': '放大', 'zoom-in': '放大',
'zoom-out': '缩小', 'zoom-out': '缩小',
'markers': '添加标签', 'markers': '添加标签',
'switchlayout': '切换主题' 'switchlayout': '切换主题',
'help': '帮助'
}, },
'popupcolor': { 'popupcolor': {
'clearColor': '清空颜色', 'clearColor': '清空颜色',
...@@ -39,12 +40,19 @@ KityMinder.LANG[ 'zh-cn' ] = { ...@@ -39,12 +40,19 @@ KityMinder.LANG[ 'zh-cn' ] = {
'threequartersdone': '完成3/4', 'threequartersdone': '完成3/4',
'done': '已完成' 'done': '已完成'
} }
},
'help': {
} }
}, },
'node': { 'node': {
'appendsiblingnode': '插入同级节点', 'appendsiblingnode': '插入同级节点',
'appendchildnode': '插入子节点', 'appendchildnode': '插入子节点',
'removenode': '删除节点' 'removenode': '删除节点'
},
'layout': {
'default': '左右展开',
'bottom': '向下展开'
} }
}; };
\ No newline at end of file
echo -e "\033[0;33;1mPublish start." echo -e "\033[0;33;1mPublish start."
echo -e "\033[0;33;1m > Checking out gh-pages\033[0m" echo -e "\033[0;33;1m> Checking out gh-pages\033[0m"
git checkout -q gh-pages git checkout -q gh-pages
echo -e "\033[0;33;1m > Merging dev commits\033[0m" echo -e "\033[0;33;1m> Merging dev commits\033[0m"
git merge dev -qm "merge from dev" git merge dev -qm "merge from dev"
echo -e "\033[0;33;1m > Building dist js files\033[0m" echo -e "\033[0;33;1m> Building dist js files\033[0m"
grunt -q > GRUNT_OUTPUT grunt -q > GRUNT_OUTPUT
rm -f GRUNT_OUTPUT rm -f GRUNT_OUTPUT
git add dist git add dist
echo -e "\033[0;33;1m > Commit dist js files\033[0m" echo -e "\033[0;33;1m> Commit dist js files\033[0m"
git commit -qm "publish" git commit -qm "publish"
echo -e "\033[0;33;1m > Pusing to git...\033[0m" echo -e "\033[0;33;1m> Pusing to git...\033[0m"
git push origin gh-pages git push -q origin gh-pages
git checkout -q dev git checkout -q dev
echo -e "\033[0;33;1mPublish done.\033[0m" echo -e "\033[0;33;1mPublish done.\033[0m"
\ No newline at end of file
KM.registerToolbarUI( 'markers', function ( name ) { KM.registerToolbarUI( 'markers help', function ( name ) {
var me = this, var me = this,
currentRange, $dialog, currentRange, $dialog,
opt = { opt = {
width: 200,
title: this.getLang( 'tooltips' )[ name ] || '', title: this.getLang( 'tooltips' )[ name ] || '',
url: me.getOptions( 'KITYMINDER_HOME_URL' ) + 'dialogs/' + name + '/' + name + '.js', url: me.getOptions( 'KITYMINDER_HOME_URL' ) + 'dialogs/' + name + '/' + name + '.js',
}; };
......
...@@ -17,6 +17,9 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) { ...@@ -17,6 +17,9 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
return null; return null;
} }
utils.each(options.items,function(i,item){
options.items[i] = me.getLang('layout')[item];
});
//实例化 //实例化
$combox = $.kmuibuttoncombobox( options ).css( 'zIndex', me.getOptions( 'zIndex' ) + 1 ); $combox = $.kmuibuttoncombobox( options ).css( 'zIndex', me.getOptions( 'zIndex' ) + 1 );
comboboxWidget = $combox.kmui(); comboboxWidget = $combox.kmui();
......
...@@ -107,6 +107,7 @@ Minder.Receiver = kity.createClass('Receiver',{ ...@@ -107,6 +107,7 @@ Minder.Receiver = kity.createClass('Receiver',{
case keys.Tab: case keys.Tab:
this.selection.setHide(); this.selection.setHide();
this.clear().setTextEditStatus(false); this.clear().setTextEditStatus(false);
this.km.fire('contentchange');
this.km.setStatus('normal'); this.km.setStatus('normal');
e.preventDefault(); e.preventDefault();
break; break;
......
...@@ -646,12 +646,14 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -646,12 +646,14 @@ KityMinder.registerModule( "LayoutDefault", function () {
if ( Layout.shicon ) Layout.shicon.remove(); if ( Layout.shicon ) Layout.shicon.remove();
} catch ( error ) {} } catch ( error ) {}
} }
//if ( _buffer[ 0 ].getData( "expand" ) !== false )
_buffer = _buffer.concat( _buffer[ 0 ].getChildren() ); _buffer = _buffer.concat( _buffer[ 0 ].getChildren() );
_buffer.shift(); _buffer.shift();
} }
if ( isExpand ) { if ( isExpand ) {
node.clearChildren(); node.clearChildren();
for ( var j = 0; j < _cleanbuffer.length; j++ ) { for ( var j = 0; j < _cleanbuffer.length; j++ ) {
//if ( _cleanbuffer[ j ].getData( "expand" ) !== false )
_cleanbuffer[ j ].clearChildren(); _cleanbuffer[ j ].clearChildren();
minder.appendChildNode( _cleanbuffer[ j ].getLayout().parent, _cleanbuffer[ j ] ); minder.appendChildNode( _cleanbuffer[ j ].getLayout().parent, _cleanbuffer[ j ] );
} }
......
...@@ -28,4 +28,7 @@ ...@@ -28,4 +28,7 @@
} }
.kmui-btn-toolbar .kmui-btn .kmui-icon-zoom-out { .kmui-btn-toolbar .kmui-btn .kmui-icon-zoom-out {
background: url(../images/zoom_out.png) no-repeat 2px 2px; background: url(../images/zoom_out.png) no-repeat 2px 2px;
}
.kmui-btn-toolbar .kmui-btn .kmui-icon-help {
background: url(../images/help.png) no-repeat 2px 2px;
} }
\ No newline at end of file
.help-content{
line-height: 20px;
font-size: 12px;
}
.help-content ul{
list-style: none;
padding:0;
}
.help-content ul li{
color:#666;
}
.help-content h2{color:#333;font-size: 18px;}
.help-content h3{
color:#333;
display: inline;
font-size: 14px;
}
\ No newline at end of file
...@@ -12,4 +12,5 @@ ...@@ -12,4 +12,5 @@
@import "colorpicker.css"; @import "colorpicker.css";
@import "separator.css"; @import "separator.css";
@import "markers.css"; @import "markers.css";
@import "help.css";
@import "dropmenu.css"; @import "dropmenu.css";
\ No newline at end of file
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