diff --git a/src/css/meditor.scss b/src/css/meditor.scss
index 49be92d..d93ce8a 100644
--- a/src/css/meditor.scss
+++ b/src/css/meditor.scss
@@ -86,6 +86,14 @@
}
&:active {background:nth($cp, 2)}
}
+.do-meditor__input {width:100%;height:40px;padding:0 10px;background:nth($cp, 1);border:2px solid transparent;border-radius:5px;font-size:13px;@include ts();color: nth($cd, 2);
+
+ &.area {height:120px;padding:5px 10px;resize:none;outline:none;}
+ &:focus {background:#fff;border-color:nth($cd, 2);}
+
+ &::-webkit-input-placeholder {color:nth($cp, 3);}
+
+}
/* 关于编辑器模块*/
@@ -128,7 +136,6 @@
section {width:100%;height: 40px;margin:10px 0;line-height:40px;
- .txt {width:100%;height:40px;padding:0 10px;border:0;border-radius:5px;background:nth($cp, 1);color:nth($cd, 2);font-size:14px;}
.label {float: left;width:50%;}
.submit {float:right;width:30%;}
}
@@ -137,16 +144,18 @@
.do-meditor-codeblock {width:480px;height:auto;
section {display:block;width:100%;height:auto;margin:10px 0;line-height:35px;
- .label {float: left;width:80px;}
- select {float:left;width:200px;height:35px;padding:0 30px 0 10px;border:0;border-radius:0;border-bottom:1px solid nth($cp, 3);background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAMAAABV0m3JAAAADFBMVEUAAAD///+Pj4+JiYkxcGihAAAABHRSTlMAABBwqVQF9wAAADNJREFUeNqlzjEOACAMw8DQ/v/PSE5FFhaEx5usdekBuzRVH0RtCqJYELUFrVjQigX/5jdvzgDh9izlMQAAAABJRU5ErkJggg==) no-repeat right 12px;color:nth($cd, 2);outline:none;appearance: none;@include ts;
-
- &::-ms-expand {display:none;}
+ .select {position:relative;width:200px;height:35px;color:nth($cgr, 1);
- &:focus {box-shadow:0 0 5px nth($ct, 1)}
- }
- textarea {width:100%;height:120px;padding:5px 10px;border:0;border-radius:5px;background:nth($cp, 1);font-size:14px;resize:none;outline:none;color:nth($cd, 2);
-
- &:focus {box-shadow:0 0 5px nth($ct, 1)}
+ select {width:100%;height:100%;padding:5px 13px;line-height:1;background:nth($cp, 1);border-radius:5px;appearance:none;border:2px solid transparent;outline:none;color: nth($cd, 2);font-size:13px;
+
+ &:focus {background:#fff;border-color:nth($cd, 2);}
+ &::-ms-expand {display:none;}
+ &:disabled {border-color:transparent;background:#fff8ed;color:nth($cp, 3)}
+ }
+ .trigon {position:absolute;right:7px;top:0;width:15px;height:35px;padding:7px 0;font-size:12px;text-align:center;
+ i {float:left;width:15px;height:12px;line-height:12px;}
+ i:nth-child(2) {margin-top:-6px;}
+ }
}
.submit {float:right;width:80px;}
}
diff --git a/src/css/meditor__attach.scss b/src/css/meditor__attach.scss
index c52821d..8e043f6 100644
--- a/src/css/meditor__attach.scss
+++ b/src/css/meditor__attach.scss
@@ -34,7 +34,6 @@
.section {display:block;width:100%;height:auto;margin:15px 0;line-height:35px;
- .txt {width:100%;height:45px;padding:0 10px;border:0;border-radius:5px;background:nth($cp, 1);color:nth($cd, 2);font-size:14px;}
.submit {float:right;width:30%;height:45px;line-height:45px;}
}
@@ -52,9 +51,8 @@
.upload-box {width:100%;height:auto;min-height:255px;padding-top:10px;
.thead {width:100%;height:35px;line-height:35px;background:nth($cp, 1);}
- .thead .col {text-align:center;}
- .col {float:left;height:30px;padding:0 5px;}
+ .col {overflow:hidden;float:left;height:30px;padding:0 5px;text-align:center;}
.col:nth-child(1) {width:50%}
.col:nth-child(2) {width:35%}
.col:nth-child(3) {width:15%}
diff --git a/src/layer/index.js b/src/layer/index.js
index c6dbeb8..7cf0490 100644
--- a/src/layer/index.js
+++ b/src/layer/index.js
@@ -12,6 +12,31 @@ import 'css/layer-normal.scss'
Anot.ui.layer = '1.0.0-normal'
+const LANGUAGES = {
+ en: {
+ TITLE: 'Dialog',
+ YES_BTN: 'OK',
+ NO_BTN: 'Cancel',
+ ERROR: 'The layer instance is not exists',
+ NEED_CONTAINER: 'layer "tips" require a DOM object as container'
+ },
+ zh: {
+ TITLE: '提示',
+ YES_BTN: '确定',
+ NO_BTN: '取消',
+ ERROR: '要关闭的layer实例不存在',
+ NEED_CONTAINER: 'tips类型需要指定一个元素节点作为容器'
+ },
+ 'zh-TW': {
+ TITLE: '提示',
+ YES_BTN: '確定',
+ NO_BTN: '取消',
+ ERROR: '要關閉的layer實例不存在',
+ NEED_CONTAINER: 'tips类型需要指定一個元素節點作爲容器'
+ }
+}
+LANGUAGES['zh-CN'] = LANGUAGES.zh
+const lang = LANGUAGES[Anot.language || navigator.language || 'en']
let layerDom = {}
let layerObj = {}
let unique = null // 储存当前打开的1/2/3类型的弹窗
@@ -24,13 +49,13 @@ let defconf = {
maskColor: null, // 遮罩背景色
radius: '0px', // 弹窗圆角半径
area: ['auto', 'auto'],
- title: '提示', // 弹窗主标题(在工具栏上的)
+ title: lang.TITLE, // 弹窗主标题(在工具栏上的)
menubar: true, // 是否显示菜单栏
content: '', // 弹窗的内容
fixed: false, // 是否固定不可拖拽
shift: 'cc', // 弹窗出来的初始位置,用于出场动画
offset: [], // 弹窗出来后的坐标, 为数组,可有4个值,依次是 上右下左
- btns: ['确定', '取消'] // 弹窗的2个按钮的文字
+ btns: [lang.YES_BTN, lang.NO_BTN] // 弹窗的2个按钮的文字
}
const $doc = Anot(document)
const uuid = function() {
@@ -38,7 +63,7 @@ const uuid = function() {
}
const close = function(id) {
if (typeof id !== 'string' && typeof id !== 'number') {
- return Anot.error('要关闭的layer实例不存在')
+ return Anot.error(lang.ERROR)
}
if (/^layerwrap\-/.test(id) || layerObj['layerwrap-' + id]) {
try {
@@ -626,7 +651,7 @@ const _layer = {
},
tips(content, container, opt = {}) {
if (!(container instanceof HTMLElement)) {
- return Anot.error('layer "tips" require a DOM object')
+ return Anot.error(lang.NEED_CONTAINER)
}
if (!opt.background) {
@@ -669,7 +694,7 @@ const _layer = {
if (typeof opt === 'string') {
opt = 'layerwrap-' + opt
if (!layerObj[opt]) {
- throw new Error('layer实例不存在')
+ throw new Error(lang.ERROR)
} else {
//只能显示一个实例
if (layerObj[opt].show) {
@@ -813,7 +838,6 @@ Anot.directive('layer', {
tips.style.visibility = 'hidden'
}, 100)
})
- // _layer.tips(val, this.element)
}
}
})
diff --git a/src/marked/index.js b/src/marked/index.js
index 6d53d92..cb37a37 100644
--- a/src/marked/index.js
+++ b/src/marked/index.js
@@ -726,7 +726,9 @@ InlineLexer.prototype.output = function(src) {
// br
if ((cap = this.rules.br.exec(src))) {
src = src.substring(cap[0].length)
- out += this.renderer.br()
+ if (!/<[\/]?([a-z0-9\-])+[^>]*>/.test(src)) {
+ out += this.renderer.br()
+ }
continue
}
@@ -921,25 +923,24 @@ Renderer.prototype.listitem = function(text) {
}
Renderer.prototype.paragraph = function(text) {
- text = text.replace(/
/g, '').replace(/
<\/p>/g, '') return '
' + text + '
' } Renderer.prototype.table = function(header, body) { return ( - '+ + + ${ + lang.INSERT + } +
+@@ -128,7 +191,9 @@ const fixCont = function(vm, tool) { :text="el.name" :layer-tips="el.name"> - 插入 + ${ + lang.INSERT + }
' + - ' __ __ _____ _ _ _\n' + - '| \\/ | ____|__| (_) |_ ___ _ __\n' + - "| |\\/| | _| / _` | | __/ _ \\| '__|\n" + - '| | | | |__| (_| | | || (_) | |\n' + - '|_| |_|_____\\__,_|_|\\__\\___/|_| ' + - 'v' + - Anot.ui.meditor + - '' + - '
开源在线Markdown编辑器
' + - 'https://doui.cc/product/meditor
' + - 'Copyright © 2017 Yutent, The MIT License.
' + - '+ __ __ _____ _ _ _ +| \\/ | ____|__| (_) |_ ___ _ __ +| |\\/| | _| / _\` | | __/ _ \\| '__| +| | | | |__| (_| | | || (_) | | +|_| |_|_____\\__,_|_|\\__\\___/|_| v${Anot.ui.meditor.version}+
${Anot.ui.meditor.lang.NAME}
+https://doui.cc/product/meditor
+Copyright © 2017 Yutent, The MIT License.
+