Commit 2c75abba authored by techird's avatar techird

stash

parent 352d292f
......@@ -66,7 +66,7 @@
"disallowSpacesInsideParentheses": true,
// 行尾「MUST NOT」使用空格
"disallowTrailingWhitespace": true,
"disallowTrailingWhitespace": false,
// 每行「MUST NOT」超过 120 个字符
"maximumLineLength": 120,
......
......@@ -27,6 +27,7 @@
"KM",
"keymap",
"baidu",
"browser"
"browser",
"FUI"
]
}
\ No newline at end of file
......@@ -3,7 +3,6 @@
*-----------------------------------------------------*/
'use strict';
var path = require('path');
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
/*-----------------------------------------------------
* Module Setting
......@@ -26,10 +25,10 @@ module.exports = function(grunt) {
var getPath = function(readFile) {
var sources = require("fs").readFileSync(readFile);
var sources = require('fs').readFileSync(readFile);
sources = /paths\s=\s\[([\s\S]*?)\]/ig.exec(sources);
sources = sources[1].replace(/\/\/.*\n/g, '\n').replace(/'|"|\n|\t|\s/g, '');
sources = sources.split(",");
sources = sources.split(',');
sources.forEach(function(filepath, index) {
sources[index] = srcPath + filepath;
});
......@@ -50,7 +49,7 @@ module.exports = function(grunt) {
banner: banner + '(function(kity, window) {\n\n',
footer: '\n\n})(kity, window)',
process: function(src, filepath) {
return src + "\n";
return src + '\n';
}
},
src: getPath(buildPath),
......@@ -115,14 +114,14 @@ module.exports = function(grunt) {
overwrite: true,
replacements: [{
from: /src=\"(.+?)\.js\"/ig,
to: 'src="$1.js?_=' + +new Date() + '"'
to: 'src="$1.js?_=' + (+new Date()) + '"'
}]
}
},
watch: {
less: {
files: ["ui/themes/**/*.less"],
files: ['ui/theme/**/*.less'],
tasks: ['less:compile']
}
},
......@@ -130,9 +129,15 @@ module.exports = function(grunt) {
less: {
compile: {
files: {
'ui/themes/default/css/default.all.css': [
"ui/themes/default/css/import.less"
'ui/theme/default/css/default.all.css': [
'ui/theme/default/css/import.less'
]
},
options: {
sourceMap: true,
sourceMapFilename: 'ui/theme/default/css/default.all.css.map',
sourceMapBasepath: 'ui/theme/default/css/'
}
}
},
......
......@@ -42,11 +42,11 @@
$addInput.val(null);
}
$addInput.on('keydown', function(e) {
if (e.keyCode == 13) addResource();
$addInput.on('inputcomplete', function(e) {
addResource();
});
$addButton.click(addResource);
$addButton.on('click', addResource);
switchDisplay();
......
Subproject commit 2d13b1977fd186c452d569e20a31137851a39db0
Subproject commit 94c73eb27e9e8d12bdc3b63fd9f0aded9d1c359d
......@@ -61,6 +61,7 @@
'module/hyperlink.js',
'module/arrange.js',
'module/paste.js',
'module/style.js',
'protocal/xmind.js',
'protocal/freemind.js',
'protocal/mindmanager.js',
......
......@@ -7,25 +7,33 @@
<meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>百度脑图 - 便捷的思维导图工具</title>
<script src="lib/jquery-2.1.0.min.js" charset="utf-8"></script>
<script src="lib/ZeroClipboard.min.js" charset="utf-8"></script>
<script type="text/javascript">
ZeroClipboard.setDefaults( { moviePath: 'lib/ZeroClipboard.swf' } );
/* global ZeroClipboard: true */
ZeroClipboard.setDefaults({ moviePath: 'lib/ZeroClipboard.swf' });
</script>
<script src="kity/dist/kity.js" charset="utf-8"></script>
<script src="import.js" charset="utf-8"></script>
<script src="kityminder.config.js" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js" charset="utf-8"></script>
<script src="fui/dev-lib/jhtmls.min.js"></script>
<script src="fui/dist/fui.all.js"></script>
<script src="ui/ui.js" charset="utf-8"></script>
<script src="lib/zip.js" charset="utf-8"></script>
<script>
/* global zip: true */
zip.inflateJSPath = 'lib/inflate.js';
</script>
<script src="lib/jquery.xml2json.js" charset="utf-8"></script>
<link href="ui/themes/default/css/default.all.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="fui/theme/default/fui.all.css" />
<link href="ui/theme/default/css/default.all.css" type="text/css" rel="stylesheet" />
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
<link href="favicon.ico" type="image/x-icon" rel="apple-touch-icon-precomposed">
</head>
......@@ -34,7 +42,9 @@
<div id="content-wrapper">
<div id="panel"></div>
<div id="kityminder" onselectstart="return false"></div>
<div id="kityminder" onselectstart="return false">
</div>
<div id="share-dialog">
<h3>URL分享:</h3>
......@@ -103,9 +113,14 @@
<!--脑图启动代码-->
<script>
/* global km:true */
/* jshint browser:true */
// create km instance
km = KM.getMinder('kityminder', window.KITYMINDER_CONFIG);
// init ui for instance
km.initUI();
// New Version Notify
$(function() {
......
......@@ -16,7 +16,24 @@ KityMinder.LANG['zh-cn'] = {
},
'maintopic': '中心主题',
'topic': '分支主题',
'tooltips': {
'panels': {
'history': '历史',
'template': '模板',
'theme': '皮肤',
'layout': '布局',
'style': '样式',
'font': '字体',
'color': '颜色',
'background': '背景',
'insert': '插入',
'arrange': '调整',
'nodeop': '当前',
'priority': '优先级',
'progress': '进度',
'resource': '资源',
'attachment': '附件'
},
'ui': {
'undo': '撤销',
'redo': '重做',
'bold': '加粗',
......@@ -33,13 +50,37 @@ KityMinder.LANG['zh-cn'] = {
'resource': '资源',
'help': '帮助',
'preference': '偏好设置',
'image': '插入图片',
'hyperlink': '插入链接',
'unhyperlink': '删除链接',
'expandnode': '展开到叶子',
'collapsenode': '收起到一级节点',
'template': '模板',
'theme': '皮肤'
'theme': '皮肤',
'clearstyle': '清除样式',
'copystyle': '复制样式',
'pastestyle': '粘贴样式',
'appendsiblingnode': '下一主题',
'appendchildnode': '儿子主题',
'arrangeup': '前调',
'arrangedown': '后调',
'editnode': '编辑',
'removenode': '移除',
'priority': '优先级',
'progress': {
'p1': '未开始',
'p2': '完成 1/8',
'p3': '完成 1/4',
'p4': '完成 3/8',
'p5': '完成一半',
'p6': '完成 5/8',
'p7': '完成 3/4',
'p8': '完成 7/8',
'p9': '已完成',
'p0': '清除进度'
},
'link': '链接',
'image': '图片',
'removelink': '移除已有连接',
'removeimage': '移除已有图片',
'resetlayout': '整理布局'
},
'popupcolor': {
'clearColor': '清空颜色',
......@@ -76,12 +117,6 @@ KityMinder.LANG['zh-cn'] = {
'image': {},
'resource': {}
},
'node': {
'appendsiblingnode': '插入兄弟节点',
'appendchildnode': '插入子节点',
'removenode': '删除',
'editnode': '编辑'
},
'hyperlink': {
'hyperlink': '链接...',
'unhyperlink': '移除链接'
......
......@@ -9,6 +9,10 @@ Utils.extend(KityMinder, {
if (!KityMinder._defaultLayout) {
KityMinder._defaultLayout = name;
}
},
getLayoutList: function() {
return this._layout;
}
});
......
......@@ -34,7 +34,7 @@ kity.extendClass(Minder, {
commandName: name.toLowerCase(),
commandArgs: cmdArgs
};
if (!cmd) {
if (!cmd || !~this.queryCommandState(name)) {
return false;
}
......
......@@ -13,11 +13,17 @@ kity.extendClass(Minder, {
},
// TODO: mousemove lazy bind
_bindPaperEvents: function() {
this._paper.on('click dblclick mousedown contextmenu mouseup mousemove mousewheel DOMMouseScroll touchstart touchmove touchend dragenter dragleave drop', this._firePharse.bind(this));
this._paper.on('click dblclick keydown keyup keypress paste mousedown contextmenu mouseup mousemove mousewheel DOMMouseScroll touchstart touchmove touchend dragenter dragleave drop', this._firePharse.bind(this));
if (window) {
window.addEventListener('resize', this._firePharse.bind(this));
window.addEventListener('blur', this._firePharse.bind(this));
}
this._renderTarget.onfocus = function() {
console.log('focus');
};
this._renderTarget.onblur = function() {
console.log('blur');
};
},
_bindKeyboardEvents: function() {
if ((navigator.userAgent.indexOf('iPhone') == -1) && (navigator.userAgent.indexOf('iPod') == -1) && (navigator.userAgent.indexOf('iPad') == -1)) {
......
......@@ -15,6 +15,7 @@ var Minder = KityMinder.Minder = kity.createClass('KityMinder', {
this.setDisabled();
}
this.refresh();
this.setTheme();
this.fire('ready');
},
......
......@@ -22,6 +22,7 @@ kity.extendClass(Minder, {
}
});
if (changed.length) this.fire('interactchange');
while (i < changed.length) changed[i++].render();
},
getSelectedNodes: function() {
......
......@@ -56,7 +56,7 @@ kity.extendClass(Minder, {
setTheme: function(name) {
this._theme = name || null;
this.getPaper().getContainer().style.background = this.getStyle('background');
this.getRenderTarget().style.background = this.getStyle('background');
},
/**
......
......@@ -18,6 +18,11 @@ function desc(nodeA, nodeB) {
return -asc(nodeA, nodeB);
}
function canArrange(km) {
var selected = km.getSelectedNode();
return selected && selected.parent && selected.parent.children.length > 1;
}
var ArrangeUpCommand = kity.createClass('ArrangeUpCommand', {
base: Command,
......@@ -31,6 +36,11 @@ var ArrangeUpCommand = kity.createClass('ArrangeUpCommand', {
node.arrange(lastIndexes[index] - 1);
});
km.layout(300);
},
queryState: function(km) {
var selected = km.getSelectedNode();
return selected ? 0 : -1;
}
});
......@@ -47,6 +57,11 @@ var ArrangeDownCommand = kity.createClass('ArrangeUpCommand', {
node.arrange(lastIndexes[index] + 1);
});
km.layout(300);
},
queryState: function(km) {
var selected = km.getSelectedNode();
return selected ? 0 : -1;
}
});
......@@ -80,6 +95,11 @@ var ArrangeCommand = kity.createClass('ArrangeCommand', {
});
km.layout(300);
},
queryState: function(km) {
var selected = km.getSelectedNode();
return selected ? 0 : -1;
}
});
......
......@@ -7,7 +7,9 @@ KityMinder.registerModule("fontmodule", function() {
var dataColor = node.getData('color');
var selectedColor = node.getStyle('selected-color');
var styleColor = node.getStyle('color');
text.fill(dataColor || (node.isSelected() && selectedColor ? selectedColor : styleColor));
text.setFont({
family: getNodeDataOrStyle(node, 'font-family'),
size: getNodeDataOrStyle(node, 'font-size')
......@@ -17,40 +19,40 @@ KityMinder.registerModule("fontmodule", function() {
return {
defaultOptions: {
'fontfamily': [{
name: 'songti',
name: '宋体',
val: '宋体,SimSun'
}, {
name: 'yahei',
name: '微软雅黑',
val: '微软雅黑,Microsoft YaHei'
}, {
name: 'kaiti',
val: '楷体,楷体_GB2312, SimKai'
name: '楷体',
val: '楷体,楷体_GB2312,SimKai'
}, {
name: 'heiti',
name: '黑体',
val: '黑体, SimHei'
}, {
name: 'lishu',
name: '隶书',
val: '隶书, SimLi'
}, {
name: 'andaleMono',
name: 'Andale Mono',
val: 'andale mono'
}, {
name: 'arial',
val: 'arial, helvetica,sans-serif'
name: 'Arial',
val: 'arial,helvetica,sans-serif'
}, {
name: 'arialBlack',
val: 'arial black,avant garde'
}, {
name: 'comicSansMs',
name: 'Comic Sans Ms',
val: 'comic sans ms'
}, {
name: 'impact',
name: 'Impact',
val: 'impact,chicago'
}, {
name: 'timesNewRoman',
name: 'Times New Roman',
val: 'times new roman'
}, {
name: 'sans-serif',
name: 'Sans-Serif',
val: 'sans-serif'
}],
'fontsize': [10, 12, 16, 18, 24, 32, 48]
......@@ -77,7 +79,7 @@ KityMinder.registerModule("fontmodule", function() {
}
}),
"backgroundcolor": kity.createClass("backgroudcolorCommand", {
"background": kity.createClass("backgroudCommand", {
base: Command,
execute: function(km, color) {
......@@ -110,7 +112,12 @@ KityMinder.registerModule("fontmodule", function() {
});
},
queryState: function(km) {
return km.getSelectedNodes().length == 0 ? -1 : 0
return km.getSelectedNodes().length === 0 ? -1 : 0
},
queryValue: function(km) {
var node = km.getSelectedNode();
if (node) return node.getData('font-family');
return null;
}
}),
"fontsize": kity.createClass("fontsizeCommand", {
......@@ -126,6 +133,11 @@ KityMinder.registerModule("fontmodule", function() {
},
queryState: function(km) {
return km.getSelectedNodes().length == 0 ? -1 : 0
},
queryValue: function(km) {
var node = km.getSelectedNode();
if (node) return node.getData('font-size');
return null;
}
})
}
......
......@@ -15,12 +15,12 @@ KityMinder.registerModule('image', function() {
fitRatio = maxWidth / maxHeight;
// 宽高比大于最大尺寸的宽高比,以宽度为标准适应
if (ratio > fitRatio && width > maxWidth) {
if (width > maxWidth && ratio > fitRatio) {
width = maxWidth;
height = maxWidth / ratio;
height = width / ratio;
} else if (height > maxHeight) {
height = maxHeight;
width = maxHeight / ratio;
width = height * ratio;
}
return {
......
......@@ -34,7 +34,7 @@ var OutlineRenderer = kity.createClass('OutlineRenderer', {
.setPosition(outlineBox.x, outlineBox.y)
.setSize(outlineBox.width, outlineBox.height)
.setRadius(node.getStyle('radius'))
.fill(node.getStyle(prefix + 'background') || node.getStyle('background'))
.fill(node.getData('background') || node.getStyle(prefix + 'background') || node.getStyle('background'))
.stroke(node.getStyle(prefix + 'stroke' || node.getStyle('stroke')),
node.getStyle(prefix + 'stroke-width'));
......
......@@ -61,7 +61,7 @@ KityMinder.registerModule('PriorityModule', function() {
execute: function(km, value) {
var nodes = km.getSelectedNodes();
for (var i = 0; i < nodes.length; i++) {
nodes[i].setData(PRIORITY_DATA, value).render();
nodes[i].setData(PRIORITY_DATA, value || null).render();
}
km.layout();
},
......@@ -72,7 +72,7 @@ KityMinder.registerModule('PriorityModule', function() {
val = nodes[i].getData(PRIORITY_DATA);
if (val) break;
}
return val;
return val || null;
},
queryState: function(km) {
......
......@@ -54,7 +54,7 @@ KityMinder.registerModule('ProgressModule', function() {
execute: function(km, value) {
var nodes = km.getSelectedNodes();
for (var i = 0; i < nodes.length; i++) {
nodes[i].setData(PROGRESS_DATA, value).render();
nodes[i].setData(PROGRESS_DATA, value || null).render();
}
km.layout();
},
......@@ -65,7 +65,7 @@ KityMinder.registerModule('ProgressModule', function() {
val = nodes[i].getData(PROGRESS_DATA);
if (val) break;
}
return val;
return val|| null;
},
queryState: function(km) {
......
......@@ -83,7 +83,7 @@ KityMinder.registerModule('Select', function() {
minder.select(selectedNodes, true);
// 清除多余的东西
window.getSelection().removeAllRanges()
window.getSelection().removeAllRanges();
},
selectEnd: function(e) {
if (startPosition) {
......
KityMinder.registerModule('StyleModule', function() {
var styleNames = ['font-size', 'font-family', 'font-weight', 'font-style', 'background', 'color'];
var styleClipBoard = null;
function hasStyle(node) {
var data = node.getData();
for(var i = 0; i < styleNames.length; i++) {
if (styleNames[i] in data) return true;
}
}
return {
"commands": {
"copystyle": kity.createClass("CopyStyleCommand", {
base: Command,
execute: function(minder) {
var node = minder.getSelectedNode();
var nodeData = node.getData();
styleClipBoard = {};
styleNames.forEach(function(name) {
if (name in nodeData) styleClipBoard[name] = nodeData[name];
else {
styleClipBoard[name] = null;
delete styleClipBoard[name];
}
});
return styleClipBoard;
},
queryState: function(minder) {
var nodes = minder.getSelectedNodes();
if (nodes.length !== 1) return -1;
return hasStyle(nodes[0]) ? 0 : -1;
}
}),
"pastestyle": kity.createClass("PastStyleCommand", {
base: Command,
execute: function(minder) {
minder.getSelectedNodes().forEach(function(node) {
for (var name in styleClipBoard) {
if (styleClipBoard.hasOwnProperty(name))
node.setData(name, styleClipBoard[name]);
}
});
minder.renderNodeBatch(minder.getSelectedNodes());
minder.layout(300);
return styleClipBoard;
},
queryState: function(minder) {
return (styleClipBoard && minder.getSelectedNodes().length) ? 0 : -1;
}
}),
"clearstyle": kity.createClass("ClearStyleCommand", {
base: Command,
execute: function(minder) {
minder.getSelectedNodes().forEach(function(node) {
styleNames.forEach(function(name) {
node.setData(name);
});
});
minder.renderNodeBatch(minder.getSelectedNodes());
minder.layout(300);
return styleClipBoard;
},
queryState: function(minder) {
var nodes = minder.getSelectedNodes();
if (!nodes.length) return -1;
for(var i = 0; i < nodes.length; i++) {
if (hasStyle(nodes[i])) return 0;
}
return -1;
}
})
}
};
});
\ No newline at end of file
......@@ -87,6 +87,9 @@ var ViewDragger = kity.createClass("ViewDragger", {
.on('mouseup touchend', dragEnd);
window.addEventListener('mouseup', dragEnd);
dragger._minder.getRenderTarget().addEventListener('contextmenu', function(e) {
e.preventDefault();
});
}
});
......
KityMinder.registerTheme('classic', {
'background': '#3A4144 url(themes/default/images/grid.png) repeat',
'background': '#3A4144 url(ui/theme/default/images/grid.png) repeat',
'root-color': '#430',
'root-background': '#e9df98',
......
KityMinder.registerTheme('snow', {
'background': '#3A4144 url(themes/default/images/grid.png) repeat',
'background': '#3A4144 url(ui/theme/default/images/grid.png) repeat',
'root-color': '#430',
'root-background': '#e9df98',
......
KityMinder.registerUI('account', function(minder) {
});
\ No newline at end of file
KityMinder.registerUI('arrange', ['tabs', 'commandbutton'], function(minder, $tabs, $commandbutton) {
var $arrangePanel = new FUI.LabelPanel({
label: minder.getLang('panels.arrange'),
column: true
});
$commandbutton.generate('arrangeup').appendTo($arrangePanel);
$commandbutton.generate('arrangedown').appendTo($arrangePanel);
$tabs.idea.appendWidget($arrangePanel);
return $arrangePanel;
});
\ No newline at end of file
KityMinder.registerUI('attachment', ['tabs'], function(minder, $tabs) {
var $attachmentPanel = new FUI.LabelPanel({
label: minder.getLang('panels.attachment'),
coloum: true
}).appendTo($tabs.idea);
return $attachmentPanel;
});
\ No newline at end of file
function generateSerisColor() {
return ['#e75d66', '#fac75b', '#99ca6a', '#00c5ad', '#3bbce0', '#c9ced1', '#425b71', 'white'];
}
KityMinder.registerUI('color', ['tabs', 'commandbuttonset'], function(minder, $tabs, $commandbuttonset) {
var $colorPanel = new FUI.LabelPanel({
label: minder.getLang('panels.color')
}).appendTo($tabs.edit);
var $backgroundPanel = new FUI.LabelPanel({
label: minder.getLang('panels.background')
}).appendTo($tabs.edit);
var foreColorList = generateSerisColor();
$colorPanel.appendWidget($commandbuttonset.generate('forecolor', foreColorList.map(function(color) {
return {
icon: {
style: {
background: color
}
},
label: color,
text: color,
value: color
};
})).addClass('color-picker'));
$backgroundPanel.appendWidget($commandbuttonset.generate('background', foreColorList.map(function(color) {
return {
icon: {
style: {
background: color
}
},
label: color,
text: color,
value: color
};
})).addClass('color-picker'));
return {
color: $colorPanel,
background: $backgroundPanel
};
});
\ No newline at end of file
KityMinder.registerUI('commandbutton', function(minder) {
return {
generate: function(command, onclick) {
var $button = new FUI.Button({
label: minder.getLang('ui.' + command),
text: minder.getLang('ui.' + command),
className: ['command-widget', 'command-button', command]
});
$button.on('click', onclick || function() {
minder.execCommand(command);
});
$button.bindCommandState(minder, command);
return $button;
}
};
});
\ No newline at end of file
KityMinder.registerUI('commandbuttonset', function(minder) {
function mapValueItem(command, valueList) {
return valueList.map(function(value) {
var text = minder.getLang([command, value].join('.')) || value;
return {
label: text,
text: text,
value: value,
className: [command, value].join(' ')
};
});
}
function generate(command, valueList) {
var $buttonset = new FUI.Buttonset({
id: 'template-set',
buttons: typeof(valueList[0]) == 'object' ? valueList : mapValueItem(command, valueList),
className: ['command-widget', 'command-buttonset', command].join(' ')
});
$buttonset.on('change', function() {
minder.execCommand(command, $buttonset.getValue());
});
$buttonset.bindCommandState(minder, command, function(value) {
this.selectByValue(value);
});
return $buttonset;
}
return {
generate: generate
};
});
\ No newline at end of file
KityMinder.registerUI('commandinputmenu', function(minder) {
function generate(command, menuList) {
var $menu = new FUI.InputMenu({
menu: {
items: menuList
},
input: {
placeholder: minder.getLang('ui.' + command),
},
className: ['command-widget', 'command-inputmenu', command]
});
var interactFlag = false;
$menu.bindCommandState(minder, command, function(value) {
interactFlag = true;
if (!$menu.selectByValue(value)) {
$menu.clearSelect();
}
interactFlag = false;
});
var lastIndex = -1;
$menu.on('select', function(e, info) {
if (interactFlag) return;
if (~info.index) {
minder.execCommand(command, info.value);
} else {
$menu.select(lastIndex);
}
lastIndex = info.index;
});
return $menu;
}
return {
generate: generate
};
});
\ No newline at end of file
function fontUI(minder, $tabs, $commandInputMenu, $commandButton) {
var $fontPanel = new FUI.LabelPanel({
label: minder.getLang('panels.font'),
id: 'font-panel'
});
var $leftPanel = new FUI.Panel({
column: true
});
var $rightPanel = new FUI.Panel({
column: true
});
var $fontFamilyMenu = $commandInputMenu.generate('fontfamily', minder.getOptions('fontfamily').map(function(ff) {
return {
label: {
text: ff.name,
style: {
fontFamily: ff.val
}
},
text: ff.name,
value: ff.val
};
}));
var $fontSizeMenu = $commandInputMenu.generate('fontsize', minder.getOptions('fontsize').map(function(fs) {
return {
label: {
text: fs,
style: {
fontSize: fs
}
},
text: fs,
value: fs
};
}));
$leftPanel.appendWidgets([$fontFamilyMenu, $fontSizeMenu]);
var $boldButton = $commandButton.generate('bold');
var $italicButton = $commandButton.generate('italic');
$rightPanel.appendWidgets([$boldButton, $italicButton]);
$fontPanel.appendWidgets([$leftPanel, $rightPanel]);
$tabs.edit.appendWidget($fontPanel);
}
KityMinder.registerUI('font', ['tabs', 'commandinputmenu', 'commandbutton'], fontUI);
\ No newline at end of file
kity.extendClass(FUI.Widget, {
setEnable: function(value) {
if (value === false) this.disable();
else this.enable();
},
setActive: function(value) {
if (value === false) this.removeClass('active');
else this.addClass('active');
},
bindCommandState: function(minder, command, valueHandle) {
var $widget = this;
minder.on('interactchange', function() {
$widget.setEnable(this.queryCommandState(command) !== -1);
$widget.setActive(this.queryCommandState(command) === 1);
if (valueHandle) valueHandle.call($widget, this.queryCommandValue(command));
});
}
});
\ No newline at end of file
KityMinder.registerUI('history', ['commandbutton'], function(minder, $commandbutton) {
var ret = {};
['undo', 'redo'].forEach(function(command) {
ret[command] = $commandbutton.generate(command).appendTo(document.getElementById('panel'));
});
return ret;
});
\ No newline at end of file
KityMinder.registerUI('image', ['attachment'], function (minder, $attachment) {
var $imageButtonMenu = new FUI.ButtonMenu({
id: 'image-button-menu',
text: minder.getLang('ui.image'),
layout: 'bottom',
buttons: [{}, {
label: minder.getLang('ui.image')
}],
menu: {
items: [minder.getLang('ui.removeimage')]
}
}).appendTo($attachment);
$imageButtonMenu.bindCommandState(minder, 'image');
var $imageDialog = new FUI.Dialog({
width: 500,
height: 400,
caption: minder.getLang('ui.image')
}).appendTo(document.getElementById('content-wrapper'));
$imageDialog.on('ok', function() {
minder.execCommand('image', $url.val());
});
$imageDialog.on('open', function() {
$url.val(minder.queryCommandValue('image'));
$preview.attr('src', '');
error(false);
});
var $dialogBody = $($imageDialog.getBodyElement());
$dialogBody.html([
'<p><label>图片地址:</label><input type="url" class="image-url" /></p>',
'<p><label>提示文本:</label><input type="text" class="image-title /"></p>',
'<img class="image-preview" src="" style="max-height: 200px;" />'
].join(''));
var $url = $dialogBody.find('.image-url');
var $preview = $dialogBody.find('.image-preview');
var $ok = $imageDialog.getButton(0);
var $errorMsg = $('<span class="validate-error"></span>');
function error(value) {
if (value) {
$url.addClass('validate-error');
$errorMsg.text('图片无法加载');
$ok.disable();
} else {
$url.removeClass('validate-error');
$errorMsg.text('');
$ok.enable();
}
return value;
}
$url.after($errorMsg);
$url.on('input', function() {
var url = $url.val();
if (/^https?\:\/\/(\w+\.)+\w+/.test(url)) {
$preview.attr('src', url);
error(false);
$ok.disable();
$preview.addClass('loading');
} else {
error(true);
}
});
$preview.on('load', function() {
error(false);
$preview.removeClass('loading');
}).on('error', function() {
if($preview.attr('src')) error(true);
$preview.removeClass('loading');
});
$imageButtonMenu.on('buttonclick', function() {
$imageDialog.open();
$url[0].focus();
});
$imageButtonMenu.on('select', function() {
minder.execCommand('removeimage');
});
return $imageButtonMenu;
});
\ No newline at end of file
KityMinder.registerUI('insertnode', ['tabs', 'commandbutton'], function(minder, $tabs, $commandbutton) {
var $insertNodePanel = new FUI.LabelPanel({
label: minder.getLang('panels.insert'),
column: true
});
$commandbutton.generate('appendchildnode').appendTo($insertNodePanel);
$commandbutton.generate('appendsiblingnode').appendTo($insertNodePanel);
$tabs.idea.appendWidget($insertNodePanel);
return $insertNodePanel;
});
\ No newline at end of file
KityMinder.registerUI('layout', ['tabs', 'commandbuttonset', 'commandbutton'], function(minder, $tabs, $commandbuttonset, $commandbutton) {
var $layoutPanel = new FUI.LabelPanel({
id: 'layout-panel',
label: minder.getLang('panels.layout')
}).appendTo($tabs.edit);
var $layoutSelect = new FUI.DropPanel({
id: 'layout-select'
}).appendTo($layoutPanel);
var layoutList = KityMinder.Utils.keys(KityMinder.getLayoutList());
$layoutSelect.appendWidget($commandbuttonset.generate('layout', layoutList));
$commandbutton.generate('resetlayout').appendTo($layoutPanel).addClass('large');
return $layoutPanel;
});
\ No newline at end of file
KityMinder.registerUI('link', ['attachment'], function(minder, $attachment) {
var $linkButtonMenu = new FUI.ButtonMenu({
id: 'link-button-menu',
text: minder.getLang('ui.link'),
layout: 'bottom',
buttons: [{}, {
label: minder.getLang('ui.link')
}],
menu: {
items: [minder.getLang('ui.removelink')]
}
}).appendTo($attachment);
$linkButtonMenu.bindCommandState(minder, 'hyperlink');
var $linkDialog = new FUI.Dialog({
width: 600,
height: 200,
caption: minder.getLang('ui.link')
}).appendTo(document.getElementById('content-wrapper'));
var $dialogBody = $($linkDialog.getBodyElement());
$dialogBody.html([
'<p><label>连接地址:</label><input type="url" class="link-href" /></p>',
'<p><label>提示文本:</label><input type="text" class="link-title /"></p>'
].join(''));
var $href = $dialogBody.find('.link-href');
var $ok = $linkDialog.getButton(0);
var $errorMsg = $('<span class="validate-error"></span>');
function error(value) {
if (value) {
$href.addClass('validate-error');
$errorMsg.text('地址格式错误');
$ok.disable();
} else {
$href.removeClass('validate-error');
$errorMsg.text('');
$ok.enable();
}
}
$href.after($errorMsg);
$href.on('input', function() {
var url = $href.val();
error(!/^https?\:\/\/(\w+\.)+\w+/.test(url));
});
$linkButtonMenu.on('buttonclick', function() {
$linkDialog.open();
$href[0].focus();
});
$linkButtonMenu.on('select', function() {
minder.execCommand('unhyperlink');
});
$linkDialog.on('ok', function() {
minder.execCommand('hyperlink', $href.val());
});
$linkDialog.on('open', function() {
$href.val(minder.queryCommandValue('hyperlink'));
error(false);
});
return $linkButtonMenu;
});
\ No newline at end of file
KityMinder.registerUI('mainmenu', function(minder) {
var $button = new FUI.Button({
id: 'main-menu-btn'
});
var $panel;
$button.setLabel('百度脑图');
$button.appendTo(document.getElementById('panel'));
$button.on('click', function(e) {
$panel.addClass('show');
});
$panel = $('<div id="main-menu"></div>').appendTo('body');
$panel.click(function() {
$panel.removeClass('show');
});
return $panel;
});
\ No newline at end of file
KityMinder.registerUI('nodeop', ['tabs', 'commandbutton'], function(minder, $tabs, $commandbutton) {
var $opPanel = new FUI.LabelPanel({
label: minder.getLang('panels.nodeop'),
column: true
}).appendTo($tabs.idea);
['editnode', 'removenode'].forEach(function(cmd) {
$commandbutton.generate(cmd).appendTo($opPanel);
});
});
\ No newline at end of file
KityMinder.registerUI('priority', ['tabs', 'commandbuttonset'], function(minder, $tabs, $commandbuttonset) {
var $priorityPanel = new FUI.LabelPanel({
label: minder.getLang('panels.priority')
}).appendTo($tabs.idea);
$commandbuttonset.generate('priority', [1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map(function(p) {
return {
label: p,
text: minder.getLang('ui.priority') + p,
value: p,
className: ['priority', p].join('-')
};
})).appendTo($priorityPanel);
return $priorityPanel;
});
\ No newline at end of file
KityMinder.registerUI('progress', ['tabs', 'commandbuttonset'], function(minder, $tabs, $commandbuttonset) {
var $progressPanel = new FUI.LabelPanel({
label: minder.getLang('panels.progress')
}).appendTo($tabs.idea);
$commandbuttonset.generate('progress', [1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map(function(p) {
return {
label: p,
text: minder.getLang('ui.progress.p' + p),
value: p,
className: ['progress', p].join('-')
};
})).appendTo($progressPanel);
return $progressPanel;
});
\ No newline at end of file
KityMinder.registerUI('resource', ['tabs', 'commandbuttonset'], function(minder, $tabs, $commandbuttonset) {
var $resourcePanel = new FUI.LabelPanel({
label: minder.getLang('panels.resource'),
id: 'resource-panel'
}).appendTo($tabs.idea);
var $addInput = new FUI.Input().appendTo($resourcePanel);
var $addButton = new FUI.Button({
label: '添加'
}).appendTo($resourcePanel);
var $resourceDrop = new FUI.DropPanel().appendTo($resourcePanel);
var $dropContainer = $($resourceDrop.getPanelElement());
var $ul = $('<ul></ul>').addClass('resource-list').appendTo($dropContainer);
function addResource() {
var resource = $addInput.getValue();
var origin = minder.queryCommandValue('resource');
if (resource) {
origin.push(resource);
minder.execCommand('resource', origin);
}
$addInput.setValue(null);
update();
$addInput.focus();
}
$addInput.on('inputcomplete', function(e) {
addResource();
});
$addButton.on('click', addResource);
$dropContainer.delegate('input[type=checkbox]', 'change', function() {
minder.execCommand('resource', $dropContainer.find('input[type=checkbox]:checked').map(function(index, chk) {
return $(chk).data('resource');
}).toArray());
update();
});
function hash(resource, used) {
return [resource.join(','), used.join(',')].join(';');
}
function changed(resource, used) {
var currentHash = hash(resource, used);
if (currentHash == changed.lastHash) return true;
changed.lastHash = currentHash;
return false;
}
function update() {
var resource = minder.queryCommandValue('resource');
var used = minder.getUsedResource();
if (!changed(resource, used)) return;
$ul.empty().append(used.map(function(name) {
var $li = $('<li></li>'),
$label = $('<label></label>').appendTo($li),
$chk = $('<input type="checkbox" />')
.data('resource', name)
.prop('checked', ~resource.indexOf(name))
.appendTo($label);
$label.append(name);
var color = minder.getResourceColor(name);
return $li.css({
color: color.dec('l', 60).toString(),
backgroundColor: ~resource.indexOf(name) ? color : color.dec('a', 0.85).toRGBA()
});
}));
switch (minder.queryCommandState('resource')) {
case 0:
$addInput.enable();
$addButton.enable();
$resourceDrop.enable();
$ul.find('input[type=checkbox]').removeProp('disabled');
break;
case -1:
$addInput.disable();
$addButton.disable();
$resourceDrop.disable();
$ul.find('input[type=checkbox]').prop('disabled', 'disabled');
}
}
minder.on('interactchange', update);
return $resourcePanel;
});
\ No newline at end of file
KityMinder.registerUI('style', ['tabs', 'commandbutton'], function(minder, $tabs, $commandbutton) {
var $stylePanel = new FUI.LabelPanel({
label: minder.getLang('panels.style')
}).appendTo($tabs.edit);
$commandbutton.generate('clearstyle').addClass('large').appendTo($stylePanel);
var $styleClipPanel = new FUI.Panel({
column: true
}).appendTo($stylePanel);
$commandbutton.generate('copystyle').appendTo($styleClipPanel);
$commandbutton.generate('pastestyle').appendTo($styleClipPanel);
return $stylePanel;
});
\ No newline at end of file
KityMinder.registerUI('tabs', function(minder) {
var $tab = new FUI.Tabs({
buttons: ['思路', '展现', '视图']
});
var $header = $('<div id="tab-select"></div>').appendTo('#panel');
var $container = $('<div id="tab-container"></div>');
$('#panel').after($container);
$tab.appendButtonTo($header[0]);
$tab.appendPanelTo($container[0]);
// 隐藏效果
var lastIndex = 0;
$tab.on('tabsselect', function(e, info) {
if (info.index == lastIndex) {
$container.toggleClass('collapsed');
$header.toggleClass('collapsed');
} else {
$container.removeClass('collapsed');
$header.removeClass('collapsed');
}
lastIndex = info.index;
});
$tab.idea = $tab.getPanel(0);
$tab.edit = $tab.getPanel(1);
$tab.view = $tab.getPanel(2);
return $tab;
});
\ No newline at end of file
KityMinder.registerUI('template', ['tabs'], function(minder, $tabs) {
var buttonset = minder.getUI('commandbuttonset');
var $templatePanel = new FUI.LabelPanel({
id: 'template-panel',
label: minder.getLang('panels.template')
});
var $templateSelect = new FUI.DropPanel({
id: 'template-select'
});
$tabs.edit.appendWidget($templatePanel);
$templatePanel.appendWidget($templateSelect);
var templateList = KityMinder.Utils.keys(KityMinder.getTemplateList());
$templateSelect.appendWidget(buttonset.generate('template', templateList));
return $templatePanel;
});
\ No newline at end of file
KityMinder.registerUI('theme', ['tabs'], function(minder, $tabs) {
var buttonset = minder.getUI('commandbuttonset');
var $themePanel = new FUI.LabelPanel({
id: 'theme-panel',
label: minder.getLang('panels.theme')
});
var $themeSelect = new FUI.DropPanel({
id: 'theme-select'
});
$tabs.edit.appendWidget($themePanel);
$themePanel.appendWidget($themeSelect);
var themeList = KityMinder.Utils.keys(KityMinder.getThemeList());
$themeSelect.appendWidget(buttonset.generate('theme', themeList.map(function(theme) {
var style = KityMinder._themes[theme];
return {
label: {
text: minder.getLang('theme.' + theme),
style: {
background: style['root-background'],
color: style['root-color'],
borderRadius: style['root-radius'] / 2
}
},
text: minder.getLang('theme.' + theme),
value: theme,
className: ['theme', theme].join(' ')
};
})));
return $themePanel;
});
\ No newline at end of file
/**
* 页面下方 “关于” 面板的样式
*/
#about {
position: absolute;
bottom: 0;
right: 0;
height: 40px;
line-height: 40px;
background: #5d697a;
color: #eee;
font-family:Arial;
font-size: 13px;
font-weight:normal;
margin:0;
text-align: right;
padding: 0 15px 0 60px;
border-bottom: 5px solid #393F4F;
overflow: visible;
.transition(all ease .3s 0.3s);
.transform(translate(100%));
a {
color: #eee;
}
#km-cat {
position: absolute;
left: 15px;
top: 5px;
.transition(all ease 1.3s 0.3s);
.transform(translate(-60px, 0));
cursor: pointer;
}
#cat-face {
fill: #393F4F;
}
&:hover, &:hover #km-cat {
.transform(translate(0));
}
#km-version.new-version{
position: relative;
padding-right: 30px;
&: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);
.transform(scale(.6))
}
}
}
.command-buttonset.color-picker {
width: 100px;
.fui-toggle-button {
margin: 3px 3px 0 0 !important;
padding: 2px !important;
border-radius: 100%;
border: 1px solid #efefef;
background: transparent;
&.fui-button-pressed {
border: 1px solid @button-active;
background: #fafcff;
}
&:hover {
border: 1px solid #ccd0d3;
background: #fff;
}
.fui-label {
display: none;
}
.fui-icon {
width: 16px;
height: 16px;
border-radius: 100%;
}
}
}
\ No newline at end of file
#font-panel {
.command-button {
padding: 0;
width: 20px;
height: 20px;
border: 1px solid transparent;
background: transparent;
&.active {
border: 1px solid #ccd0d3;
background: #fafcff;
}
&:hover {
border: 1px solid #ccd0d3;
background: #fff;
}
&:active {
background: darken(#fafcff, 5%);
}
border-radius: 11px;
margin-left: 5px;
margin-top: 2px;
margin-bottom: 2px !important;
.fui-label {
display: none;
}
}
}
\ No newline at end of file
......@@ -5,20 +5,6 @@
-o-filter: blur(5px);
filter: blur(5px);
filter: url(../images/blur.svg#blur);
/* transition: all ease 0.5s; */
}
.kmui-modal.kmui-dialog-help .kmui-modal-header {
display: none;
}
.kmui-modal.kmui-dialog-help .kmui-modal-body {
position: fixed;
left: 0;
top: 85px;
right: 0;
bottom: 0;
max-height: 1000000px;
background: hsla(222, 14%, 41%, 0.8);
}
.shortcuts-opt {
margin: 0px 7px;
......
@import "_vars";
.command-button {
&.undo, &.redo {
float: left;
border: none;
width: @panel-height;
height: @panel-height;
line-height: @panel-height;
padding: 0;
margin: 0;
.fui-label {
display: none;
}
.fui-icon {
display: block;
width: @panel-height;
height: @panel-height;
background: url(../images/history.png) no-repeat;
}
&:hover {
background: @tab-hover;
.fui-icon {
background-position-y: -40px;
}
}
&:active {
background: @tab-active;
}
&.fui-disabled {
&:hover, &:active {
background: none;
}
.fui-icon {
background-position-y: 0;
}
}
}
&.undo {
margin-left: 10px;
}
&.redo {
.fui-icon {
background-position-x: -40px;
}
}
}
\ No newline at end of file
@iconsize: 20px;
.sprite(@index, @size:@iconsize) {
background-position: 0 (-@index * @iconsize);
}
.command-button .fui-icon {
background: url(../images/icons.png) no-repeat;
.sprite(-1);
.appendchildnode& { .sprite(0); }
.appendsiblingnode& { .sprite(1); }
.editnode& { .sprite(3); }
.removenode& { .sprite(4); }
.resetlayout& { background-position: 0 -150px; }
.clearstyle& { background-position: 0 -175px; }
.copystyle& { .sprite(10); }
.pastestyle& { .sprite(11); }
.bold& { .sprite(12); }
.italic& { .sprite(13); }
.arrangeup& { .sprite(14); }
.arrangedown& { .sprite(15); }
}
\ No newline at end of file
/**
* 基本页面样式
*/
@import "_vendor";
@import "_vars";
html, body, div {
margin: 0;
padding: 0;
overflow: hidden;
}
body, svg {
font-family: Arial, "Microsoft Yahei", "Heiti SC", sans-serif;
}
html, body {
height: 100%;
}
#content-wrapper {
overflow: hidden;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#kityminder {
position: absolute;
left: 0;
top: @panel-height;
right: 0;
bottom: 0;
-moz-user-select: none;
}
#panel {
background: hsl(224, 16%, 27%);
font-family: 'Hiragino Sans GB', 'Arial', 'Microsoft Yahei';
height: @panel-height;
overflow: visible;
position: relative;
}
.fui-widget {
-webkit-font-smoothing: auto;
}
\ No newline at end of file
@import "_vars";
@main-menu-btn-color: #ff6e6e;
#main-menu-btn {
display: block;
float: left;
height: @panel-height;
line-height: @panel-height;
padding: 0 30px 0 15px;
z-index: 11;
background-color: @main-menu-btn-color;
&:hover {
background-color: lighten(@main-menu-btn-color, 5%) !important;
}
&:active {
background-color: darken(@main-menu-btn-color, 5%) !important;
}
.fui-label {
height: @panel-height;
line-height: @panel-height;
font-size: 14px;
color: white;
}
&:after {
content: ' ';
display: block;
position: absolute;
width: 0;
height: 0;
line-height: 0;
font-size: 0;
border: 6px solid;
border-color: white transparent transparent transparent;
right: 12px;
top: @panel-height / 2 - 4;
}
}
#main-menu {
position: absolute;
background: gray;
top: 0;
left: 0;
right: 0;
opacity: 0;
.transition(opacity ease 0.2s);
&.show {
bottom: 0;
opacity: 1;
}
}
\ No newline at end of file
.priority-sprite(@count) when (@count >= 0) {
.priority-sprite(@count - 1);
&.priority-@{count} .fui-icon {
background-position: (-20px * (@count - 1)) 0;
}
}
#tab-container .command-buttonset.priority {
width: 140px;
.fui-button {
width: 20px;
height: 20px;
margin: 1px;
.fui-label {
display: none;
}
.fui-icon {
display: block;
height: 20px;
width: 20px;
background: url(../images/iconpriority.png) repeat-x;
background-color: transparent;
}
padding: 3px;
border-radius: 4px;
.priority-sprite(9);
&.fui-button-pressed {
background-color: @button-active;
}
}
}
\ No newline at end of file
.progress-sprite(@count) when (@count >= 0) {
.progress-sprite(@count - 1);
&.progress-@{count} .fui-icon {
background-position: (-20px * (@count - 1)) 0;
}
}
#tab-container .command-buttonset.progress {
width: 140px;
.fui-button {
width: 20px;
height: 20px;
margin: 1px;
.fui-label {
display: none;
}
.fui-icon {
display: block;
height: 20px;
width: 20px;
background: url(../images/iconprogress.png) repeat-x;
background-color: transparent;
}
padding: 3px;
border-radius: 4px;
.progress-sprite(9);
&.fui-button-pressed {
background-color: @button-active;
}
}
}
\ No newline at end of file
.km_receiver{
width:0;
height:0;
}
\ No newline at end of file
#resource-panel > .fui-panel-content > .fui-label-panel-content {
position: relative;
& > .fui-input {
width: 148px;
margin: 5px 0 0;
vertical-align: middle;
}
& > .fui-button {
left: auto;
right: 6px;
top: 11px;
padding: 1px 3px;
vertical-align: middle;
position: absolute;
}
& > .fui-drop-panel {
display: block;
height: 30px;
margin-top: -1px;
width: 140px;
}
}
#image-button-menu .fui-button:first-child {
background-image: url(../images/icons.png);
background-position: center -125px;
background-repeat: no-repeat;
}
#link-button-menu .fui-button:first-child {
background-image: url(../images/icons.png);
background-position: center -100px;
background-repeat: no-repeat;
}
ul.resource-list {
margin: 0;
padding: 0;
list-style: none;
li {
display: inline-block;
padding: 1px 2px;
border-radius: 4px;
margin: 5px 0px 5px 5px;
}
}
\ No newline at end of file
#share-dialog {
display: none;
}
\ No newline at end of file
@import "_vars";
#tab-select {
height: @panel-height;
line-height: @panel-height;
margin-left: 10px;
float: left;
.fui-button {
width: 60px;
height: @panel-height;
line-height: @panel-height;
text-align: 50px;
display: inline-block;
&:hover {
background: @tab-hover !important;
}
&:active {
background: @tab-active !important;
}
.fui-icon {
display: none;
}
.fui-label {
height: @panel-height;
line-height: @panel-height;
text-align: center;
display: block;
color: hsl(224, 6%, 80%);
font-size: 14px;
&:hover {
background: @tab-hover;
}
&:active {
background: darken(@tab-active, 10%);
}
}
&.fui-selected {
.fui-label {
color: white;
}
&:after {
content: ' ';
height: 0;
line-height: 0;
font-size: 0;
display: block;
position: absolute;
border: 6px solid;
border-color: transparent transparent white transparent;
bottom: 0;
left: 50%;
margin-left: -3px;
z-index: 11;
}
}
}
&.collapsed .fui-button.fui-selected {
.fui-label {
color: hsl(224, 6%, 80%);
}
&:after {
display: none;
}
}
}
#tab-container {
position: absolute;
top: @panel-height;
height: 89px;
left: 0;
right: 0;
background: white;
z-index: 10;
border-bottom: 1px solid #dbdbdb;
box-shadow: 0 -3px 3px rgba(0, 0, 0, .05);
/* 每一个 Tab 面板 */
& > .fui-panel {
display: block;
height: 100%;
/* 每一个小节 */
& > .fui-panel-content > .fui-panel {
height: 100%;
padding: 0 5px;
border-right: 1px dashed #eee;
& > .fui-panel-content > .fui-label {
text-align: center;
display: block;
width: 100%;
padding: 1px 0;
position: absolute;
bottom: 0;
top: auto;
}
& > .fui-panel-content > .fui-label-panel-content {
padding: 5px;
}
}
}
.transition(all 0.15s ease);
&.collapsed {
opacity: 0;
height: 0;
}
}
\ No newline at end of file
#template-panel {
& > .fui-panel-content
> .fui-label-panel-content
> .fui-drop-panel {
width: 65px;
height: 50px;
}
}
#theme-panel {
& > .fui-panel-content
> .fui-label-panel-content
> .fui-drop-panel {
width: 90px;
height: 50px;
}
}
#layout-panel {
& > .fui-panel-content
> .fui-label-panel-content
> .fui-drop-panel {
width: 65px;
height: 50px;
margin-right: 10px;
}
}
.fui-button.template {
width: 50px;
height: 40px;
padding: 0 2px !important;
margin: 5px 0 0 5px !important;
.fui-label {
display: none;
}
.fui-icon {
display: block;
width: 50px;
height: 40px;
background-image: url(../images/template.png);
background-repeat: no-repeat;
}
&.default .fui-icon {
background-position: 0 0;
}
&.structure .fui-icon {
background-position: -50px 0;
}
&.filetree .fui-icon {
background-position: -100px 0;
}
}
.fui-button.theme {
padding: 5px !important;
margin: 5px 0 0 5px !important;
.fui-label {
width: 60px;
height: 30px;
line-height: 30px;
text-align: center;
padding: 0 5px;
}
}
.fui-button.layout {
width: 50px;
height: 40px;
padding: 0 2px !important;
margin: 5px 0 0 5px !important;
.fui-label {
display: none;
}
.fui-icon {
display: block;
width: 50px;
height: 40px;
background-image: url(../images/layout.png);
background-repeat: no-repeat;
}
&.default .fui-icon {
background-position: 0 0;
}
&.bottom .fui-icon {
background-position: -100px 0;
}
&.filetree .fui-icon {
background-position: -200px 0;
}
}
\ No newline at end of file
.triangle {
content: ' ';
display: block;
width: 0;
height: 0;
padding: 0 !important;
line-height: 0;
font-size: 0;
border-style: solid;
border-color: transparent;
}
.triangle-top(@color, @width: 10px, @height: @width) {
.triangle;
border-width: @height (@width/2);
border-top-color: @color;
}
.triangle-bottom(@color, @width: 10px, @height: @width) {
.triangle;
border-width: @height (@width/2);
border-bottom-color: @color;
}
.triangle-left(@color, @width: 10px, @height: @width) {
.triangle;
border-width: (@height/2) @width;
border-left-color: @color;
}
.triangle-right(@color, @width: 10px, @height: @width) {
.triangle;
border-width: (@height/2) @width;
border-right-color: @color;
}
@panel-height: 40px;
@tab-hover: #5a6378;
@tab-active: darken(@tab-hover, 10%);
@button-border: #c9ced1;
@button-text: #5a6378;
@button-hover: hsl(222, 55%, 96%);
@button-active: hsl(222, 55%, 85%);
@button-pressed: hsl(222, 55%, 90%);
@border-color: #c9ced1;
@ui-color: #393f4f;
\ No newline at end of file
@import "_triangle";
@import "_vars";
#tab-container .fui-button {
display: inline-block;
padding: 2px 5px 2px 3px;
.fui-label {
color: @button-text;
font-size: 12px;
vertical-align: baseline;
}
&.command-button {
margin-bottom: 3px;
.fui-icon {
width: 20px;
height: 20px;
margin-right: 3px;
display: inline-block;
vertical-align: baseline;
}
&.large {
width: 50px;
height: 50px;
padding: 0;
.fui-icon {
width: 25px;
height: 25px;
margin-left: 12px;
margin-bottom: 3px;
margin-top: 4px;
}
.fui-label {
display: block;
text-align: center;
}
}
}
&:hover {
background-color: @button-hover;
}
&:active {
background-color: @button-active;
}
&.fui-disabled:hover,
&.fui-disabled:active {
background-color: transparent;
}
&.active {
background-color: @button-pressed;
}
}
.command-buttonset {
.fui-toggle-button {
&:hover {
background-color: @button-hover;
.fui-disabled& {
background-color: transparent;
}
}
&:active {
.transform(scale(0.9));
&:hover {
background-color: @button-active;
.fui-disabled& {
background-color: transparent;
}
}
}
&.fui-button-pressed {
background-color: @button-pressed;
}
}
}
.command-inputmenu {
& > .fui-input-button {
position: relative;
.fui-input {
width: 100px;
}
border-color: @border-color;
margin: 2px 0;
& > .fui-button {
position: absolute;
left: auto;
right: 0;
top: 0;
bottom: 0;
width: 20px;
border-left: 1px solid @border-color;
padding: 0 !important;
.fui-icon {
position: absolute;
left: auto;
right: 6px;
top: 50%;
margin-top: -2px;
.triangle-top(@button-text, 8px, 4px);
}
}
}
}
#tab-container .fui-drop-panel {
padding-right: 10px;
border-color: @border-color;
& > .fui-button {
position: absolute;
display: block;
right: 1px;
left: auto;
top: 1px;
bottom: 1px;
width: 10px;
padding: 0;
&:hover {
background: @button-hover;
}
&:active {
background: @button-active;
}
& > .fui-icon {
position: absolute;
.triangle-top(@button-text, 6px, 4px);
top: auto;
bottom: 2px;
left: 2px;
}
}
}
.fui-drop-panel-popup {
background: white;
box-shadow: 0 0 3px rgba(0,0,0,.3);
padding-right: 5px;
padding-bottom: 5px;
max-width: 300px;
}
#tab-container .fui-button-menu {
border: 1px solid transparent;
width: 40px;
height: 50px;
display: inline-block;
margin-top: 5px;
&:hover {
border-color: @button-hover;
}
.fui-button:first-child {
display: block;
width: 40px;
height: 25px;
padding: 0;
}
.fui-button:last-child {
display: block;
width: 40px;
height: 25px;
padding: 0;
.fui-label {
font-size: 12px;
}
.fui-icon {
.triangle-top(@button-text, 6px, 4px);
display: block;
position: absolute;
top: auto;
bottom: -2px;
left: 50%;
margin-left: -3px;
}
}
}
.fui-dialog {
& > .fui-panel-content {
padding: 0;
}
box-shadow: 0 0 5px rgba(0,0,0, .15);
border: none;
.fui-dialog-head {
background-color: @ui-color;
color: white;
h1 {
font-size: 14px;
font-weight: normal;
}
padding: 5px;
.fui-close-button {
.fui-close-button-icon { display: none; }
position: absolute;
right: 6px;
top: 7px;
left: auto;
display: block;
width: 20px;
height: 20px;
cursor: pointer;
border-radius: 100%;
&:hover {
background-color: hsl(0, 73%, 64%);
}
&:active {
background-color: hsl(0, 73%, 60%);
}
&:after {
content: 'x';
display: block;
width: 16px;
height: 16px;
font-family: inherit;
color: white;
font-size: 14px;
position: absolute;
left: 2px;
top: 1px;
line-height: 16px;
text-align: center;
}
}
}
.fui-dialog-body {
padding: 20px;
p {
margin: 0;
height: 40px;
}
input[type=text],
input[type=url] {
border: 1px solid @border-color;
outline: none;
height: 20px;
padding: 2px 4px;
width: 300px;
}
}
.fui-dialog-foot {
position: absolute;
bottom: 0;
left: 0;
right: 0;
top: auto;
height: 50px;
border-top: 1px solid @border-color;
text-align: right;
.fui-button {
width: 80px;
height: 30px;
line-height: 30px;
text-align: center;
&:hover {
background: lighten(@ui-color, 60%);
}
&:active {
background: lighten(@ui-color, 55%);
}
&.fui-xdialog-ok-btn {
background: @ui-color;
&:hover {
background: lighten(@ui-color, 5%);
}
&:active {
background: darken(@ui-color, 3%);
}
border-color: transparent;
.fui-label {
color: white;
}
}
border: 1px solid @border-color;
border-radius: 4px;
margin: 8px 8px 0 0;
.fui-label {
font-size: 14px;
line-height: 30px;
height: 30px;
}
}
}
}
.validate-error {
color: red;
border-color: red !important;
}
This diff is collapsed.
This diff is collapsed.
@import "_widgets";
@import "_kityminder";
@import "_mainmenu";
@import "_history";
@import "_tab";
@import "_priority_panel";
@import "_progress_panel";
@import "_resource_panel";
@import "_attachment_panel";
@import "_themepanel";
@import "_fontpanel";
@import "_colorpanel";
@import "_about";
@import "_receiver";
@import "_help";
@import "_share";
@import "_icons";
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" id="km-cat" viewBox="0 0 1200 1200" width="500" height="500">
<g id="cat-face">
<path d="M1066.769,368.482L1119.5,80L830,131.611C760.552,97.29,682.35,77.999,599.641,77.999
c-82.424,0-160.371,19.161-229.641,53.26L81,81l50.769,289l0,0c-33.792,69.019-52.77,146.612-52.77,228.641
c0,287.542,233.099,520.642,520.642,520.642s520.642-233.099,520.642-520.642C1120.282,516.011,1101.028,437.88,1066.769,368.482z"
/>
</g>
<g id="cat-eye">
<path style="fill:#FFFFFF;" d="M920.255,371C794.746,371,693,472.746,693,598.255s101.746,227.255,227.255,227.255
s227.255-101.746,227.255-227.255S1045.765,371,920.255,371z M920,746c-80.081,0-145-64.919-145-145s64.919-145,145-145
s145,64.919,145,145S1000.081,746,920,746z"/>
<path style="fill:#FFFFFF;" d="M276.255,371C150.746,371,49,472.746,49,598.255s101.746,227.255,227.255,227.255
s227.255-101.746,227.255-227.255S401.765,371,276.255,371z M276,745c-80.081,0-145-64.919-145-145s64.919-145,145-145
s145,64.919,145,145S356.081,745,276,745z"/>
</g>
</svg>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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