Skip to content

Commit

Permalink
add tianpan test
Browse files Browse the repository at this point in the history
  • Loading branch information
baipgydx729 committed Mar 20, 2015
1 parent 031dd42 commit 113ac81
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 14 deletions.
1 change: 1 addition & 0 deletions import.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@

/* 模板 */
{ path: 'src/template/default.js', pack: 'edit|share|m-share' },
{ path: 'src/template/tianpan.js', pack: 'edit|share|m-share' },
{ path: 'src/template/structure.js', pack: 'edit|share|m-share' },
{ path: 'src/template/filetree.js', pack: 'edit|share|m-share' },
{ path: 'src/template/right.js', pack: 'edit|share|m-share' },
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/* 初始化网盘使用的 APP 身份 */
fio.user.init({
apiKey: 'wiE55BGOG8BkGnpPs6UNtPbb'
apiKey: 'IF1PQMDsNy2iy0GKCx084qdx' //微行平台Key
});

var $a = $('p.login a').hide();
Expand Down
2 changes: 1 addition & 1 deletion kityminder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
maxImageHeight: 200,

// 修改后自动保存时间间隔(单位:秒);设置为 false 不自动保存
autoSave: 2
autoSave: 1000
};
})();
2 changes: 2 additions & 0 deletions lang/zh-cn/zh-cn.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

KityMinder.LANG['zh-cn'] = {
'template': {
'default': '思维导图',
'tianpan': '天盘图',
'structure': '组织结构图',
'filetree': '目录组织图',
'right': '逻辑结构图',
Expand Down
1 change: 0 additions & 1 deletion src/connect/fish-bone-master.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

KityMinder.registerConnectProvider('fish-bone-master', function(node, parent, connection) {

var pout = parent.getLayoutVertexOut(),
pin = node.getLayoutVertexIn();

Expand Down
2 changes: 2 additions & 0 deletions src/layout/filetree.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


/* global Layout:true */

[-1, 1].forEach(function (dir) {
Expand Down
1 change: 1 addition & 0 deletions src/layout/mind.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ KityMinder.registerLayout('mind', kity.createClass({
base: Layout,

doLayout: function(node, children) {

var layout = this;
var half = Math.ceil(node.children.length / 2);
var right = [];
Expand Down
35 changes: 35 additions & 0 deletions src/template/tianpan.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* @fileOverview
*
* 天盘模板
*
* @author: techird
* @copyright: Baidu FEX, 2014
*/

KityMinder.registerTemplate('tianpan', {

getLayout: function(node) {
console.log(node)
if (node.getData('layout')) return node.getData('layout');

var level = node.getLevel();

// 根节点
if (level === 0) {
return 'mind';
}

// 一级节点
if (level === 1) {
return node.getLayoutPointPreview().x > 0 ? 'right': 'left';
}

return node.parent.getLayout();
},

getConnect: function(node) {
if (node.getLevel() == 1) return 'arc';
return 'bezier';
}
});
4 changes: 2 additions & 2 deletions ui/fiox.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
KityMinder.registerUI('fiox', function(minder) {
var eve = minder.getUI('eve');
eve.setup(fio.user);

/* 初始化网盘使用的 APP 身份 */
fio.user.init({
apiKey: 'wiE55BGOG8BkGnpPs6UNtPbb'
apiKey: 'zMSuveBXX6zUGyAR99N9h2ZU'
});
});
1 change: 0 additions & 1 deletion ui/ribbon/appearence/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ KityMinder.registerUI('ribbon/appearence/template', function(minder) {
label: minder.getLang('panels.template')
});


var templateList = KityMinder.Utils.keys(KityMinder.getTemplateList());
var $templateSelect = $commandselectmenu.generate('template', templateList, 2);

Expand Down
10 changes: 7 additions & 3 deletions ui/ribbon/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
KityMinder.registerUI('ribbon/tabs', function(minder) {
var memory = minder.getUI('memory');


var buttons = ['idea', 'appearence', 'view'].map(function(key) {
return minder.getLang('ui.tabs.' + key);
});

console.log(buttons)
var $tab = new FUI.Tabs({
buttons: ['idea', 'appearence', 'view'].map(function(key) {
return minder.getLang('ui.tabs.' + key);
})
buttons:buttons
});
var $title = minder.getUI('topbar/title').$title;

Expand Down
4 changes: 4 additions & 0 deletions ui/theme/default/css/_themepanel.less
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
&.fish-bone .fui-icon {
background-position: -200px 0;
}

&.tianpan .fui-icon {
background-position: -250px 0;
}
}

.fui-button.theme {
Expand Down
Binary file modified ui/theme/default/images/template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions ui/topbar/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ KityMinder.registerUI('topbar/user', function(minder) {

menu.clearSelect();
$userMenu.hide();

});

minder.on('uiready', function() {
Expand Down Expand Up @@ -133,12 +132,15 @@ KityMinder.registerUI('topbar/user', function(minder) {
}

function requireLogin($element) {
var $login_tip = $('<p class="login-tip"></p>')
.html(minder.getLang('ui.requirelogin'));

var $login_tip = $('<p class="login-tip"></p>').html(minder.getLang('ui.requirelogin'));

$element.append($login_tip);

fio.user.on('login', function() {
$element.removeClass('login-required');
});

fio.user.on('logout', function() {
$element.addClass('login-required');
});
Expand Down
2 changes: 0 additions & 2 deletions ui/widget/commandbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
* @copyright: Baidu FEX, 2014
*/
KityMinder.registerUI('widget/commandbutton', function(minder) {

return {

generate: function(command, onclick) {
var $button = new FUI.Button({
label: minder.getLang('ui.command.' + command) || minder.getLang('ui.' + command),
Expand Down
1 change: 1 addition & 0 deletions ui/widget/commandselectmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ KityMinder.registerUI('widget/commandselectmenu', function(minder) {
});

$selectMenu.bindExecution('change', function() {
console.log(command+" : "+ $selectMenu.getValue())
minder.execCommand(command, $selectMenu.getValue());
});

Expand Down

0 comments on commit 113ac81

Please sign in to comment.