upgrade editor.md(many bug exists)

This commit is contained in:
gsw945
2024-03-27 16:26:01 +08:00
parent 93441cad0e
commit 8c2c69e433
448 changed files with 43080 additions and 16808 deletions

View File

@@ -4,7 +4,7 @@
* @file table-dialog.js
* @author pandao
* @version 1.2.1
* @updateTime 2015-06-09
* @updateTime 2021-12-02
* {@link https://github.com/pandao/editor.md}
* @license MIT
*/
@@ -78,32 +78,36 @@
var lang = this.lang;
var dialogLang = lang.dialog.table;
var dialogContent = [
"<div class=\"editormd-form\" style=\"padding: 13px 0;\">",
"<label>" + dialogLang.cellsLabel + "</label>",
dialogLang.rows + " <input type=\"number\" value=\"3\" class=\"number-input\" style=\"width:40px;\" max=\"100\" min=\"2\" data-rows />&nbsp;&nbsp;",
dialogLang.cols + " <input type=\"number\" value=\"2\" class=\"number-input\" style=\"width:40px;\" max=\"100\" min=\"1\" data-cols /><br/>",
"<label>" + dialogLang.alignLabel + "</label>",
"<div class=\"fa-btns\"></div>",
"<label>" + dialogLang.cellsLabel + "</label>",
"<div class='form-flex'>",
"<span style=\"margin-right: 8px;\">" + dialogLang.rows + "</span>",
" <input type=\"number\" value=\"3\" class=\"number-input\" style=\"width:50px;\" max=\"100\" min=\"2\" data-rows />&nbsp;&nbsp;",
"<span style=\"margin: 0 8px;\">" + dialogLang.cols + "</span>",
" <input type=\"number\" value=\"2\" class=\"number-input\" style=\"width:50px;\" max=\"100\" min=\"1\" data-cols /><br/>",
"</div>",
"<br>",
"<label>" + dialogLang.alignLabel + "</label>",
"<div class=\"fa-btns\"></div>",
"</div>"
].join("\n");
if (editor.find("." + dialogName).length > 0)
if (editor.find("." + dialogName).length > 0)
{
dialog = editor.find("." + dialogName);
this.dialogShowMask(dialog);
this.dialogLockScreen();
dialog.show();
}
}
else
{
dialog = this.createDialog({
name : dialogName,
title : dialogLang.title,
width : 360,
height : 226,
mask : settings.dialogShowMask,
drag : settings.dialogDraggable,
content : dialogContent,
@@ -127,14 +131,14 @@
right : hrLine + ":"
};
if ( rows > 1 && cols > 0)
if ( rows > 1 && cols > 0)
{
for (var r = 0, len = rows; r < len; r++)
for (var r = 0, len = rows; r < len; r++)
{
var row = [];
var head = [];
for (var c = 0, len2 = cols; c < len2; c++)
for (var c = 0, len2 = cols; c < len2; c++)
{
if (r === 1) {
head.push(alignSign[align]);
@@ -146,7 +150,7 @@
if (r === 1) {
table += "| " + head.join(" | ") + " |" + "\n";
}
table += "| " + row.join( (cols === 1) ? "" : " | " ) + " |" + "\n";
}
}
@@ -158,7 +162,7 @@
return false;
}],
cancel : [lang.buttons.cancel, function() {
cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask();
return false;
@@ -175,7 +179,7 @@
var _lang = dialogLang.aligns;
var values = ["_default", "left", "center", "right"];
for (var i = 0, len = icons.length; i < len; i++)
for (var i = 0, len = icons.length; i < len; i++)
{
var checked = (i === 0) ? " checked=\"checked\"" : "";
var btn = "<a href=\"javascript:;\"><label for=\"editormd-table-dialog-radio"+i+"\" title=\"" + _lang[i] + "\">";
@@ -189,10 +193,10 @@
};
};
// CommonJS/Node.js
if (typeof require === "function" && typeof exports === "object" && typeof module === "object")
{
{
module.exports = factory;
}
else if (typeof define === "function") // AMD/CMD/Sea.js
@@ -209,7 +213,7 @@
factory(editormd);
});
}
}
}
else
{
factory(window.editormd);