diff --git a/src/css/basic-elem.scss b/src/css/basic-elem.scss index 2f65fe9..ff5546a 100644 --- a/src/css/basic-elem.scss +++ b/src/css/basic-elem.scss @@ -10,66 +10,58 @@ /*--------各种按钮---------*/ -.do-ui-button {display:inline-block;padding:0 5px;border:1px solid #ddd;text-align:center;font-size:12px;background:none;cursor:pointer;@include ts; +.do-ui-button {display:inline-block;padding:2px 5px;border:1px solid #ddd;text-align:center;font-size:12px;background:none;cursor:pointer;@include ts; - &.medium {min-width:100px;height:35px;padding:0 8px;line-height:35px;font-size:15px} - &.large {min-width:150px;height:50px;padding:0 13px;line-height:50px;font-size:18px;} - &.radius-3 {border-radius:3px;} - &.radius-5 {border-radius:5px;} + &.medium {min-width:100px;height:35px;padding:0 8px;line-height:35px;font-size:15px} + &.large {min-width:150px;height:50px;padding:0 13px;line-height:50px;font-size:18px;} + &.radius-3 {border-radius:3px; + [class^="do-icon-"], [class*=" do-icon-"] {border-radius:3px} + } + &.radius-5 {border-radius:5px; + [class^="do-icon-"], [class*=" do-icon-"] {border-radius:3px} + } + + &.teal {border:0;background:nth($ct, 1);color:#fff;} + &.teal:hover {background:nth($ct, 2);} + &.teal:active {background:nth($ct, 3);} + &.green {border:0;background:nth($cg, 1);color:#fff;} + &.green:hover {background:nth($cg, 2);} + &.green:active {background:nth($cg, 3);} + &.blue {border:0;background:nth($cb, 1);color:#fff;} + &.blue:hover {background:nth($cb, 2);} + &.blue:active {background:nth($cb, 3);} + &.purple {border:0;background:nth($cpp, 1);color:#fff;} + &.purple:hover {background:nth($cpp, 2);} + &.purple:active {background:nth($cpp, 3);} + &.red {border:0;background:nth($cr, 1);color:#fff;} + &.red:hover {background:nth($cr, 2);} + &.red:active {background:nth($cr, 3);} + &.orange {border:0;background:nth($co, 1);color:#fff;} + &.orange:hover {background:nth($co, 2);} + &.orange:active {background:nth($co, 3);} + &.plain {border:0;background:nth($cp, 1);color:nth($cgr, 1);} + &.plain:hover {background:nth($cp, 2);} + &.plain:active {background:nth($cp, 3);} + &.grey {border:0;background:nth($cgr, 1);color:#fff;} + &.grey:hover {background:nth($cgr, 2);} + &.grey:active {background:nth($cgr, 3);} + + &.disabled {border-color:nth($cp, 1);color:nth($cp, 3);cursor:not-allowed;} - &.teal {border:0;background:nth($ct, 1);color:#fff;} - &.teal:hover {background:nth($ct, 2);} - &.teal:active {background:nth($ct, 3);} - &.green {border:0;background:nth($cg, 1);color:#fff;} - &.green:hover {background:nth($cg, 2);} - &.green:active {background:nth($cg, 3);} - &.blue {border:0;background:nth($cb, 1);color:#fff;} - &.blue:hover {background:nth($cb, 2);} - &.blue:active {background:nth($cb, 3);} - &.purple {border:0;background:nth($cpp, 1);color:#fff;} - &.purple:hover {background:nth($cpp, 2);} - &.purple:active {background:nth($cpp, 3);} - &.red {border:0;background:nth($cr, 1);color:#fff;} - &.red:hover {background:nth($cr, 2);} - &.red:active {background:nth($cr, 3);} - &.orange {border:0;background:nth($co, 1);color:#fff;} - &.orange:hover {background:nth($co, 2);} - &.orange:active {background:nth($co, 3);} - &.plain {border:0;background:nth($cp, 1);color:nth($cgr, 1);} - &.plain:hover {background:nth($cp, 2);} - &.plain:active {background:nth($cp, 3);} - &.grey {border:0;background:nth($cgr, 1);color:#fff;} - &.grey:hover {background:nth($cgr, 2);} - &.grey:active {background:nth($cgr, 3);} - - &.disabled {border-color:nth($cp, 1);color:nth($cp, 3);cursor:not-allowed;} - - /* 额外样式 */ - &.medium.with-style, - &.large.with-style {position:relative;padding-right:43px; - - &::after {position:absolute;right:0;top:0;width:35px;;text-align:center;background:rgba(0,0,0,.2);font-family:"ui font" !important;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;} + + + /* 额外样式 */ + &.medium.with-icon, + &.large.with-icon {position:relative;padding-left:43px; + [class^="do-icon-"], [class*=" do-icon-"] { + position:absolute;left:0;top:0;width:35px;font-size:25px;background:rgba(0,0,0,.1); } - &.large.with-style {padding-right:58px; - &::after {width:50px;} + } + &.large.with-icon {padding-left:58px; + [class^="do-icon-"], [class*=" do-icon-"] { + width:50px;font-size:35px; } - - &.icon-del::after {content:"\e6f0"} - &.icon-add::after {content:"\e64c"} - &.icon-send::after {content:"\e64b"} - &.icon-confirm::after {content:"\e60f"} - &.icon-share::after {content:"\e631"} - &.icon-bad::after {content:"\e8ee"} - &.icon-good::after {content:"\e62d"} - &.icon-download::after {content:"\e611"} - &.icon-upload::after {content:"\e6f7"} - &.icon-mac::after {content:"\e60a"} - &.icon-ios::after {content:"\e609"} - &.icon-windows::after {content:"\e601"} - &.icon-linux::after {content:"\e602"} - &.icon-android::after {content:"\e600"} - - + } } diff --git a/src/js/anot.shim.js b/src/js/anot.shim.js index f39379b..be4ce76 100644 --- a/src/js/anot.shim.js +++ b/src/js/anot.shim.js @@ -3365,7 +3365,19 @@ delete elem[attr.value] } else { var camelizeName = camelize(name) - ret[camelizeName] = parseData(attr.value) + if (camelizeName.indexOf('@') === 0) { + camelizeName = camelizeName.slice(1) + var vm = vmodels[0] + if ( + vm && + vm.hasOwnProperty(attr.value) && + typeof vm[attr.value] === 'function' + ) { + ret[camelizeName] = vm[attr.value].bind(vm) + } + } else { + ret[camelizeName] = parseData(attr.value) + } } } } @@ -4015,6 +4027,10 @@ console.error('设置style样式, 请改用 :css指令') continue } + // 通过属性设置回调,必须以@符号开头 + if (typeof obj[i] === 'function' && i.indexOf('@') !== 0) { + continue + } if (i === 'href' || i === 'src') { //处理IE67自动转义的问题 if (!root.hasAttribute) obj[i] = obj[i].replace(/&/g, '&') @@ -4061,7 +4077,7 @@ if (typeof obj[i] === 'object') { obj[i] = JSON.stringify(obj[i]) } else if (typeof obj[i] === 'function') { - k = '__fn__' + camelize(k) + k = ronattr + camelize(k.slice(1)) elem[k] = obj[i].bind(vm) obj[i] = k } diff --git a/src/js/marked/index.js b/src/js/marked/index.js index f00ebbb..eb72476 100644 --- a/src/js/marked/index.js +++ b/src/js/marked/index.js @@ -830,7 +830,7 @@ Renderer.prototype.code = function(code, lang, escaped) { output += '' + codes[idx - 1] + '\n' //加\n为了避免空行时无法显示 } - return '
' + output + '
' + return '
' + output + '
' } Renderer.prototype.blockquote = function(quote) { @@ -931,7 +931,7 @@ Renderer.prototype.em = function(text) { Renderer.prototype.codespan = function(txt) { txt = txt.replace(/&/g, '&') - return '' + txt + '' + return '' + txt + '' } Renderer.prototype.br = function() { diff --git a/src/js/marked/theme.scss b/src/js/marked/theme.scss index b87a677..8468670 100644 --- a/src/js/marked/theme.scss +++ b/src/js/marked/theme.scss @@ -5,7 +5,7 @@ * @date 2017-09-29 00:05:45 * @version $Id$ */ -@import "../../../css/var.scss"; +@import "var.scss"; .do-marked-theme {position:relative; diff --git a/src/js/meditor/addon/attach.js b/src/js/meditor/addon/attach.js index 123b7de..d9ffd80 100644 --- a/src/js/meditor/addon/attach.js +++ b/src/js/meditor/addon/attach.js @@ -75,7 +75,6 @@ const fixCont = function(vm, tool) { } return `
-
${LANG[tool][0]} @@ -259,6 +258,7 @@ function showDialog(elem, vm, tool) { type: 7, menubar: false, fixed: true, + maskClose: true, offset: [offset.top + 40 - $doc.scrollTop()], shift: { top: offset.top - $doc.scrollTop() @@ -324,10 +324,7 @@ function showDialog(elem, vm, tool) { vm.insert(val) this.close() }, - content: fixCont(vm, tool), - success() { - this.switchTab(3) - } + content: fixCont(vm, tool) }) } diff --git a/src/js/meditor/addon/attach.scss b/src/js/meditor/addon/attach.scss index 509c525..86a82ca 100644 --- a/src/js/meditor/addon/attach.scss +++ b/src/js/meditor/addon/attach.scss @@ -14,11 +14,6 @@ ::-webkit-scrollbar-button {display:none;} ::-webkit-scrollbar-thumb {background:nth($cgr, 2);} ::-webkit-scrollbar-thumb:hover {background:nth($cgr, 1);} - - dt.close {position:absolute;z-index:65539;top:-15px;right:-10px;width:30px;height:30px;line-height:30px;font-size:20px;text-align:center;cursor:pointer; - - &:hover {color:nth($ct, 1);font-size:28px;} - } .tab-box {float:left;width:130px;height:300px;padding:10px 5px;text-align:center;background:nth($cp, 2);border-radius:5px; diff --git a/src/js/meditor/skin/main.scss b/src/js/meditor/skin/main.scss index 9ee3d3b..ae31fe4 100644 --- a/src/js/meditor/skin/main.scss +++ b/src/js/meditor/skin/main.scss @@ -12,7 +12,7 @@ src: url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAABEUAAsAAAAAGygAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFZW7kiCY21hcAAAAYAAAAELAAADBGqGdy9nbHlmAAACjAAAC8AAABIsPd75f2hlYWQAAA5MAAAALwAAADYRZEeYaGhlYQAADnwAAAAcAAAAJAfeA51obXR4AAAOmAAAABQAAABwb+kAAGxvY2EAAA6sAAAAOgAAADpDyD8EbWF4cAAADugAAAAfAAAAIAE0AG5uYW1lAAAPCAAAAUUAAAJtPlT+fXBvc3QAABBQAAAAwwAAAQaYIDHPeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2Bk/s84gYGVgYOpk+kMAwNDP4RmfM1gxMjBwMDEwMrMgBUEpLmmMDgwVDybyNzwv4EhhrmBoQEozAiSAwAwZA0EeJzFkllOAkEURU9B206I88gW/DSuxJ0goXHAeSKQwDb8clV3G3irH4lxBbzO6eRVakqdC6wATXNuCkg/JHJ9ezTV40026vGCofs2azQoqdRTXyNNNJvPPV6p636gsaZ1/1fJa9rs+bvgsu4b3rPwySWr3m3d+2/SYsuzttlh1zP3OeCQI4454ZQzOl5WsrRKyzv6f7XyL10tOr8K1QJfUd3A74uug+xWvSD7VT/I3jUI7AHdBDaCbgO7QXeBLaH7IOdBw8Dm0EOQb6fHwDbRU2Cv6DmwYfQS2DV6DWwdvQX2j94DJwF9BM4E+gycDvQVOCdoFDgxaBw4O2gSOEVoGjhPaBbQ+QUI7mQ5AHiclVdpjBzHda5Xfc1MHzM9fc2xc3VzuvecnZ2eQySXs1yZlLikbJI6zVgylowiipQZkVIcirBoUhBph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4iTv8CrfQ8erCPuZeV7iNRy/2x1YvnF6p5UHFockikzm/gple75KFrdLqnGtbxCZTg6BfSVOdaVvdU+zXQ+ciFVmTqgmrOkmMyq3Z6tAFG+fyUa8XiR6EJuVYY/62xgKOcQWFJQ6MMUIYZIjK6Og7VWb0r7FDwl57Vj3N53RbFNT/c4UBAvTPXFO6stJ5Ok+BPV8bUnV0K27LnpQ0kV7NSRKyQl7WtlRC6gE2ZVeOEXpc0Yk/KGdI/wAJWm7IAAAAeJxtjElSwzAUBfUUOY4VxjCEIRwhizDdR5a/S6r8SEKRgeODzZZedHW9xRNS/KHF/2wgMYNChTlqLNBAY4kTnOIM57jAJVa4wjVucIs17nCPBzxigyeB77kpxVinfOhj03K0exs7Ur2x1PQxlG0buVtM1RHrfmA+2kwUltPmi2FvpXuWbifdq3Rv0r0oR5yke9c+sA80HY4xav+rY9Exd5S3Y9bJ2zJkUsknqlOmT09f1ccQC1XFtEyq+AMJ8QPRDzuOAA==') format('woff'); } -.do-meditor {position:relative;width:100%;height:100%;min-height:180px;padding-top:41px;border:1px solid nth($cp, 3);background:#fff;color:#666;box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15); +.do-meditor {position:relative;width:100%;height:100%;min-height:180px;padding-top:41px;border:1px solid nth($cp, 3);background:#fff;color:#666; ::-webkit-scrollbar {width:5px;height:5px;background:nth($cp, 2);} ::-webkit-scrollbar:hover {background:nth($cp, 1);}