Commit 6502aee7 authored by techird's avatar techird

bug fix

parent 1f11f20f
...@@ -78,17 +78,11 @@ kity.extendClass(Minder, { ...@@ -78,17 +78,11 @@ kity.extendClass(Minder, {
}, },
// TODO: mousemove lazy bind // TODO: mousemove lazy bind
_bindPaperEvents: function() { _bindPaperEvents: function() {
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)); this._paper.on('click dblclick mousedown contextmenu mouseup mousemove mousewheel DOMMouseScroll touchstart touchmove touchend dragenter dragleave drop', this._firePharse.bind(this));
if (window) { if (window) {
window.addEventListener('resize', this._firePharse.bind(this)); window.addEventListener('resize', this._firePharse.bind(this));
window.addEventListener('blur', 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() { _bindKeyboardEvents: function() {
if ((navigator.userAgent.indexOf('iPhone') == -1) && (navigator.userAgent.indexOf('iPod') == -1) && (navigator.userAgent.indexOf('iPad') == -1)) { if ((navigator.userAgent.indexOf('iPhone') == -1) && (navigator.userAgent.indexOf('iPod') == -1) && (navigator.userAgent.indexOf('iPad') == -1)) {
......
...@@ -20,14 +20,14 @@ kity.extendClass(Minder, { ...@@ -20,14 +20,14 @@ kity.extendClass(Minder, {
me.bkqueryCommandValue = me.queryCommandValue; me.bkqueryCommandValue = me.queryCommandValue;
me.queryCommandState = function(type) { me.queryCommandState = function(type) {
var cmd = this._getCommand(type); var cmd = this._getCommand(type);
if (cmd && cmd.enableReadOnly === false) { if (cmd && cmd.enableReadOnly) {
return me.bkqueryCommandState.apply(me, arguments); return me.bkqueryCommandState.apply(me, arguments);
} }
return -1; return -1;
}; };
me.queryCommandValue = function(type) { me.queryCommandValue = function(type) {
var cmd = this._getCommand(type); var cmd = this._getCommand(type);
if (cmd && cmd.enableReadOnly === false) { if (cmd && cmd.enableReadOnly) {
return me.bkqueryCommandValue.apply(me, arguments); return me.bkqueryCommandValue.apply(me, arguments);
} }
return null; return null;
...@@ -48,7 +48,7 @@ kity.extendClass(Minder, { ...@@ -48,7 +48,7 @@ kity.extendClass(Minder, {
delete me.bkqueryCommandValue; delete me.bkqueryCommandValue;
} }
this.rollbackStatus(); this.setStatus('normal');
me._interactChange(); me._interactChange();
} }
......
...@@ -22,7 +22,9 @@ kity.extendClass(Minder, { ...@@ -22,7 +22,9 @@ kity.extendClass(Minder, {
var sf = ~window.location.href.indexOf('status'); var sf = ~window.location.href.indexOf('status');
var tf = ~window.location.href.indexOf('trace'); var tf = ~window.location.href.indexOf('trace');
return function(status) { // 在 readonly 模式下,只有 force 为 true 才能切换回来
return function(status, force) {
if (this._status == 'readonly' && !force) return this;
if (status != this._status) { if (status != this._status) {
this._rollbackStatus = this._status; this._rollbackStatus = this._status;
this._status = status; this._status = status;
......
...@@ -296,7 +296,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){ ...@@ -296,7 +296,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
if(this.km.getStatus() == 'normal' && node && this.selection.isHide()){ if(this.km.getStatus() == 'normal' && node && this.selection.isHide()){
if(this.isShortcutCopyKey){ if(this.isShortcutCopyKey){
console.log(this.km.getStatus())
return; return;
} }
......
...@@ -142,7 +142,9 @@ KityMinder.registerModule('KeyboardModule', function() { ...@@ -142,7 +142,9 @@ KityMinder.registerModule('KeyboardModule', function() {
queryState: function(km) { queryState: function(km) {
return km.getSelectedNode() ? 0 : -1; return km.getSelectedNode() ? 0 : -1;
} },
enableReadOnly: true
}); });
// 稀释用 // 稀释用
...@@ -159,7 +161,7 @@ KityMinder.registerModule('KeyboardModule', function() { ...@@ -159,7 +161,7 @@ KityMinder.registerModule('KeyboardModule', function() {
var root = this.getRoot(); var root = this.getRoot();
buildPositionNetwork(root); buildPositionNetwork(root);
}, },
'normal.keydown': function(e) { 'normal.keydown readonly.keydown': function(e) {
var minder = this; var minder = this;
['left', 'right', 'up', 'down'].forEach(function(key) { ['left', 'right', 'up', 'down'].forEach(function(key) {
if (e.isShortcutKey(key)) { if (e.isShortcutKey(key)) {
......
...@@ -107,7 +107,7 @@ KityMinder.registerModule('Select', function() { ...@@ -107,7 +107,7 @@ KityMinder.registerModule('Select', function() {
}); });
}, },
'events': { 'events': {
'normal.mousedown textedit.mousedown inputready.mousedown': function(e) { 'mousedown': function(e) {
var downNode = e.getTargetNode(); var downNode = e.getTargetNode();
...@@ -140,8 +140,8 @@ KityMinder.registerModule('Select', function() { ...@@ -140,8 +140,8 @@ KityMinder.registerModule('Select', function() {
lastDownPosition = e.getPosition(this.getRenderContainer()); lastDownPosition = e.getPosition(this.getRenderContainer());
} }
}, },
'normal.mousemove textedit.mousemove inputready.mousemove': marqueeActivator.selectMove, 'mousemove': marqueeActivator.selectMove,
'normal.mouseup textedit.mouseup inputready.mouseup': function(e) { 'mouseup': function(e) {
var upNode = e.getTargetNode(); var upNode = e.getTargetNode();
// 如果 mouseup 发生在 lastDownNode 外,是无需理会的 // 如果 mouseup 发生在 lastDownNode 外,是无需理会的
...@@ -158,10 +158,7 @@ KityMinder.registerModule('Select', function() { ...@@ -158,10 +158,7 @@ KityMinder.registerModule('Select', function() {
//全选操作 //全选操作
'normal.keydown inputready.keydown':function(e){ 'normal.keydown inputready.keydown':function(e){
if ( e.isShortcutKey('ctrl+a') ){
var keyEvent = e.originEvent;
if ( (keyEvent.ctrlKey || keyEvent.metaKey) && keymap.a == keyEvent.keyCode){
var selectedNodes = []; var selectedNodes = [];
this.getRoot().traverse(function(node){ this.getRoot().traverse(function(node){
......
...@@ -107,7 +107,7 @@ var ViewDragger = kity.createClass("ViewDragger", { ...@@ -107,7 +107,7 @@ var ViewDragger = kity.createClass("ViewDragger", {
}) })
.on('normal.mousemove normal.touchmove ' + .on('normal.mousemove normal.touchmove ' +
'readonly.touchmove readonly.mousemove ' + 'readonly.mousemove readonly.touchmove ' +
'inputready.mousemove inputready.touchmove', function(e) { 'inputready.mousemove inputready.touchmove', function(e) {
if (e.type == 'touchmove') { if (e.type == 'touchmove') {
e.preventDefault(); // 阻止浏览器的后退事件 e.preventDefault(); // 阻止浏览器的后退事件
...@@ -115,7 +115,7 @@ var ViewDragger = kity.createClass("ViewDragger", { ...@@ -115,7 +115,7 @@ var ViewDragger = kity.createClass("ViewDragger", {
if (!isTempDrag) return; if (!isTempDrag) return;
var offset = kity.Vector.fromPoints(lastPosition, e.getPosition()); var offset = kity.Vector.fromPoints(lastPosition, e.getPosition());
if (offset.length() > 10) { if (offset.length() > 10) {
this.setStatus('hand'); this.setStatus('hand', true);
var paper = dragger._minder.getPaper(); var paper = dragger._minder.getPaper();
paper.setStyle('cursor', '-webkit-grabbing'); paper.setStyle('cursor', '-webkit-grabbing');
} }
...@@ -163,7 +163,7 @@ KityMinder.registerModule('View', function() { ...@@ -163,7 +163,7 @@ KityMinder.registerModule('View', function() {
execute: function(minder) { execute: function(minder) {
if (minder.getStatus() != 'hand') { if (minder.getStatus() != 'hand') {
minder.setStatus('hand'); minder.setStatus('hand', true);
} else { } else {
minder.rollbackStatus(); minder.rollbackStatus();
} }
...@@ -173,7 +173,7 @@ KityMinder.registerModule('View', function() { ...@@ -173,7 +173,7 @@ KityMinder.registerModule('View', function() {
queryState: function(minder) { queryState: function(minder) {
return minder.getStatus() == 'hand' ? 1 : 0; return minder.getStatus() == 'hand' ? 1 : 0;
}, },
enableReadOnly: false enableReadOnly: true
}); });
var CameraCommand = kity.createClass('CameraCommand', { var CameraCommand = kity.createClass('CameraCommand', {
...@@ -190,7 +190,7 @@ KityMinder.registerModule('View', function() { ...@@ -190,7 +190,7 @@ KityMinder.registerModule('View', function() {
dragger.move(new kity.Point(dx, dy), duration); dragger.move(new kity.Point(dx, dy), duration);
this.setContentChanged(false); this.setContentChanged(false);
}, },
enableReadOnly: false enableReadOnly: true
}); });
var MoveCommand = kity.createClass('MoveCommand', { var MoveCommand = kity.createClass('MoveCommand', {
...@@ -213,7 +213,9 @@ KityMinder.registerModule('View', function() { ...@@ -213,7 +213,9 @@ KityMinder.registerModule('View', function() {
dragger.move(new kity.Point(-size.width / 2, 0), duration); dragger.move(new kity.Point(-size.width / 2, 0), duration);
break; break;
} }
} },
enableReadOnly: true
}); });
return { return {
......
...@@ -88,7 +88,7 @@ KityMinder.registerModule('Zoom', function() { ...@@ -88,7 +88,7 @@ KityMinder.registerModule('Zoom', function() {
} }
return 0; return 0;
}, },
enableReadOnly: false enableReadOnly: true
}); });
var ZoomOutCommand = kity.createClass('ZoomOutCommand', { var ZoomOutCommand = kity.createClass('ZoomOutCommand', {
...@@ -107,7 +107,7 @@ KityMinder.registerModule('Zoom', function() { ...@@ -107,7 +107,7 @@ KityMinder.registerModule('Zoom', function() {
} }
return 0; return 0;
}, },
enableReadOnly: false enableReadOnly: true
}); });
return { return {
......
...@@ -13,6 +13,7 @@ if (!kity.Browser.ie) { ...@@ -13,6 +13,7 @@ if (!kity.Browser.ie) {
image.onerror = function(err) { image.onerror = function(err) {
reject(err); reject(err);
}; };
image.crossOrigin = '';
image.src = url; image.src = url;
}); });
} }
...@@ -50,17 +51,24 @@ if (!kity.Browser.ie) { ...@@ -50,17 +51,24 @@ if (!kity.Browser.ie) {
height: renderBox.height + 1, height: renderBox.height + 1,
style: 'font-family: Arial, "Microsoft Yahei","Heiti SC";' style: 'font-family: Arial, "Microsoft Yahei","Heiti SC";'
}); });
$svg.removeAttr('id').find('*[id]').removeAttr('id');
svgXml = $('<div></div>').append($svg).html(); svgXml = $('<div></div>').append($svg).html();
// Dummy IE
svgXml = svgXml.replace(' xmlns="http://www.w3.org/2000/svg" xmlns:NS1="" NS1:ns1:xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:NS2="" NS2:xmlns:ns1=""', '');
// svg 含有 &nbsp; 符号导出报错 Entity 'nbsp' not defined // svg 含有 &nbsp; 符号导出报错 Entity 'nbsp' not defined
svgXml = svgXml.replace(/&nbsp;/g, '&#xa0;'); svgXml = svgXml.replace(/&nbsp;/g, '&#xa0;');
blob = new Blob([svgXml], { // blob = new Blob([svgXml], {
type: 'image/svg+xml;charset=utf-8' // type: 'image/svg+xml'
}); // });
// svgUrl = DomURL.createObjectURL(blob);
svgUrl = DomURL.createObjectURL(blob); svgUrl = 'data:image/svg+xml;charset=utf-8,' + 
  encodeURIComponent(svgXml);
return { return {
width: width, width: width,
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div class="share-body"> <div class="share-body">
<h3>$lang.url_share</h3> <h3>$lang.url_share</h3>
<p> <p>
<input id="share-url" type="url" value="http://naotu.baidu.com/?shareId=kcev3dd" /> <input id="share-url" class="fui-widget fui-selectable" type="url" readonly value="http://naotu.baidu.com/?shareId=kcev3dd" />
<button id="copy-share-url" data-clipboard-target="share-url" type="button">$lang.copy</button> <button id="copy-share-url" data-clipboard-target="share-url" type="button">$lang.copy</button>
</p> </p>
<h3>$lang.sns_share</h3> <h3>$lang.sns_share</h3>
......
...@@ -73,8 +73,9 @@ KityMinder.registerUI('doc', function(minder) { ...@@ -73,8 +73,9 @@ KityMinder.registerUI('doc', function(minder) {
return current; return current;
} }
function checkSaved() { function checkSaved(noConfirm) {
if (!fio.user.current()) return true; if (!fio.user.current()) return true;
if (noConfirm) return current.saved;
return current.saved || window.confirm(minder.getLang('ui.unsavedcontent', '* ' + current.title)); return current.saved || window.confirm(minder.getLang('ui.unsavedcontent', '* ' + current.title));
} }
......
...@@ -37,6 +37,9 @@ KityMinder.registerUI('menu/help/help', function (minder) { ...@@ -37,6 +37,9 @@ KityMinder.registerUI('menu/help/help', function (minder) {
})); }));
$help.find('.shortcut-content').html(convert(operation)); $help.find('.shortcut-content').html(convert(operation));
if (kity.Browser.mac) {
$help.addClass('mac');
}
$help.removeClass('loading'); $help.removeClass('loading');
} }
......
...@@ -68,7 +68,7 @@ KityMinder.registerUI('menu/open/local', function(minder) { ...@@ -68,7 +68,7 @@ KityMinder.registerUI('menu/open/local', function(minder) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
}).on('drop', function(e) { }).on('drop', function(e) {
if (!$doc.checkSave()) return; if (!$doc.checkSaved()) return;
e = e.originalEvent; e = e.originalEvent;
read(e.dataTransfer.files[0]); read(e.dataTransfer.files[0]);
$menu.hide(); $menu.hide();
...@@ -81,6 +81,11 @@ KityMinder.registerUI('menu/open/local', function(minder) { ...@@ -81,6 +81,11 @@ KityMinder.registerUI('menu/open/local', function(minder) {
var info = new fio.file.anlysisPath(domfile.name); var info = new fio.file.anlysisPath(domfile.name);
var protocol = supports[info.extension]; var protocol = supports[info.extension];
if (!protocol || !protocol.decode) {
alert(minder.getLang('ui.unsupportedfile'));
return Promise.reject();
}
var dataPromise = new Promise(function(resolve, reject) { var dataPromise = new Promise(function(resolve, reject) {
var reader; var reader;
......
...@@ -62,10 +62,14 @@ KityMinder.registerUI('menu/save/download', function(minder) { ...@@ -62,10 +62,14 @@ KityMinder.registerUI('menu/save/download', function(minder) {
return null; return null;
})['catch'](function(e) {
debugger;
window.alert('下载失败:' + e.message);
}).then(function() { }).then(function() {
setTimeout(function() {
$panel.removeClass('loading'); $panel.removeClass('loading');
$menu.hide(); $menu.hide();
});
}); });
} }
...@@ -99,7 +103,12 @@ KityMinder.registerUI('menu/save/download', function(minder) { ...@@ -99,7 +103,12 @@ KityMinder.registerUI('menu/save/download', function(minder) {
$('<input name="iehack" value="&#9760;" />').appendTo($form); $('<input name="iehack" value="&#9760;" />').appendTo($form);
var netdisk = minder.getUI('menu/save/netdisk');
netdisk.mute = true;
$form.appendTo('body').submit().remove(); $form.appendTo('body').submit().remove();
setTimeout(function() {
netdisk.mute = false;
});
} }
function buildDataUrl(mineType, data) { function buildDataUrl(mineType, data) {
......
...@@ -39,6 +39,7 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) { ...@@ -39,6 +39,7 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
/* 文件名 */ /* 文件名 */
var $filename = $('<input>') var $filename = $('<input>')
.addClass('fui-widget fui-selectable')
.attr('type', 'text') .attr('type', 'text')
.attr('placeholder', minder.getLang('ui.filename')) .attr('placeholder', minder.getLang('ui.filename'))
.attr('title', minder.getLang('ui.filename')) .attr('title', minder.getLang('ui.filename'))
...@@ -81,8 +82,8 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) { ...@@ -81,8 +82,8 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
ret.quickSave = quickSave; ret.quickSave = quickSave;
window.onbeforeunload = function() { window.onbeforeunload = function() {
var noask = window.location.href.indexOf('noask') > 0; var noask = ret.mute || window.location.href.indexOf('noask') > 0;
if (!$doc.checkSaved() && !noask) if (!$doc.checkSaved(true) && !noask)
return minder.getLang('ui.unsavedcontent', '* ' + $doc.current().title); return minder.getLang('ui.unsavedcontent', '* ' + $doc.current().title);
}; };
......
...@@ -100,6 +100,10 @@ KityMinder.registerUI('menu/share/share', function(minder) { ...@@ -100,6 +100,10 @@ KityMinder.registerUI('menu/share/share', function(minder) {
}; };
actions[e.target.value](); actions[e.target.value]();
}); });
$panel.delegate('input#share-url', 'dblclick', function() {
this.select();
});
} }
function bindManageActions() { function bindManageActions() {
...@@ -192,7 +196,7 @@ KityMinder.registerUI('menu/share/share', function(minder) { ...@@ -192,7 +196,7 @@ KityMinder.registerUI('menu/share/share', function(minder) {
function uuid() { function uuid() {
// 最多使用 1e7,否则 IE toString() 会出来指数表示法 // 最多使用 1e7,否则 IE toString() 会出来指数表示法
var timeLead = 1e7; var timeLead = 1e6;
return ((+new Date() * timeLead) + (Math.random() * --timeLead)).toString(36); return ((+new Date() * timeLead) + (Math.random() * --timeLead)).toString(36);
} }
......
...@@ -48,6 +48,8 @@ KityMinder.registerUI('menu/share/view', function (minder) { ...@@ -48,6 +48,8 @@ KityMinder.registerUI('menu/share/view', function (minder) {
}); });
} }
var $container = $(minder.getRenderTarget()).addClass('loading');
return $.pajax({ return $.pajax({
url: 'http://naotu.baidu.com/share.php', //'http://naotu.baidu.com/mongo.php', url: 'http://naotu.baidu.com/share.php', //'http://naotu.baidu.com/mongo.php',
...@@ -66,9 +68,9 @@ KityMinder.registerUI('menu/share/view', function (minder) { ...@@ -66,9 +68,9 @@ KityMinder.registerUI('menu/share/view', function (minder) {
}).then(function() { }).then(function() {
$(minder.getRenderTarget()).removeClass('loading'); $(minder.getRenderTarget()).removeClass('loading');
minder.execCommand('hand');
minder.disable(); minder.disable();
minder.execCommand('hand', true);
$container.removeClass('loading');
}); });
} }
......
...@@ -86,6 +86,7 @@ KityMinder.registerUI('nav', function(minder) { ...@@ -86,6 +86,7 @@ KityMinder.registerUI('nav', function(minder) {
$previewNavigator.show = function() { $previewNavigator.show = function() {
$.fn.show.call(this); $.fn.show.call(this);
bind(); bind();
updateContentView();
updateVisibleView(); updateVisibleView();
}; };
......
...@@ -44,7 +44,7 @@ KityMinder.registerUI('image', function(minder) { ...@@ -44,7 +44,7 @@ KityMinder.registerUI('image', function(minder) {
var $dialogBody = $($imageDialog.getBodyElement()); var $dialogBody = $($imageDialog.getBodyElement());
$dialogBody.html([ $dialogBody.html([
'<p><label>图片地址:</label><input type="url" class="image-url" /></p>', '<p><label>图片地址:</label><input type="url" class="image-url fui-widget fui-selection" /></p>',
'<p><label>提示文本:</label><input type="text" class="image-title /"></p>', '<p><label>提示文本:</label><input type="text" class="image-title /"></p>',
'<img class="image-preview" src="" style="max-height: 200px;" />' '<img class="image-preview" src="" style="max-height: 200px;" />'
].join('')); ].join(''));
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
KityMinder.registerUI('ribbon/idea/link', function(minder) { KityMinder.registerUI('ribbon/idea/link', function(minder) {
var R_URL = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?/;
var $attachment = minder.getUI('ribbon/idea/attachment'); var $attachment = minder.getUI('ribbon/idea/attachment');
var $linkButtonMenu = new FUI.ButtonMenu({ var $linkButtonMenu = new FUI.ButtonMenu({
...@@ -34,8 +36,8 @@ KityMinder.registerUI('ribbon/idea/link', function(minder) { ...@@ -34,8 +36,8 @@ KityMinder.registerUI('ribbon/idea/link', function(minder) {
var $dialogBody = $($linkDialog.getBodyElement()); var $dialogBody = $($linkDialog.getBodyElement());
$dialogBody.html([ $dialogBody.html([
'<p><label>连接地址:</label><input type="url" class="link-href" /></p>', '<p><label>连接地址:</label><input type="url" class="link-href fui-widget fui-selectable" /></p>',
'<p><label>提示文本:</label><input type="text" class="link-title /"></p>' '<p><label>提示文本:</label><input type="text" class="link-title fui-widget fui-selectable" /></p>'
].join('')); ].join(''));
var $href = $dialogBody.find('.link-href'); var $href = $dialogBody.find('.link-href');
...@@ -58,7 +60,7 @@ KityMinder.registerUI('ribbon/idea/link', function(minder) { ...@@ -58,7 +60,7 @@ KityMinder.registerUI('ribbon/idea/link', function(minder) {
$href.on('input', function() { $href.on('input', function() {
var url = $href.val(); var url = $href.val();
error(!/^https?\:\/\/(\w+\.)+\w+/.test(url)); error(!R_URL.test(url));
}); });
$linkButtonMenu.on('buttonclick', function() { $linkButtonMenu.on('buttonclick', function() {
......
...@@ -35,6 +35,9 @@ html, body { ...@@ -35,6 +35,9 @@ html, body {
&.maximize { &.maximize {
top: 40px; top: 40px;
} }
&:focus {
/* box-shadow: inset 0 0 10px fadeOut(black, 0.5); */
}
-moz-user-select: none; -moz-user-select: none;
} }
#tab-container.collapsed + #kityminder, #tab-container.collapsed + #kityminder,
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
.validate-error { .validate-error {
color: red; color: red;
border-color: red !important; border-color: red !important;
vertical-align: middle;
} }
.button, button { .button, button {
......
...@@ -6,6 +6,25 @@ ...@@ -6,6 +6,25 @@
color: @ui-fore; color: @ui-fore;
vertical-align: baseline; vertical-align: baseline;
.loading-tip {
text-indent: 100000px;
display: inline-block;
width: 50px;
height: @panel-height;
line-height: @panel-height;
position: relative;
&:before {
content: ' ';
display: block;
position: absolute;
left: 9px;
top: 7px;
.loading-circle(16px);
box-shadow: none;
}
}
.fui-button { .fui-button {
padding: 5px 10px; padding: 5px 10px;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
.fui-label { .fui-label {
color: @button-text; color: @button-text;
font-size: 12px; font-size: 12px;
vertical-align: baseline; vertical-align: middle;
} }
&.command-button { &.command-button {
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
height: 20px; height: 20px;
margin-right: 3px; margin-right: 3px;
display: inline-block; display: inline-block;
vertical-align: baseline; vertical-align: middle;
} }
&.large { &.large {
width: 50px; width: 50px;
...@@ -260,6 +260,7 @@ ...@@ -260,6 +260,7 @@
height: 20px; height: 20px;
padding: 2px 4px; padding: 2px 4px;
width: 300px; width: 300px;
vertical-align: middle;
} }
} }
.fui-dialog-foot { .fui-dialog-foot {
......
...@@ -560,6 +560,7 @@ ...@@ -560,6 +560,7 @@
.validate-error { .validate-error {
color: red; color: red;
border-color: red !important; border-color: red !important;
vertical-align: middle;
} }
.button, .button,
button { button {
...@@ -822,7 +823,7 @@ li { ...@@ -822,7 +823,7 @@ li {
#tab-container .fui-button .fui-label { #tab-container .fui-button .fui-label {
color: #5a6378; color: #5a6378;
font-size: 12px; font-size: 12px;
vertical-align: baseline; vertical-align: middle;
} }
#tab-container .fui-button.command-button { #tab-container .fui-button.command-button {
margin-bottom: 3px; margin-bottom: 3px;
...@@ -832,7 +833,7 @@ li { ...@@ -832,7 +833,7 @@ li {
height: 20px; height: 20px;
margin-right: 3px; margin-right: 3px;
display: inline-block; display: inline-block;
vertical-align: baseline; vertical-align: middle;
} }
#tab-container .fui-button.command-button.large { #tab-container .fui-button.command-button.large {
width: 50px; width: 50px;
...@@ -1080,6 +1081,7 @@ li { ...@@ -1080,6 +1081,7 @@ li {
height: 20px; height: 20px;
padding: 2px 4px; padding: 2px 4px;
width: 300px; width: 300px;
vertical-align: middle;
} }
.fui-dialog .fui-dialog-foot { .fui-dialog .fui-dialog-foot {
position: absolute; position: absolute;
...@@ -1315,6 +1317,9 @@ body { ...@@ -1315,6 +1317,9 @@ body {
#kityminder.maximize { #kityminder.maximize {
top: 40px; top: 40px;
} }
#kityminder:focus {
/* box-shadow: inset 0 0 10px fadeOut(black, 0.5); */
}
#tab-container.collapsed + #kityminder, #tab-container.collapsed + #kityminder,
#panel + #kityminder { #panel + #kityminder {
top: 40px; top: 40px;
...@@ -1996,6 +2001,36 @@ body { ...@@ -1996,6 +2001,36 @@ body {
color: #ffffff; color: #ffffff;
vertical-align: baseline; vertical-align: baseline;
} }
#panel div.user-panel .loading-tip {
text-indent: 100000px;
display: inline-block;
width: 50px;
height: 40px;
line-height: 40px;
position: relative;
}
#panel div.user-panel .loading-tip:before {
content: ' ';
display: block;
position: absolute;
left: 9px;
top: 7px;
width: 16px;
height: 16px;
border: 4px solid;
border-color: #c9ced1 transparent transparent;
box-shadow: 0 0 11px #ffffff;
z-index: 10;
border-radius: 100%;
-webkit-animation: rotate 1.33s ease infinite;
-moz-animation: rotate 1.33s ease infinite;
-ms-animation: rotate 1.33s ease infinite;
-o-animation: rotate 1.33s ease infinite;
animation: rotate 1.33s ease infinite;
filter: none;
-webkit-filter: none;
box-shadow: none;
}
#panel div.user-panel .fui-button { #panel div.user-panel .fui-button {
padding: 5px 10px; padding: 5px 10px;
height: 30px; height: 30px;
......
This diff is collapsed.
...@@ -14,7 +14,9 @@ KityMinder.registerUI('topbar/user', function(minder) { ...@@ -14,7 +14,9 @@ KityMinder.registerUI('topbar/user', function(minder) {
var $userPanel = $('<div class="user-panel"></div>').appendTo('#panel'); var $userPanel = $('<div class="user-panel"></div>').appendTo('#panel');
var $tip = $('<span></span>').text(minder.getLang('ui.checklogin')).appendTo($userPanel); var $tip = $('<span class="loading-tip"></span>')
.text(minder.getLang('ui.checklogin'))
.appendTo($userPanel);
/* 登录按钮 */ /* 登录按钮 */
var $loginButton = new FUI.Button({ var $loginButton = new FUI.Button({
...@@ -83,7 +85,7 @@ KityMinder.registerUI('topbar/user', function(minder) { ...@@ -83,7 +85,7 @@ KityMinder.registerUI('topbar/user', function(minder) {
fio.user.check().then(check)['catch'](function(error) { fio.user.check().then(check)['catch'](function(error) {
$loginButton.show(); $loginButton.show();
$userButton.hide(); $userButton.hide();
$tip.remove(); $tip.hide();
}); });
}); });
...@@ -98,11 +100,13 @@ KityMinder.registerUI('topbar/user', function(minder) { ...@@ -98,11 +100,13 @@ KityMinder.registerUI('topbar/user', function(minder) {
$loginButton.hide(); $loginButton.hide();
fio.user.fire('login', user); fio.user.fire('login', user);
} else { } else {
$loginButton.show(); if (window.location.href.indexOf('nocheck') == -1) {
$userButton.hide(); logout();
fio.user.fire('logout', user); } else {
$loginButton.show();
}
} }
$tip.remove(); $tip.hide();
currentUser = user; currentUser = user;
} }
......
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
e.stopPropagation(); e.stopPropagation();
}); });
// 阻止非脑图事件冒泡
$('#content-wrapper').delegate('input', 'mousedown mousemove mouseup contextmenu', function(e) {
e.stopPropagation();
});
minder.getPaper().addClass('loading-target'); minder.getPaper().addClass('loading-target');
this.fire('interactchange'); this.fire('interactchange');
......
...@@ -81,7 +81,7 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) { ...@@ -81,7 +81,7 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
var $input = $('<input>') var $input = $('<input>')
.attr('type', 'text') .attr('type', 'text')
.addClass('new-dir-name') .addClass('new-dir-name fui-widget fui-selectable')
.val(minder.getLang('ui.newdir')) .val(minder.getLang('ui.newdir'))
.appendTo($li); .appendTo($li);
......
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