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,12 +10,16 @@
/*--------各种按钮---------*/ /*--------各种按钮---------*/
.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} &.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;} &.large {min-width:150px;height:50px;padding:0 13px;line-height:50px;font-size:18px;}
&.radius-3 {border-radius:3px;} &.radius-3 {border-radius:3px;
&.radius-5 {border-radius:5px;} [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 {border:0;background:nth($ct, 1);color:#fff;}
&.teal:hover {background:nth($ct, 2);} &.teal:hover {background:nth($ct, 2);}
@ -44,32 +48,20 @@
&.disabled {border-color:nth($cp, 1);color:nth($cp, 3);cursor:not-allowed;} &.disabled {border-color:nth($cp, 1);color:nth($cp, 3);cursor:not-allowed;}
/* 额外样式 */ /* 额外样式 */
&.medium.with-style, &.medium.with-icon,
&.large.with-style {position:relative;padding-right:43px; &.large.with-icon {position:relative;padding-left:43px;
[class^="do-icon-"], [class*=" do-icon-"] {
&::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;} position:absolute;left:0;top:0;width:35px;font-size:25px;background:rgba(0,0,0,.1);
}
}
&.large.with-icon {padding-left:58px;
[class^="do-icon-"], [class*=" do-icon-"] {
width:50px;font-size:35px;
} }
&.large.with-style {padding-right:58px;
&::after {width:50px;}
} }
&.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,10 +3365,22 @@
delete elem[attr.value] delete elem[attr.value]
} else { } else {
var camelizeName = camelize(name) var camelizeName = camelize(name)
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) ret[camelizeName] = parseData(attr.value)
} }
} }
} }
}
return ret return ret
} }
@ -4015,6 +4027,10 @@
console.error('设置style样式, 请改用 :css指令') console.error('设置style样式, 请改用 :css指令')
continue continue
} }
// 通过属性设置回调,必须以@符号开头
if (typeof obj[i] === 'function' && i.indexOf('@') !== 0) {
continue
}
if (i === 'href' || i === 'src') { if (i === 'href' || i === 'src') {
//处理IE67自动转义的问题 //处理IE67自动转义的问题
if (!root.hasAttribute) obj[i] = obj[i].replace(/&/g, '&') if (!root.hasAttribute) obj[i] = obj[i].replace(/&/g, '&')
@ -4061,7 +4077,7 @@
if (typeof obj[i] === 'object') { if (typeof obj[i] === 'object') {
obj[i] = JSON.stringify(obj[i]) obj[i] = JSON.stringify(obj[i])
} else if (typeof obj[i] === 'function') { } else if (typeof obj[i] === 'function') {
k = '__fn__' + camelize(k) k = ronattr + camelize(k.slice(1))
elem[k] = obj[i].bind(vm) elem[k] = obj[i].bind(vm)
obj[i] = k 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为了避免空行时无法显示 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) { Renderer.prototype.blockquote = function(quote) {
@ -931,7 +931,7 @@ Renderer.prototype.em = function(text) {
Renderer.prototype.codespan = function(txt) { Renderer.prototype.codespan = function(txt) {
txt = txt.replace(/&amp;/g, '&') 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() { Renderer.prototype.br = function() {

View File

@ -5,7 +5,7 @@
* @date 2017-09-29 00:05:45 * @date 2017-09-29 00:05:45
* @version $Id$ * @version $Id$
*/ */
@import "../../../css/var.scss"; @import "var.scss";
.do-marked-theme {position:relative; .do-marked-theme {position:relative;

View File

@ -75,7 +75,6 @@ const fixCont = function(vm, tool) {
} }
return ` return `
<dl class="do-meditor-attach do-meditor__font"> <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"> <dt class="tab-box" :drag="do-layer" data-limit="window">
<span class="item" :class="active:tab === 1" :click="switchTab(1)"> <span class="item" :class="active:tab === 1" :click="switchTab(1)">
${LANG[tool][0]} ${LANG[tool][0]}
@ -259,6 +258,7 @@ function showDialog(elem, vm, tool) {
type: 7, type: 7,
menubar: false, menubar: false,
fixed: true, fixed: true,
maskClose: true,
offset: [offset.top + 40 - $doc.scrollTop()], offset: [offset.top + 40 - $doc.scrollTop()],
shift: { shift: {
top: offset.top - $doc.scrollTop() top: offset.top - $doc.scrollTop()
@ -324,10 +324,7 @@ function showDialog(elem, vm, tool) {
vm.insert(val) vm.insert(val)
this.close() this.close()
}, },
content: fixCont(vm, tool), content: fixCont(vm, tool)
success() {
this.switchTab(3)
}
}) })
} }

View File

@ -15,11 +15,6 @@
::-webkit-scrollbar-thumb {background:nth($cgr, 2);} ::-webkit-scrollbar-thumb {background:nth($cgr, 2);}
::-webkit-scrollbar-thumb:hover {background:nth($cgr, 1);} ::-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; .tab-box {float:left;width:130px;height:300px;padding:10px 5px;text-align:center;background:nth($cp, 2);border-radius:5px;
.item {display:block;width:100%;height:40px;line-height:40px;border-radius:3px;cursor:pointer; .item {display:block;width:100%;height:40px;line-height:40px;border-radius:3px;cursor:pointer;

File diff suppressed because one or more lines are too long