From b5cf3b8bb60f0571b189fc73ab44867200d1af25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Wed, 22 Jul 2020 19:56:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A1=A8=E5=8D=95=E7=BB=84?= =?UTF-8?q?=E4=BB=B6;=E4=BF=AE=E5=A4=8DreadOnly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.dev.js | 2 +- build.prod.js | 2 +- src/codemirror/codemirror.js | 189 +++++++++++++++++++++------- src/codemirror/index.js | 6 +- src/counter/doui.count.js | 2 +- src/css/meditor.scss | 2 +- src/css/meditor__attach.css | 1 + src/css/meditor__attach.scss | 2 +- src/css/reset-basic.css | 2 +- src/css/tree.css | 1 + src/css/tree.scss | 2 +- src/drag/core.js | 2 +- src/drag/index.js | 2 +- src/form/checkbox.wc | 7 +- src/form/input.wc | 24 ++-- src/form/number.wc | 6 +- src/form/radio.wc | 57 ++++++--- src/form/select.wc | 6 +- src/form/switch.wc | 30 +++-- src/icon/svg.js | 2 +- src/markd/core.js | 2 +- src/meditor2/addon/attach-native.js | 2 +- src/meditor2/addon/attach.js | 4 +- src/meditor2/addon/base.js | 2 +- src/meditor2/index.js | 4 +- src/neditor/svg.js | 2 +- src/request/index.js | 3 +- src/request/lib/format.js | 2 +- src/router/index.js | 2 +- src/store/index.js | 2 +- src/tree/index.js | 2 +- src/uploader/uploader.js | 6 +- src/utils.js | 2 +- 33 files changed, 267 insertions(+), 115 deletions(-) create mode 100644 src/css/meditor__attach.css create mode 100644 src/css/tree.css diff --git a/build.dev.js b/build.dev.js index b388c32..174f53a 100644 --- a/build.dev.js +++ b/build.dev.js @@ -132,7 +132,7 @@ function mkWCFile({ style, html, js }) { return `/** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date ${BUILD_DATE} * @version v${VERSION} * diff --git a/build.prod.js b/build.prod.js index 4bdfaa8..ae84181 100644 --- a/build.prod.js +++ b/build.prod.js @@ -143,7 +143,7 @@ function mkWCFile({ style, html, js }) { return `/** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date ${BUILD_DATE} * @version v${VERSION} * diff --git a/src/codemirror/codemirror.js b/src/codemirror/codemirror.js index db32cec..0999798 100644 --- a/src/codemirror/codemirror.js +++ b/src/codemirror/codemirror.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2018-08-04 18:47:35 */ @@ -133,15 +133,44 @@ function CodeMirror(place, givenOptions) { updateInput = false })() var history = new History() - connect(scroller, 'mousedown', operation(onMouseDown)) - connect(scroller, 'dblclick', operation(onDoubleClick)) - connect(lineSpace, 'selectstart', e_preventDefault) - if (!gecko) connect(scroller, 'contextmenu', onContextMenu) - connect(scroller, 'scroll', onScrollMain) - connect(scrollbar, 'scroll', onScrollBar) - connect(scrollbar, 'mousedown', function() { - if (focused) setTimeout(focusInput, 0) - }) + connect( + scroller, + 'mousedown', + operation(onMouseDown) + ) + connect( + scroller, + 'dblclick', + operation(onDoubleClick) + ) + connect( + lineSpace, + 'selectstart', + e_preventDefault + ) + if (!gecko) + connect( + scroller, + 'contextmenu', + onContextMenu + ) + connect( + scroller, + 'scroll', + onScrollMain + ) + connect( + scrollbar, + 'scroll', + onScrollBar + ) + connect( + scrollbar, + 'mousedown', + function() { + if (focused) setTimeout(focusInput, 0) + } + ) var resizeHandler = connect( window, 'resize', @@ -151,31 +180,79 @@ function CodeMirror(place, givenOptions) { }, true ) - connect(input, 'keyup', operation(onKeyUp)) - connect(input, 'input', fastPoll) - connect(input, 'keydown', operation(onKeyDown)) - connect(input, 'keypress', operation(onKeyPress)) - connect(input, 'focus', onFocus) - connect(input, 'blur', onBlur) + connect( + input, + 'keyup', + operation(onKeyUp) + ) + connect( + input, + 'input', + fastPoll + ) + connect( + input, + 'keydown', + operation(onKeyDown) + ) + connect( + input, + 'keypress', + operation(onKeyPress) + ) + connect( + input, + 'focus', + onFocus + ) + connect( + input, + 'blur', + onBlur + ) function drag_(e) { if (options.onDragEvent && options.onDragEvent(instance, addStop(e))) return e_stop(e) } if (options.dragDrop) { - connect(scroller, 'dragstart', onDragStart) - connect(scroller, 'dragenter', drag_) - connect(scroller, 'dragover', drag_) - connect(scroller, 'drop', operation(onDrop)) + connect( + scroller, + 'dragstart', + onDragStart + ) + connect( + scroller, + 'dragenter', + drag_ + ) + connect( + scroller, + 'dragover', + drag_ + ) + connect( + scroller, + 'drop', + operation(onDrop) + ) } - connect(scroller, 'paste', function() { - focusInput() - fastPoll() - }) - connect(input, 'paste', function() { - pasteIncoming = true - fastPoll() - }) + connect( + scroller, + 'paste', + function() { + focusInput() + fastPoll() + } + ) + connect( + input, + 'paste', + function() { + pasteIncoming = true + fastPoll() + } + ) connect( input, 'cut', @@ -184,10 +261,14 @@ function CodeMirror(place, givenOptions) { }) ) if (khtml) - connect(sizer, 'mouseup', function() { - if (document.activeElement == input) input.blur() - focusInput() - }) + connect( + sizer, + 'mouseup', + function() { + if (document.activeElement == input) input.blur() + focusInput() + } + ) var hasFocus try { hasFocus = document.activeElement == input @@ -698,8 +779,18 @@ function CodeMirror(place, givenOptions) { type == 'single' ) { if (webkit) scroller.draggable = true - var up = connect(document, 'mouseup', operation(dragEnd), true) - var drop = connect(scroller, 'drop', operation(dragEnd), true) + var up = connect( + document, + 'mouseup', + operation(dragEnd), + true + ) + var drop = connect( + scroller, + 'drop', + operation(dragEnd), + true + ) draggingText = true if (scroller.dragDrop) scroller.dragDrop() return @@ -775,7 +866,12 @@ function CodeMirror(place, givenOptions) { }), true ) - var up = connect(document, 'mouseup', operation(done), true) + var up = connect( + document, + 'mouseup', + operation(done), + true + ) } function onDoubleClick(e) { @@ -2032,12 +2128,12 @@ function CodeMirror(place, givenOptions) { var check = isWordChar(startChar) ? isWordChar : /\s/.test(startChar) - ? function(ch) { - return /\s/.test(ch) - } - : function(ch) { - return !/\s/.test(ch) && isWordChar(ch) - } + ? function(ch) { + return /\s/.test(ch) + } + : function(ch) { + return !/\s/.test(ch) && isWordChar(ch) + } while (start > 0 && check(line.charAt(start - 1))) --start while (end < line.length && check(line.charAt(end))) ++end } @@ -3358,7 +3454,12 @@ CodeMirror.fromTextArea = function(textarea, options) { textarea.value = instance.getValue() } if (textarea.form) { - var rmSubmit = connect(textarea.form, 'submit', save, true) + var rmSubmit = connect( + textarea.form, + 'submit', + save, + true + ) var realSubmit = textarea.form.submit textarea.form.submit = function wrappedSubmit() { save() @@ -3764,7 +3865,7 @@ Line.prototype = { if (!m) break pos += skipped + 1 if (m[0] == '\t') { - var tabWidth = tabSize - col % tabSize + var tabWidth = tabSize - (col % tabSize) content.appendChild(elt('span', spaceStr(tabWidth), 'cm-tab')) col += tabWidth } else { @@ -4287,7 +4388,7 @@ function countColumn(string, end, tabSize) { if (end == -1) end = string.length } for (var i = 0, n = 0; i < end; ++i) { - if (string.charAt(i) == '\t') n += tabSize - n % tabSize + if (string.charAt(i) == '\t') n += tabSize - (n % tabSize) else ++n } return n diff --git a/src/codemirror/index.js b/src/codemirror/index.js index aff089d..993e8f8 100644 --- a/src/codemirror/index.js +++ b/src/codemirror/index.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2018-08-04 18:47:35 */ @@ -117,8 +117,8 @@ CodeMirror.defineMode( state.token == html ? htmlMode : state.token == javascript - ? jsMode - : cssMode + ? jsMode + : cssMode return { state: state.localState || state.htmlState, mode: mode diff --git a/src/counter/doui.count.js b/src/counter/doui.count.js index 5938589..ce3336f 100644 --- a/src/counter/doui.count.js +++ b/src/counter/doui.count.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2016-08-19 10:38:25 * */ diff --git a/src/css/meditor.scss b/src/css/meditor.scss index d93ce8a..d283122 100644 --- a/src/css/meditor.scss +++ b/src/css/meditor.scss @@ -1,7 +1,7 @@ @charset "UTF-8"; /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2017-04-17 16:43:22 * */ diff --git a/src/css/meditor__attach.css b/src/css/meditor__attach.css new file mode 100644 index 0000000..53e57dd --- /dev/null +++ b/src/css/meditor__attach.css @@ -0,0 +1 @@ +.do-meditor-attach{width:630px;height:300px;cursor:default;color:#526273}.do-meditor-attach ::-webkit-scrollbar{width:5px;height:5px;background:#f2f5fc}.do-meditor-attach ::-webkit-scrollbar:hover{background:#e8ebf4}.do-meditor-attach ::-webkit-scrollbar-button{display:none}.do-meditor-attach ::-webkit-scrollbar-thumb{background:#bdbdbd}.do-meditor-attach ::-webkit-scrollbar-thumb:hover{background:#9e9e9e}.do-meditor-attach .tab-box{float:left;width:130px;height:300px;padding:10px 5px;text-align:center;background:#f2f5fc;border-radius:5px}.do-meditor-attach .tab-box .item{display:block;width:100%;height:40px;line-height:40px;border-radius:3px;cursor:pointer}.do-meditor-attach .tab-box .item.active{background:#fff}.do-meditor-attach .cont-box{position:relative;float:right;width:480px;height:auto;min-height:200px}.do-meditor-attach .cont-box .remote,.do-meditor-attach .cont-box .local{position:relative;width:92%;height:auto;margin:0 auto}.do-meditor-attach .cont-box .remote{padding:30px 0}.do-meditor-attach .cont-box .hide{display:none}.do-meditor-attach .cont-box .section{display:block;width:100%;height:auto;margin:15px 0;line-height:35px}.do-meditor-attach .cont-box .section .submit{float:right;width:30%;height:45px;line-height:45px}.do-meditor-attach .cont-box .select-file{width:100%;height:35px;line-height:35px}.do-meditor-attach .cont-box .select-file .file{float:left;width:100px;height:35px;border-radius:3px;background:#e8ebf4;text-align:center;cursor:pointer}.do-meditor-attach .cont-box .select-file .file:hover{background:#f2f5fc}.do-meditor-attach .cont-box .select-file .file:active{background:#dae1e9}.do-meditor-attach .cont-box .select-file .tips{display:inline-block;padding:0 10px}.do-meditor-attach .cont-box .upload-box{width:100%;height:auto;min-height:255px;padding-top:10px}.do-meditor-attach .cont-box .upload-box .thead{width:100%;height:35px;line-height:35px;background:#f2f5fc}.do-meditor-attach .cont-box .upload-box .col{overflow:hidden;float:left;height:30px;padding:0 5px;text-align:center}.do-meditor-attach .cont-box .upload-box .col:nth-child(1){width:50%}.do-meditor-attach .cont-box .upload-box .col:nth-child(2){width:35%}.do-meditor-attach .cont-box .upload-box .col:nth-child(3){width:15%}.do-meditor-attach .cont-box .upload-box .tbody{overflow:hidden;overflow-y:auto;width:100%;height:220px}.do-meditor-attach .cont-box .upload-box .tbody p{display:block;width:100%;height:30px;line-height:30px}.do-meditor-attach .cont-box .upload-box .insert{display:inline-block;padding:3px 5px;line-height:13px;background:#f2f5fc;color:#526273;cursor:pointer}.do-meditor-attach .cont-box .upload-box .red{color:#f30}.do-meditor-attach .cont-box .manager{overflow:hidden;overflow-y:auto;width:100%;height:300px}.do-meditor-attach .cont-box .manager .list-box{width:100%;-webkit-column-count:4;column-count:4;-webkit-column-gap:5;column-gap:5}.do-meditor-attach .cont-box .manager .item{margin:0 0 10px;padding:5px;text-align:center;background:#f2f5fc;-webkit-column-break-inside:avoid;break-inside:avoid;transition:background .2s ease-in-out}.do-meditor-attach .cont-box .manager .item:hover{background:#dae1e9}.do-meditor-attach .cont-box .manager .item .thumb{display:block;width:100%}.do-meditor-attach .cont-box .manager .item .name{overflow:hidden;height:30px;line-height:30px;text-align:center}.do-meditor-attach .cont-box .manager .item img{width:100%;height:auto}.do-meditor-attach .cont-box .manager .item em{line-height:1;font-size:50px} diff --git a/src/css/meditor__attach.scss b/src/css/meditor__attach.scss index 8e043f6..a3d7d98 100644 --- a/src/css/meditor__attach.scss +++ b/src/css/meditor__attach.scss @@ -1,7 +1,7 @@ @charset "UTF-8"; /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2017-04-20 19:13:24 * */ diff --git a/src/css/reset-basic.css b/src/css/reset-basic.css index 565dfba..75b2a0c 100644 --- a/src/css/reset-basic.css +++ b/src/css/reset-basic.css @@ -1,7 +1,7 @@ @charset "UTF-8"; /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2014-10-10 00:45:09 * * doui的CSS规范 diff --git a/src/css/tree.css b/src/css/tree.css new file mode 100644 index 0000000..9b2d2fc --- /dev/null +++ b/src/css/tree.css @@ -0,0 +1 @@ +.do-tree{overflow:hidden;overflow-y:auto;position:relative;display:block;width:100%;height:100%;line-height:30px;font-size:15px;color:#526273}.do-tree__item{overflow:hidden;min-height:30px}.do-tree__item .sub-tree{display:none;width:100%;padding-left:20px}.do-tree__item em,.do-tree__item span{display:block;cursor:pointer}.do-tree__item em{float:left;padding:0 5px;font-size:20px;color:#62778d}.do-tree__item span:hover{color:#62778d}.do-tree__item span.active{color:#425064;font-weight:bold}.do-tree__item span.checkbox{float:left;position:relative;width:18px;height:18px;margin:6px 5px 6px 0;line-height:16px;border:1px solid #526273;border-radius:3px;font-size:16px;text-align:center}.do-tree__item span.label{white-space:nowrap;text-overflow:ellipsis}.do-tree__item.open>.sub-tree{display:block} diff --git a/src/css/tree.scss b/src/css/tree.scss index 7cdbfd8..737a6c8 100644 --- a/src/css/tree.scss +++ b/src/css/tree.scss @@ -1,7 +1,7 @@ @charset "UTF-8"; /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2017-04-14 21:18:53 * */ diff --git a/src/drag/core.js b/src/drag/core.js index 7a9d3f6..7790487 100644 --- a/src/drag/core.js +++ b/src/drag/core.js @@ -1,6 +1,6 @@ /** * 拖拽插件的核心部分 - * @author yutent + * @author yutent * @date 2019/08/23 19:41:21 */ diff --git a/src/drag/index.js b/src/drag/index.js index fb9f816..27e462e 100644 --- a/src/drag/index.js +++ b/src/drag/index.js @@ -1,6 +1,6 @@ /** * 拖拽指令 :drag - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2017-03-29 18:39:35 * */ diff --git a/src/form/checkbox.wc b/src/form/checkbox.wc index 32e58d2..6ed849d 100644 --- a/src/form/checkbox.wc +++ b/src/form/checkbox.wc @@ -165,7 +165,6 @@ export default class Checkbox { } set value(val) { - log(val, this, this.props.label) if (Array.isArray(val)) { this.props.value = val this.checked = this.props.value.includes(this.props.label) @@ -261,7 +260,11 @@ export default class Checkbox { case 'checked': case 'readonly': case 'disabled': - this[name] = true + var k = name + if (k === 'readonly') { + k = 'readOnly' + } + this[k] = true break } } diff --git a/src/form/input.wc b/src/form/input.wc index bd2f91f..83af240 100644 --- a/src/form/input.wc +++ b/src/form/input.wc @@ -25,6 +25,7 @@ li { -moz-user-select: none; color: nth($cd, 2); border-radius: 2px; + cursor: text; } .label { @@ -40,7 +41,7 @@ li { border-radius: inherit; background: #fff; color: inherit; - cursor: text; + cursor: inherit; input, textarea { @@ -52,8 +53,7 @@ li { border: 0; border-radius: inherit; color: inherit; - font-size: inherit; - font-family: inherit; + font: inherit; background: none; outline: none; box-shadow: none; @@ -154,10 +154,16 @@ li { :host([auto-border]) .label { border-color: transparent; } -:host([disabled]) .label { - background: nth($cp, 1); +:host([disabled]) { cursor: not-allowed; - opacity: 0.6; + + .label { + background: nth($cp, 1); + opacity: 0.6; + } +} +:host([readonly]) { + cursor: default; } :host(:focus-within) { @include focus1; @@ -549,7 +555,11 @@ export default class Input { case 'readonly': case 'disabled': - this[name] = true + var k = name + if (k === 'readonly') { + k = 'readOnly' + } + this[k] = true break } } diff --git a/src/form/number.wc b/src/form/number.wc index 2dfd575..bcc54d1 100644 --- a/src/form/number.wc +++ b/src/form/number.wc @@ -373,7 +373,11 @@ export default class Number { case 'readonly': case 'disabled': - this[name] = true + var k = name + if (k === 'readonly') { + k = 'readOnly' + } + this[k] = true break } } diff --git a/src/form/radio.wc b/src/form/radio.wc index 08748ef..a987b99 100644 --- a/src/form/radio.wc +++ b/src/form/radio.wc @@ -26,16 +26,14 @@ color: nth($cgr, 3); &.checked .dot::after { - display: block; - width: 12px; - height: 12px; - border-radius: 50%; - background: nth($cgr, 1); content: ''; } } .dot { + display: flex; + justify-content: center; + align-items: center; width: 18px; height: 18px; padding: 2px; @@ -43,6 +41,14 @@ border: 1px solid nth($cgr, 1); border-radius: 50%; background: #fff; + + &::after { + display: block; + width: 12px; + height: 12px; + border-radius: 50%; + background: nth($cgr, 1); + } } } @@ -57,33 +63,46 @@ :host([size='large']) { label { - width: 58px; + min-width: 58px; height: 32px; } .dot { width: 26px; height: 26px; + + &::after { + width: 18px; + height: 18px; + } } } :host([size='medium']) { label { - width: 50px; + min-width: 50px; height: 28px; } .dot { width: 22px; height: 22px; + + &::after { + width: 14px; + height: 14px; + } } } :host([size='mini']) { label { - width: 22px; height: 14px; - padding: 2px; } .dot { - width: 10px; - height: 10px; + width: 14px; + height: 14px; + + &::after { + width: 8px; + height: 8px; + } } } @@ -230,11 +249,13 @@ export default class Radio { } mounted() { - this._handleClick = $.bind(this, 'click', ev => { - if (!this.disabled && !this.readOnly && !this.checked) { - this.checked = true - this.dispatchEvent(new CustomEvent('input')) + this._handleClick = $.catch(this, 'click', ev => { + if (this.disabled || this.readOnly || this.checked) { + return } + + this.checked = true + this.dispatchEvent(new CustomEvent('input')) }) } @@ -251,7 +272,11 @@ export default class Radio { case 'checked': case 'readonly': case 'disabled': - this[name] = true + var k = name + if (k === 'readonly') { + k = 'readOnly' + } + this[k] = true break } } diff --git a/src/form/select.wc b/src/form/select.wc index 864fc59..c4e68d7 100644 --- a/src/form/select.wc +++ b/src/form/select.wc @@ -521,7 +521,11 @@ export default class Select { case 'readonly': case 'disabled': - this[name] = true + var k = name + if (k === 'readonly') { + k = 'readOnly' + } + this[k] = true break } } diff --git a/src/form/switch.wc b/src/form/switch.wc index a781ddf..e1d1a80 100644 --- a/src/form/switch.wc +++ b/src/form/switch.wc @@ -15,15 +15,17 @@ display: flex; justify-content: center; align-items: center; + // vertical-align: middle; + line-height: 0; white-space: nowrap; } label { display: flex; - width: 38px; - height: 22px; + align-items: center; + width: 32px; + height: 18px; padding: 3px; margin: 5px; - line-height: 0; border-radius: 21px; background: nth($cp, 3); cursor: inherit; @@ -34,8 +36,8 @@ } } .dot { - width: 16px; - height: 16px; + width: 12px; + height: 12px; border-radius: 50%; background: #fff; } @@ -48,22 +50,24 @@ :host([size='large']) { label { - width: 58px; - height: 32px; + width: 46px; + height: 26px; + padding: 3px 5px; } .dot { - width: 26px; - height: 26px; + width: 18px; + height: 18px; } } :host([size='medium']) { label { - width: 50px; - height: 28px; + width: 38px; + height: 22px; + padding: 3px 4px; } .dot { - width: 22px; - height: 22px; + width: 16px; + height: 16px; } } :host([size='mini']) { diff --git a/src/icon/svg.js b/src/icon/svg.js index 9148832..8f587f6 100644 --- a/src/icon/svg.js +++ b/src/icon/svg.js @@ -1,6 +1,6 @@ /** * {icon svg} - * @author yutent + * @author yutent * @date 2019/07/17 15:12:14 */ diff --git a/src/markd/core.js b/src/markd/core.js index d6b29d1..ab47d9e 100644 --- a/src/markd/core.js +++ b/src/markd/core.js @@ -1,6 +1,6 @@ /** * markdown解析器 - * @author yutent + * @author yutent * @date 2020/02/07 17:14:19 */ diff --git a/src/meditor2/addon/attach-native.js b/src/meditor2/addon/attach-native.js index 775d8ad..064ef94 100644 --- a/src/meditor2/addon/attach-native.js +++ b/src/meditor2/addon/attach-native.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2017-04-19 21:17:26 * */ diff --git a/src/meditor2/addon/attach.js b/src/meditor2/addon/attach.js index d76ba34..35c466a 100644 --- a/src/meditor2/addon/attach.js +++ b/src/meditor2/addon/attach.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2017-04-19 21:17:26 * */ @@ -108,7 +108,7 @@ class Uploader { 'progress', evt => { if (evt.lengthComputable && this.progress) { - let res = Math.round(evt.loaded * 100 / evt.total) + let res = Math.round((evt.loaded * 100) / evt.total) this.progress(res) } }, diff --git a/src/meditor2/addon/base.js b/src/meditor2/addon/base.js index 0e45d7f..1ec9015 100644 --- a/src/meditor2/addon/base.js +++ b/src/meditor2/addon/base.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2017-04-17 21:41:48 * */ diff --git a/src/meditor2/index.js b/src/meditor2/index.js index 60294b5..66164d6 100644 --- a/src/meditor2/index.js +++ b/src/meditor2/index.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2017-04-17 16:37:12 * */ @@ -471,7 +471,7 @@ Anot.component('meditor', { let sh = ev.target.scrollHeight let ch = ev.target.clientHeight let psh = preview.scrollHeight - let syncTop = st / (sh - ch) * (psh - ch) + let syncTop = (st / (sh - ch)) * (psh - ch) preview.scrollTop = syncTop }) //编辑器成功加载的回调 diff --git a/src/neditor/svg.js b/src/neditor/svg.js index 02aba65..4fd6c19 100644 --- a/src/neditor/svg.js +++ b/src/neditor/svg.js @@ -1,6 +1,6 @@ /** * icon字典 - * @author yutent + * @author yutent * @date 2019/07/08 17:39:11 */ diff --git a/src/request/index.js b/src/request/index.js index 4b4c84b..abd502c 100644 --- a/src/request/index.js +++ b/src/request/index.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2018-03-25 23:59:13 * @version $Id$ */ @@ -441,7 +441,6 @@ if (!window.request) { this.__INIT__ = param } } - Anot.ui.request = request.version } export default request diff --git a/src/request/lib/format.js b/src/request/lib/format.js index ce5d8a7..8259cba 100644 --- a/src/request/lib/format.js +++ b/src/request/lib/format.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2016-11-26 16:35:45 * */ diff --git a/src/router/index.js b/src/router/index.js index 528bdad..a877956 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2017-04-14 21:04:50 * */ diff --git a/src/store/index.js b/src/store/index.js index c6220d8..c9208d4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2018-06-25 21:39:42 * @version $Id$ */ diff --git a/src/tree/index.js b/src/tree/index.js index ffb02d2..3bcfc0b 100644 --- a/src/tree/index.js +++ b/src/tree/index.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2017-04-14 21:04:50 * */ diff --git a/src/uploader/uploader.js b/src/uploader/uploader.js index 1278584..fd8228b 100644 --- a/src/uploader/uploader.js +++ b/src/uploader/uploader.js @@ -1,7 +1,7 @@ /** * Uploader 无刷新上传文件(next版) * 只支持chrome/firefox/IE10+/opera12+ - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2016-09-05 19:33:23 * */ @@ -74,7 +74,7 @@ define(function() { function(evt) { if (evt.lengthComputable && _this.progress) { var now = Date.now() - var upSize = evt.loaded * 1000 / 1024 + var upSize = (evt.loaded * 1000) / 1024 var res = { loaded: evt.loaded, time: now - startTime } res.speed = upSize / res.time @@ -84,7 +84,7 @@ define(function() { res.speed = res.speed.toFixed(2) + ' KB/s' } - res.progress = Math.round(evt.loaded * 100 / evt.total) + res.progress = Math.round((evt.loaded * 100) / evt.total) _this.progress(res) } }, diff --git a/src/utils.js b/src/utils.js index 53e2303..1a325f2 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,6 +1,6 @@ /** * 公共方法库 - * @author yutent + * @author yutent * @date 2019/08/08 10:47:55 */