Commit 54be9b09 authored by techird's avatar techird

fui reflact finish

parent 8661ff6b
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
'lib/fio/src/fio.js', 'lib/fio/src/fio.js',
'lib/fio/provider/netdisk/oauth.js', 'lib/fio/provider/netdisk/oauth.js',
'lib/fio/provider/netdisk/netdisk.js', 'lib/fio/provider/netdisk/netdisk.js',
'lib/fio/provider/mongoshare/mongoshare.js',
/* Kity 依赖库 */ /* Kity 依赖库 */
'lib/kity/dist/kity.js', 'lib/kity/dist/kity.js',
...@@ -118,6 +117,7 @@ ...@@ -118,6 +117,7 @@
/* UI 菜单 */ /* UI 菜单 */
'ui/menu/menu.js', 'ui/menu/menu.js',
'ui/menu/header.js', 'ui/menu/header.js',
'ui/menu/default.js',
/* UI 菜单 - 新建 */ /* UI 菜单 - 新建 */
'ui/menu/new/new.js', 'ui/menu/new/new.js',
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
'src/module/expand.js', 'src/module/expand.js',
'src/module/outline.js', 'src/module/outline.js',
'src/module/geometry.js', 'src/module/geometry.js',
'src/module/history.js',
'src/module/progress.js', 'src/module/progress.js',
'src/module/priority.js', 'src/module/priority.js',
'src/module/image.js', 'src/module/image.js',
...@@ -69,7 +68,6 @@ ...@@ -69,7 +68,6 @@
'src/module/dragtree.js', 'src/module/dragtree.js',
'src/module/keyboard.js', 'src/module/keyboard.js',
'src/module/select.js', 'src/module/select.js',
'src/module/history.js',
'src/module/basestyle.js', 'src/module/basestyle.js',
'src/module/font.js', 'src/module/font.js',
'src/module/zoom.js', 'src/module/zoom.js',
...@@ -121,6 +119,7 @@ ...@@ -121,6 +119,7 @@
/* UI 菜单 - 分享 */ /* UI 菜单 - 分享 */
// 'ui/menu/share/share.js', // 'ui/menu/share/share.js',
'ui/menu/share/view.js',
/* UI Top Bar */ /* UI Top Bar */
// 'ui/topbar/history.js', // 'ui/topbar/history.js',
......
...@@ -66,7 +66,9 @@ KityMinder.LANG['zh-cn'] = { ...@@ -66,7 +66,9 @@ KityMinder.LANG['zh-cn'] = {
'newheader': '新建脑图', 'newheader': '新建脑图',
'openheader': '打开', 'openheader': '打开',
'saveheader': '保存到', 'saveheader': '保存到',
'shareheader': '分享我的脑图' 'draftheader': '草稿箱',
'shareheader': '分享我的脑图',
'downloadheader': '导出到指定格式'
}, },
'mydocument': '我的文档', 'mydocument': '我的文档',
...@@ -101,9 +103,15 @@ KityMinder.LANG['zh-cn'] = { ...@@ -101,9 +103,15 @@ KityMinder.LANG['zh-cn'] = {
'email_share_description': '创建指定人可见的分享,您还可以允许他们编辑', 'email_share_description': '创建指定人可见的分享,您还可以允许他们编辑',
'ondev': '敬请期待!', 'ondev': '敬请期待!',
'create_share_failed': '分享失败:{0}', 'create_share_failed': '分享失败:{0}',
'remove_share_failed': '删除失败:{1}',
'copy': '复制', 'copy': '复制',
'copied': '已复制', 'copied': '已复制',
'shared_tip': '当前脑图被 {0} 分享,你可以修改之后保存到自己的网盘上或再次分享', 'shared_tip': '当前脑图被 {0} 分享,你可以修改之后保存到自己的网盘上或再次分享',
'current_share': '当前脑图',
'manage_share': '我的分享',
'share_remove_action': '不分享该脑图',
'share_view_action': '打开分享地址',
'share_edit_action': '编辑分享的文件',
'login': '登录', 'login': '登录',
'logout': '注销', 'logout': '注销',
...@@ -182,7 +190,7 @@ KityMinder.LANG['zh-cn'] = { ...@@ -182,7 +190,7 @@ KityMinder.LANG['zh-cn'] = {
'lang_input_text': '文本内容:', 'lang_input_text': '文本内容:',
'lang_input_url': '链接地址:', 'lang_input_url': '链接地址:',
'lang_input_title': '标题:', 'lang_input_title': '标题:',
'lang_input_target': '是否在新窗口打开:' 'lang_input_target': '是否在新窗口:'
}, },
'priority': '优先级', 'priority': '优先级',
'none': '无', 'none': '无',
......
Subproject commit e37fe078a7722794d47c3dd2ee99cb31a0943afc Subproject commit ae1bf8e7aaf22d55ed19ac888d5d33a645813de5
...@@ -62,6 +62,9 @@ KityMinder.registerUI('doc', function(minder) { ...@@ -62,6 +62,9 @@ KityMinder.registerUI('doc', function(minder) {
function save(doc) { function save(doc) {
current = doc; current = doc;
doc.data = minder.exportJson();
doc.json = JSON.stringify(doc.data);
minder.getUI('topbar/title').setTitle(doc.title, true); minder.getUI('topbar/title').setTitle(doc.title, true);
ret.fire('docsave', doc); ret.fire('docsave', doc);
} }
......
...@@ -7,5 +7,19 @@ ...@@ -7,5 +7,19 @@
* @copyright: Baidu FEX, 2014 * @copyright: Baidu FEX, 2014
*/ */
KityMinder.registerUI('menu/default', function (minder) { KityMinder.registerUI('menu/default', function (minder) {
minder.on('uiready', function() {
var $menu = minder.getUI('menu/menu');
var $open = minder.getUI('menu/open/open');
var $save = minder.getUI('menu/save/save');
var $share = minder.getUI('menu/share/share');
$menu.$tabs.select(1); // 打开
$open.$tabs.select(0); // 最近
$save.$tabs.select(0); // 云存储
$share.$tabs.select(0); // 当前脑图
// $menu.show();
});
}); });
\ No newline at end of file
...@@ -81,7 +81,5 @@ KityMinder.registerUI('menu/menu', function(minder) { ...@@ -81,7 +81,5 @@ KityMinder.registerUI('menu/menu', function(minder) {
ret.$button = $button; ret.$button = $button;
ret.$tabs = $tabs; ret.$tabs = $tabs;
show();
return ret; return ret;
}); });
\ No newline at end of file
...@@ -37,7 +37,7 @@ KityMinder.registerUI('menu/open/draft', function(minder) { ...@@ -37,7 +37,7 @@ KityMinder.registerUI('menu/open/draft', function(minder) {
/* 标题 */ /* 标题 */
var $title = $('<h2></h2>') var $title = $('<h2></h2>')
.text(minder.getLang('ui.menu.open.draft')) .text(minder.getLang('ui.menu.draftheader'))
.appendTo($panel); .appendTo($panel);
var $clear = $('<button></button>') var $clear = $('<button></button>')
......
...@@ -17,7 +17,7 @@ KityMinder.registerUI('menu/open/recent', function(minder) { ...@@ -17,7 +17,7 @@ KityMinder.registerUI('menu/open/recent', function(minder) {
var recentList = minder.getUI('widget/locallist').use('recent'); var recentList = minder.getUI('widget/locallist').use('recent');
/* 网盘面板 */ /* 网盘面板 */
var $panel = $($open.createSub('recent', true)).addClass('recent-file-panel'); var $panel = $($open.createSub('recent')).addClass('recent-file-panel');
minder.on('uiready', function() { minder.on('uiready', function() {
minder.getUI('topbar/user').requireLogin($panel); minder.getUI('topbar/user').requireLogin($panel);
......
...@@ -15,7 +15,7 @@ KityMinder.registerUI('menu/save/download', function(minder) { ...@@ -15,7 +15,7 @@ KityMinder.registerUI('menu/save/download', function(minder) {
/* 标题 */ /* 标题 */
var $title = $('<h2></h2>') var $title = $('<h2></h2>')
.text(minder.getLang('ui.menu.save.download')) .text(minder.getLang('ui.menu.downloadheader'))
.appendTo($panel); .appendTo($panel);
var $list = $('<ul>') var $list = $('<ul>')
...@@ -55,7 +55,7 @@ KityMinder.registerUI('menu/save/download', function(minder) { ...@@ -55,7 +55,7 @@ KityMinder.registerUI('menu/save/download', function(minder) {
switch (protocol.dataType) { switch (protocol.dataType) {
case 'text': case 'text':
return doDownload(buildDataUrl(mineType), filename, 'text'); return doDownload(buildDataUrl(mineType, data), filename, 'text');
case 'base64': case 'base64':
return doDownload(data, filename, 'base64'); return doDownload(data, filename, 'base64');
} }
......
<h2 id="current-share-header">$lang.current_share</h2>
<form id="share-select"> <form id="share-select">
<div id="shared-tip"></div> <div id="shared-tip"></div>
<fieldset id="no-share"> <fieldset id="no-share">
......
This diff is collapsed.
...@@ -7,13 +7,14 @@ ...@@ -7,13 +7,14 @@
* @copyright: Baidu FEX, 2014 * @copyright: Baidu FEX, 2014
*/ */
KityMinder.registerUI('menu/share/view', function (minder) { KityMinder.registerUI('menu/share/view', function (minder) {
var $menu = minder.getUI('menu/menu');
var $save = minder.getUI('menu/save/save');
var $doc = minder.getUI('doc'); var $doc = minder.getUI('doc');
var $save = minder.getUI('menu/save');
var $download = minder.getUI('download');
function loadShareDoc(results) { $menu.$tabs.select(0);
var user = results[0], $save.$tabs.select(0);
$panel = results[1];
function loadShareDoc() {
var pattern = /(?:shareId|share_id)=(\w+)([&#]|$)/; var pattern = /(?:shareId|share_id)=(\w+)([&#]|$)/;
var match = pattern.exec(window.location) || pattern.exec(document.referrer); var match = pattern.exec(window.location) || pattern.exec(document.referrer);
...@@ -25,7 +26,9 @@ KityMinder.registerUI('menu/share/view', function (minder) { ...@@ -25,7 +26,9 @@ KityMinder.registerUI('menu/share/view', function (minder) {
function renderShareData(data) { function renderShareData(data) {
if (data.error) { if (data.error) {
return window.alert(data.error); window.alert(data.error);
window.location.href = 'index.html';
return;
} }
var content = data.shareMinder.data; var content = data.shareMinder.data;
...@@ -35,22 +38,13 @@ KityMinder.registerUI('menu/share/view', function (minder) { ...@@ -35,22 +38,13 @@ KityMinder.registerUI('menu/share/view', function (minder) {
source: 'share', source: 'share',
content: content, content: content,
protocol: 'json', protocol: 'json',
saved: false, saved: true,
ownerId: data.uid, ownerId: data.uid,
ownerName: data.uname ownerName: data.uname
}).then(function(doc) { }).then(function(doc) {
var $title = minder.getUI('topbar/title');
if (user) { $title.setTitle('[分享的] ' + $title.getTitle());
if (doc.ownerId == user.id) {
}
}
// 分享着不是当前用户
if (doc.ownerId && doc.ownerId != (user && user.id)) {
$('#shared-tip', $panel).text(minder.getLang('ui.shared_tip', doc.ownerName));
}
}); });
} }
...@@ -75,4 +69,6 @@ KityMinder.registerUI('menu/share/view', function (minder) { ...@@ -75,4 +69,6 @@ KityMinder.registerUI('menu/share/view', function (minder) {
}); });
} }
loadShareDoc();
}); });
\ No newline at end of file
...@@ -14,6 +14,14 @@ ...@@ -14,6 +14,14 @@
tranform: @value; tranform: @value;
} }
.animation(@value) {
-webkit-animation: @value;
-moz-animation: @value;
-ms-animation: @value;
-o-animation: @value;
animation: @value;
}
.blur { .blur {
-webkit-filter: blur(5px); -webkit-filter: blur(5px);
-moz-filter: blur(5px); -moz-filter: blur(5px);
...@@ -87,6 +95,7 @@ input[type=url] { ...@@ -87,6 +95,7 @@ input[type=url] {
display: block; display: block;
.dock; .dock;
background: fadeOut(@color, 25%); background: fadeOut(@color, 25%);
.animation(fadeIn 3s ease);
} }
&:before { &:before {
...@@ -103,7 +112,7 @@ input[type=url] { ...@@ -103,7 +112,7 @@ input[type=url] {
margin-top: -24px; margin-top: -24px;
z-index: 10; z-index: 10;
border-radius: 100%; border-radius: 100%;
-webkit-animation: rotate 1.33s ease infinite; .animation(rotate 1.33s ease infinite);
filter: none; filter: none;
-webkit-filter: none; -webkit-filter: none;
} }
...@@ -128,4 +137,38 @@ input[type=url] { ...@@ -128,4 +137,38 @@ input[type=url] {
@keyframes rotate { @keyframes rotate {
from { transform: rotate(0); } from { transform: rotate(0); }
to { transform: rotate(360deg); } to { transform: rotate(360deg); }
} }
\ No newline at end of file
@-webkit-keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@-moz-keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@-ms-keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@-webkit-keyframes fadeOut {
from { opacity: 1; }
to { opacity: 0; }
}
@-moz-keyframes fadeOut {
from { opacity: 1; }
to { opacity: 0; }
}
@-ms-keyframes fadeOut {
from { opacity: 1; }
to { opacity: 0; }
}
@keyframes fadeOut {
from { opacity: 1; }
to { opacity: 0; }
}
#current-share-header {
&:before {
content: ' ';
display: block;
width: 25px;
height: 25px;
position: absolute;
left: 0;
top: 1px;
background: url(../images/icons.png) no-repeat 0 -645px;
}
}
#manage-share-header {
&:before {
content: ' ';
display: block;
width: 25px;
height: 25px;
position: absolute;
left: 0;
top: 1px;
background: url(../images/icons.png) no-repeat 0 -620px;
}
}
#manage-share-list {
margin: 0;
padding: 0;
list-style: none;
.dock(40px, 0, 0, 0);
overflow: auto;
overflow-x: hidden;
overflow-y: auto;
&:empty:after {
content: '没有分享';
display: block;
text-align: center;
font-size: 18px;
height: 50px;
line-height: 50px;
color: #CCC;
}
.share-item {
font-size: 14px;
line-height: 20px;
padding: 10px 20px 10px 40px;
cursor: default;
position: relative;
&:hover {
background-color: lighten(@tab-hover, 55%);
}
&:active {
background-color: lighten(@tab-hover, 50%);
}
.title {
display: block;
margin: 0;
font-weight: normal;
height: 20px;
line-height: 20px;
overflow: ellipse;
&:after {
content: ' ';
display: block;
position: absolute;
width: 25px;
height: 25px;
background: url(../images/icons.png) no-repeat 0 -445px;
left: 5px;
top: 10px;
}
}
.url {
display: block;
margin: 0;
margin-top: 5px;
font-size: 12px;
color: #999;
}
.ctime {
position: absolute;
right: 5px;
top: 10px;
font-size: 12px;
color: #999;
}
.view-action, .remove-action, .edit-action {
display: none;
float: right;
width: 18px;
height: 18px;
background: url(../images/icons.png) no-repeat;
position: relative;
margin-left: 5px;
left: 15px;
top: -20px;
border: 1px solid transparent;
border-radius: 2px;
text-indent: -99999px;
&:hover {
border: 1px solid #888;
box-shadow: inset 0 8px 1px rgba(255,255,255,0.3),
inset 0 0 3px rgba(0, 0, 0, 0.2);
}
&:active {
box-shadow: inset 0 7px 3px rgba(0,0,0,0.05),
inset 0 0 4px rgba(0, 0, 0, 0.3);
}
}
.view-action {
background-position: -1px -670px;
}
.remove-action {
background-position: 0 -690px;
}
.edit-action {
background-position: 0 -710px;
}
&:hover {
.view-action, .remove-action, .edit-action {
display: block;
}
}
}
}
#share-select { #share-select {
margin-top: 10px;
fieldset { fieldset {
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
margin: 0; margin: 0;
margin-bottom: 10px; margin-bottom: 10px;
padding: 10px; padding: 10px;
border-radius: 2px;
legend { legend {
font-size: 14px; font-size: 14px;
......
.fui-button { .fui-button, li {
.transition(background-color .2s ease); .transition(background-color .2s ease);
} }
......
...@@ -616,6 +616,11 @@ input[type=url]:focus { ...@@ -616,6 +616,11 @@ input[type=url]:focus {
bottom: 0; bottom: 0;
left: 0; left: 0;
background: rgba(128, 130, 140, 0.75); background: rgba(128, 130, 140, 0.75);
-webkit-animation: fadeIn 3s ease;
-moz-animation: fadeIn 3s ease;
-ms-animation: fadeIn 3s ease;
-o-animation: fadeIn 3s ease;
animation: fadeIn 3s ease;
} }
.loading:before { .loading:before {
content: ' '; content: ' ';
...@@ -632,6 +637,10 @@ input[type=url]:focus { ...@@ -632,6 +637,10 @@ input[type=url]:focus {
z-index: 10; z-index: 10;
border-radius: 100%; border-radius: 100%;
-webkit-animation: rotate 1.33s ease infinite; -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; filter: none;
-webkit-filter: none; -webkit-filter: none;
} }
...@@ -667,6 +676,70 @@ input[type=url]:focus { ...@@ -667,6 +676,70 @@ input[type=url]:focus {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
@-webkit-keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-moz-keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-ms-keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-webkit-keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@-moz-keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@-ms-keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
.triangle { .triangle {
content: ' '; content: ' ';
display: block; display: block;
...@@ -678,7 +751,8 @@ input[type=url]:focus { ...@@ -678,7 +751,8 @@ input[type=url]:focus {
border-style: solid; border-style: solid;
border-color: transparent; border-color: transparent;
} }
.fui-button { .fui-button,
li {
-webkit-transition: background-color 0.2s ease; -webkit-transition: background-color 0.2s ease;
-moz-transition: background-color 0.2s ease; -moz-transition: background-color 0.2s ease;
-ms-transition: background-color 0.2s ease; -ms-transition: background-color 0.2s ease;
...@@ -2580,11 +2654,143 @@ ul.resource-list li { ...@@ -2580,11 +2654,143 @@ ul.resource-list li {
div.right { div.right {
float: right; float: right;
} }
#current-share-header:before {
content: ' ';
display: block;
width: 25px;
height: 25px;
position: absolute;
left: 0;
top: 1px;
background: url(../images/icons.png) no-repeat 0 -645px;
}
#manage-share-header:before {
content: ' ';
display: block;
width: 25px;
height: 25px;
position: absolute;
left: 0;
top: 1px;
background: url(../images/icons.png) no-repeat 0 -620px;
}
#manage-share-list {
margin: 0;
padding: 0;
list-style: none;
position: absolute;
top: 40px;
right: 0;
bottom: 0;
left: 0;
overflow: auto;
overflow-x: hidden;
overflow-y: auto;
}
#manage-share-list:empty:after {
content: '没有分享';
display: block;
text-align: center;
font-size: 18px;
height: 50px;
line-height: 50px;
color: #CCC;
}
#manage-share-list .share-item {
font-size: 14px;
line-height: 20px;
padding: 10px 20px 10px 40px;
cursor: default;
position: relative;
}
#manage-share-list .share-item:hover {
background-color: #f4f5f7;
}
#manage-share-list .share-item:active {
background-color: #e5e7ec;
}
#manage-share-list .share-item .title {
display: block;
margin: 0;
font-weight: normal;
height: 20px;
line-height: 20px;
overflow: ellipse;
}
#manage-share-list .share-item .title:after {
content: ' ';
display: block;
position: absolute;
width: 25px;
height: 25px;
background: url(../images/icons.png) no-repeat 0 -445px;
left: 5px;
top: 10px;
}
#manage-share-list .share-item .url {
display: block;
margin: 0;
margin-top: 5px;
font-size: 12px;
color: #999;
}
#manage-share-list .share-item .ctime {
position: absolute;
right: 5px;
top: 10px;
font-size: 12px;
color: #999;
}
#manage-share-list .share-item .view-action,
#manage-share-list .share-item .remove-action,
#manage-share-list .share-item .edit-action {
display: none;
float: right;
width: 18px;
height: 18px;
background: url(../images/icons.png) no-repeat;
position: relative;
margin-left: 5px;
left: 15px;
top: -20px;
border: 1px solid transparent;
border-radius: 2px;
text-indent: -99999px;
}
#manage-share-list .share-item .view-action:hover,
#manage-share-list .share-item .remove-action:hover,
#manage-share-list .share-item .edit-action:hover {
border: 1px solid #888;
box-shadow: inset 0 8px 1px rgba(255, 255, 255, 0.3), inset 0 0 3px rgba(0, 0, 0, 0.2);
}
#manage-share-list .share-item .view-action:active,
#manage-share-list .share-item .remove-action:active,
#manage-share-list .share-item .edit-action:active {
box-shadow: inset 0 7px 3px rgba(0, 0, 0, 0.05), inset 0 0 4px rgba(0, 0, 0, 0.3);
}
#manage-share-list .share-item .view-action {
background-position: -1px -670px;
}
#manage-share-list .share-item .remove-action {
background-position: 0 -690px;
}
#manage-share-list .share-item .edit-action {
background-position: 0 -710px;
}
#manage-share-list .share-item:hover .view-action,
#manage-share-list .share-item:hover .remove-action,
#manage-share-list .share-item:hover .edit-action {
display: block;
}
#share-select {
margin-top: 10px;
}
#share-select fieldset { #share-select fieldset {
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
margin: 0; margin: 0;
margin-bottom: 10px; margin-bottom: 10px;
padding: 10px; padding: 10px;
border-radius: 2px;
} }
#share-select fieldset legend { #share-select fieldset legend {
font-size: 14px; font-size: 14px;
......
This diff is collapsed.
ui/theme/default/images/icons.png

9.82 KB | W: | H:

ui/theme/default/images/icons.png

11.3 KB | W: | H:

ui/theme/default/images/icons.png
ui/theme/default/images/icons.png
ui/theme/default/images/icons.png
ui/theme/default/images/icons.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -103,6 +103,7 @@ KityMinder.registerUI('topbar/user', function(minder) { ...@@ -103,6 +103,7 @@ KityMinder.registerUI('topbar/user', function(minder) {
$loginButton.show(); $loginButton.show();
$userButton.hide(); $userButton.hide();
fio.user.fire('logout'); fio.user.fire('logout');
window.location.href = 'index.html';
} }
function login() { function login() {
......
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