diff --git a/index.html b/index.html index 0f074f4b974a754b322be25d43197fef0080848d..1dd34487e4ef71839ba0eae1595a78d6a0a5e9df 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,7 @@ - + diff --git a/src/environment.js b/src/environment.js index da32a4b8736ba562799dc386e9e61a586c197be4..3495e9a9d2dc8567e56c399ed05f43c4a8ae2bec 100644 --- a/src/environment.js +++ b/src/environment.js @@ -1,4 +1,4 @@ export default { - debug: false, - testing: false + debug: true, + testing: true }; diff --git a/src/resources/elements/em-chat-content-item.less b/src/resources/elements/em-chat-content-item.less index 8b057d724791203abb9977d0299c7e4332fceac2..c806adb6ddb05f3b284e77ea12b546f5151ae780 100644 --- a/src/resources/elements/em-chat-content-item.less +++ b/src/resources/elements/em-chat-content-item.less @@ -13,11 +13,11 @@ margin-left: 3em; } .actions { - > a { + >a { margin-right: 5px; } .dropdown { - > a .ellipsis.icon { + >a .ellipsis.icon { margin-right: 0; } .item.tms-red { @@ -87,13 +87,30 @@ transition-timing-function: ease-out; } } - > .content { - > .metadata > .rating { + >.content { + textarea.tms-edit-textarea { + box-sizing: border-box; + // background-color: transparent; + padding: 8px; // margin: 0; + // -webkit-appearance: none; + // tap-highlight-color: rgba(255, 255, 255, 0); + // padding: .78571429em 1em; + // background: #fff; + border: 1px solid rgba(34, 36, 38, .15); + outline: 0; // color: rgba(0, 0, 0, .87); + border-radius: .28571429rem; + box-shadow: 0 0 0 0 transparent inset; // -webkit-transition: color .1s ease, border-color .1s ease; + // transition: color .1s ease, border-color .1s ease; + // font-size: 1em; + // line-height: 1.2857; + // resize: vertical; + } + >.metadata>.rating { @media only screen and (max-width: 767px) { display: none!important; } } - > .markdown-body { + >.markdown-body { span.at-user { cursor: pointer; } @@ -104,12 +121,12 @@ } } } - > .tools { + >.tools { position: absolute; right: 0; bottom: 0; display: none; - > .ui.button { + >.ui.button { margin: 0; background-color: rgba(224, 225, 226, 0.5); &:hover { diff --git a/src/resources/elements/em-chat-sidebar-right.js b/src/resources/elements/em-chat-sidebar-right.js index ff5df86230cad8347049e0c35ad4e1b198237917..35022f5e2355ca04fec92fd7c93d68e2c636a0db 100644 --- a/src/resources/elements/em-chat-sidebar-right.js +++ b/src/resources/elements/em-chat-sidebar-right.js @@ -16,7 +16,7 @@ export class EmChatSidebarRight { [nsCons.ACTION_TYPE_SEARCH]: { nodata: '无符合检索结果', show: 'msg', icon: 'search', title: '检索结果' }, [nsCons.ACTION_TYPE_PIN]: { nodata: '暂无频道固定消息', show: 'msg', icon: 'pin', title: '频道固定消息' }, [nsCons.ACTION_TYPE_TOPIC]: { nodata: '', show: 'topic', icon: 'talk outline', title: '话题讨论' }, - [nsCons.ACTION_TYPE_TODO]: { handler: this.todoHandler, nodata: '暂无待办事项', show: 'todo', icon: 'ordered list', title: '待办事项' }, + [nsCons.ACTION_TYPE_TODO]: { handler: this.todoHandler, nodata: '暂无待办事项', show: 'todo', icon: 'list', title: '待办事项' }, } /** diff --git a/src/resources/elements/em-chat-todo.html b/src/resources/elements/em-chat-todo.html index c82a093f6bded9d2a79807ea746ce78f3e0fcc4f..4611fac19f572815fb1a42e0122e8c65197af3dd 100644 --- a/src/resources/elements/em-chat-todo.html +++ b/src/resources/elements/em-chat-todo.html @@ -23,6 +23,7 @@ +
${item.title}
@@ -30,6 +31,11 @@ +
+
+ +
+
@@ -49,6 +55,7 @@ +
${item.title}
@@ -56,6 +63,11 @@ +
+
+ +
+
diff --git a/src/resources/elements/em-chat-todo.js b/src/resources/elements/em-chat-todo.js index 9f11005da43f5163114ca0a7e2845d12ab949f78..fdfde77c417a23e5ca6f766913089d6c25e902f1 100644 --- a/src/resources/elements/em-chat-todo.js +++ b/src/resources/elements/em-chat-todo.js @@ -99,18 +99,47 @@ export class EmChatTodo { _.defer(() => $(inputRef).focus()); } + editContentHandler(item, textareaRef) { + item.isOpen = !item.isOpen; + if (item.isOpen) { + item.oldContent = item.content; + _.defer(() => { + $(textareaRef).focus() + if (item.content) { + autosize.update(textareaRef); + } + }); + } + } + updateHandler(item) { item.isEditing = false; if (!_.trim(item.title) || item.title == item.oldTitle) { - item.title = item.oldTitle + item.title = item.oldTitle return; } $.post('/admin/todo/update', { id: item.id, title: item.title }, (data, textStatus, xhr) => { - if (data.success) {} else { + if (data.success) { + toastr.success('更新待办事项内容成功!'); + } else { item.title = item.oldTitle; toastr.error(data.data, '更新待办事项失败!'); } }); } + updateDescHandler(item) { + if (item.content == item.oldContent) { + return; + } + $.post('/admin/todo/update', { id: item.id, content: item.content }, (data, textStatus, xhr) => { + if (data.success) { + toastr.success('更新待办事项描述成功!'); + } else { + item.content = item.oldContent; + toastr.error(data.data, '更新待办事项失败!'); + } + }); + } + } diff --git a/src/resources/elements/em-chat-todo.less b/src/resources/elements/em-chat-todo.less index e9e1c5034bfa44aeaf13edf670c6a3f2f8e004c9..a3eab51f7e6d700ca9773e2112f0e450cca6fc48 100644 --- a/src/resources/elements/em-chat-todo.less +++ b/src/resources/elements/em-chat-todo.less @@ -5,8 +5,7 @@ text-overflow: ellipsis; overflow: hidden; max-width: 300px; - min-width: 300px; - // width: 300px; + min-width: 300px; // width: 300px; white-space: nowrap; &.red { color: red; @@ -26,6 +25,31 @@ display: inline-block; } } + >.ui.form { + // transition: all 0.15s ease-out 0s; + textarea { + box-sizing: border-box; + background-color: transparent; + } + } + i.icon { + &.square { + padding-right: 6px; + } + &.checkmark { + padding-right: 3px; + } + } + i.angle.icon { + // padding-left: .28571429em; + padding-left: 4px; + padding-right: 4px; + padding-top: 3px; + &.down { + padding-left: 2px; + padding-right: 2px; + } + } } } } diff --git a/src/resources/elements/em-chat-top-menu.html b/src/resources/elements/em-chat-top-menu.html index 2228f5b7d7ecb2a778035b6e71207fedb29c970a..24d8ce77951ef71807e96e9835756eb610fbccbd 100644 --- a/src/resources/elements/em-chat-top-menu.html +++ b/src/resources/elements/em-chat-top-menu.html @@ -109,7 +109,7 @@
@@ -151,7 +151,7 @@