This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

优化meditor样式;框架插件的回调属性回调传递改为须@开头

old
宇天 2018-05-20 17:13:48 +08:00
parent 7dd01665e9
commit bc30db6dfa
7 changed files with 72 additions and 72 deletions

View File

@ -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"}
}
}

View File

@ -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
}

View File

@ -830,7 +830,7 @@ Renderer.prototype.code = function(code, lang, escaped) {
output += '<code class="lang ' + lang + '">' + codes[idx - 1] + '\n</code>' //加\n为了避免空行时无法显示
}
return '<pre :skip class="do-ui-blockcode">' + output + '</pre>'
return '<pre skip class="do-ui-blockcode">' + output + '</pre>'
}
Renderer.prototype.blockquote = function(quote) {
@ -931,7 +931,7 @@ Renderer.prototype.em = function(text) {
Renderer.prototype.codespan = function(txt) {
txt = txt.replace(/&amp;/g, '&')
return '<code :skip class="do-ui-inlinecode">' + txt + '</code>'
return '<code skip class="do-ui-inlinecode">' + txt + '</code>'
}
Renderer.prototype.br = function() {

View File

@ -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;

View File

@ -75,7 +75,6 @@ const fixCont = function(vm, tool) {
}
return `
<dl class="do-meditor-attach do-meditor__font">
<dt :click="close" class="do-icon-close close"></dt>
<dt class="tab-box" :drag="do-layer" data-limit="window">
<span class="item" :class="active:tab === 1" :click="switchTab(1)">
${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)
})
}

View File

@ -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;

File diff suppressed because one or more lines are too long