Initial commit

This commit is contained in:
2025-06-06 09:07:50 +08:00
commit 7533598830
293 changed files with 111546 additions and 0 deletions
Executable
+6
View File
@@ -0,0 +1,6 @@
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
BIN
View File
Binary file not shown.
Executable
+4
View File
@@ -0,0 +1,4 @@
{
"code": 1,
"msg": "服务端清理缓存成功"
}
+117
View File
@@ -0,0 +1,117 @@
{
"homeInfo": {
"title": "首页",
"name":"home",
"href": "page/welcome-1.html?t=1"
},
"logoInfo": {
"title": "USED CAR",
"image": "assets/images/logo.png",
"href": ""
},
"menuInfo": [
{
"title": "",
"icon": "fa fa-address-book",
"href": "",
"target": "_self",
"child": [
{
"title": "首页",
"name":"home",
"href": "page/welcome-1.html",
"icon": "fa fa-home",
"target": "_self"
},
{
"title": "小程序",
"name":"smallprogram",
"href": "",
"icon": "fa fa-calendar",
"target": "_self",
"child": [
{
"title": "用户管理",
"name":"user",
"href": "page/userList.html",
"icon": "fa fa-user",
"target": "_self"
},
{
"title": "车辆管理",
"name":"car",
"href": "page/carlist.html",
"icon": "fa fa-car",
"target": "_self"
},
{
"title": "审核管理",
"name":"examine",
"href": "page/audit.html",
"icon": "fa fa-file-archive-o",
"target": "_self"
},
{
"title": "品牌管理",
"name":"brand",
"href": "page/brand.html",
"icon": "fa fa-navicon",
"target": "_self"
},
{
"title": "型号管理",
"name":"model",
"href": "page/model.html",
"icon": "fa fa-support",
"target": "_self"
},
{
"title": "能源管理",
"name":"energy",
"href": "page/energy.html",
"icon": "fa fa-cogs",
"target": "_self"
},
{
"title": "类型管理",
"name":"type",
"href": "page/type.html",
"icon": "fa fa-cubes",
"target": "_self"
},
{
"title": "协议管理",
"name":"agreement",
"href": "page/agreement.html",
"icon": "fa fa-file-word-o",
"target": "_self"
},
{
"title": "SEO管理",
"name":"seo",
"href": "page/seo.html",
"icon": "fa fa-file-word-o",
"target": "_self"
}
]
},
{
"title": "通用设置",
"name":"general",
"href": "",
"icon": "fa fa-cog",
"target": "_self",
"child": [
{
"title": "字典设置",
"name":"dictionary",
"href": "page/dict.html",
"icon": "fa fa-file-powerpoint-o",
"target": "_self"
}
]
}
]
}
]
}
Executable
+108
View File
@@ -0,0 +1,108 @@
{
"homeInfo": {
"title": "首页",
"name":"home",
"href": "page/welcome-1.html"
},
"logoInfo": {
"title": "USED CAR",
"image": "assets/images/logo.png",
"href": ""
},
"menuInfo": [
{
"title": "",
"icon": "fa fa-address-book",
"href": "",
"target": "_self",
"child": [
{
"title": "首页",
"name":"home",
"href": "page/welcome-1.html",
"icon": "fa fa-home",
"target": "_self"
},
{
"title": "用户管理",
"name":"user",
"href": "page/userList1.html",
"icon": "fa fa-user",
"target": "_self"
},
{
"title": "车辆管理",
"name": "car",
"href": "",
"icon": "fa fa-calendar",
"target": "_self",
"child": [
{
"title": "二手车",
"name":"usedcar",
"href": "page/carlist.html",
"icon": "fa fa-car",
"target": "_self"
},
{
"title": "新车管理",
"name":"newcar",
"href": "page/newcarlist.html",
"icon": "fa fa-car",
"target": "_self"
}
]
},
{
"title": "审核管理",
"name":"examine",
"href": "page/audit.html",
"icon": "fa fa-file-archive-o",
"target": "_self"
},
{
"title": "品牌管理",
"name":"brand",
"href": "page/brand.html",
"icon": "fa fa-navicon",
"target": "_self"
},
{
"title": "型号管理",
"name":"model",
"href": "page/model.html",
"icon": "fa fa-support",
"target": "_self"
},
{
"title": "能源管理",
"name":"energy",
"href": "page/energy.html",
"icon": "fa fa-cogs",
"target": "_self"
},
{
"title": "类型管理",
"name":"type",
"href": "page/type.html",
"icon": "fa fa-cubes",
"target": "_self"
},
{
"title": "协议管理",
"name":"agreement",
"href": "page/agreement.html",
"icon": "fa fa-file-word-o",
"target": "_self"
},
{
"title": "邮箱管理",
"name":"email",
"href": "page/email.html",
"icon": "fa fa-info-circle",
"target": "_self"
}
]
}
]
}
Executable
+254
View File
@@ -0,0 +1,254 @@
{
"code": 0,
"msg": "",
"count": 19,
"data": [
{
"authorityId": 1,
"authorityName": "系统管理",
"orderNumber": 1,
"menuUrl": null,
"menuIcon": "layui-icon-set",
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 0,
"parentId": -1
},
{
"authorityId": 2,
"authorityName": "用户管理",
"orderNumber": 2,
"menuUrl": "system/user",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 3,
"authorityName": "查询用户",
"orderNumber": 3,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:54:16",
"authority": "user:view",
"checked": 0,
"updateTime": "2018/07/21 13:54:16",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 4,
"authorityName": "添加用户",
"orderNumber": 4,
"menuUrl": null,
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": "user:add",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 5,
"authorityName": "修改用户",
"orderNumber": 5,
"menuUrl": null,
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": "user:edit",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 6,
"authorityName": "删除用户",
"orderNumber": 6,
"menuUrl": null,
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": "user:delete",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 7,
"authorityName": "角色管理",
"orderNumber": 7,
"menuUrl": "system/role",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 8,
"authorityName": "查询角色",
"orderNumber": 8,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:54:59",
"authority": "role:view",
"checked": 0,
"updateTime": "2018/07/21 13:54:58",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 9,
"authorityName": "添加角色",
"orderNumber": 9,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:add",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 10,
"authorityName": "修改角色",
"orderNumber": 10,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:edit",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 11,
"authorityName": "删除角色",
"orderNumber": 11,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:delete",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 12,
"authorityName": "角色权限管理",
"orderNumber": 12,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:auth",
"checked": 0,
"updateTime": "2018/07/13 15:27:18",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 13,
"authorityName": "权限管理",
"orderNumber": 13,
"menuUrl": "system/authorities",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 15:45:13",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 14,
"authorityName": "查询权限",
"orderNumber": 14,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:55:57",
"authority": "authorities:view",
"checked": 0,
"updateTime": "2018/07/21 13:55:56",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 15,
"authorityName": "添加权限",
"orderNumber": 15,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "authorities:add",
"checked": 0,
"updateTime": "2018/06/29 11:05:41",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 16,
"authorityName": "修改权限",
"orderNumber": 16,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/13 09:13:42",
"authority": "authorities:edit",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 17,
"authorityName": "删除权限",
"orderNumber": 17,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "authorities:delete",
"checked": 0,
"updateTime": "2018/06/29 11:05:41",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 18,
"authorityName": "登录日志",
"orderNumber": 18,
"menuUrl": "system/loginRecord",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/06/29 11:05:41",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 19,
"authorityName": "查询登录日志",
"orderNumber": 19,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:56:43",
"authority": "loginRecord:view",
"checked": 0,
"updateTime": "2018/07/21 13:56:43",
"isMenu": 1,
"parentId": 18
}
]
}
Executable
+127
View File
@@ -0,0 +1,127 @@
{
"code": 0,
"msg": "",
"count": 1000,
"data": [
{
"id": 1,
"username": "user-0",
"sex": "女",
"city": "城市-0",
"sign": "签名-0",
"experience": 255,
"logins": 24,
"wealth": 82830700,
"classify": "作家",
"score": 57
},
{
"id": 2,
"username": "user-1",
"sex": "男",
"city": "城市-1",
"sign": "签名-1",
"experience": 884,
"logins": 58,
"wealth": 64928690,
"classify": "词人",
"score": 27
},
{
"id": 3,
"username": "user-2",
"sex": "女",
"city": "城市-2",
"sign": "签名-2",
"experience": 650,
"logins": 77,
"wealth": 6298078,
"classify": "酱油",
"score": 31
},
{
"id": 10003,
"username": "user-3",
"sex": "女",
"city": "城市-3",
"sign": "签名-3",
"experience": 362,
"logins": 157,
"wealth": 37117017,
"classify": "诗人",
"score": 68
},
{
"id": 10004,
"username": "user-4",
"sex": "男",
"city": "城市-4",
"sign": "签名-4",
"experience": 807,
"logins": 51,
"wealth": 76263262,
"classify": "作家",
"score": 6
},
{
"id": 10005,
"username": "user-5",
"sex": "女",
"city": "城市-5",
"sign": "签名-5",
"experience": 173,
"logins": 68,
"wealth": 60344147,
"classify": "作家",
"score": 87
},
{
"id": 10006,
"username": "user-6",
"sex": "女",
"city": "城市-6",
"sign": "签名-6",
"experience": 982,
"logins": 37,
"wealth": 57768166,
"classify": "作家",
"score": 34
},
{
"id": 10007,
"username": "user-7",
"sex": "男",
"city": "城市-7",
"sign": "签名-7",
"experience": 727,
"logins": 150,
"wealth": 82030578,
"classify": "作家",
"score": 28
},
{
"id": 10008,
"username": "user-8",
"sex": "男",
"city": "城市-8",
"sign": "签名-8",
"experience": 951,
"logins": 133,
"wealth": 16503371,
"classify": "词人",
"score": 14
},
{
"id": 10009,
"username": "user-9",
"sex": "女",
"city": "城市-9",
"sign": "签名-9",
"experience": 484,
"logins": 25,
"wealth": 86801934,
"classify": "词人",
"score": 75
}
]
}
+23
View File
@@ -0,0 +1,23 @@
{
"code": 0,
"msg": "",
"count": 16,
"data": [
{ "id":"001", "username":"张玉林", "sex":"女" },
{ "id":"002", "username":"刘晓军", "sex":"男" },
{ "id":"003", "username":"张恒", "sex":"男" },
{ "id":"004", "username":"朱一", "sex":"男" },
{ "id":"005", "username":"刘佳能", "sex":"女" },
{ "id":"006", "username":"晓梅", "sex":"女" },
{ "id":"007", "username":"马冬梅", "sex":"女" },
{ "id":"008", "username":"刘晓庆", "sex":"女" },
{ "id":"009", "username":"刘晓庆", "sex":"女" },
{ "id":"010", "username":"刘晓庆", "sex":"女" },
{ "id":"011", "username":"刘晓庆", "sex":"女" },
{ "id":"012", "username":"刘晓庆", "sex":"女" },
{ "id":"013", "username":"刘晓庆", "sex":"女" },
{ "id":"014", "username":"刘晓庆", "sex":"女" },
{ "id":"015", "username":"刘晓庆", "sex":"女" },
{ "id":"016", "username":"刘晓庆", "sex":"女" }
]
}
+10
View File
@@ -0,0 +1,10 @@
{
"code": 1,
"msg": "上传成功",
"data": {
"url": [
"../images/logo.png",
"../images/captcha.jpg"
]
}
}
+928
View File
@@ -0,0 +1,928 @@
/**
配色方案(如有需要,请自行配置)
*/
/**头部-配色*/
.layui-layout-admin .layui-header {
background-color: #1aa094 !important;
}
.layui-header > ul > .layui-nav-item.layui-this, .layuimini-tool i:hover {
background-color: #197971 !important;
}
.layui-header .layuimini-header-content > ul > .layui-nav-item.layui-this, .layuimini-tool i:hover {
background-color: #197971 !important;
}
/**logo-配色*/
.layui-layout-admin .layuimini-logo {
background-color: #243346 !important;
}
/**左侧-配色*/
.layui-side.layui-bg-black, .layui-side.layui-bg-black > .layuimini-menu-left > ul {
background-color: #2f4056 !important;
}
.layuimini-menu-left .layui-nav .layui-nav-child a:hover:not(.layui-this) {
background-color: #3b3f4b;
}
/**左侧菜单选中-配色*/
.layui-layout-admin .layui-nav-tree .layui-this, .layui-layout-admin .layui-nav-tree .layui-this > a, .layui-layout-admin .layui-nav-tree .layui-nav-child dd.layui-this, .layui-layout-admin .layui-nav-tree .layui-nav-child dd.layui-this a {
background-color: #1aa094 !important;
}
/**头部样式 */
.layui-layout-admin .header {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.layuimini-header-menu, .layui-header {
height: 60px !important;
}
.layuimini-header-menu > .layui-nav-item {
color: #1b1d21;
height: 60px !important;
line-height: 60px !important;
}
.layui-header > .layui-layout-right > .layui-nav-item {
height: 60px !important;
line-height: 60px !important;
}
.layui-layout-left {
left: 295px !important;
}
.layui-nav.layui-layout-left.layuimini-header-menu.layuimini-pc-show {
font-weight: bold;
transition: all .2s;
}
/**logo演示(通用) */
.layui-layout-admin .layuimini-logo {
font-weight: bold;
color: #ffffff !important;
height: 60px !important;
line-height: 60px !important;
overflow: hidden;
line-height: 64px;
transition: all .2s !important;
}
.layui-layout-admin .layuimini-logo img {
display: inline-block;
height: 40px;
vertical-align: middle;
}
.layui-layout-admin .layuimini-logo h1 {
display: inline-block;
margin: 0 0 0 12px;
color: #ffffff;
font-weight: 600;
font-size: 20px;
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
vertical-align: middle;
}
/**缩放工具(通用) */
.layuimini-tool {
position: absolute !important;
top: 0;
left: 235px;
width: 60px;
height: 100%;
line-height: 60px;
text-align: center;
color: #ffffff !important;
transition: all .2s;
}
/**缩放工具(缩放) */
.layuimini-tool i {
display: block;
color: #bbe3df;
width: 32px;
height: 32px;
line-height: 32px;
border-radius: 3px;
text-align: center;
margin-top: 15px;
cursor: pointer;
}
/**tab选项卡 */
.layuimini-tab {
margin: 0px;
overflow: hidden;
height: 100% !important;
}
.layuimini-tab .layui-tab-content {
height: calc(100% - 37px) !important;
}
.layuimini-tab .layui-tab-content .layui-tab-item {
height: 100%;
}
.layuimini-tab .layui-tab-content {
padding: 0px;
}
.layuimini-tab .layui-tab-title {
border: none;
border: 1px solid whitesmoke;
background-color: white;
}
.layuimini-tab .layui-tab-title li {
border-right: 1px solid whitesmoke;
color: dimgray;
}
.layuimini-tab .layui-tab-title .layui-tab-bar {
display: none;
}
.layuimini-tab .layui-tab-title .layui-this:after {
display: none;
}
.layuimini-tab .layui-tab-title .layuimini-tab-active {
display: inline-block;
background-color: lightgray;
width: 9px;
height: 9px;
border-radius: 30px;
margin-right: 5px;
}
.layuimini-tab .layui-tab-title .layui-this .layuimini-tab-active {
background-color: #1aa094;
}
.layuimini-tab > .layui-tab-title, .layuimini-tab > .close-box {
height: 35px !important;
}
.layuimini-tab > .layui-tab-title li, .layuimini-tab > .close-box li {
line-height: 35px !important;
}
.layuimini-tab .layui-tab-title span {
color: #acafb1;
}
.layuimini-tab .layui-tab-title .layui-this span {
color: dimgray;
}
.layuimini-tab .layui-tab-title .layui-tab-close {
font-size: 12px !important;
width: 14px !important;
height: 14px !important;
line-height: 16px !important;
}
.layuimini-tab .layui-tab-title .layui-tab-close:hover {
border-radius: 4em;
background: #ff5722;
}
.layuimini-tab .layui-tab-title .disable-close + .layui-tab-close {
display: none;
}
.layuimini-tab .layui-tab-title .able-close + .layui-tab-close {
display: inline-block;
}
.layuimini-tab .layui-tab-control > li {
position: absolute;
top: 0px;
height: 35px;
line-height: 35px;
width: 35px;
text-align: center;
background-color: white;
border-top: whitesmoke 1px solid;
border-bottom: whitesmoke 1px solid;
}
.layuimini-tab .layuimini-tab-roll-left {
left: 0px;
border-right: whitesmoke 1px solid;
border-left: whitesmoke 1px solid;
}
.layuimini-tab .layuimini-tab-roll-right {
right: 35px;
border-left: 1px solid whitesmoke;
}
.layuimini-tab .layui-tab-tool {
right: 0px;
border-left: 1px solid whitesmoke;
}
.layuimini-tab .layui-tab-control .layui-tab-tool,
.layuimini-tab .layui-tab-control .layuimini-tab-roll-left,
.layuimini-tab .layui-tab-control .layuimini-tab-roll-right {
display: none;
}
.layuimini-tab.layui-tab-roll .layui-tab-control .layuimini-tab-roll-left,
.layuimini-tab.layui-tab-roll .layui-tab-control .layuimini-tab-roll-right {
display: block;
}
.layuimini-tab.layui-tab-roll .layui-tab-control .layuimini-tab-roll-right {
right: 0px;
border-right: 1px solid whitesmoke;
}
.layuimini-tab.layui-tab-roll .layui-tab-title {
padding-left: 35px;
padding-right: 35px;
}
.layuimini-tab.layui-tab-tool .layui-tab-control .layui-tab-tool {
display: block;
}
.layuimini-tab.layui-tab-tool .layui-tab-title {
padding-left: 0px;
padding-right: 35px;
}
.layuimini-tab.layui-tab-rollTool .layui-tab-title {
padding-left: 35px;
padding-right: 80px;
}
.layuimini-tab.layui-tab-rollTool .layui-tab-control .layuimini-tab-roll-left,
.layuimini-tab.layui-tab-rollTool .layui-tab-control .layuimini-tab-roll-right,
.layuimini-tab.layui-tab-rollTool .layui-tab-control .layui-tab-tool {
display: block;
}
.layuimini-tab .layui-tab-tool .layui-nav {
position: absolute;
height: 43px !important;
top: 0;
width: 100%;
height: 100%;
padding: 0;
background: 0 0;
}
.layuimini-tab .layui-tab-tool .layui-nav-item {
height: 35px;
}
.layuimini-tab .layui-tab-tool .layui-nav-bar {
display: none;
}
.layuimini-tab .layui-tab-tool .layui-nav-child {
left: auto;
top: 45px;
right: 3px;
width: 120px;
border: 1px solid whitesmoke;
}
.layuimini-tab .layui-tab-tool .layui-this a {
background-color: #009688;
}
.layuimini-tab-loading {
position: absolute;
display: none;
width: 100%;
height: calc(100% - 37px);
top: 37px;
z-index: 19;
background-color: #fff
}
.layuimini-tab-loading.close {
animation: close 1s;
-webkit-animation: close 1s;
animation-fill-mode: forwards;
}
/**左侧菜单栏 (通用) */
.layui-side.layui-bg-black {
transition: all .2s;
}
.layui-side.layui-bg-black > .layuimini-menu-left > ul {
transition: all .2s;
}
.layui-side.layui-bg-black > .layuimini-menu-left > ul > .layui-nav-item:first-child {
border-top: 1px solid #4b5461;
}
.layuimini-menu-left .layui-nav .layui-nav-item a {
height: 40px;
line-height: 40px;
padding-right: 30px;
}
.layuimini-menu-left .layui-nav .layui-nav-item > a {
padding-top: 5px;
padding-bottom: 5px;
}
.layuimini-menu-left .layui-nav .layui-nav-child .layui-nav-child {
background: 0 0 !important
}
.layuimini-menu-left .layui-nav .layui-nav-more {
right: 15px;
}
.layuimini-menu-left .layui-nav .layui-nav-item a:hover {
background-color: transparent !important;
}
.layuimini-menu-left .layui-nav {
background-color: transparent !important;
}
/**左侧菜单栏 (正常) */
.layui-layout-body .layui-nav-itemed .layui-nav-child a, .layui-layout-body .layuimini-menu-left .layui-nav .layui-nav-child a {
padding-left: 35px;
}
.layui-layout-body .layuimini-menu-left .layui-nav .layui-nav-child .layui-nav-child a {
padding-left: 45px;
}
.layui-layout-body .layuimini-menu-left .layui-nav .layui-nav-child .layui-nav-child .layui-nav-child a {
padding-left: 55px;
}
.layui-layout-body .layuimini-menu-left .layui-nav .layui-nav-child .layui-nav-child .layui-nav-child .layui-nav-child a {
padding-left: 65px;
}
.layui-layout-body .layuimini-menu-left .layui-nav .layui-nav-itemed > .layui-nav-child {
padding: 5px 0;
}
/**内容主体(通用) */
.layui-layout-admin .layui-body {
overflow: hidden;
bottom: 0px !important;
top: 60px !important;
transition: all .2s;
}
/**选择配色方案 */
.layuimini-color .color-title {
padding: 10px 0 10px 20px;
border-bottom: 1px solid #d9dada;
margin-bottom: 8px;
}
.layuimini-color .color-content {
padding: 10px 5px 0 5px;
}
.layuimini-color .color-content ul {
list-style: none;
text-align: center;
}
.layuimini-color .color-content ul li {
position: relative;
display: inline-block;
vertical-align: top;
width: 80px;
height: 50px;
margin: 0 15px 15px 0;
padding: 2px 2px 4px 2px;
background-color: #f2f2f2;
cursor: pointer;
font-size: 12px;
color: #666;
}
.layuimini-color .color-content li.layui-this:after, .layuimini-color .color-content li:hover:after {
width: 100%;
height: 100%;
padding: 4px;
top: -5px;
left: -5px;
border-color: #d8d8d8;
opacity: 1;
}
.layuimini-color .color-content li:after {
content: '';
position: absolute;
z-index: 20;
top: 50%;
left: 50%;
width: 1px;
height: 0;
border: 1px solid #f2f2f2;
transition: all .3s;
-webkit-transition: all .3s;
opacity: 0;
}
/**其它 */
.layui-tab-item {
width: 100% !important;
height: 100% !important;
}
.layui-nav-item.layui-this {
background-color: #1b1d21;
}
.layui-width-height {
width: 100%;
height: 95%;
}
.layui-tab {
margin: 0 0 0 0;
z-index: 99999;
}
.text-center {
height: 30px !important;
line-height: 30px !important;
text-align: center !important;
}
.layui-nav {
padding: 0 !important;
}
.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after {
width: 0 !important;
height: 0 !important;
}
.layui-layout-admin .layui-side {
top: 60px !important;
}
.layui-tab-card {
box-shadow: 0px 0px 0px #888888;
border-bottom: 0;
}
/**自定义滚动条样式 */
::-webkit-scrollbar {
display: none
}
/*移动端遮罩层*/
.layuimini-make {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 1000;
background: rgba(0, 0, 0, .5);
display: none;
}
.layuimini-mini .layui-header {
z-index: 1001;
}
/**初始化加载层*/
.layuimini-loader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #ffffff;
z-index: 999999;
}
.layuimini-loader .layuimini-loader-inner {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 150px;
height: 150px;
margin: -75px 0 0 -75px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #1E9FFF;
animation: spin 2s linear infinite;
}
.layuimini-loader .layuimini-loader-inner:before {
content: "";
position: absolute;
top: 5px;
left: 5px;
right: 5px;
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #1E9FFF;
animation: spin 3s linear infinite;
}
.layuimini-loader .layuimini-loader-inner:after {
content: "";
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #1E9FFF;
animation: spin 1.5s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
to {
transform: rotate(1turn);
}
}
/*系统设置*/
.layuimini-color .layui-word-aux {
position: absolute;
left: 60px;
top: 12px;
font-size: 12px;
}
.layuimini-color .layui-input-block {
margin-left: 15px;
min-height: 36px;
}
.layuimini-color .more-menu-list {
width: 100%;
margin-top: 30px;
}
.layuimini-color .more-menu-item:first-child {
border-top: 1px solid #e8e8e8;
}
.layuimini-color .more-menu-item .layui-icon {
font-size: 18px;
padding-right: 10px;
}
.layuimini-color .more-menu-item {
color: #595959;
height: 50px;
line-height: 50px;
font-size: 16px;
padding: 0 25px;
border-bottom: 1px solid #e8e8e8;
font-style: normal;
display: block;
}
.layuimini-color .more-menu-item:hover {
background-color: whitesmoke;
}
.layuimini-color .more-menu-item:after {
color: #8c8c8c;
right: 16px;
content: "\e602";
position: absolute;
font-family: layui-icon !important;
}
/**
鼠标右键
*/
.layuimini-tab-mousedown {
display: none;
width: 80px;
position: absolute;
top: 0px !important;
left: 0px !important;
}
.layuimini-tab-mousedown dd a {
padding: 0 15px;
color: #484545;
}
.layuimini-tab-make{
position: absolute;
top: 36px;
bottom: 0px;
width: 100%;
background: rgb(255, 255, 255,0);
padding: 0px;
overflow: hidden;
}
/**
菜单缩放
*/
.popup-tips .layui-layer-TipsG{
display: none;
}
.popup-tips.layui-layer-tips .layui-layer-content{
padding: 0;
}
.popup-tips .layui-nav-tree{
width: 150px;
border-radius: 10px;
}
/**左侧菜单字体间距*/
.layuimini-menu-left .layui-nav-item a span {
letter-spacing: 1px;
}
/**头部菜单字体间距*/
.layui-layout-admin .layui-header .layuimini-header-menu.layuimini-pc-show,.layui-layout-admin .layui-header .layuimini-header-menu.layuimini-mobile-show {
letter-spacing: 1px;
}
/**左侧菜单更多下拉样式*/
.layuimini-menu-left .layui-nav-more,.layuimini-menu-left-zoom .layui-nav-more {
top:36%;
font-family: layui-icon !important;
font-size: 12px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
overflow: hidden;
width: auto;
height: auto;
line-height: normal;
border: none;
display: inline-block;
margin-top: -6px !important;
}
.layuimini-menu-left .layui-nav-child .layui-nav-more {
margin-top: -6px !important;
}
.layuimini-menu-left .layui-nav .layui-nav-mored,.layuimini-menu-left .layui-nav-itemed>a .layui-nav-more{
margin-top: -9px!important;
}
.layuimini-menu-left-zoom.layui-nav .layui-nav-mored,.layuimini-menu-left-zoom.layui-nav-itemed>a .layui-nav-more{
margin-top: -9px!important;
}
.layuimini-menu-left .layui-nav-more:before,.layuimini-menu-left-zoom .layui-nav-more:before {
content: "\e61a";
}
.layuimini-menu-left .layui-nav-itemed > a > .layui-nav-more,.layuimini-menu-left-zoom .layui-nav-itemed > a > .layui-nav-more {
transform: rotate(180deg);
-ms-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-o-transform: rotate(180deg);
width: 12px;
text-align: center;
border-style:none;
}
.layuimini-menu-left .layui-nav-itemed > a > .layui-nav-more:before,.layuimini-menu-left-zoom .layui-nav-itemed > a > .layui-nav-more:before {
content: '\e61a';
background-color: transparent;
display: inline-block;
vertical-align: middle;
}
/**修复左侧菜单字体不对齐的问题*/
.layuimini-menu-left .layui-nav-item a .fa,.layuimini-menu-left .layui-nav-item a .layui-icon{
width: 20px;
}
/**
PC版样式
*/
@media screen and (min-width: 1025px) {
/**头部样式(缩放) */
.layuimini-mini .layui-layout-left.layuimini-header-menu.layuimini-pc-show {
left: 155px !important;
}
/**logo演示(缩放) */
.layuimini-mini .layui-layout-admin .layuimini-logo {
width: 60px !important;
}
.layuimini-mini .layui-layout-admin .layuimini-logo h1 {
display: none;
}
/**左侧菜单栏(缩放) */
.layuimini-mini .layuimini-menu-left {
width: 80px !important;
}
.layuimini-mini .layui-side.layui-bg-black, .layuimini-mini .layuimini-menu-left > ul, .layuimini-mini .layuimini-menu-left > ul li i {
width: 60px !important;
}
.layuimini-mini .layuimini-menu-left > ul li span:first-child {
display: none;
}
.layuimini-mini .layuimini-menu-left > ul li span:last-child {
float: right;
right: 7px;
}
.layuimini-mini .layuimini-menu-left .layui-nav .layui-nav-item a {
height: 40px;
line-height: 40px;
padding-right: 0px !important;
}
/**内容主体(缩放) */
.layuimini-mini .layui-layout-admin .layui-body {
left: 60px !important;
}
.layuimini-mini .layuimini-tool {
left: 95px !important;
}
.layuimini-pc-show{
display: block;
}
.layuimini-mobile-show{
display: none;
}
/**菜单缩放*/
.layuimini-mini .layuimini-menu-left .layui-nav-more,.layuimini-mini .layuimini-menu-left .layui-nav-child{
display: none;!important;
}
}
/**
手机自适应样式
*/
@media screen and (max-width: 1024px) {
/**
todo 修复低版本IOS不能滑动问题, 但还是有问题, 低版本IOS部分情况下子页面无法自适应
*/
.layuimini-tab .layui-tab-content .layui-tab-item {
-webkit-overflow-scrolling: touch;
overflow: scroll;
width: 100%;
height: 100%;
}
.layuimini-tab .layui-tab-content .layui-tab-item iframe {
height: 100%;
width: 100%;
}
.layuimini-pc-show{
display: none;
}
.layuimini-mobile-show{
display: block;
}
.layuimini-header-content {
left: 0;
}
.layui-layout-admin .layui-body .layui-tab-item.layui-show {
border-top: 1px solid #e2e2e2;
}
.layuimini-all .layui-layout-left.layuimini-header-menu {
left: 15px !important
}
.layuimini-mini .layui-layout-left.layuimini-header-menu {
left: 205px !important
}
.layui-layout-admin .layui-nav.layui-layout-right > li:not(.layuimini-setting) {
width: 40px !important;
}
.layui-layout-admin .layui-nav.layui-layout-right > li:not(.layuimini-setting) a {
padding: 0 15px;
}
.layuimini-all .layui-layout-admin .layui-body {
left: 0px !important;
}
.layuimini-mini .layui-layout-admin .layuimini-menu-left, .layuimini-mini .layui-header .layuimini-logo {
left: 0;
transition: left .2s;
z-index: 1001 !important;
}
.layuimini-all .layui-layout-admin .layuimini-menu-left, .layuimini-all .layui-header .layuimini-logo {
left: -200px;
transition: left .2s;
top: 0;
z-index: 1002;
}
.layuimini-mini .layui-layout-admin .layui-body {
left: 0!important;
transition: left .2s;
top: 0;
z-index: 998;
}
.layuimini-mini .layuimini-make {
display: block;
}
.layuimini-multi-module .layuimini-header-content .layuimini-tool {
display: none;
}
.layuimini-single-module .layuimini-header-content .layuimini-tool {
left: 15px;
}
.layuimini-mini .layuimini-site-mobile {
display: none !important;
}
.layuimini-site-mobile {
display: block !important;
position: fixed;
z-index: 100000;
bottom: 15px;
left: 15px;
width: 40px;
height: 40px;
line-height: 40px;
border-radius: 2px;
text-align: center;
background-color: rgba(0, 0, 0, .7);
color: #fff;
}
.layuimini-header-content {
z-index: 997;
}
/*修复UC之类的浏览器点击无效*/
.layuimini-make {
cursor: pointer;
}
.layuimini-site-mobile {
cursor: pointer;
}
}
@media screen and (max-width: 550px){
/**头部右侧数据*/
.layuimini-multi-module.layuimini-mini .layuimini-header-content .layui-layout-right {
display: none;
}
}
+118
View File
@@ -0,0 +1,118 @@
body {
margin: 15px 15px 15px 15px;
background: #f2f2f2;
}
.bootm{
text-align: right;
margin: 10px;
}
.more{
display: flex;
justify-content: center;
color: #1890ff;
}
.more i{
font-size: 20px !important;
}
.c-t{
text-align: center;
}
.layuimini-form{
margin: 20px 20px 0px 0px;
}
.layuimini-container {
border: 1px solid #f2f2f2;
border-radius: 5px;
background-color: #ffffff
}
.layuimini-main {
margin: 10px 10px 10px 10px;
}
/**必填红点 */
.layuimini-form > .layui-form-item > .required:after {
content: '*';
color: red;
position: absolute;
margin-left: 4px;
font-weight: bold;
line-height: 1.8em;
top: 6px;
right: 5px;
}
.layuimini-form > .layui-form-item > .layui-form-label {
width: 120px !important;
}
.layuimini-form > .layui-form-item > .layui-input-block {
margin-left: 150px !important;
}
.layuimini-form > .layui-form-item > .layui-input-block > tip {
display: inline-block;
margin-top: 10px;
line-height: 10px;
font-size: 10px;
color: #a29c9c;
}
/**搜索框*/
.layuimini-container .table-search-fieldset {
margin: 0;
border: 1px solid #e6e6e6;
padding: 10px 20px 5px 20px;
color: #6b6b6b;
}
/**自定义滚动条样式 */
::-webkit-scrollbar {
width: 6px;
height: 6px
}
::-webkit-scrollbar-track {
background-color: transparent;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
}
::-webkit-scrollbar-thumb {
background-color: #9c9da0;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em
}
.layadmin-contact-box .edit{
margin-right: 0px;
}
.check,
.show,
.edit {
margin-right: 10px;
}
.check{
color: #FFB800;
}
.show{
color: #009688;
}
.edit{
color: #1890ff;
}
.delete{
color: #FF5722;
}
.red{
color: #FF5722;
}
.orange{
color: #FFB800;
}
.green{
color: #009688;
}
.blue{
color: #1890ff;
}
+95
View File
@@ -0,0 +1,95 @@
/*头部右侧背景色 headerRightBg */
.layui-layout-admin .layui-header {
background-color: #ffffff !important;
}
/*头部右侧选中背景色 headerRightBgThis */
.layui-layout-admin .layui-header .layuimini-header-content > ul > .layui-nav-item.layui-this, .layuimini-tool i:hover {
background-color: #e4e4e4 !important;
}
/*头部右侧字体颜色 headerRightColor */
.layui-layout-admin .layui-header .layui-nav .layui-nav-item a {
color: rgba(107, 107, 107, 0.7);
}
/**头部右侧下拉字体颜色 headerRightChildColor */
.layui-layout-admin .layui-header .layui-nav .layui-nav-item .layui-nav-child a {
color: rgba(107, 107, 107, 0.7) !important;
}
/*头部右侧鼠标选中 headerRightColorThis */
.layui-header .layuimini-menu-header-pc.layui-nav .layui-nav-item a:hover, .layui-header .layuimini-header-menu.layuimini-pc-show.layui-nav .layui-this a {
color: #565656 !important;
}
/*头部右侧更多下拉颜色 headerRightNavMore */
.layui-header .layui-nav .layui-nav-more {
border-top-color: rgba(160, 160, 160, 0.7) !important;
}
/*头部右侧更多下拉颜色 headerRightNavMore */
.layui-header .layui-nav .layui-nav-mored, .layui-header .layui-nav-itemed > a .layui-nav-more {
border-color: transparent transparent rgba(160, 160, 160, 0.7) !important;
}
/**头部右侧更多下拉配置色 headerRightNavMoreBg headerRightNavMoreColor */
.layui-header .layui-nav .layui-nav-child dd.layui-this a, .layui-header .layui-nav-child dd.layui-this, .layui-layout-admin .layui-header .layui-nav .layui-nav-item .layui-nav-child .layui-this a {
background-color: #1E9FFF !important;
color: #ffffff !important;
}
/*头部缩放按钮样式 headerRightToolColor */
.layui-layout-admin .layui-header .layuimini-tool i {
color: #565656;
}
/*logo背景颜色 headerLogoBg */
.layui-layout-admin .layuimini-logo {
background-color: #192027 !important;
}
/*logo字体颜色 headerLogoColor */
.layui-layout-admin .layuimini-logo h1 {
color: rgb(191, 187, 187);
}
/*左侧菜单更多下拉样式 leftMenuNavMore */
.layuimini-menu-left .layui-nav .layui-nav-more, .layuimini-menu-left-zoom.layui-nav .layui-nav-more {
border-top-color: rgb(191, 187, 187);
}
/*左侧菜单更多下拉样式 leftMenuNavMore */
.layuimini-menu-left .layui-nav .layui-nav-mored, .layuimini-menu-left .layui-nav-itemed > a .layui-nav-more, .layuimini-menu-left-zoom.layui-nav .layui-nav-mored, .layuimini-menu-left-zoom.layui-nav-itemed > a .layui-nav-more {
border-color: transparent transparent rgb(191, 187, 187) !important;
}
/*左侧菜单背景 leftMenuBg */
.layui-side.layui-bg-black, .layui-side.layui-bg-black > .layuimini-menu-left > ul, .layuimini-menu-left-zoom > ul {
background-color: #28333E !important;
}
/*左侧菜单选中背景 leftMenuBgThis */
.layuimini-menu-left .layui-nav-tree .layui-this, .layuimini-menu-left .layui-nav-tree .layui-this > a, .layuimini-menu-left .layui-nav-tree .layui-nav-child dd.layui-this, .layuimini-menu-left .layui-nav-tree .layui-nav-child dd.layui-this a, .layuimini-menu-left-zoom.layui-nav-tree .layui-this, .layuimini-menu-left-zoom.layui-nav-tree .layui-this > a, .layuimini-menu-left-zoom.layui-nav-tree .layui-nav-child dd.layui-this, .layuimini-menu-left-zoom.layui-nav-tree .layui-nav-child dd.layui-this a {
background-color: #1E9FFF !important
}
/*左侧菜单子菜单背景 leftMenuChildBg */
.layuimini-menu-left .layui-nav-itemed > .layui-nav-child {
background-color: #0c0f13 !important;
}
/*左侧菜单字体颜色 leftMenuColor */
.layuimini-menu-left .layui-nav .layui-nav-item a, .layuimini-menu-left-zoom.layui-nav .layui-nav-item a {
color: rgb(191, 187, 187) !important;
}
/*左侧菜单选中字体颜色 leftMenuColorThis */
.layuimini-menu-left .layui-nav .layui-nav-item a:hover, .layuimini-menu-left .layui-nav .layui-this a, .layuimini-menu-left-zoom.layui-nav .layui-nav-item a:hover, .layuimini-menu-left-zoom.layui-nav .layui-this a {
color: #ffffff !important;
}
/**tab选项卡选中颜色 tabActiveColor */
.layuimini-tab .layui-tab-title .layui-this .layuimini-tab-active {
background-color: #1e9fff;
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 671 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

+216
View File
@@ -0,0 +1,216 @@
layui.use(['form','table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
// 获取当前语言
var currentLang = localStorage.getItem('language') || 'zh';
var lang = langConfig[currentLang];
var operationBar = $('#currentTableBar').html();
if (operationBar) {
var newHtml = operationBar
.replace(/编辑/g, lang.carlist.operations.edit)
.replace(/删除/g, lang.carlist.operations.delete)
$('#currentTableBar').html(newHtml);
}
var toolbarDemo = $('#toolbarDemo').html();
if (toolbarDemo) {
var newHtmlt = toolbarDemo
.replace(/添加/g, lang.userlist.add)
$('#toolbarDemo').html(newHtmlt);
}
var tableInitb=table.render({
elem: '#currentTableId',
url: lang.baseUrl+'console/agt/list',
headers: {
Authorization: sessionStorage.tokencar,
lang:localStorage.getItem('language')?localStorage.getItem('language'):"zh"
},
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
parseData: function(res) { //res 即为原始返回的数据
console.log(res)
return {
"code": 0, //解析接口状态
"msg": 'message', //解析提示文本
"count": res.data.meta.total, //解析数据长度
"data": res.data.list //解析数据列表
};
},
cols: [[
{type: "checkbox"},
{field: 'id', title: 'ID', sort: true},
{field: 'key', title: lang.alllist.agtype,
templet: function(d){
var v=''
if(d.key=='privacy'){
v=lang.alllist.privacy
}
if(d.key=='user'){
v=lang.alllist.user
}
return v
}
},
{field: 'content', title: lang.alllist.title},
{field: 'title',title: lang.alllist.content},
{field: 'status', title:lang.alllist.status,
templet: function(d){
var v=''
if(d.status==1){
v='<span class="layui-badge layui-bg-green">'+lang.alllist.status2+'</span>'
}
if(d.status==0){
v='<span class="layui-badge">'+lang.alllist.status2+'</span>'
}
return v
},
},
{field: 'sort', title: lang.alllist.sort},
{field: 'created_at',title: lang.alllist.create_time},
{field: 'updated_at',title: lang.alllist.update_time},
{title: lang.alllist.operation, minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
skin: 'line',
done: function(res, curr, count){
window.i18n.updatePageContent();
}
});
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
var result = JSON.stringify(data.field);
table.reload('currentTableId', {
page: {
curr: 1
}
, where: {
key: data.field.key,
status: data.field.status,
title: data.field.title,
}
}, 'data');
return false;
});
/**
* toolbar监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: lang.userlist.add,
type: 2,
maxmin: true,
area: ['70%', '90%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/agreementadd.html',
yes: function (index, layero) {
var iframeWindow = window['layui-layer-iframe' + index]
, submitID = 'saveBtn'
, submit = layero.find('iframe').contents().find('#' + submitID);
//监听提交
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
var field = data.field; //获取提交的字段
self.agtadd({
type: 'post',
data: data.field,
successCallBack: function (result) {
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function (result) {
alert(result.message);
}
})
console.log(field)
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
var checkStatus = table.checkStatus('currentTableId')
, data = checkStatus.data;
layer.alert(JSON.stringify(data));
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
var index = layer.open({
title:lang.audit.edit_title,
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '90%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/agreementedit.html?id='+data.id,
yes: function(index, layero){
var iframeWindow = window['layui-layer-iframe'+ index]
,submitID = 'saveBtn'
,submit = layero.find('iframe').contents().find('#'+ submitID);
//监听提交
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
var field = data.field; //获取提交的字段
self.agtupdate({
type:'post',
data:data.field,
successCallBack: function(result){
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
}
})
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
return false;
} else if (obj.event === 'delete') {
layer.confirm(lang.audit.confirm_delete, function(index) {
self.agtdelete({
type:'post',
data:{id:data.id},
successCallBack: function(result){
layer.msg(result.message, {
icon: 1,
time: 1000
});
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
window.location.reload()
}
})
});
}
});
});
+232
View File
@@ -0,0 +1,232 @@
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
// 获取当前语言
var currentLang = localStorage.getItem('language') || 'zh';
var lang = langConfig[currentLang];
var operationBar = $('#currentTableBar').html();
if (operationBar) {
var newHtml = operationBar
.replace(/删除/g, lang.carlist.operations.delete)
.replace(/审核/g, lang.carlist.operations.check)
.replace(/详情/g, lang.carlist.operations.show)
.replace(/Delete/g, lang.carlist.operations.delete)
.replace(/Check/g, lang.carlist.operations.check)
.replace(/Details/g, lang.carlist.operations.show);
$('#currentTableBar').html(newHtml);
}
var toolbarDemo = $('#toolbarDemo').html();
if (toolbarDemo) {
var newHtmlt = toolbarDemo
.replace(/全部/g, lang.audit.all)
.replace(/待审核/g, lang.audit.applied)
.replace(/已审核/g, lang.audit.not_applied)
$('#toolbarDemo').html(newHtmlt);
}
var tableInitb = table.render({
elem: '#currentTableId',
url: lang.baseUrl+'console/apply/list',
headers: {
Authorization: sessionStorage.tokencar,
lang:localStorage.getItem('language')?localStorage.getItem('language'):"zh"
},
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
parseData: function(res) { //res 即为原始返回的数据
console.log(res)
return {
"code": 0, //解析接口状态
"msg": 'message', //解析提示文本
"count": res.data.meta.total, //解析数据长度
"data": res.data.list //解析数据列表
};
},
cols: [[
{type: "checkbox"},
{field: 'id',title:"ID", sort: true},
// {field: 'admin_name',minWidth: 100, title: lang.audit.admin_name},
{field: 'name',minWidth: 100, title: lang.audit.product_name},
{field: 'desc',minWidth: 150, title: lang.audit.audit_desc,
templet: function (d) {
var v=''
if(d.apply_status==0){
v=''
}else{
v=d.desc
}
return v
}
},
{field: 'apply_status', title: lang.audit.status,
templet: function (d) {
var v=''
if(d.apply_status==0){
v='<span class="layui-badge layui-bg-orange">' + lang.audit.pending_review + '</span>'
}
if(d.apply_status==1){
v='<span class="layui-badge layui-bg-blue">' + lang.audit.approved + '</span>'
}
if(d.apply_status==2){
v='<span class="layui-badge">' + lang.audit.rejected + '</span>'
}
return v
}
},
{field: 'created_at',minWidth: 150,title: lang.audit.create_time},
{field: 'updated_at',minWidth: 150,title: lang.audit.update_time},
{title:lang.audit.operation, minWidth: 200, toolbar: '#currentTableBar', align: "center",fixed:'right'}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
skin: 'line',
done: function(res, curr, count){
window.i18n.updatePageContent();
}
});
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
//执行搜索重载
table.reload('currentTableId', {
page: {
curr: 1
}
, where: {
vehicle_data_name: data.field.vehicle_data_name
}
}, 'data');
return false;
});
/**
* toolbar监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'all') { // 监听添加操作
table.reload('currentTableId', {
page: {
curr: 1
}
, where: {
apply_status:''
}
}, 'data');
} else if (obj.event === 'apply') {
table.reload('currentTableId', {
page: {
curr: 1
}
, where: {
apply_status: 1
}
}, 'data');
} else if (obj.event === 'noapply') {
table.reload('currentTableId', {
page: {
curr: 1
}
, where: {
apply_status: 0
}
}, 'data');
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
var index = layer.open({
title: lang.audit.edit_title,
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '90%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/carlistedit.html?id='+data.id,
});
$(window).on("resize", function () {
layer.full(index);
});
return false;
} else if (obj.event === 'delete') {
layer.confirm(lang.audit.confirm_delete, function(index) {
self.applydelete({
type:'post',
data:{id:data.id},
successCallBack: function(result){
layer.msg(result.message, {
icon: 1,
time: 1000
});
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
window.location.reload()
}
})
});
} else if (obj.event === 'check') { // 监听删除操作
var index = layer.open({
title: lang.audit.check,
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: false,
area: ['60%', '85%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/auditcheck.html?id='+data.id+'&vehicle_data_id='+data.vehicle_data_id,
yes: function (index, layero) {
var iframeWindow = window['layui-layer-iframe' + index]
, submitID = 'saveBtn'
, submit = layero.find('iframe').contents().find('#' + submitID);
//监听提交
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
var field = data.field; //获取提交的字段
self.applydo({
type: 'post',
data: data.field,
successCallBack: function (result) {
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function (result) {
alert(result.message);
}
})
console.log(field)
});
submit.trigger('click');
}
});
} else if (obj.event === 'show') { // 监听删除操作
var index = layer.open({
title: lang.audit.show,
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: false,
area: ['60%', '85%'],
content: '../page/table/auditshow.html?id='+data.id
});
}
});
});
+254
View File
@@ -0,0 +1,254 @@
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
// 获取当前语言
var currentLang = localStorage.getItem('language') || 'zh';
var lang = langConfig[currentLang];
var operationBar = $('#currentTableBar').html();
if (operationBar) {
var newHtml = operationBar
.replace(/编辑/g, lang.carlist.operations.edit)
.replace(/删除/g, lang.carlist.operations.delete)
$('#currentTableBar').html(newHtml);
}
var toolbarDemo = $('#toolbarDemo').html();
if (toolbarDemo) {
var newHtmlt = toolbarDemo
.replace(/添加/g, lang.userlist.add)
$('#toolbarDemo').html(newHtmlt);
}
var tableInitb = table.render({
elem: '#currentTableId',
url: lang.baseUrl+'console/brand/list',
headers: {
Authorization: sessionStorage.tokencar,
lang:localStorage.getItem('language')?localStorage.getItem('language'):"zh"
},
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
parseData: function(res) { //res 即为原始返回的数据
console.log(res)
return {
"code": 0, //解析接口状态
"msg": 'message', //解析提示文本
"count": res.data.meta.total, //解析数据长度
"data": res.data.list //解析数据列表
};
},
cols: [[
{type: "checkbox"},
{field: 'id', title: 'ID', sort: true},
{field: 'name', title: lang.alllist.name},
{field: 'cover', minWidth: 100,title: lang.alllist.logo,
templet: function(d){
var img= '<img style="display: inline-block;max-width:40px;max-height:40px" lay-src="'+d.logo_full+'" src="'+d.logo_full+'">'
return img;
}
},
{field: 'status',title: lang.alllist.status,
// templet: function(d){
// var img= '<input type="checkbox" checked="" name="open" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">'
// return img;
// },
templet: function (d) {
form.on("switch(status)", function (data) {
let load = layer.load();
let postData = {};
postData.status = data.elem.checked ? 1 : 0;
postData.id = d.id;
postData.name = d.name;
self.brandupdate({
type:'post',
data: postData,
successCallBack: function (result) {
layer.msg(result.message)
layer.close(load);
},
failCallBack: function (result) {
layer.msg(result.message)
layer.closeAll('loading');
tableInitb.reload()
}
})
});
let checked = d['status'] === 1 ? "checked" : "";
return '<input type="checkbox" value="'+d.status+'" lay-filter="status" lay-skin="switch" lay-text="" '+checked+'/>';
}
},
{field: 'sort', title: lang.alllist.is_hot,
templet: function (d) {
var v=''
if(d.is_hot==0){
v='<span>'+lang.alllist.no+'</span>'
}
if(d.is_hot==1){
v='<span class="red">'+lang.alllist.yes+'</span>'
}
return v
}
},
{field: 'created_at',title: lang.alllist.create_time},
{field: 'updated_at',title: lang.alllist.update_time},
{title: lang.alllist.operation, minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
skin: 'line',
done: function(res, curr, count){
// 表格渲染完成后绑定图片点击事件
$('img[lay-src]').on('click', function(){
var imgSrc = $(this).attr('lay-src');
layer.photos({
photos: {
"data": [{
"src": imgSrc
}]
},
anim: 5
});
});
window.i18n.updatePageContent();
},
});
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
var result = JSON.stringify(data.field);
table.reload('currentTableId', {
page: {
curr: 1
}
, where: {
name: data.field.name,
status: data.field.status,
}
}, 'data');
return false;
});
/**
* toolbar监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: lang.userlist.add,
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '80%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/brandadd.html',
yes: function (index, layero) {
var iframeWindow = window['layui-layer-iframe' + index]
, submitID = 'saveBtn'
, submit = layero.find('iframe').contents().find('#' + submitID);
//监听提交
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
var field = data.field; //获取提交的字段
var datas = transformData(field)
self.brandadd({
type: 'post',
data: datas,
successCallBack: function (result) {
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function (result) {
alert(result.message);
}
})
console.log(field)
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
var checkStatus = table.checkStatus('currentTableId')
, data = checkStatus.data;
layer.alert(JSON.stringify(data));
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
var index = layer.open({
title: lang.audit.edit_title,
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '80%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/brandedit.html?id='+data.id,
yes: function(index, layero){
var iframeWindow = window['layui-layer-iframe'+ index]
,submitID = 'saveBtn'
,submit = layero.find('iframe').contents().find('#'+ submitID);
//监听提交
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
var field = data.field; //获取提交的字段
var datas = transformDataalledt(field,'brand')
console.log(datas)
self.brandupdate({
type:'post',
data:datas,
successCallBack: function(result){
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
}
})
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
return false;
}else if (obj.event === 'delete') {
layer.confirm(lang.audit.confirm_delete, function(index) {
self.branddelete({
type:'post',
data:{id:data.id},
successCallBack: function(result){
layer.msg(result.message, {
icon: 1,
time: 1000
});
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
window.location.reload()
}
})
});
}
});
});
+310
View File
@@ -0,0 +1,310 @@
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
brandpresetfn(form)
typespresetfn(form)
energypresetfn(form)
// 获取当前语言
var currentLang = localStorage.getItem('language') || 'zh';
var lang = langConfig[currentLang];
var operationBar = $('#currentTableBar').html();
if (operationBar) {
var newHtml = operationBar
.replace(/编辑/g, lang.carlist.operations.edit)
.replace(/删除/g, lang.carlist.operations.delete)
.replace(/审核/g, lang.carlist.operations.check)
.replace(/详情/g, lang.carlist.operations.show)
.replace(/Edit/g, lang.carlist.operations.edit)
.replace(/Delete/g, lang.carlist.operations.delete)
.replace(/Check/g, lang.carlist.operations.check)
.replace(/Details/g, lang.carlist.operations.show);
$('#currentTableBar').html(newHtml);
}
var toolbarDemo = $('#toolbarDemo').html();
if (toolbarDemo) {
var newHtmlt = toolbarDemo
.replace(/添加/g, lang.userlist.add)
$('#toolbarDemo').html(newHtmlt);
}
console.log(lang.carlist.operation)
var tableInitb = table.render({
elem: '#currentTableId',
url: lang.baseUrl+'console/vehicle/data/list',
headers: {
Authorization: sessionStorage.tokencar,
lang:localStorage.getItem('language')?localStorage.getItem('language'):"zh"
},
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
parseData: function(res) { //res 即为原始返回的数据
console.log(res)
return {
"code": 0, //解析接口状态
"msg": 'message', //解析提示文本
"count": res.data.meta.total, //解析数据长度
"data": res.data.list //解析数据列表
};
},
cols: [[
{type: "checkbox"},
{field: 'id', title: lang.carlist.ID, sort: true},
{field: 'user_nickname',minWidth: 100, title: lang.carlist.user},
{field: 'name',minWidth: 100, title: lang.carlist.product_name},
{field: 'vin',minWidth: 100, title: lang.carlist.VIN},
{field: 'cover', minWidth: 100,title: lang.carlist.product_image,
templet: function(d){
var img= '<img style="display: inline-block;max-width:40px;max-height:40px" lay-src="'+d.cover+'" src="'+d.cover+'">'
return img;
}
},
{field: 'brand', title: lang.carlist.brand,},
{field: 'price', title: lang.carlist.price},
{field: 'type',title: lang.carlist.type,},
{field: 'energy', title: lang.carlist.energy},
{field: 'mileage', title: lang.carlist.mileage},
{field: 'vehicle_age',title: lang.carlist.vehicle_age},
{field: 'condition_desc',minWidth: 150, title: lang.carlist.condition_desc},
// {field: 'info_status', title: lang.carlist.status,
// templet: function (d) {
// var v=''
// if(d.info_status==0){
// v='<span class="layui-badge layui-bg-orange">'+lang.carlist.pending_review+'</span>'
// }
// if(d.info_status==1){
// v='<span class="layui-badge layui-bg-blue">'+lang.carlist.pending_publish+'</span>'
// }
// if(d.info_status==2){
// v='<span class="layui-badge">'+lang.carlist.rejected+'</span>'
// }
// return v
// }
// },
{field: 'is_saled', title: lang.carlist.is_sold,
templet: function (d) {
var v=''
if(d.is_saled==0){
v='<span class="orange">'+lang.carlist.not_sold+'</span>'
}
if(d.info_status==1){
v='<span class="green">'+lang.carlist.sold+'</span>'
}
return v
}
},
{field: 'created_at',minWidth: 150,title: lang.carlist.create_time},
// {field: 'updated_at',minWidth: 150,title: '更新时间'},
{title: lang.carlist.operation, minWidth: 200, toolbar: '#currentTableBar', align: "center",fixed:'right'}
]],
done: function(res, curr, count){
// 表格渲染完成后绑定图片点击事件
$('img[lay-src]').on('click', function(){
var imgSrc = $(this).attr('lay-src');
layer.photos({
photos: {
"data": [{
"src": imgSrc
}]
},
anim: 5
});
});
window.i18n.updatePageContent();
},
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
skin: 'line',
lang: localStorage.getItem('language'),
// 添加分页相关的多语言配置
});
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
//执行搜索重载
console.log(data.field)
table.reload('currentTableId', {
page: {
curr: 1
}
, where: {
"userInfo.nickname_like":data.field.nickname_like,
"name_like":data.field.name_like,
"brand":data.field.brand,
"type":data.field.type,
"energy":data.field.energy,
"is_saled":data.field.is_saled
}
}, 'data');
return false;
});
/**
* toolbar监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: lang.userlist.add,
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '90%'],
btn: [lang.audit.confirm, lang.audit.cancel],
// content: '../page/table/carlistadd.html',
content: '../page/table/carlistadd.html',
yes: function (index, layero) {
var iframeWindow = window['layui-layer-iframe' + index]
, submitID = 'saveBtn'
, submit = layero.find('iframe').contents().find('#' + submitID);
//监听提交
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
var field = data.field; //获取提交的字段
self.vehicleadd({
type: 'post',
data: data.field,
successCallBack: function (result) {
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function (result) {
alert(result.message);
}
})
console.log(field)
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
var checkStatus = table.checkStatus('currentTableId')
, data = checkStatus.data;
layer.alert(JSON.stringify(data));
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
var index = layer.open({
title:lang.audit.edit_title,
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '90%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/carlistedit.html?id='+data.id,
yes: function(index, layero){
var iframeWindow = window['layui-layer-iframe'+ index]
,submitID = 'saveBtn'
,submit = layero.find('iframe').contents().find('#'+ submitID);
//监听提交
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
var field = data.field; //获取提交的字段
console.log(field)
self.vehicleupdate({
type:'post',
data:data.field,
successCallBack: function(result){
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
}
})
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
return false;
} else if (obj.event === 'delete') {
layer.confirm(lang.audit.confirm_delete, function(index) {
self.vehicledelete({
type:'post',
data:{id:data.id},
successCallBack: function(result){
layer.msg(result.message, {
icon: 1,
time: 1000
});
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
window.location.reload()
}
})
});
} else if (obj.event === 'check') { // 监听删除操作
var index = layer.open({
title:lang.audit.check,
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: false,
area: ['60%', '85%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/carlistcheck.html?id='+data.id,
yes: function (index, layero) {
var iframeWindow = window['layui-layer-iframe' + index]
, submitID = 'saveBtn'
, submit = layero.find('iframe').contents().find('#' + submitID);
//监听提交
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
var field = data.field; //获取提交的字段
self.vehicleapply({
type: 'post',
data: data.field,
successCallBack: function (result) {
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function (result) {
alert(result.message);
}
})
console.log(field)
});
submit.trigger('click');
}
});
} else if (obj.event === 'show') { // 监听删除操作
var index = layer.open({
title: lang.audit.show,
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: false,
area: ['60%', '85%'],
content: '../page/table/carlistshow.html?id='+data.id
});
}
});
});
+183
View File
@@ -0,0 +1,183 @@
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
var tableInitb = table.render({
elem: '#currentTableId',
url: 'console/brand/list',
headers: {
Authorization: sessionStorage.tokencar,
lang:localStorage.getItem('language')?localStorage.getItem('language'):"zh"
},
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
parseData: function(res) { //res 即为原始返回的数据
console.log(res)
return {
"code": 0, //解析接口状态
"msg": 'message', //解析提示文本
"count": res.data.meta.total, //解析数据长度
"data": res.data.list //解析数据列表
};
},
cols: [[
{type: "checkbox"},
{field: 'id', title: 'ID',width:80, sort: true},
{field: 'name', width:80,title: '名称'},
{field: 'status',title: '值',
templet: function (d) {
var value= '[{"value":"0","name":"女"},{"value":"1","name":"男"}]'
const dicts = JSON.parse(value)
return dicts.map(dict => `<span class="layui-badge layui-bg-blue">${dict.name}: ${dict.value}</span>`).join(' ');
},
},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
skin: 'line'
});
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
var result = JSON.stringify(data.field);
layer.alert(result, {
title: '最终的搜索信息'
});
//执行搜索重载
table.reload('currentTableId', {
page: {
curr: 1
}
, where: {
searchParams: result
}
}, 'data');
return false;
});
/**
* toolbar监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: '添加',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '80%'],
btn: ['确定', '取消'],
content: '../page/table/dictadd.html',
yes: function (index, layero) {
var iframeWindow = window['layui-layer-iframe' + index]
, submitID = 'saveBtn'
, submit = layero.find('iframe').contents().find('#' + submitID);
//监听提交
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
var field = data.field; //获取提交的字段
// self.brandadd({
// type: 'post',
// data: data.field,
// successCallBack: function (result) {
// layer.msg(result.message)
// layer.close(index); //关闭弹层
// tableInitb.reload()
// },
// failCallBack: function (result) {
// alert(result.message);
// }
// })
console.log(field)
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
var checkStatus = table.checkStatus('currentTableId')
, data = checkStatus.data;
layer.alert(JSON.stringify(data));
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
var index = layer.open({
title: '编辑',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '80%'],
btn: ['确定', '取消'],
content: '../page/table/dictedit.html?id='+data.id,
yes: function(index, layero){
var iframeWindow = window['layui-layer-iframe'+ index]
,submitID = 'saveBtn'
,submit = layero.find('iframe').contents().find('#'+ submitID);
//监听提交
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
var field = data.field; //获取提交的字段
console.log(field)
// self.brandupdate({
// type:'post',
// data:data.field,
// successCallBack: function(result){
// layer.msg(result.message)
// layer.close(index); //关闭弹层
// tableInitb.reload()
// },
// failCallBack: function(result){
// alert(result.message);
// }
// })
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
return false;
}else if (obj.event === 'delete') {
layer.confirm('确认删除么?', function(index) {
self.branddelete({
type:'post',
data:{id:data.id},
successCallBack: function(result){
layer.msg(result.message, {
icon: 1,
time: 1000
});
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
window.location.reload()
}
})
});
}
});
});
+193
View File
@@ -0,0 +1,193 @@
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
// 获取当前语言
var currentLang = localStorage.getItem('language') || 'zh';
var lang = langConfig[currentLang];
var tableInitb = table.render({
elem: '#currentTableId',
url: lang.baseUrl+'console/email/subscribe',
headers: {
Authorization: sessionStorage.tokencar,
lang:localStorage.getItem('language')?localStorage.getItem('language'):"zh"
},
// toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
parseData: function(res) { //res 即为原始返回的数据
console.log(res)
return {
"code": 0, //解析接口状态
"msg": 'message', //解析提示文本
"count": res.data.meta.total, //解析数据长度
"data": res.data.list //解析数据列表
};
},
cols: [[
{type: "checkbox"},
{field: 'id', title: 'ID', sort: true},
{field: 'email', title:lang.email.name},
{field: 'ip', minWidth: 100,title: lang.email.ip},
{field: 'created_at',title: lang.alllist.create_time},
{field: 'updated_at',title: lang.alllist.update_time},
// {title: lang.alllist.operation, minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
done: function(){
// 表格渲染完成后绑定图片点击事件
$('img[lay-src]').on('click', function(){
var imgSrc = $(this).attr('lay-src');
layer.photos({
photos: {
"data": [{
"src": imgSrc
}]
},
anim: 5
});
});
},
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
skin: 'line',
done: function(res, curr, count){
window.i18n.updatePageContent();
}
});
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
var result = JSON.stringify(data.field);
table.reload('currentTableId', {
page: {
curr: 1
}
, where: {
name: data.field.name,
status: data.field.status,
}
}, 'data');
return false;
});
/**
* toolbar监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: lang.userlist.add,
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '80%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/typeadd.html',
yes: function (index, layero) {
var iframeWindow = window['layui-layer-iframe' + index]
, submitID = 'saveBtn'
, submit = layero.find('iframe').contents().find('#' + submitID);
//监听提交
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
var field = data.field; //获取提交的字段
self.typesadd({
type: 'post',
data: data.field,
successCallBack: function (result) {
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function (result) {
alert(result.message);
}
})
console.log(field)
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
var checkStatus = table.checkStatus('currentTableId')
, data = checkStatus.data;
layer.alert(JSON.stringify(data));
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
var index = layer.open({
title: lang.audit.edit_title,
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '80%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/typeedit.html?id='+data.id,
yes: function(index, layero){
var iframeWindow = window['layui-layer-iframe'+ index]
,submitID = 'saveBtn'
,submit = layero.find('iframe').contents().find('#'+ submitID);
//监听提交
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
var field = data.field; //获取提交的字段
self.typesupdate({
type:'post',
data:data.field,
successCallBack: function(result){
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
}
})
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
return false;
}else if (obj.event === 'delete') {
layer.confirm(lang.audit.confirm_delete, function(index) {
self.typesdelete({
type:'post',
data:{id:data.id},
successCallBack: function(result){
layer.msg(result.message, {
icon: 1,
time: 1000
});
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
window.location.reload()
}
})
});
}
});
});
+223
View File
@@ -0,0 +1,223 @@
layui.use(['form', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
table = layui.table;
// 获取当前语言
var currentLang = localStorage.getItem('language') || 'zh';
var lang = langConfig[currentLang];
var operationBar = $('#currentTableBar').html();
if (operationBar) {
var newHtml = operationBar
.replace(/编辑/g, lang.carlist.operations.edit)
.replace(/删除/g, lang.carlist.operations.delete)
$('#currentTableBar').html(newHtml);
}
var toolbarDemo = $('#toolbarDemo').html();
if (toolbarDemo) {
var newHtmlt = toolbarDemo
.replace(/添加/g, lang.userlist.add)
$('#toolbarDemo').html(newHtmlt);
}
var tableInitb = table.render({
elem: '#currentTableId',
url: lang.baseUrl+'console/energy/list',
headers: {
Authorization: sessionStorage.tokencar,
lang:localStorage.getItem('language')?localStorage.getItem('language'):"zh"
},
toolbar: '#toolbarDemo',
defaultToolbar: ['filter', 'exports', 'print', {
title: '提示',
layEvent: 'LAYTABLE_TIPS',
icon: 'layui-icon-tips'
}],
parseData: function(res) { //res 即为原始返回的数据
console.log(res)
return {
"code": 0, //解析接口状态
"msg": 'message', //解析提示文本
"count": res.data.meta.total, //解析数据长度
"data": res.data.list //解析数据列表
};
},
cols: [[
{type: "checkbox"},
{field: 'id', title: 'ID', sort: true},
{field: 'name', title: lang.alllist.name},
{field: 'status',title:lang.alllist.status,
// templet: function(d){
// var img= '<input type="checkbox" checked="" name="open" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">'
// return img;
// },
templet: function (d) {
form.on("switch(status)", function (data) {
let load = layer.load();
let postData = {};
postData.status = data.elem.checked ? 1 : 0;
postData.id = d.id;
postData.name = d.name;
self.brandupdate({
type:'post',
data: postData,
successCallBack: function (result) {
layer.msg(result.message)
layer.close(load);
},
failCallBack: function (result) {
layer.msg(result.message)
layer.closeAll('loading');
tableInitb.reload()
}
})
});
let checked = d['status'] === 1 ? "checked" : "";
return '<input type="checkbox" value="'+d.status+'" lay-filter="status" lay-skin="switch" lay-text="" '+checked+'/>';
}
},
{field: 'sort', title: lang.alllist.sort},
{field: 'created_at',title: lang.alllist.create_time},
{field: 'updated_at',title: lang.alllist.update_time},
{title: lang.alllist.operation, minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]],
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
page: true,
skin: 'line',
done: function(res, curr, count){
window.i18n.updatePageContent();
}
});
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
var result = JSON.stringify(data.field);
table.reload('currentTableId', {
page: {
curr: 1
}
, where: {
name: data.field.name,
status: data.field.status,
}
}, 'data');
return false;
});
/**
* toolbar监听事件
*/
table.on('toolbar(currentTableFilter)', function (obj) {
if (obj.event === 'add') { // 监听添加操作
var index = layer.open({
title: lang.userlist.add,
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '80%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/energyadd.html',
yes: function (index, layero) {
var iframeWindow = window['layui-layer-iframe' + index]
, submitID = 'saveBtn'
, submit = layero.find('iframe').contents().find('#' + submitID);
//监听提交
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
var field = data.field; //获取提交的字段
self.energyadd({
type: 'post',
data: data.field,
successCallBack: function (result) {
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function (result) {
alert(result.message);
}
})
console.log(field)
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
} else if (obj.event === 'delete') { // 监听删除操作
var checkStatus = table.checkStatus('currentTableId')
, data = checkStatus.data;
layer.alert(JSON.stringify(data));
}
});
//监听表格复选框选择
table.on('checkbox(currentTableFilter)', function (obj) {
console.log(obj)
});
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
var index = layer.open({
title:lang.audit.edit_title,
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['70%', '80%'],
btn: [lang.audit.confirm, lang.audit.cancel],
content: '../page/table/energyedit.html?id='+data.id,
yes: function(index, layero){
var iframeWindow = window['layui-layer-iframe'+ index]
,submitID = 'saveBtn'
,submit = layero.find('iframe').contents().find('#'+ submitID);
//监听提交
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
var field = data.field; //获取提交的字段
self.energyupdate({
type:'post',
data:data.field,
successCallBack: function(result){
layer.msg(result.message)
layer.close(index); //关闭弹层
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
}
})
});
submit.trigger('click');
}
});
$(window).on("resize", function () {
layer.full(index);
});
return false;
}else if (obj.event === 'delete') {
layer.confirm(lang.audit.confirm_delete, function(index) {
self.energydelete({
type:'post',
data:{id:data.id},
successCallBack: function(result){
layer.msg(result.message, {
icon: 1,
time: 1000
});
tableInitb.reload()
},
failCallBack: function(result){
alert(result.message);
window.location.reload()
}
})
});
}
});
});
+117
View File
@@ -0,0 +1,117 @@
function loadJSONSync(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false); // false 表示同步请求
try {
xhr.send(null);
if (xhr.status === 200) {
return JSON.parse(xhr.responseText);
} else {
console.error('请求失败,状态码:', xhr.status);
return null;
}
} catch (e) {
console.error('请求过程中出错:', e);
return null;
}
}
class I18n {
constructor() {
this.currentLang = localStorage.getItem('language') || 'zh';
this.translations = {};
this.loadLanguage(this.currentLang);
this.updateLanguageSelect();
}
async loadLanguage(lang) {
try {
var data = loadJSONSync(`./assets/js/lang/${lang}.json`);
// console.log(data);
this.translations = data;
this.updatePageContent();
this.updateLanguageSelect();
// 如果菜单已初始化,重新渲染菜单
if (window.menu) {
window.menu.render();
}
} catch (error) {
console.error('Error loading language file:', error);
}
}
setLanguage(lang) {
this.currentLang = lang;
localStorage.setItem('language', lang);
this.loadLanguage(lang);
}
setLanguagehome(lang) {
this.currentLang = lang;
localStorage.setItem('language', lang);
window.location.reload();
}
translate(key) {
const keys = key.split('.');
let value = this.translations;
for (const k of keys) {
if (value && value[k] !== undefined) {
value = value[k];
} else {
return key;
}
}
return value;
}
updatePageContent() {
var data = this.translations;
// 常规文本内容
$('[data-i18n]').each(function() {
const keys = $(this).data('i18n').split('.');
let value = data;
keys.forEach(key => {
value = value[key];
});
$(this).text(value || '');
});
// placeholder翻译
$('[data-i18n-placeholder]').each(function() {
const keys = $(this).data('i18n-placeholder').split('.');
let value = data;
keys.forEach(key => {
value = value[key];
});
$(this).attr('placeholder', value || '');
});
// option文本翻译
$('option[data-i18n]').each(function() {
const keys = $(this).data('i18n').split('.');
let value = data;
keys.forEach(key => {
value = value[key];
});
$(this).text(value || '');
});
}
updateLanguageSelect() {
// 更新语言选择下拉框的选中状态
const select = document.querySelector('.language-switch select');
if (select) {
select.value = this.currentLang;
}
}
}
// 创建全局实例
window.i18n = new I18n();
+117
View File
@@ -0,0 +1,117 @@
function loadJSONSync(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false); // false 表示同步请求
try {
xhr.send(null);
if (xhr.status === 200) {
return JSON.parse(xhr.responseText);
} else {
console.error('请求失败,状态码:', xhr.status);
return null;
}
} catch (e) {
console.error('请求过程中出错:', e);
return null;
}
}
class I18n {
constructor() {
this.currentLang = localStorage.getItem('language') || 'zh';
this.translations = {};
this.loadLanguage(this.currentLang);
this.updateLanguageSelect();
}
async loadLanguage(lang) {
try {
var data = loadJSONSync(`../../assets/js/lang/${lang}.json`);
// console.log(data);
this.translations = data;
this.updatePageContent();
this.updateLanguageSelect();
// 如果菜单已初始化,重新渲染菜单
if (window.menu) {
window.menu.render();
}
} catch (error) {
console.error('Error loading language file:', error);
}
}
setLanguage(lang) {
this.currentLang = lang;
localStorage.setItem('language', lang);
this.loadLanguage(lang);
}
setLanguagehome(lang) {
this.currentLang = lang;
localStorage.setItem('language', lang);
window.location.reload();
}
translate(key) {
const keys = key.split('.');
let value = this.translations;
for (const k of keys) {
if (value && value[k] !== undefined) {
value = value[k];
} else {
return key;
}
}
return value;
}
updatePageContent() {
var data = this.translations;
// 常规文本内容
$('[data-i18n]').each(function() {
const keys = $(this).data('i18n').split('.');
let value = data;
keys.forEach(key => {
value = value[key];
});
$(this).text(value || '');
});
// placeholder翻译
$('[data-i18n-placeholder]').each(function() {
const keys = $(this).data('i18n-placeholder').split('.');
let value = data;
keys.forEach(key => {
value = value[key];
});
$(this).attr('placeholder', value || '');
});
// option文本翻译
$('option[data-i18n]').each(function() {
const keys = $(this).data('i18n').split('.');
let value = data;
keys.forEach(key => {
value = value[key];
});
$(this).text(value || '');
});
}
updateLanguageSelect() {
// 更新语言选择下拉框的选中状态
const select = document.querySelector('.language-switch select');
if (select) {
select.value = this.currentLang;
}
}
}
// 创建全局实例
window.i18n = new I18n();
+117
View File
@@ -0,0 +1,117 @@
function loadJSONSync(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false); // false 表示同步请求
try {
xhr.send(null);
if (xhr.status === 200) {
return JSON.parse(xhr.responseText);
} else {
console.error('请求失败,状态码:', xhr.status);
return null;
}
} catch (e) {
console.error('请求过程中出错:', e);
return null;
}
}
class I18n {
constructor() {
this.currentLang = localStorage.getItem('language') || 'zh';
this.translations = {};
this.loadLanguage(this.currentLang);
this.updateLanguageSelect();
}
async loadLanguage(lang) {
try {
var data = loadJSONSync(`../assets/js/lang/${lang}.json`);
// console.log(data);
this.translations = data;
this.updatePageContent();
this.updateLanguageSelect();
// 如果菜单已初始化,重新渲染菜单
if (window.menu) {
window.menu.render();
}
} catch (error) {
console.error('Error loading language file:', error);
}
}
setLanguage(lang) {
this.currentLang = lang;
localStorage.setItem('language', lang);
this.loadLanguage(lang);
}
setLanguagehome(lang) {
this.currentLang = lang;
localStorage.setItem('language', lang);
window.location.reload();
}
translate(key) {
const keys = key.split('.');
let value = this.translations;
for (const k of keys) {
if (value && value[k] !== undefined) {
value = value[k];
} else {
return key;
}
}
return value;
}
updatePageContent() {
var data = this.translations;
// 常规文本内容
$('[data-i18n]').each(function() {
const keys = $(this).data('i18n').split('.');
let value = data;
keys.forEach(key => {
value = value[key];
});
$(this).text(value || '');
});
// placeholder翻译
$('[data-i18n-placeholder]').each(function() {
const keys = $(this).data('i18n-placeholder').split('.');
let value = data;
keys.forEach(key => {
value = value[key];
});
$(this).attr('placeholder', value || '');
});
// option文本翻译
$('option[data-i18n]').each(function() {
const keys = $(this).data('i18n').split('.');
let value = data;
keys.forEach(key => {
value = value[key];
});
$(this).text(value || '');
});
}
updateLanguageSelect() {
// 更新语言选择下拉框的选中状态
const select = document.querySelector('.language-switch select');
if (select) {
select.value = this.currentLang;
}
}
}
// 创建全局实例
window.i18n = new I18n();
+169
View File
@@ -0,0 +1,169 @@
{
"page": {
"title": "Admin Panel-Login"
},
"login": {
"title": "Admin Login",
"username": "Please enter username",
"password": "Please enter password",
"submit": "Login Now",
"username_required": "Username cannot be empty",
"password_required": "Password cannot be empty",
"success": "Login successful",
"invalid_credentials": "Authentication failed! Incorrect username or password!"
},
"nav": {
"home": "Home",
"smallprogram": "Mini Program",
"user": "User",
"car": "Vehicle",
"examine": "Review",
"brand": "Brand",
"model": "Model",
"energy": "Energy",
"type": "Type",
"agreement": "Agreement",
"general": "General Settings",
"dictionary": "Dictionary Settings"
},
"home": {
"welcome": "Welcome to our website",
"more": "Learn more"
},
"btn": {
"submit": "Submit",
"cancel": "Cancel",
"search": "Search",
"add": "Add",
"edit": "Edit",
"delete": "Delete",
"check": "Check",
"show": "Details",
"confirm": "Confirm",
"reset": "Reset"
},
"footer": {
"copyright": "Copyright",
"address": "Address",
"phone": "Phone",
"email": "Email"
},
"search_info": "Search information",
"userlist": {
"search_info": "Search information",
"user_id": "User ID",
"nickname": "Nickname",
"realname": "Real Name",
"phone": "Phone",
"wechat_id": "WeChat ID",
"search": "Search",
"reset": "Reset",
"expand": "Expand",
"retract": "Retract",
"add": "Add",
"delete": "Delete",
"confirm_delete": "Confirm deletion?",
"no_data": "No data",
"id": "ID",
"company": "Company",
"phone_number": "Phone Number",
"wechat_id_full": "WeChat ID",
"create_time": "Creation Time",
"update_time": "Update Time",
"edit": "Edit",
"head":"profile picture",
"uploadig":"upload pictures",
"status":"state"
},
"carlist": {
"user": "User",
"product_name": "Product Name",
"VIN": "VIN",
"product_image": "Product Image",
"brand": "Brand",
"price": "Price",
"type": "Type",
"energy": "Energy Type",
"mileage": "Mileage",
"vehicle_age": "Vehicle Age",
"condition_desc": "Condition Description",
"status": "Status",
"is_sold": "Sold Status",
"create_time": "Creation Time",
"operation": "Operation",
"pending_review": "Pending Review",
"pending_publish": "Pending Publication",
"rejected": "Rejected",
"not_sold": "Not Sold",
"sold": "Sold",
"confirm_delete": "Confirm deletion?",
"tips": "Tips",
"add_car": "Add Vehicle",
"edit_car": "Edit Vehicle",
"check_car": "Review Vehicle",
"car_details": "Vehicle Details",
"basic_info": "Basic Information",
"car_album": "Vehicle Album",
"store_status": "Inventory Status",
"in_stock": "In Stock",
"in_transit": "In Transit",
"on_order": "On Order",
"location": "Location",
"CoverImage":"Cover Image",
"model":"Model",
"front45Degree": "45° Front",
"leftFront45Degree": "Left Front 45°",
"leftFrontHeadlight": "Left Front Headlight",
"front": "Front",
"frontLowerPart": "Front Lower Part",
"wheelHub": "Wheel Hub",
"rightFrontSeat": "Right Front Seat",
"rightBottomEdge": "Right Bottom Edge",
"rightRearTaillight": "Right Rear Taillight",
"rightRear45Degree": "Right Rear 45°",
"rearLowerPart": "Rear Lower Part",
"trunk": "Trunk",
"leftBottomEdge": "Left Bottom Edge",
"rearSeat": "Rear Seat",
"console": "Console",
"controlPanel": "Control Panel",
"gearLever": "Gear Lever",
"key": "Key",
"steeringWheel": "Steering Wheel",
"dashboard": "Dashboard",
"displayedMileage": "Displayed Mileage",
"leftFrontDoorPanel": "Left Front Door Panel",
"leftFrontDoorFunctionArea": "Left Front Door Function Area",
"leftFrontSeat": "Left Front Seat",
"ceiling": "Ceiling"
},
"audit":{
"all": "全部",
"applied": "已审核",
"not_applied": "未审核"
},
"seach":{
"name":"Name",
"status": "Status",
"agtype":"Protocol",
"title":"Title",
"content":"Content"
},
"selectlist":{
"privacy": "Privacy Agreement",
"user": "User Agreement",
"status1": "Active",
"status2": "Disabled"
},
"sort": "Sort",
"pleaseenter":"please enter",
"Belongingbrand":"Belonging brand",
"typeimg":"type map",
"select":"Please select",
"logout":"Log Out",
"Close1":"Close the current ",
"Close2":"Close Other",
"Close3":"Close All",
"all":"Total",
"items":"items"
}
+237
View File
@@ -0,0 +1,237 @@
{
"page": {
"title": "Admin Panel - Login"
},
"login": {
"title": "Admin Login",
"username": "Please enter username",
"password": "Please enter password",
"submit": "Login",
"username_required": "Username cannot be empty",
"password_required": "Password cannot be empty",
"success": "Login successful",
"invalid_credentials": "Authentication failed! Incorrect username or password!"
},
"nav": {
"home": "Home",
"smallprogram": "Mini Program",
"user": "User",
"car": "Vehicle",
"examine": "Review",
"brand": "Brand",
"model": "Model",
"energy": "Energy",
"type": "Type",
"agreement": "Agreement",
"general": "General Settings",
"dictionary": "Dictionary Settings",
"newcar":"New Car",
"usedcar":"Used Car",
"seo":"SEO",
"email":"Email"
},
"homE": {
"welcome": "Welcome to our website",
"more": "Learn more",
"title": "Data Statistics",
"realtime": "Real-time",
"brandCounts": "Number of Brands",
"inOrderCounts": "Orders in Process",
"inTransitCounts": "In Transit",
"vehicleCounts": "Vehicle Count"
},
"btn": {
"submit": "Submit",
"cancel": "Cancel",
"search": "Search",
"add": "Add",
"edit": "Edit",
"delete": "Delete",
"check": "Review",
"show": "Details",
"confirm": "Confirm",
"reset": "Reset"
},
"footer": {
"copyright": "Copyright",
"address": "Address",
"phone": "Phone",
"email": "Email"
},
"search_info": "Search information",
"userlist": {
"search_info": "Search information",
"user_id": "User ID",
"nickname": "Nickname",
"realname": "Full Name",
"phone": "Phone",
"wechat_id": "WeChat ID",
"search": "Search",
"reset": "Reset",
"expand": "Expand",
"retract": "Collapse",
"add": "Add",
"delete": "Delete",
"confirm_delete": "Confirm deletion?",
"no_data": "No data",
"id": "ID",
"company": "Company",
"phone_number": "Phone Number",
"wechat_id_full": "WeChat ID",
"create_time": "Creation Time",
"update_time": "Update Time",
"edit": "Edit",
"head": "Avatar",
"uploadig": "Uploading image",
"status": "Status"
},
"carlist": {
"user": "User",
"product_name": "Product Name",
"VIN": "Vehicle Identification Number",
"product_image": "Product Image",
"brand": "Brand",
"price": "Price",
"type": "Type",
"energy": "Energy",
"mileage": "Mileage",
"vehicle_age": "Vehicle age (years)",
"condition_desc": "Condition Description",
"status": "Status",
"is_sold": "Is Sold",
"create_time": "Creation Time",
"operation": "Operation",
"pending_review": "Pending Review",
"pending_publish": "Pending Publish",
"rejected": "Rejected",
"not_sold": "Not Sold",
"sold": "Sold",
"confirm_delete": "Confirm deletion?",
"tips": "Tips",
"add_car": "Add Vehicle",
"edit_car": "Edit Vehicle",
"check_car": "Review Vehicle",
"car_details": "Vehicle Details",
"basic_info": "Basic Information",
"car_album": "Vehicle Album",
"store_status": "Inventory Status",
"in_stock": "In Stock",
"in_transit": "In Transit",
"on_order": "On Order",
"location": "Location",
"CoverImage": "Cover Image",
"model": "Model",
"front45Degree": "45° Front View",
"leftFront45Degree": "Left Front 45°",
"leftFrontHeadlight": "Left Front Headlight",
"front": "Front View",
"frontLowerPart": "Front Lower Part",
"wheelHub": "Wheel Hub",
"rightFrontSeat": "Right Front Seat",
"rightBottomEdge": "Right Bottom Edge",
"rightRearTaillight": "Right Rear Taillight",
"rightRear45Degree": "Right Rear 45°",
"rearLowerPart": "Rear Lower Part",
"trunk": "Trunk",
"leftBottomEdge": "Left Bottom Edge",
"rearSeat": "Rear Seat",
"console": "Console",
"controlPanel": "Control Panel",
"gearLever": "Gear Lever",
"key": "Key",
"steeringWheel": "Steering Wheel",
"dashboard": "Dashboard",
"displayedMileage": "Displayed Mileage",
"leftFrontDoorPanel": "Left Front Door Panel",
"leftFrontDoorFunctionArea": "Left Front Door Function Area",
"leftFrontSeat": "Left Front Seat",
"ceiling": "Ceiling"
},
"audit": {
"all": "All",
"applied": "Reviewed",
"not_applied": "Not Reviewed",
"pass": "Pass",
"refuse": "Refuse",
"desc": "Description",
"editcarbtn": "Edit vehicle"
},
"seach": {
"name": "Name",
"status": "Status",
"agtype": "Agreement Type",
"title": "Title",
"content": "Content"
},
"selectlist": {
"privacy": "Privacy Agreement",
"user": "User Agreement",
"status1": "Active",
"status2": "Disabled"
},
"seo": {
"title": "Page Title",
"description": "Page Description",
"canonical": "",
"og_type": "Website Type",
"og_title": "Share Title",
"og_description": "Share Description",
"og_image": "Share Thumbnail",
"og_url": "Share URL",
"og_site_name": "Site Name",
"page": "Current Page"
},
"brand": {
"name": "Brand Name",
"logo": "Brand Logo",
"logoalt": "Logo Description",
"status": "Status",
"banner": "Banner Image",
"banneralt": "Banner Description",
"desc": "Brand Description",
"thumbnail": "Thumbnail",
"thumbnailalt": "Thumbnail Description",
"detailsimg": "Brand Carousel Images",
"advantage": "Brand Advantages",
"advantage-title": "Advantage Title",
"advantage-desc": "Advantage Description",
"album": "Brand Album",
"is_hot": "Is Hot"
},
"newcar": {
"memo": "Vehicle Description",
"introduce": "Vehicle Introduction",
"desc": "Vehicle Description",
"characteristic": "Vehicle Features",
"video": "Vehicle Video",
"problem": "FAQ",
"imgalt": "Image Description",
"coveralt": "Cover Image Description"
},
"alls": {
"title": "Title",
"title_placeholder": "Please enter title",
"content": "Content",
"content_placeholder": "Please enter content",
"introduce_placeholder": "Please enter introduction",
"image_desc": "Please enter image description",
"problem": "Question",
"answer": "Answer",
"answer_placeholder": "Please enter answer",
"problem_placeholder": "Please enter question",
"yes": "Yes",
"no": "No"
},
"sort": "Sort",
"pleaseenter": "Please enter",
"Belongingbrand": "Belonging Brand",
"typeimg": "Type Image",
"Imageratio":"Aspect ratio",
"select": "Please select",
"logout": "Logout",
"Close1": "Close Current",
"Close2": "Close Others",
"Close3": "Close All",
"all": "Total",
"items": "items"
}
+237
View File
@@ -0,0 +1,237 @@
{
"page": {
"title": "Админ панель - Вход"
},
"login": {
"title": "Вход в админку",
"username": "Введите имя пользователя",
"password": "Введите пароль",
"submit": "Войти",
"username_required": "Имя пользователя не может быть пустым",
"password_required": "Пароль не может быть пустым",
"success": "Вход выполнен успешно",
"invalid_credentials": "Ошибка аутентификации! Неверное имя пользователя или пароль!"
},
"nav": {
"home": "Главная",
"smallprogram": "Мини-программа",
"user": "пользователями",
"car": "автомобилями",
"examine": "проверками",
"brand": "брендами",
"model": "моделями",
"energy": "типами топлива",
"type": "типами",
"agreement": "соглашениями",
"general": "Общие настройки",
"dictionary": "Настройки словарей",
"newcar":"Новые автомобили",
"usedcar":"Б/у автомобили",
"seo":"SEO",
"email":"Эл. почта"
},
"home": {
"welcome": "Добро пожаловать на наш сайт",
"more": "Узнать больше",
"title": "Статистика данных",
"realtime": "В реальном времени",
"brandCounts": "Количество брендов",
"inOrderCounts": "Заказы в обработке",
"inTransitCounts": "В пути",
"vehicleCounts": "Количество автомобилей"
},
"btn": {
"submit": "Отправить",
"cancel": "Отмена",
"search": "Поиск",
"add": "Добавить",
"edit": "Редактировать",
"delete": "Удалить",
"check": "Проверить",
"show": "Подробности",
"confirm": "Подтвердить",
"reset": "Сброс"
},
"footer": {
"copyright": "Авторские права",
"address": "Адрес",
"phone": "Телефон",
"email": "Эл. почта"
},
"search_info": "Поиск информации",
"userlist": {
"search_info": "Поиск информации",
"user_id": "ID пользователя",
"nickname": "Никнейм",
"realname": "Полное имя",
"phone": "Телефон",
"wechat_id": "WeChat ID",
"search": "Поиск",
"reset": "Сброс",
"expand": "Развернуть",
"retract": "Свернуть",
"add": "Добавить",
"delete": "Удалить",
"confirm_delete": "Подтвердить удаление?",
"no_data": "Нет данных",
"id": "ID",
"company": "Компания",
"phone_number": "Номер телефона",
"wechat_id_full": "WeChat ID",
"create_time": "Время создания",
"update_time": "Время обновления",
"edit": "Редактировать",
"head": "Аватар",
"uploadig": "Загрузка изображения",
"status": "Статус"
},
"carlist": {
"user": "Пользователь",
"product_name": "Название продукта",
"VIN": "Идентификационный номер автомобиля",
"product_image": "Изображение продукта",
"brand": "Бренд",
"price": "Цена",
"type": "Тип",
"energy": "Тип топлива",
"mileage": "Пробег",
"vehicle_age": "Возраст автомобиля (лет)",
"condition_desc": "Описание состояния",
"status": "Статус",
"is_sold": "Продан",
"create_time": "Время создания",
"operation": "Действие",
"pending_review": "Ожидает проверки",
"pending_publish": "Ожидает публикации",
"rejected": "Отклонено",
"not_sold": "Не продан",
"sold": "Продан",
"confirm_delete": "Подтвердить удаление?",
"tips": "Подсказки",
"add_car": "Добавить автомобиль",
"edit_car": "Редактировать автомобиль",
"check_car": "Проверить автомобиль",
"car_details": "Детали автомобиля",
"basic_info": "Основная информация",
"car_album": "Альбом автомобиля",
"store_status": "Статус склада",
"in_stock": "В наличии",
"in_transit": "В пути",
"on_order": "На заказ",
"location": "Местоположение",
"CoverImage": "Обложка",
"model": "Модель",
"front45Degree": "45° спереди",
"leftFront45Degree": "Слева спереди 45°",
"leftFrontHeadlight": "Левая передняя фара",
"front": "Вид спереди",
"frontLowerPart": "Нижняя часть спереди",
"wheelHub": "Ступица колеса",
"rightFrontSeat": "Правое переднее сиденье",
"rightBottomEdge": "Правая нижняя кромка",
"rightRearTaillight": "Правый задний фонарь",
"rightRear45Degree": "Справа сзади 45°",
"rearLowerPart": "Нижняя часть сзади",
"trunk": "Багажник",
"leftBottomEdge": "Левая нижняя кромка",
"rearSeat": "Заднее сиденье",
"console": "Консоль",
"controlPanel": "Панель управления",
"gearLever": "Рычаг переключения передач",
"key": "Ключ",
"steeringWheel": "Руль",
"dashboard": "Приборная панель",
"displayedMileage": "Показания пробега",
"leftFrontDoorPanel": "Левая передняя дверная панель",
"leftFrontDoorFunctionArea": "Функциональная зона левой передней двери",
"leftFrontSeat": "Левое переднее сиденье",
"ceiling": "Потолок"
},
"audit": {
"all": "Все",
"applied": "Проверено",
"not_applied": "Не проверено",
"pass": "Пропустить",
"refuse": "Отказать",
"desc": "Описание",
"editcarbtn": "Изменить авто"
},
"seach": {
"name": "Название",
"status": "Статус",
"agtype": "Тип соглашения",
"title": "Заголовок",
"content": "Содержание"
},
"selectlist": {
"privacy": "Политика конфиденциальности",
"user": "Пользовательское соглашение",
"status1": "Активно",
"status2": "Отключено"
},
"seo": {
"title": "Заголовок страницы",
"description": "Описание страницы",
"canonical": "",
"og_type": "Тип веб-страницы",
"og_title": "Заголовок для публикации",
"og_description": "Описание для публикации",
"og_image": "Миниатюра для публикации",
"og_url": "Ссылка для публикации",
"og_site_name": "Название сайта",
"page": "Текущая страница"
},
"brand": {
"name": "Название бренда",
"logo": "Логотип бренда",
"logoalt": "Описание логотипа",
"status": "Статус",
"banner": "Баннер",
"banneralt": "Описание баннера",
"desc": "Описание бренда",
"thumbnail": "Миниатюра",
"thumbnailalt": "Описание миниатюры",
"detailsimg": "Карусель изображений бренда",
"advantage": "Преимущества бренда",
"advantage-title": "Заголовок преимущества",
"advantage-desc": "Описание преимущества",
"album": "Альбом бренда",
"is_hot": "Популярный"
},
"newcar": {
"memo": "Описание автомобиля",
"introduce": "Описание автомобиля",
"desc": "Описание автомобиля",
"characteristic": "Характеристики автомобиля",
"video": "Видео автомобиля",
"problem": "Частые вопросы",
"imgalt": "Описание изображения",
"coveralt": "Описание обложки"
},
"alls": {
"title": "Заголовок",
"title_placeholder": "Введите заголовок",
"content": "Содержание",
"content_placeholder": "Введите содержание",
"introduce_placeholder": "Введите описание",
"image_desc": "Введите описание изображения",
"problem": "Вопрос",
"answer": "Ответ",
"answer_placeholder": "Введите ответ",
"problem_placeholder": "Введите вопрос",
"yes": "Да",
"no": "Нет"
},
"sort": "Сортировка",
"pleaseenter": "Пожалуйста, введите",
"Belongingbrand": "Принадлежащий бренд",
"typeimg": "Изображение типа",
"Imageratio":"Соотношение сторон",
"select": "Пожалуйста, выберите",
"logout": "Выйти",
"Close1": "Закрыть текущее",
"Close2": "Закрыть другие",
"Close3": "Закрыть все",
"all": "Всего",
"items": "шт."
}
+237
View File
@@ -0,0 +1,237 @@
{
"page": {
"title": "后台管理-登录"
},
"login": {
"title": "后台登录",
"username": "请输入登录账号",
"password": "请输入密码",
"submit": "立即登录",
"username_required": "用户名不能为空",
"password_required": "密码不能为空",
"success": "登录成功",
"invalid_credentials": "验证失败!用户名或者密码错误!"
},
"nav": {
"home": "首页",
"smallprogram": "小程序",
"user": "用户管理",
"car": "车辆管理",
"examine": "审核管理",
"brand": "品牌管理",
"model": "型号管理",
"energy": "能源管理",
"type": "类型管理",
"agreement": "协议管理",
"general": "通用设置",
"dictionary": "字典设置",
"newcar":"新车管理",
"usedcar":"二手车",
"seo":"SEO管理",
"email":"邮箱管理"
},
"home": {
"welcome": "欢迎访问我们的网站",
"more": "了解更多",
"title": "数据统计",
"realtime": "实时",
"brandCounts":"品牌数",
"inOrderCounts":"订购数",
"inTransitCounts":"在途数",
"vehicleCounts":"车辆数"
},
"btn": {
"submit": "提交",
"cancel": "取消",
"search": "搜索",
"add": "添加",
"edit": "编辑",
"delete": "删除",
"check": "审核",
"show": "详情",
"confirm": "确定",
"reset": "重置"
},
"footer": {
"copyright": "版权所有",
"address": "地址",
"phone": "电话",
"email": "邮箱"
},
"search_info": "搜索信息",
"userlist": {
"search_info": "搜索信息",
"user_id": "用户编号",
"nickname": "昵称",
"realname": "姓名",
"phone": "手机",
"wechat_id": "微信id",
"search": "搜索",
"reset": "重置",
"expand": "展开",
"retract": "收起",
"add": "添加",
"delete": "删除",
"confirm_delete": "确认删除么?",
"no_data": "无数据",
"id": "编号",
"company": "公司",
"phone_number": "手机号",
"wechat_id_full": "微信ID",
"create_time": "创建时间",
"update_time": "更新时间",
"edit": "编辑",
"head":"头像",
"uploadig":"上传图片",
"status":"状态"
},
"carlist":{
"user": "用户",
"product_name": "产品名称",
"VIN": "车辆识别码",
"product_image": "产品图",
"brand": "品牌",
"price": "售价",
"type": "类型",
"energy": "能源",
"mileage": "里程",
"vehicle_age": "车龄(年)",
"condition_desc": "车况描述",
"status": "状态",
"is_sold": "是否出售",
"create_time": "创建时间",
"operation": "操作",
"pending_review": "待审核",
"pending_publish": "待发布",
"rejected": "已拒绝",
"not_sold": "未售",
"sold": "已售",
"confirm_delete": "确认删除么?",
"tips": "提示",
"add_car": "添加车辆",
"edit_car": "编辑车辆",
"check_car": "审核车辆",
"car_details": "车辆详情",
"basic_info": "基本信息",
"car_album": "车辆图册",
"store_status": "库存状态",
"in_stock": "现货",
"in_transit": "在途",
"on_order": "订购",
"location": "位置",
"CoverImage":"封面图",
"model":"型号",
"front45Degree": "45°正脸",
"leftFront45Degree": "左前45°",
"leftFrontHeadlight": "左前大灯",
"front": "正前",
"frontLowerPart": "车头下部",
"wheelHub": "车辆轮毂",
"rightFrontSeat": "右侧前排座椅",
"rightBottomEdge": "右侧底大边",
"rightRearTaillight": "右后尾灯",
"rightRear45Degree": "右后45°",
"rearLowerPart": "车尾下部",
"trunk": "后备厢",
"leftBottomEdge": "左侧底大边",
"rearSeat": "后排座椅",
"console": "中控台",
"controlPanel": "中控面板",
"gearLever": "档把",
"key": "钥匙",
"steeringWheel": "方向盘",
"dashboard": "仪表盘",
"displayedMileage": "表显里程",
"leftFrontDoorPanel": "左前门内饰板",
"leftFrontDoorFunctionArea": "左前门功能区",
"leftFrontSeat": "左侧前排座椅",
"ceiling": "车内顶棚"
},
"audit":{
"all": "全部",
"applied": "已审核",
"not_applied": "未审核",
"pass":"通过",
"refuse":"拒绝",
"desc":"描述",
"editcarbtn":"修改车辆信息"
},
"seach":{
"name":"名称",
"status": "状态",
"agtype":"协议类型",
"title":"标题",
"content":"内容"
},
"selectlist":{
"privacy":"隐私协议",
"user":"用户协议",
"status1":"正常",
"status2":"禁用"
},
"seo":{
"title":"页面标题",
"description":"页面描述",
"canonical":"",
"og_type":"网页类型",
"og_title":"分享显示标题",
"og_description":"分享时的描述文本",
"og_image":"分享显示缩略图",
"og_url":"分享的网页链接",
"og_site_name":"网站名称",
"page":"当前页面"
},
"brand":{
"name":"品牌名称",
"logo":"品牌logo",
"logoalt":"logo描述",
"status":"状态",
"banner":"导航图",
"banneralt":"导航图描述",
"desc":"品牌描述",
"thumbnail":"缩略图",
"thumbnailalt":"缩略图描述",
"detailsimg":"品牌轮播图",
"advantage":"品牌优势",
"advantage-title":"优势标题",
"advantage-desc":"优势描述",
"album":"品牌图册",
"is_hot":"是否热门"
},
"newcar":{
"memo":"车辆描述",
"introduce":"车辆介绍",
"desc":"车辆介绍",
"characteristic":"车辆特点",
"video":"车辆视频",
"problem":"常见问题",
"imgalt":"图片描述",
"coveralt":"封面图描述"
},
"alls":{
"title": "标题",
"title_placeholder": "请输入标题",
"content": "内容",
"content_placeholder": "请输入内容",
"introduce_placeholder": "请输入介绍内容",
"image_desc": "请输入图片描述",
"problem":"问题",
"answer":"回答",
"answer_placeholder": "请输入回答内容",
"problem_placeholder": "请输入问题内容",
"yes":"是",
"no":"否"
},
"sort": "排序",
"pleaseenter":"请输入",
"Belongingbrand":"所属品牌",
"typeimg":"类型图",
"Imageratio":"图片比例",
"select":"请选择",
"logout":"退出登录",
"Close1":"关 闭 当 前",
"Close2":"关 闭 其 他",
"Close3":"关 闭 全 部",
"all":"共",
"items":"条"
}
+32
View File
@@ -0,0 +1,32 @@
/**
* date:2019/08/16
* author:Mr.Chung
* description:此处放layui自定义扩展
* version:2.0.4
*/
window.rootPath = (function (src) {
src = document.scripts[document.scripts.length - 1].src;
return src.substring(0, src.lastIndexOf("/") + 1);
})();
layui.config({
base: rootPath + "lay-module/"
}).extend({
miniAdmin: "layuimini/miniAdmin", // layuimini后台扩展
miniMenu: "layuimini/miniMenu", // layuimini菜单扩展
miniTab: "layuimini/miniTab", // layuimini tab扩展
miniPage: "layuimini/miniPage", // layuimini 单页扩展
miniTheme: "layuimini/miniTheme", // layuimini 主题扩展
miniTongji: "layuimini/miniTongji", // layuimini 统计扩展
step: 'step-lay/step', // 分步表单扩展
treetable: 'treetable-lay/treetable', //table树形扩展
tableSelect: 'tableSelect/tableSelect', // table选择扩展
iconPickerFa: 'iconPicker/iconPickerFa', // fa图标选择扩展
echarts: 'echarts/echarts', // echarts图表扩展
echartsTheme: 'echarts/echartsTheme', // echarts图表主题扩展
wangEditor: 'wangEditor/wangEditor', // wangEditor富文本扩展
tinymce: 'tinymce/tinymce', // tinymce富文本扩展
common: 'common/common', // tinymce富文本扩展
layarea: 'layarea/layarea', // 省市县区三级联动下拉选择器
});
+71
View File
@@ -0,0 +1,71 @@
layui.define(['jquery', 'element','table'], function(exports) {
"use strict";
/**
* 常用封装类
* */
var MOD_NAME = 'common',
$ = layui.jquery,
table = layui.table,
element = layui.element;
var common = new function() {
/**
* 获取当前表格选中字段
* @param obj 表格回调参数
* @param field 要获取的字段
* */
this.checkField = function(obj, field) {
let data = table.checkStatus(obj.config.id).data;
if (data.length === 0) {
return "";
}
let ids = "";
for (let i = 0; i < data.length; i++) {
ids += data[i][field] + ",";
}
ids = ids.substr(0, ids.length - 1);
return ids;
}
/**
* 当前是否为与移动端
* */
this.isModile = function(){
if ($(window).width() <= 768) {
return true;
}
return false;
}
/**
* 提交 json 数据
* @param data 提交数据
* @param href 提交接口
* @param table 刷新父级表
*
* */
this.submit = function(data,href,table,callback){
$.ajax({
url:href,
data:JSON.stringify(data),
dataType:'json',
contentType:'application/json',
type:'post',
success:callback !=null?callback(result):function(result){
if(result.success){
layer.msg(result.msg,{icon:1,time:1000},function(){
parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
parent.layui.table.reload(table);
});
}else{
layer.msg(result.msg,{icon:2,time:1000});
}
}
})
}
}
exports(MOD_NAME, common);
});
File diff suppressed because one or more lines are too long
+492
View File
@@ -0,0 +1,492 @@
layui.define(function(exports) {
exports('echartsTheme',
{
"color": [
"#3fb1e3",
"#6be6c1",
"#626c91",
"#a0a7e6",
"#c4ebad",
"#96dee8"
],
"backgroundColor": "rgba(252,252,252,0)",
"textStyle": {},
"title": {
"textStyle": {
"color": "#666666"
},
"subtextStyle": {
"color": "#999999"
}
},
"line": {
"itemStyle": {
"normal": {
"borderWidth": "3"
}
},
"lineStyle": {
"normal": {
"width": "4"
}
},
"symbolSize": "10",
"symbol": "emptyCircle",
"smooth": true
},
"radar": {
"itemStyle": {
"normal": {
"borderWidth": "3"
}
},
"lineStyle": {
"normal": {
"width": "4"
}
},
"symbolSize": "10",
"symbol": "emptyCircle",
"smooth": true
},
"bar": {
"itemStyle": {
"normal": {
"barBorderWidth": 0,
"barBorderColor": "#ccc"
},
"emphasis": {
"barBorderWidth": 0,
"barBorderColor": "#ccc"
}
}
},
"pie": {
"itemStyle": {
"normal": {
"borderWidth": 0,
"borderColor": "#ccc"
},
"emphasis": {
"borderWidth": 0,
"borderColor": "#ccc"
}
}
},
"scatter": {
"itemStyle": {
"normal": {
"borderWidth": 0,
"borderColor": "#ccc"
},
"emphasis": {
"borderWidth": 0,
"borderColor": "#ccc"
}
}
},
"boxplot": {
"itemStyle": {
"normal": {
"borderWidth": 0,
"borderColor": "#ccc"
},
"emphasis": {
"borderWidth": 0,
"borderColor": "#ccc"
}
}
},
"parallel": {
"itemStyle": {
"normal": {
"borderWidth": 0,
"borderColor": "#ccc"
},
"emphasis": {
"borderWidth": 0,
"borderColor": "#ccc"
}
}
},
"sankey": {
"itemStyle": {
"normal": {
"borderWidth": 0,
"borderColor": "#ccc"
},
"emphasis": {
"borderWidth": 0,
"borderColor": "#ccc"
}
}
},
"funnel": {
"itemStyle": {
"normal": {
"borderWidth": 0,
"borderColor": "#ccc"
},
"emphasis": {
"borderWidth": 0,
"borderColor": "#ccc"
}
}
},
"gauge": {
"itemStyle": {
"normal": {
"borderWidth": 0,
"borderColor": "#ccc"
},
"emphasis": {
"borderWidth": 0,
"borderColor": "#ccc"
}
}
},
"candlestick": {
"itemStyle": {
"normal": {
"color": "#e6a0d2",
"color0": "transparent",
"borderColor": "#e6a0d2",
"borderColor0": "#3fb1e3",
"borderWidth": "2"
}
}
},
"graph": {
"itemStyle": {
"normal": {
"borderWidth": 0,
"borderColor": "#ccc"
}
},
"lineStyle": {
"normal": {
"width": "1",
"color": "#cccccc"
}
},
"symbolSize": "10",
"symbol": "emptyCircle",
"smooth": true,
"color": [
"#3fb1e3",
"#6be6c1",
"#626c91",
"#a0a7e6",
"#c4ebad",
"#96dee8"
],
"label": {
"normal": {
"textStyle": {
"color": "#ffffff"
}
}
}
},
"map": {
"itemStyle": {
"normal": {
"areaColor": "#eeeeee",
"borderColor": "#aaaaaa",
"borderWidth": 0.5
},
"emphasis": {
"areaColor": "rgba(63,177,227,0.25)",
"borderColor": "#3fb1e3",
"borderWidth": 1
}
},
"label": {
"normal": {
"textStyle": {
"color": "#ffffff"
}
},
"emphasis": {
"textStyle": {
"color": "rgb(63,177,227)"
}
}
}
},
"geo": {
"itemStyle": {
"normal": {
"areaColor": "#eeeeee",
"borderColor": "#aaaaaa",
"borderWidth": 0.5
},
"emphasis": {
"areaColor": "rgba(63,177,227,0.25)",
"borderColor": "#3fb1e3",
"borderWidth": 1
}
},
"label": {
"normal": {
"textStyle": {
"color": "#ffffff"
}
},
"emphasis": {
"textStyle": {
"color": "rgb(63,177,227)"
}
}
}
},
"categoryAxis": {
"axisLine": {
"show": true,
"lineStyle": {
"color": "#cccccc"
}
},
"axisTick": {
"show": false,
"lineStyle": {
"color": "#333"
}
},
"axisLabel": {
"show": true,
"textStyle": {
"color": "#999999"
}
},
"splitLine": {
"show": true,
"lineStyle": {
"color": [
"#eeeeee"
]
}
},
"splitArea": {
"show": false,
"areaStyle": {
"color": [
"rgba(250,250,250,0.05)",
"rgba(200,200,200,0.02)"
]
}
}
},
"valueAxis": {
"axisLine": {
"show": true,
"lineStyle": {
"color": "#cccccc"
}
},
"axisTick": {
"show": false,
"lineStyle": {
"color": "#333"
}
},
"axisLabel": {
"show": true,
"textStyle": {
"color": "#999999"
}
},
"splitLine": {
"show": true,
"lineStyle": {
"color": [
"#eeeeee"
]
}
},
"splitArea": {
"show": false,
"areaStyle": {
"color": [
"rgba(250,250,250,0.05)",
"rgba(200,200,200,0.02)"
]
}
}
},
"logAxis": {
"axisLine": {
"show": true,
"lineStyle": {
"color": "#cccccc"
}
},
"axisTick": {
"show": false,
"lineStyle": {
"color": "#333"
}
},
"axisLabel": {
"show": true,
"textStyle": {
"color": "#999999"
}
},
"splitLine": {
"show": true,
"lineStyle": {
"color": [
"#eeeeee"
]
}
},
"splitArea": {
"show": false,
"areaStyle": {
"color": [
"rgba(250,250,250,0.05)",
"rgba(200,200,200,0.02)"
]
}
}
},
"timeAxis": {
"axisLine": {
"show": true,
"lineStyle": {
"color": "#cccccc"
}
},
"axisTick": {
"show": false,
"lineStyle": {
"color": "#333"
}
},
"axisLabel": {
"show": true,
"textStyle": {
"color": "#999999"
}
},
"splitLine": {
"show": true,
"lineStyle": {
"color": [
"#eeeeee"
]
}
},
"splitArea": {
"show": false,
"areaStyle": {
"color": [
"rgba(250,250,250,0.05)",
"rgba(200,200,200,0.02)"
]
}
}
},
"toolbox": {
"iconStyle": {
"normal": {
"borderColor": "#999999"
},
"emphasis": {
"borderColor": "#666666"
}
}
},
"legend": {
"textStyle": {
"color": "#999999"
}
},
"tooltip": {
"axisPointer": {
"lineStyle": {
"color": "#cccccc",
"width": 1
},
"crossStyle": {
"color": "#cccccc",
"width": 1
}
}
},
"timeline": {
"lineStyle": {
"color": "#626c91",
"width": 1
},
"itemStyle": {
"normal": {
"color": "#626c91",
"borderWidth": 1
},
"emphasis": {
"color": "#626c91"
}
},
"controlStyle": {
"normal": {
"color": "#626c91",
"borderColor": "#626c91",
"borderWidth": 0.5
},
"emphasis": {
"color": "#626c91",
"borderColor": "#626c91",
"borderWidth": 0.5
}
},
"checkpointStyle": {
"color": "#3fb1e3",
"borderColor": "rgba(63,177,227,0.15)"
},
"label": {
"normal": {
"textStyle": {
"color": "#626c91"
}
},
"emphasis": {
"textStyle": {
"color": "#626c91"
}
}
}
},
"visualMap": {
"color": [
"#2a99c9",
"#afe8ff"
]
},
"dataZoom": {
"backgroundColor": "rgba(255,255,255,0)",
"dataBackgroundColor": "rgba(222,222,222,1)",
"fillerColor": "rgba(114,230,212,0.25)",
"handleColor": "#cccccc",
"handleSize": "100%",
"textStyle": {
"color": "#999999"
}
},
"markPoint": {
"label": {
"normal": {
"textStyle": {
"color": "#ffffff"
}
},
"emphasis": {
"textStyle": {
"color": "#ffffff"
}
}
}
}
});
});
+399
View File
@@ -0,0 +1,399 @@
/**
* fa图标选择器 根据开源项目https://gitee.com/wujiawei0926/iconpicker修改而来
* @author wujiawei0926@yeah.net chung@99php.cn
* @version 1.1
*/
layui.define(['laypage', 'form'], function (exports) {
"use strict";
var IconPicker = function () {
this.v = '1.1';
}, _MOD = 'iconPickerFa',
_this = this,
$ = layui.jquery,
laypage = layui.laypage,
form = layui.form,
BODY = 'body',
TIPS = '请选择图标';
/**
* 渲染组件
*/
IconPicker.prototype.render = function (options) {
var opts = options,
// DOM选择器
elem = opts.elem,
// 数据类型:fontClass/unicode
url = opts.url,
// 是否分页:true/false
page = opts.page == null ? true : opts.page,
// 每页显示数量
limit = opts.limit == null ? 12 : opts.limit,
// 是否开启搜索:true/false
search = opts.search == null ? true : opts.search,
// 每个图标格子的宽度:'43px'或'20%'
cellWidth = opts.cellWidth,
// 点击回调
click = opts.click,
// 渲染成功后的回调
success = opts.success,
// json数据
data = {},
// 唯一标识
tmp = new Date().getTime(),
// 初始化时input的值
ORIGINAL_ELEM_VALUE = $(elem).val(),
TITLE = 'layui-select-title',
TITLE_ID = 'layui-select-title-' + tmp,
ICON_BODY = 'layui-iconpicker-' + tmp,
PICKER_BODY = 'layui-iconpicker-body-' + tmp,
PAGE_ID = 'layui-iconpicker-page-' + tmp,
LIST_BOX = 'layui-iconpicker-list-box',
selected = 'layui-form-selected',
unselect = 'layui-unselect';
var a = {
init: function () {
data = common.getData(url);
a.hideElem().createSelect().createBody().toggleSelect();
a.preventEvent().inputListen();
common.loadCss();
if (success) {
success(this.successHandle());
}
return a;
},
successHandle: function () {
var d = {
options: opts,
data: data,
id: tmp,
elem: $('#' + ICON_BODY)
};
return d;
},
/**
* 隐藏elem
*/
hideElem: function () {
$(elem).hide();
return a;
},
/**
* 绘制select下拉选择框
*/
createSelect: function () {
var oriIcon = '<i class="fa">';
// 默认图标
if (ORIGINAL_ELEM_VALUE === '') {
ORIGINAL_ELEM_VALUE = 'fa-adjust';
}
oriIcon = '<i class="fa ' + ORIGINAL_ELEM_VALUE + '">';
oriIcon += '</i>';
var selectHtml = '<div class="layui-iconpicker layui-unselect layui-form-select" id="' + ICON_BODY + '">' +
'<div class="' + TITLE + '" id="' + TITLE_ID + '">' +
'<div class="layui-iconpicker-item">' +
'<span class="layui-iconpicker-icon layui-unselect">' +
oriIcon +
'</span>' +
'<i class="layui-edge"></i>' +
'</div>' +
'</div>' +
'<div class="layui-anim layui-anim-upbit" style="">' +
'123' +
'</div>';
$(elem).after(selectHtml);
return a;
},
/**
* 展开/折叠下拉框
*/
toggleSelect: function () {
var item = '#' + TITLE_ID + ' .layui-iconpicker-item,#' + TITLE_ID + ' .layui-iconpicker-item .layui-edge';
a.event('click', item, function (e) {
var $icon = $('#' + ICON_BODY);
if ($icon.hasClass(selected)) {
$icon.removeClass(selected).addClass(unselect);
} else {
// 隐藏其他picker
$('.layui-form-select').removeClass(selected);
// 显示当前picker
$icon.addClass(selected).removeClass(unselect);
}
e.stopPropagation();
});
return a;
},
/**
* 绘制主体部分
*/
createBody: function () {
// 获取数据
var searchHtml = '';
if (search) {
searchHtml = '<div class="layui-iconpicker-search">' +
'<input class="layui-input">' +
'<i class="layui-icon">&#xe615;</i>' +
'</div>';
}
// 组合dom
var bodyHtml = '<div class="layui-iconpicker-body" id="' + PICKER_BODY + '">' +
searchHtml +
'<div class="' + LIST_BOX + '"></div> ' +
'</div>';
$('#' + ICON_BODY).find('.layui-anim').eq(0).html(bodyHtml);
a.search().createList().check().page();
return a;
},
/**
* 绘制图标列表
* @param text 模糊查询关键字
* @returns {string}
*/
createList: function (text) {
var d = data,
l = d.length,
pageHtml = '',
listHtml = $('<div class="layui-iconpicker-list">')//'<div class="layui-iconpicker-list">';
// 计算分页数据
var _limit = limit, // 每页显示数量
_pages = l % _limit === 0 ? l / _limit : parseInt(l / _limit + 1), // 总计多少页
_id = PAGE_ID;
// 图标列表
var icons = [];
for (var i = 0; i < l; i++) {
var obj = d[i];
// 判断是否模糊查询
if (text && obj.indexOf(text) === -1) {
continue;
}
// 是否自定义格子宽度
var style = '';
if (cellWidth !== null) {
style += ' style="width:' + cellWidth + '"';
}
// 每个图标dom
var icon = '<div class="layui-iconpicker-icon-item" title="' + obj + '" ' + style + '>';
icon += '<i class="fa ' + obj + '"></i>';
icon += '</div>';
icons.push(icon);
}
// 查询出图标后再分页
l = icons.length;
_pages = l % _limit === 0 ? l / _limit : parseInt(l / _limit + 1);
for (var i = 0; i < _pages; i++) {
// 按limit分块
var lm = $('<div class="layui-iconpicker-icon-limit" id="layui-iconpicker-icon-limit-' + tmp + (i + 1) + '">');
for (var j = i * _limit; j < (i + 1) * _limit && j < l; j++) {
lm.append(icons[j]);
}
listHtml.append(lm);
}
// 无数据
if (l === 0) {
listHtml.append('<p class="layui-iconpicker-tips">无数据</p>');
}
// 判断是否分页
if (page) {
$('#' + PICKER_BODY).addClass('layui-iconpicker-body-page');
pageHtml = '<div class="layui-iconpicker-page" id="' + PAGE_ID + '">' +
'<div class="layui-iconpicker-page-count">' +
'<span id="' + PAGE_ID + '-current">1</span>/' +
'<span id="' + PAGE_ID + '-pages">' + _pages + '</span>' +
' (<span id="' + PAGE_ID + '-length">' + l + '</span>)' +
'</div>' +
'<div class="layui-iconpicker-page-operate">' +
'<i class="layui-icon" id="' + PAGE_ID + '-prev" data-index="0" prev>&#xe603;</i> ' +
'<i class="layui-icon" id="' + PAGE_ID + '-next" data-index="2" next>&#xe602;</i> ' +
'</div>' +
'</div>';
}
$('#' + ICON_BODY).find('.layui-anim').find('.' + LIST_BOX).html('').append(listHtml).append(pageHtml);
return a;
},
// 阻止Layui的一些默认事件
preventEvent: function () {
var item = '#' + ICON_BODY + ' .layui-anim';
a.event('click', item, function (e) {
e.stopPropagation();
});
return a;
},
// 分页
page: function () {
var icon = '#' + PAGE_ID + ' .layui-iconpicker-page-operate .layui-icon';
$(icon).unbind('click');
a.event('click', icon, function (e) {
var elem = e.currentTarget,
total = parseInt($('#' + PAGE_ID + '-pages').html()),
isPrev = $(elem).attr('prev') !== undefined,
// 按钮上标的页码
index = parseInt($(elem).attr('data-index')),
$cur = $('#' + PAGE_ID + '-current'),
// 点击时正在显示的页码
current = parseInt($cur.html());
// 分页数据
if (isPrev && current > 1) {
current = current - 1;
$(icon + '[prev]').attr('data-index', current);
} else if (!isPrev && current < total) {
current = current + 1;
$(icon + '[next]').attr('data-index', current);
}
$cur.html(current);
// 图标数据
$('#' + ICON_BODY + ' .layui-iconpicker-icon-limit').hide();
$('#layui-iconpicker-icon-limit-' + tmp + current).show();
e.stopPropagation();
});
return a;
},
/**
* 搜索
*/
search: function () {
var item = '#' + PICKER_BODY + ' .layui-iconpicker-search .layui-input';
a.event('input propertychange', item, function (e) {
var elem = e.target,
t = $(elem).val();
a.createList(t);
});
return a;
},
/**
* 点击选中图标
*/
check: function () {
var item = '#' + PICKER_BODY + ' .layui-iconpicker-icon-item';
a.event('click', item, function (e) {
var el = $(e.currentTarget).find('.fa'),
icon = '';
var clsArr = el.attr('class').split(/[\s\n]/),
cls = clsArr[1],
icon = cls;
$('#' + TITLE_ID).find('.layui-iconpicker-item .fa').html('').attr('class', clsArr.join(' '));
$('#' + ICON_BODY).removeClass(selected).addClass(unselect);
$(elem).val(icon).attr('value', icon);
// 回调
if (click) {
click({
icon: icon
});
}
});
return a;
},
// 监听原始input数值改变
inputListen: function () {
var el = $(elem);
a.event('change', elem, function () {
var value = el.val();
})
// el.change(function(){
// });
return a;
},
event: function (evt, el, fn) {
$(BODY).on(evt, el, fn);
}
};
var common = {
/**
* 加载样式表
*/
loadCss: function () {
var css = '.layui-iconpicker {max-width: 280px;}.layui-iconpicker .layui-anim{display:none;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #d2d2d2;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12);box-sizing:border-box;}.layui-iconpicker-item{border:1px solid #e6e6e6;width:90px;height:38px;border-radius:4px;cursor:pointer;position:relative;}.layui-iconpicker-icon{border-right:1px solid #e6e6e6;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:60px;height:100%;float:left;text-align:center;background:#fff;transition:all .3s;}.layui-iconpicker-icon i{line-height:38px;font-size:18px;}.layui-iconpicker-item > .layui-edge{left:70px;}.layui-iconpicker-item:hover{border-color:#D2D2D2!important;}.layui-iconpicker-item:hover .layui-iconpicker-icon{border-color:#D2D2D2!important;}.layui-iconpicker.layui-form-selected .layui-anim{display:block;}.layui-iconpicker-body{padding:6px;}.layui-iconpicker .layui-iconpicker-list{background-color:#fff;border:1px solid #ccc;border-radius:4px;}.layui-iconpicker .layui-iconpicker-icon-item{display:inline-block;width:21.1%;line-height:36px;text-align:center;cursor:pointer;vertical-align:top;height:36px;margin:4px;border:1px solid #ddd;border-radius:2px;transition:300ms;}.layui-iconpicker .layui-iconpicker-icon-item i.layui-icon{font-size:17px;}.layui-iconpicker .layui-iconpicker-icon-item:hover{background-color:#eee;border-color:#ccc;-webkit-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;-moz-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;box-shadow:0 0 2px #aaa,0 0 2px #fff inset;text-shadow:0 0 1px #fff;}.layui-iconpicker-search{position:relative;margin:0 0 6px 0;border:1px solid #e6e6e6;border-radius:2px;transition:300ms;}.layui-iconpicker-search:hover{border-color:#D2D2D2!important;}.layui-iconpicker-search .layui-input{cursor:text;display:inline-block;width:86%;border:none;padding-right:0;margin-top:1px;}.layui-iconpicker-search .layui-icon{position:absolute;top:11px;right:4%;}.layui-iconpicker-tips{text-align:center;padding:8px 0;cursor:not-allowed;}.layui-iconpicker-page{margin-top:6px;margin-bottom:-6px;font-size:12px;padding:0 2px;}.layui-iconpicker-page-count{display:inline-block;}.layui-iconpicker-page-operate{display:inline-block;float:right;cursor:default;}.layui-iconpicker-page-operate .layui-icon{font-size:12px;cursor:pointer;}.layui-iconpicker-body-page .layui-iconpicker-icon-limit{display:none;}.layui-iconpicker-body-page .layui-iconpicker-icon-limit:first-child{display:block;}';
var $style = $('head').find('style[iconpicker]');
if ($style.length === 0) {
$('head').append('<style rel="stylesheet" iconpicker>' + css + '</style>');
}
},
/**
* 获取数据
*/
getData: function (url) {
var iconlist = [];
$.ajax({
url: url,
type: 'get',
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
async: false,
success: function (ret) {
var exp = /fa-var-(.*):/ig;
var result;
while ((result = exp.exec(ret)) != null) {
iconlist.push('fa-' + result[1]);
}
},
error: function (xhr, textstatus, thrown) {
layer.msg('fa图标接口有误');
}
});
return iconlist;
}
};
a.init();
return new IconPicker();
};
/**
* 选中图标
* @param filter lay-filter
* @param iconName 图标名称,自动识别fontClass/unicode
*/
IconPicker.prototype.checkIcon = function (filter, iconName) {
var el = $('*[lay-filter=' + filter + ']'),
p = el.next().find('.layui-iconpicker-item .fa'),
c = iconName;
if (c.indexOf('#xe') > 0) {
p.html(c);
} else {
p.html('').attr('class', 'fa ' + c);
}
el.attr('value', c).val(c);
};
var iconPicker = new IconPicker();
exports(_MOD, iconPicker);
});
File diff suppressed because it is too large Load Diff
+363
View File
@@ -0,0 +1,363 @@
/**
* date:2020/02/27
* author:Mr.Chung
* version:2.0
* description:layuimini 主体框架扩展
*/
layui.define(["jquery", "miniMenu", "element","miniTab","miniPage", "miniTheme"], function (exports) {
var $ = layui.$,
layer = layui.layer,
miniMenu = layui.miniMenu,
miniTheme = layui.miniTheme,
element = layui.element ,
miniTab = layui.miniTab,
miniPage = layui.miniPage;
if (!/http(s*):\/\//.test(location.href)) {
var tips = "请先将项目部署至web容器(Apache/Tomcat/Nginx/IIS/等),否则部分数据将无法显示";
return layer.alert(tips);
}
var miniAdmin = {
/**
* 后台框架初始化
* @param options.iniUrl 后台初始化接口地址
* @param options.clearUrl 后台清理缓存接口
* @param options.urlHashLocation URL地址hash定位
* @param options.bgColorDefault 默认皮肤
* @param options.multiModule 是否开启多模块
* @param options.menuChildOpen 是否展开子菜单
* @param options.loadingTime 初始化加载时间
* @param options.pageAnim iframe窗口动画
* @param options.maxTabNum 最大的tab打开数量
*/
render: function (options) {
options.iniUrl = options.iniUrl || null;
options.clearUrl = options.clearUrl || null;
options.urlHashLocation = options.urlHashLocation || false;
options.bgColorDefault = options.bgColorDefault || 0;
options.multiModule = options.multiModule || false;
options.menuChildOpen = options.menuChildOpen || false;
options.loadingTime = options.loadingTime || 1;
options.pageAnim = options.pageAnim || false;
options.maxTabNum = options.maxTabNum || 20;
$.getJSON(options.iniUrl, function (data) {
if (data == null) {
miniAdmin.error('暂无菜单信息')
} else {
miniAdmin.renderLogo(data.logoInfo);
miniAdmin.renderClear(options.clearUrl);
miniAdmin.renderHome(data.homeInfo);
miniAdmin.renderAnim(options.pageAnim);
miniAdmin.listen();
miniMenu.render({
menuList: data.menuInfo,
multiModule: options.multiModule,
menuChildOpen: options.menuChildOpen
});
miniPage.render({
homeInfo:data.homeInfo,
menuList: data.menuInfo,
multiModule: options.multiModule,
renderPageVersion: options.renderPageVersion,
menuChildOpen: options.menuChildOpen,
listenSwichCallback: function () {
miniAdmin.renderDevice();
}
});
miniTab.render({
filter: 'layuiminiTab',
urlHashLocation: options.urlHashLocation,
multiModule: options.multiModule,
menuChildOpen: options.menuChildOpen,
maxTabNum: options.maxTabNum,
menuList: data.menuInfo,
homeInfo: data.homeInfo,
listenSwichCallback: function () {
miniAdmin.renderDevice();
}
});
miniTheme.render({
bgColorDefault: options.bgColorDefault,
listen: true,
});
miniAdmin.deleteLoader(options.loadingTime);
}
}).fail(function () {
miniAdmin.error('菜单接口有误');
});
},
/**
* 初始化logo
* @param data
*/
renderLogo: function (data) {
var html = '<a href="' + data.href + '"><img src="' + data.image + '" alt="logo"><h1>' + data.title + '</h1></a>';
$('.layuimini-logo').html(html);
},
/**
* 初始化首页
* @param data
*/
renderHome: function (data) {
sessionStorage.setItem('layuiminiHomeHref', data.href);
$('#layuiminiHomeTabId').html('<span class="layuimini-tab-active"></span><span class="disable-close" data-i18n="nav.' + data.name + '"></span><i class="layui-icon layui-unselect layui-tab-close">ဆ</i>');
// $('#layuiminiHomeTabId').html('<span class="layuimini-tab-active"></span><span class="disable-close">' + data.title + '</span><i class="layui-icon layui-unselect layui-tab-close">ဆ</i>');
$('#layuiminiHomeTabId').attr('lay-id', data.href);
$('#layuiminiHomeTabIframe').html('<iframe width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" src="' + data.href + '"></iframe>');
},
/**
* 初始化缓存地址
* @param clearUrl
*/
renderClear: function (clearUrl) {
$('.layuimini-clear').attr('data-href',clearUrl);
},
/**
* 初始化iframe窗口动画
* @param anim
*/
renderAnim: function (anim) {
if (anim) {
$('#layuimini-bg-color').after('<style id="layuimini-page-anim">' +
'.layui-tab-item.layui-show {animation:moveTop 1s;-webkit-animation:moveTop 1s;animation-fill-mode:both;-webkit-animation-fill-mode:both;position:relative;height:100%;-webkit-overflow-scrolling:touch;}\n' +
'@keyframes moveTop {0% {opacity:0;-webkit-transform:translateY(30px);-ms-transform:translateY(30px);transform:translateY(30px);}\n' +
' 100% {opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}\n' +
'}\n' +
'@-o-keyframes moveTop {0% {opacity:0;-webkit-transform:translateY(30px);-ms-transform:translateY(30px);transform:translateY(30px);}\n' +
' 100% {opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}\n' +
'}\n' +
'@-moz-keyframes moveTop {0% {opacity:0;-webkit-transform:translateY(30px);-ms-transform:translateY(30px);transform:translateY(30px);}\n' +
' 100% {opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}\n' +
'}\n' +
'@-webkit-keyframes moveTop {0% {opacity:0;-webkit-transform:translateY(30px);-ms-transform:translateY(30px);transform:translateY(30px);}\n' +
' 100% {opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}\n' +
'}' +
'</style>');
}
},
fullScreen: function () {
var el = document.documentElement;
var rfs = el.requestFullScreen || el.webkitRequestFullScreen;
if (typeof rfs != "undefined" && rfs) {
rfs.call(el);
} else if (typeof window.ActiveXObject != "undefined") {
var wscript = new ActiveXObject("WScript.Shell");
if (wscript != null) {
wscript.SendKeys("{F11}");
}
} else if (el.msRequestFullscreen) {
el.msRequestFullscreen();
} else if (el.oRequestFullscreen) {
el.oRequestFullscreen();
} else if (el.webkitRequestFullscreen) {
el.webkitRequestFullscreen();
} else if (el.mozRequestFullScreen) {
el.mozRequestFullScreen();
} else {
miniAdmin.error('浏览器不支持全屏调用!');
}
},
/**
* 退出全屏
*/
exitFullScreen: function () {
var el = document;
var cfs = el.cancelFullScreen || el.webkitCancelFullScreen || el.exitFullScreen;
if (typeof cfs != "undefined" && cfs) {
cfs.call(el);
} else if (typeof window.ActiveXObject != "undefined") {
var wscript = new ActiveXObject("WScript.Shell");
if (wscript != null) {
wscript.SendKeys("{F11}");
}
} else if (el.msExitFullscreen) {
el.msExitFullscreen();
} else if (el.oRequestFullscreen) {
el.oCancelFullScreen();
}else if (el.mozCancelFullScreen) {
el.mozCancelFullScreen();
} else if (el.webkitCancelFullScreen) {
el.webkitCancelFullScreen();
} else {
miniAdmin.error('浏览器不支持全屏调用!');
}
},
/**
* 初始化设备端
*/
renderDevice: function () {
if (miniAdmin.checkMobile()) {
$('.layuimini-tool i').attr('data-side-fold', 1);
$('.layuimini-tool i').attr('class', 'fa fa-outdent');
$('.layui-layout-body').removeClass('layuimini-mini');
$('.layui-layout-body').addClass('layuimini-all');
}
},
/**
* 初始化加载时间
* @param loadingTime
*/
deleteLoader: function (loadingTime) {
setTimeout(function () {
$('.layuimini-loader').fadeOut();
}, loadingTime * 1000)
},
/**
* 成功
* @param title
* @returns {*}
*/
success: function (title) {
return layer.msg(title, {icon: 1, shade: this.shade, scrollbar: false, time: 2000, shadeClose: true});
},
/**
* 失败
* @param title
* @returns {*}
*/
error: function (title) {
return layer.msg(title, {icon: 2, shade: this.shade, scrollbar: false, time: 3000, shadeClose: true});
},
/**
* 判断是否为手机
* @returns {boolean}
*/
checkMobile: function () {
var ua = navigator.userAgent.toLocaleLowerCase();
var pf = navigator.platform.toLocaleLowerCase();
var isAndroid = (/android/i).test(ua) || ((/iPhone|iPod|iPad/i).test(ua) && (/linux/i).test(pf))
|| (/ucweb.*linux/i.test(ua));
var isIOS = (/iPhone|iPod|iPad/i).test(ua) && !isAndroid;
var isWinPhone = (/Windows Phone|ZuneWP7/i).test(ua);
var clientWidth = document.documentElement.clientWidth;
if (!isAndroid && !isIOS && !isWinPhone && clientWidth > 1024) {
return false;
} else {
return true;
}
},
/**
* 监听
*/
listen: function () {
/**
* 清理
*/
$('body').on('click', '[data-clear]', function () {
var loading = layer.load(0, {shade: false, time: 2 * 1000});
sessionStorage.clear();
// 判断是否清理服务端
var clearUrl = $(this).attr('data-href');
if (clearUrl != undefined && clearUrl != '' && clearUrl != null) {
$.getJSON(clearUrl, function (data, status) {
layer.close(loading);
if (data.code != 1) {
return miniAdmin.error(data.msg);
} else {
return miniAdmin.success(data.msg);
}
}).fail(function () {
layer.close(loading);
return miniAdmin.error('清理缓存接口有误');
});
} else {
layer.close(loading);
return miniAdmin.success('清除缓存成功');
}
});
/**
* 刷新
*/
$('body').on('click', '[data-refresh]', function () {
miniPage.refresh(options);
// $(".layui-tab-item.layui-show").find("iframe")[0].contentWindow.location.reload();
miniAdmin.success('刷新成功');
});
/**
* 监听提示信息
*/
$("body").on("mouseenter", ".layui-nav-tree .menu-li", function () {
if (miniAdmin.checkMobile()) {
return false;
}
var classInfo = $(this).attr('class'),
tips = $(this).prop("innerHTML"),
isShow = $('.layuimini-tool i').attr('data-side-fold');
if (isShow == 0 && tips) {
tips = "<ul class='layuimini-menu-left-zoom layui-nav layui-nav-tree layui-this'><li class='layui-nav-item layui-nav-itemed'>"+tips+"</li></ul>" ;
window.openTips = layer.tips(tips, $(this), {
tips: [2, '#2f4056'],
time: 300000,
skin:"popup-tips",
success:function (el) {
var left = $(el).position().left - 10 ;
$(el).css({ left:left });
element.render();
}
});
}
});
$("body").on("mouseleave", ".popup-tips", function () {
if (miniAdmin.checkMobile()) {
return false;
}
var isShow = $('.layuimini-tool i').attr('data-side-fold');
if (isShow == 0) {
try {
layer.close(window.openTips);
} catch (e) {
console.log(e.message);
}
}
});
/**
* 全屏
*/
$('body').on('click', '[data-check-screen]', function () {
var check = $(this).attr('data-check-screen');
if (check == 'full') {
miniAdmin.fullScreen();
$(this).attr('data-check-screen', 'exit');
$(this).html('<i class="fa fa-compress"></i>');
} else {
miniAdmin.exitFullScreen();
$(this).attr('data-check-screen', 'full');
$(this).html('<i class="fa fa-arrows-alt"></i>');
}
});
/**
* 点击遮罩层
*/
$('body').on('click', '.layuimini-make', function () {
miniAdmin.renderDevice();
});
}
};
exports("miniAdmin", miniAdmin);
});
+253
View File
@@ -0,0 +1,253 @@
/**
* date:2020/02/27
* author:Mr.Chung
* version:2.0
* description:layuimini 菜单框架扩展
*/
layui.define(["element","laytpl" ,"jquery"], function (exports) {
var element = layui.element,
$ = layui.$,
laytpl = layui.laytpl,
layer = layui.layer;
var miniMenu = {
/**
* 菜单初始化
* @param options.menuList 菜单数据信息
* @param options.multiModule 是否开启多模块
* @param options.menuChildOpen 是否展开子菜单
*/
render: function (options) {
options.menuList = options.menuList || [];
options.multiModule = options.multiModule || false;
options.menuChildOpen = options.menuChildOpen || false;
if (options.multiModule) {
miniMenu.renderMultiModule(options.menuList, options.menuChildOpen);
} else {
miniMenu.renderSingleModule(options.menuList, options.menuChildOpen);
}
window.i18n.updatePageContent();
miniMenu.listen();
},
/**
* 单模块
* @param menuList 菜单数据
* @param menuChildOpen 是否默认展开
*/
renderSingleModule: function (menuList, menuChildOpen) {
menuList = menuList || [];
var leftMenuHtml = '',
childOpenClass = '',
leftMenuCheckDefault = 'layui-this';
var me = this ;
if (menuChildOpen) childOpenClass = ' layui-nav-itemed';
leftMenuHtml = this.renderLeftMenu(menuList,{ childOpenClass:childOpenClass }) ;
$('.layui-layout-body').addClass('layuimini-single-module'); //单模块标识
$('.layuimini-header-menu').remove();
$('.layuimini-menu-left').html(leftMenuHtml);
element.init();
},
/**
* 渲染一级菜单
*/
compileMenu: function(menu,isSub){
// console.log(menu)
var menuHtml = '<li {{#if( d.menu){ }} data-menu="{{d.menu}}" {{#}}} class="layui-nav-item menu-li {{d.childOpenClass}} {{d.className}}" {{#if( d.id){ }} id="{{d.id}}" {{#}}}> <a {{#if( d.href){ }} layuimini-href="{{d.href}}" {{#}}} {{#if( d.target){ }} target="{{d.target}}" {{#}}} href="javascript:;">{{#if( d.icon){ }} <i class="{{d.icon}}"></i> {{#}}} <span class="layui-left-nav" data-i18n="nav.{{d.name}}"></span></a> {{# if(d.children){}} {{d.children}} {{#}}} </li>' ;
if(isSub){
menuHtml = '<dd class="menu-dd {{d.childOpenClass}} {{ d.className }}"> <a href="javascript:;" {{#if( d.menu){ }} data-menu="{{d.menu}}" {{#}}} {{#if( d.id){ }} id="{{d.id}}" {{#}}} {{#if(( !d.child || !d.child.length ) && d.href){ }} layuimini-href="{{d.href}}" {{#}}} {{#if( d.target){ }} target="{{d.target}}" {{#}}}> {{#if( d.icon){ }} <i class="{{d.icon}}"></i> {{#}}} <span class="layui-left-nav" data-i18n="nav.{{d.name}}"></span></a> {{# if(d.children){}} {{d.children}} {{#}}}</dd>'
}
return laytpl(menuHtml).render(menu);
},
compileMenuContainer :function(menu,isSub){
var wrapperHtml = '<ul class="layui-nav layui-nav-tree layui-left-nav-tree {{d.className}}" id="{{d.id}}">{{d.children}}</ul>' ;
if(isSub){
wrapperHtml = '<dl class="layui-nav-child ">{{d.children}}</dl>' ;
}
if(!menu.children){
return "";
}
return laytpl(wrapperHtml).render(menu);
},
each:function(list,callback){
var _list = [];
for(var i = 0 ,length = list.length ; i<length ;i++ ){
_list[i] = callback(i,list[i]) ;
}
return _list ;
},
renderChildrenMenu:function(menuList,options){
var me = this ;
menuList = menuList || [] ;
var html = this.each(menuList,function (idx,menu) {
if(menu.child && menu.child.length){
menu.children = me.renderChildrenMenu(menu.child,{ childOpenClass: options.childOpenClass || '' });
}
menu.className = "" ;
menu.childOpenClass = options.childOpenClass || ''
return me.compileMenu(menu,true)
}).join("");
return me.compileMenuContainer({ children:html },true)
},
renderLeftMenu :function(leftMenus,options){
options = options || {};
var me = this ;
var leftMenusHtml = me.each(leftMenus || [],function (idx,leftMenu) { // 左侧菜单遍历
var children = me.renderChildrenMenu(leftMenu.child, { childOpenClass:options.childOpenClass });
var leftMenuHtml = me.compileMenu({
href: leftMenu.href,
name: leftMenu.name,
target: leftMenu.target,
childOpenClass: options.childOpenClass,
icon: leftMenu.icon,
title: leftMenu.title,
children: children,
className: '',
});
return leftMenuHtml ;
}).join("");
leftMenusHtml = me.compileMenuContainer({ id:options.parentMenuId,className:options.leftMenuCheckDefault,children:leftMenusHtml }) ;
return leftMenusHtml ;
},
/**
* 多模块
* @param menuList 菜单数据
* @param menuChildOpen 是否默认展开
*/
renderMultiModule: function (menuList, menuChildOpen) {
menuList = menuList || [];
var me = this ;
var headerMenuHtml = '',
headerMobileMenuHtml = '',
leftMenuHtml = '',
leftMenuCheckDefault = 'layui-this',
childOpenClass = '',
headerMenuCheckDefault = 'layui-this';
if (menuChildOpen) childOpenClass = ' layui-nav-itemed';
var headerMenuHtml = this.each(menuList, function (index, val) { //顶部菜单渲染
var menu = 'multi_module_' + index ;
var id = menu+"HeaderId";
var topMenuItemHtml = "" ;
topMenuItemHtml = me.compileMenu({
className:headerMenuCheckDefault,
menu:menu,
id:id,
title:val.title,
href:"",
target:"",
children:""
});
leftMenuHtml+=me.renderLeftMenu(val.child,{
parentMenuId:menu,
childOpenClass:childOpenClass,
leftMenuCheckDefault:leftMenuCheckDefault
});
headerMobileMenuHtml +=me.compileMenu({ id:id,menu:menu,id:id,icon:val.icon, title:val.title, },true);
headerMenuCheckDefault = "";
leftMenuCheckDefault = "layui-hide" ;
return topMenuItemHtml ;
}).join("");
$('.layui-layout-body').addClass('layuimini-multi-module'); //多模块标识
$('.layuimini-menu-header-pc').html(headerMenuHtml); //电脑
$('.layuimini-menu-left').html(leftMenuHtml);
$('.layuimini-menu-header-mobile').html(headerMobileMenuHtml); //手机
element.init();
},
/**
* 监听
*/
listen: function () {
/**
* 菜单模块切换
*/
$('body').on('click', '[data-menu]', function () {
var loading = layer.load(0, {shade: false, time: 2 * 1000});
var menuId = $(this).attr('data-menu');
// header
$(".layuimini-header-menu .layui-nav-item.layui-this").removeClass('layui-this');
$(this).addClass('layui-this');
// left
$(".layuimini-menu-left .layui-nav.layui-nav-tree.layui-this").addClass('layui-hide');
$(".layuimini-menu-left .layui-nav.layui-nav-tree.layui-this.layui-hide").removeClass('layui-this');
$("#" + menuId).removeClass('layui-hide');
$("#" + menuId).addClass('layui-this');
layer.close(loading);
});
/**
* 菜单缩放
*/
$('body').on('click', '.layuimini-site-mobile', function () {
var loading = layer.load(0, {shade: false, time: 2 * 1000});
var isShow = $('.layuimini-tool [data-side-fold]').attr('data-side-fold');
if (isShow == 1) { // 缩放
$('.layuimini-tool [data-side-fold]').attr('data-side-fold', 0);
$('.layuimini-tool [data-side-fold]').attr('class', 'fa fa-indent');
$('.layui-layout-body').removeClass('layuimini-all');
$('.layui-layout-body').addClass('layuimini-mini');
} else { // 正常
$('.layuimini-tool [data-side-fold]').attr('data-side-fold', 1);
$('.layuimini-tool [data-side-fold]').attr('class', 'fa fa-outdent');
$('.layui-layout-body').removeClass('layuimini-mini');
$('.layui-layout-body').addClass('layuimini-all');
layer.close(window.openTips);
}
element.init();
layer.close(loading);
});
/**
* 菜单缩放
*/
$('body').on('click', '[data-side-fold]', function () {
var loading = layer.load(0, {shade: false, time: 2 * 1000});
var isShow = $('.layuimini-tool [data-side-fold]').attr('data-side-fold');
if (isShow == 1) { // 缩放
$('.layuimini-tool [data-side-fold]').attr('data-side-fold', 0);
$('.layuimini-tool [data-side-fold]').attr('class', 'fa fa-indent');
$('.layui-layout-body').removeClass('layuimini-all');
$('.layui-layout-body').addClass('layuimini-mini');
// $(".menu-li").each(function (idx,el) {
// $(el).addClass("hidden-sub-menu");
// });
} else { // 正常
$('.layuimini-tool [data-side-fold]').attr('data-side-fold', 1);
$('.layuimini-tool [data-side-fold]').attr('class', 'fa fa-outdent');
$('.layui-layout-body').removeClass('layuimini-mini');
$('.layui-layout-body').addClass('layuimini-all');
// $(".menu-li").each(function (idx,el) {
// $(el).removeClass("hidden-sub-menu");
// });
layer.close(window.openTips);
}
element.init();
layer.close(loading);
});
/**
* 手机端点开模块
*/
$('body').on('click', '.layuimini-header-menu.layuimini-mobile-show dd', function () {
var loading = layer.load(0, {shade: false, time: 2 * 1000});
var check = $('.layuimini-tool [data-side-fold]').attr('data-side-fold');
if(check === "1"){
$('.layuimini-site-mobile').trigger("click");
element.init();
}
layer.close(loading);
});
},
};
exports("miniMenu", miniMenu);
});
+413
View File
@@ -0,0 +1,413 @@
/**
* date:2020/02/27
* author:Mr.Chung
* version:2.0
* description:layuimini 单页框架扩展
*/
layui.define(["element", "jquery"], function (exports) {
var element = layui.element,
$ = layui.$,
// miniAdmin = layui.miniAdmin,
layer = layui.layer;
var miniPage = {
/**
* 初始化tab
* @param options
*/
render: function (options) {
options.homeInfo = options.homeInfo || {};
options.menuList = options.menuList || [];
options.multiModule = options.multiModule || false;
options.renderPageVersion = options.renderPageVersion || false;
options.listenSwichCallback = options.listenSwichCallback || function () {
};
var href = location.hash.replace(/^#\//, '');
if (href === null || href === undefined || href === '') {
miniPage.renderHome(options);
} else {
miniPage.renderPage(href, options);
if (options.multiModule) {
miniPage.listenSwitchMultiModule(href);
} else {
miniPage.listenSwitchSingleModule(href);
}
}
miniPage.listen(options);
miniPage.listenHash(options);
},
/**
* 初始化主页
* @param options
*/
renderHome: function (options) {
options.homeInfo = options.homeInfo || {};
options.homeInfo.href = options.homeInfo.href || '';
options.renderPageVersion = options.renderPageVersion || false;
$('.layuimini-page-header').addClass('layui-hide');
miniPage.renderPageContent(options.homeInfo.href, options);
},
/**
* 初始化页面
* @param href
* @param options
*/
renderPage: function (href, options) {
miniPage.renderPageTitle(href, options);
miniPage.renderPageContent(href, options);
},
/**
* 初始化页面标题
* @param href
* @param options
*/
renderPageTitle: function (href, options) {
options.homeInfo = options.homeInfo || {};
// options.homeInfo.title = options.homeInfo.title || '主页';
options.homeInfo.title ='';
options.menuList = options.menuList || [];
$('.layuimini-page-header').removeClass('layui-hide');
var pageTitleHtml = '<a lay-href="" href="javascript:;" class="layuimini-back-home" style="font-size: 16px; color: #fafafa !important;"><i class="fa icon fa-home"></i></a><span lay-separator="">/</span>\n';
// var pageTitleHtml = '';
var pageTitleArray = miniPage.buildPageTitleArray(href, options.menuList);
pageTitleArray=pageTitleArray.slice(1)
if (pageTitleArray.length > 0) {
for (var key in pageTitleArray) {
key = parseInt(key);
if (key !== pageTitleArray.length - 1) {
pageTitleHtml += '<a><cite>' + pageTitleArray[key] + '</cite></a><span lay-separator="">/</span>\n';
} else {
pageTitleHtml += '<a><cite>' + pageTitleArray[key] + '</cite></a>\n';
}
}
} else {
var title = sessionStorage.getItem('layuimini_page_title');
if (title === null || title === undefined || title === '') {
$('.layuimini-page-header').addClass('layui-hide');
} else {
pageTitleHtml += '<a><cite>' + title + '</cite></a>\n';
}
}
$('.layuimini-page-header .layuimini-page-title').empty().html(pageTitleHtml);
},
/**
* 初始化页面内容
* @param options
* @param href
*/
renderPageContent: function (href, options) {
options.renderPageVersion = options.renderPageVersion || false;
var container = '.layuimini-content-page';
if (options.renderPageVersion) {
var v = new Date().getTime();
// href = href.indexOf("?") > -1 ? href + '&v=' + v : href + '?v=' + v;
href = href;
}
if ($(".layuimini-page-header").hasClass("layui-hide")) {
$(container).removeAttr("style");
} else {
$(container).attr("style", "height: calc(100% - 36px)");
}
$(container).html('');
$.ajax({
url: href,
type: 'get',
dataType: 'html',
success: function (data) {
$(container).html(data);
element.init();
},
error: function (xhr, textstatus, thrown) {
return layer.msg('Status:' + xhr.status + ',' + xhr.statusText + ',请稍后再试!');
}
});
},
/**
* 刷新页面内容
* @param options
*/
refresh: function (options) {
var href = location.hash.replace(/^#\//, '');
if (href === null || href === undefined || href === '') {
miniPage.renderHome(options);
} else {
miniPage.renderPageContent(href, options);
}
},
/**
* 构建页面标题数组
* @param href
* @param menuList
*/
buildPageTitleArray: function (href, menuList) {
var array = [],
newArray = [];
for (key in menuList) {
var item = menuList[key];
if (item.href === href) {
array.push(item.title);
break;
}
if (item.child) {
newArray = miniPage.buildPageTitleArray(href, item.child);
if (newArray.length > 0) {
newArray.unshift(item.title);
array = array.concat(newArray);
break;
}
}
}
return array;
},
/**
* 获取指定链接内容
* @param href
* @returns {string}
*/
getHrefContent: function (href) {
var content = '';
var v = new Date().getTime();
$.ajax({
url: href.indexOf("?") > -1 ? href + '&v=' + v : href + '?v=' + v,
type: 'get',
dataType: 'html',
async: false,
success: function (data) {
content = data;
},
error: function (xhr, textstatus, thrown) {
return layer.msg('Status:' + xhr.status + ',' + xhr.statusText + ',请稍后再试!');
}
});
return content;
},
/**
* 获取弹出层的宽高
* @returns {jQuery[]}
*/
getOpenWidthHeight: function () {
var clienWidth = $(".layuimini-content-page").width();
var clienWidth1 = $(".layuimini-content-page").width();
var clientHeight = $(".layuimini-content-page").height();
var offsetLeft = $(".layuimini-content-page").offset().left;
var offsetTop = $(".layuimini-content-page").offset().top;
if(parseFloat(clienWidth)>1000){
clienWidth=clienWidth/2
}
if(parseFloat(clientHeight)>700){
clientHeight=700
}
return [clienWidth, clientHeight, offsetTop, offsetLeft,clienWidth1];
},
/**
* 单模块切换
* @param tabId
*/
listenSwitchSingleModule: function (tabId) {
$("[layuimini-href]").each(function () {
if ($(this).attr("layuimini-href") === tabId) {
// 自动展开菜单栏
var addMenuClass = function ($element, type) {
if (type === 1) {
$element.addClass('layui-this');
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-this')) {
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
} else {
addMenuClass($element.parent().parent(), 2);
}
} else {
$element.addClass('layui-nav-itemed');
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-nav-itemed')) {
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
} else {
addMenuClass($element.parent().parent(), 2);
}
}
};
addMenuClass($(this).parent(), 1);
return false;
}
});
},
/**
* 多模块切换
* @param tabId
*/
listenSwitchMultiModule: function (tabId) {
$("[layuimini-href]").each(function () {
if ($(this).attr("layuimini-href") === tabId) {
// 自动展开菜单栏
var addMenuClass = function ($element, type) {
if (type === 1) {
$element.addClass('layui-this');
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-this')) {
var moduleId = $element.parent().attr('id');
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
$("#" + moduleId + "HeaderId").addClass("layui-this");
$(".layuimini-menu-left .layui-nav.layui-nav-tree").attr('class', 'layui-nav layui-nav-tree layui-hide');
$("#" + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
} else {
addMenuClass($element.parent().parent(), 2);
}
} else {
$element.addClass('layui-nav-itemed');
$element.addClass('additemed');
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-nav-itemed')) {
var moduleId = $element.parent().attr('id');
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
$("#" + moduleId + "HeaderId").addClass("layui-this");
$(".layuimini-menu-left .layui-nav.layui-nav-tree").attr('class', 'layui-nav layui-nav-tree layui-hide');
$("#" + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
} else {
addMenuClass($element.parent().parent(), 2);
}
}
};
addMenuClass($(this).parent(), 1);
return false;
}
});
},
/**
* 修改hash地址定位
* @param href
*/
hashChange: function (href) {
window.location.hash = "/" + href;
},
/**
* 修改hash地址为主页
*/
hashHome: function () {
window.location.hash = "/";
},
/**
* 监听
* @param options
*/
listen: function (options) {
/**
* 打开新窗口
*/
$('body').on('click', '[layuimini-href]', function (e) {
e.stopPropagation()
var loading = layer.load(0, {shade: false, time: 2 * 1000});
var href = $(this).attr('layuimini-href'),
target = $(this).attr('target');
if(!href) return ;
if(href=='welcome.html'){
$(".menu-li").removeClass("layui-nav-itemed")
$(".menu-li").removeClass("additemed")
}else{
}
var me = this ;
var el = $("[layuimini-href='"+href+"']",".layuimini-menu-left") ;
layer.close(window.openTips);
if(el.length){
$(el).closest(".layui-nav-tree").find(".layui-this").removeClass("layui-this");
$(el).parent().addClass("layui-this");
}
if (target === '_blank') {
layer.close(loading);
window.open(href, "_blank");
return false;
}
miniPage.hashChange(href);
$('.layuimini-menu-left').attr('layuimini-page-add', 'yes');
layer.close(loading);
});
/**
* 在子页面上打开新窗口
*/
$('body').on('click', '[layuimini-content-href]', function () {
var loading = parent.layer.load(0, {shade: false, time: 2 * 1000});
var href = $(this).attr('layuimini-content-href'),
title = $(this).attr('data-title'),
target = $(this).attr('target');
if(!href) return ;
var me = this ;
var el = $("[layuimini-href='"+href+"']",".layuimini-menu-left") ;
layer.close(window.openTips);
if(el.length){
$(el).closest(".layui-nav-tree").find(".layui-this").removeClass("layui-this");
$(el).parent().addClass("layui-this");
}
if (target === '_blank') {
parent.layer.close(loading);
window.open(href, "_blank");
return false;
}
sessionStorage.setItem('layuimini_page_title', title);
miniPage.hashChange(href);
parent.layer.close(loading);
});
/**
* 返回主页
*/
$('body').on('click', '.layuimini-back-home', function () {
miniPage.hashHome();
});
},
/**
* 监听hash变化
* @returns {boolean}
*/
listenHash: function (options) {
options.homeInfo = options.homeInfo || {};
options.multiModule = options.multiModule || false;
options.listenSwichCallback = options.listenSwichCallback || function () {
};
window.onhashchange = function () {
var href = location.hash.replace(/^#\//, '');
if (typeof options.listenSwichCallback === 'function') {
options.listenSwichCallback();
}
if (href === null || href === undefined || href === '') {
$("[layuimini-href]").parent().removeClass('layui-this');
miniPage.renderHome(options);
} else {
miniPage.renderPage(href, options);
}
if ($('.layuimini-menu-left').attr('layuimini-page-add') === 'yes') {
$('.layuimini-menu-left').attr('layuimini-page-add', 'no');
} else {
// 从页面中打开的话,浏览器前进后退、需要重新定位菜单焦点
$("[layuimini-href]").parent().removeClass('layui-this');
if (options.multiModule) {
miniPage.listenSwitchMultiModule(href);
} else {
miniPage.listenSwitchSingleModule(href);
}
}
};
},
};
exports("miniPage", miniPage);
});
+597
View File
@@ -0,0 +1,597 @@
/**
* date:2020/02/27
* author:Mr.Chung
* version:2.0
* description:layuimini tab框架扩展
*/
layui.define(["element", "layer", "jquery"], function (exports) {
var element = layui.element,
layer = layui.layer,
$ = layui.$;
var miniTab = {
/**
* 初始化tab
* @param options
*/
render: function (options) {
options.filter = options.filter || null;
options.multiModule = options.multiModule || false;
options.urlHashLocation = options.urlHashLocation || false;
options.maxTabNum = options.maxTabNum || 20;
options.menuList = options.menuList || []; // todo 后期菜单想改为不操作dom, 而是直接操作初始化传过来的数据
options.homeInfo = options.homeInfo || {};
options.listenSwichCallback = options.listenSwichCallback || function () {
};
miniTab.listen(options);
miniTab.listenRoll();
miniTab.listenSwitch(options);
miniTab.listenHash(options);
},
/**
* 新建tab窗口
* @param options.tabId
* @param options.href
* @param options.title
* @param options.isIframe
* @param options.maxTabNum
*/
create: function (options) {
options.tabId = options.tabId || null;
options.href = options.href || null;
options.title = options.title || null;
options.isIframe = options.isIframe || false;
options.maxTabNum = options.maxTabNum || 20;
if ($(".layuimini-tab .layui-tab-title li").length >= options.maxTabNum) {
layer.msg('Tab窗口已达到限定数量,请先关闭部分Tab');
return false;
}
var ele = element;
// console.log(options)
if (options.isIframe) ele = parent.layui.element;
if(options.hash){
ele.tabAdd('layuiminiTab', {
title: '<span class="layuimini-tab-active"></span><span data-i18n="nav.' + options.name + '"></span><i class="layui-icon layui-unselect layui-tab-close">ဆ</i>' //用于演示
, content: '<iframe width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" src="' + options.href + '"></iframe>'
, id: options.tabId
});
window.i18n.updatePageContent();
}else{
ele.tabAdd('layuiminiTab', {
title: '<span class="layuimini-tab-active"></span><span>' + options.title + '</span><i class="layui-icon layui-unselect layui-tab-close">ဆ</i>' //用于演示
, content: '<iframe width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" src="' + options.href + '"></iframe>'
, id: options.tabId
});
}
$('.layuimini-menu-left').attr('layuimini-tab-tag', 'add');
sessionStorage.setItem('layuiminimenu_' + options.tabId, options.title);
},
/**
* 切换选项卡
* @param tabId
*/
change: function (tabId) {
element.tabChange('layuiminiTab', tabId);
},
/**
* 删除tab窗口
* @param tabId
* @param isParent
*/
delete: function (tabId, isParent) {
// todo 未知BUG,不知道是不是layui问题,必须先删除元素
$(".layuimini-tab .layui-tab-title .layui-unselect.layui-tab-bar").remove();
if (isParent === true) {
parent.layui.element.tabDelete('layuiminiTab', tabId);
} else {
element.tabDelete('layuiminiTab', tabId);
}
},
/**
* 在iframe层打开新tab方法
*/
openNewTabByIframe: function (options) {
// console.log(options)
options.href = options.href || null;
options.title = options.title || null;
var loading = parent.layer.load(0, {shade: false, time: 2 * 1000});
if (options.href === null || options.href === undefined) options.href = new Date().getTime();
var checkTab = miniTab.check(options.href, true);
if (!checkTab) {
miniTab.create({
tabId: options.href,
href: options.href,
title: options.title,
name: options.name,
isIframe: true,
});
}
parent.layui.element.tabChange('layuiminiTab', options.href);
parent.layer.close(loading);
},
/**
* 在iframe层关闭当前tab方法
*/
deleteCurrentByIframe: function () {
var ele = $(".layuimini-tab .layui-tab-title li.layui-this", parent.document);
if (ele.length > 0) {
var layId = $(ele[0]).attr('lay-id');
miniTab.delete(layId, true);
}
},
/**
* 判断tab窗口
*/
check: function (tabId, isIframe) {
// 判断选项卡上是否有
var checkTab = false;
if (isIframe === undefined || isIframe === false) {
$(".layui-tab-title li").each(function () {
var checkTabId = $(this).attr('lay-id');
if (checkTabId != null && checkTabId === tabId) {
checkTab = true;
}
});
} else {
parent.layui.$(".layui-tab-title li").each(function () {
var checkTabId = $(this).attr('lay-id');
if (checkTabId != null && checkTabId === tabId) {
checkTab = true;
}
});
}
return checkTab;
},
/**
* 开启tab右键菜单
* @param tabId
* @param left
*/
openTabRignMenu: function (tabId, left) {
miniTab.closeTabRignMenu();
var menuHtml = '<div class="layui-unselect layui-form-select layui-form-selected layuimini-tab-mousedown layui-show" data-tab-id="' + tabId + '" style="left: ' + left + 'px!important">\n' +
'<dl>\n' +
'<dd><a href="javascript:;" layuimini-tab-menu-close="current">关 闭 当 前</a></dd>\n' +
'<dd><a href="javascript:;" layuimini-tab-menu-close="other">关 闭 其 他</a></dd>\n' +
'<dd><a href="javascript:;" layuimini-tab-menu-close="all">关 闭 全 部</a></dd>\n' +
'</dl>\n' +
'</div>';
var makeHtml = '<div class="layuimini-tab-make"></div>';
$('.layuimini-tab .layui-tab-title').after(menuHtml);
$('.layuimini-tab .layui-tab-content').after(makeHtml);
},
/**
* 关闭tab右键菜单
*/
closeTabRignMenu: function () {
$('.layuimini-tab-mousedown').remove();
$('.layuimini-tab-make').remove();
},
/**
* 查询菜单信息
* @param href
* @param menuList
*/
searchMenu: function (href, menuList) {
var menu;
for (key in menuList) {
var item = menuList[key];
if (item.href === href) {
menu = item;
break;
}
if (item.child) {
newMenu = miniTab.searchMenu(href, item.child);
if (newMenu) {
menu = newMenu;
break;
}
}
}
return menu;
},
/**
* 监听
* @param options
*/
listen: function (options) {
options = options || {};
options.maxTabNum = options.maxTabNum || 20;
/**
* 打开新窗口
*/
$('body').on('click', '[layuimini-href]', function () {
var loading = layer.load(0, {shade: false, time: 2 * 1000});
var tabId = $(this).attr('layuimini-href'),
href = $(this).attr('layuimini-href'),
title = $(this).text(),
target = $(this).attr('target');
var el = $("[layuimini-href='" + href + "']", ".layuimini-menu-left");
layer.close(window.openTips);
if (el.length) {
$(el).closest(".layui-nav-tree").find(".layui-this").removeClass("layui-this");
$(el).parent().addClass("layui-this");
}
if (target === '_blank') {
layer.close(loading);
window.open(href, "_blank");
return false;
}
if (tabId === null || tabId === undefined) tabId = new Date().getTime();
var checkTab = miniTab.check(tabId);
if (!checkTab) {
miniTab.create({
tabId: tabId,
href: href,
title: title,
isIframe: false,
maxTabNum: options.maxTabNum,
});
}
element.tabChange('layuiminiTab', tabId);
layer.close(loading);
});
/**
* 在iframe子菜单上打开新窗口
*/
$('body').on('click', '[layuimini-content-href]', function () {
var loading = parent.layer.load(0, {shade: false, time: 2 * 1000});
var tabId = $(this).attr('layuimini-content-href'),
href = $(this).attr('layuimini-content-href'),
title = $(this).attr('data-title'),
target = $(this).attr('target');
if (target === '_blank') {
parent.layer.close(loading);
window.open(href, "_blank");
return false;
}
if (tabId === null || tabId === undefined) tabId = new Date().getTime();
var checkTab = miniTab.check(tabId, true);
if (!checkTab) {
miniTab.create({
tabId: tabId,
href: href,
title: title,
isIframe: true,
maxTabNum: options.maxTabNum,
});
}
parent.layui.element.tabChange('layuiminiTab', tabId);
parent.layer.close(loading);
});
/**
* 关闭选项卡
**/
$('body').on('click', '.layuimini-tab .layui-tab-title .layui-tab-close', function () {
var loading = layer.load(0, {shade: false, time: 2 * 1000});
var $parent = $(this).parent();
var tabId = $parent.attr('lay-id');
if (tabId !== undefined || tabId !== null) {
miniTab.delete(tabId);
}
layer.close(loading);
});
/**
* 选项卡操作
*/
$('body').on('click', '[layuimini-tab-close]', function () {
var loading = layer.load(0, {shade: false, time: 2 * 1000});
var closeType = $(this).attr('layuimini-tab-close');
$(".layuimini-tab .layui-tab-title li").each(function () {
var tabId = $(this).attr('lay-id');
var id = $(this).attr('id');
var isCurrent = $(this).hasClass('layui-this');
if (id !== 'layuiminiHomeTabId') {
if (closeType === 'all') {
miniTab.delete(tabId);
} else {
if (closeType === 'current' && isCurrent) {
miniTab.delete(tabId);
} else if (closeType === 'other' && !isCurrent) {
miniTab.delete(tabId);
}
}
}
});
layer.close(loading);
});
/**
* 禁用网页右键
*/
$(".layuimini-tab .layui-tab-title").unbind("mousedown").bind("contextmenu", function (e) {
e.preventDefault();
return false;
});
/**
* 注册鼠标右键
*/
$('body').on('mousedown', '.layuimini-tab .layui-tab-title li', function (e) {
var left = $(this).offset().left - $('.layuimini-tab ').offset().left + ($(this).width() / 2),
tabId = $(this).attr('lay-id');
if (e.which === 3) {
miniTab.openTabRignMenu(tabId, left);
}
});
/**
* 关闭tab右键菜单
*/
$('body').on('click', '.layui-body,.layui-header,.layuimini-menu-left,.layuimini-tab-make', function () {
miniTab.closeTabRignMenu();
});
/**
* tab右键选项卡操作
*/
$('body').on('click', '[layuimini-tab-menu-close]', function () {
var loading = layer.load(0, {shade: false, time: 2 * 1000});
var closeType = $(this).attr('layuimini-tab-menu-close'),
currentTabId = $('.layuimini-tab-mousedown').attr('data-tab-id');
$(".layuimini-tab .layui-tab-title li").each(function () {
var tabId = $(this).attr('lay-id');
var id = $(this).attr('id');
if (id !== 'layuiminiHomeTabId') {
if (closeType === 'all') {
miniTab.delete(tabId);
} else {
if (closeType === 'current' && currentTabId === tabId) {
miniTab.delete(tabId);
} else if (closeType === 'other' && currentTabId !== tabId) {
miniTab.delete(tabId);
}
}
}
});
miniTab.closeTabRignMenu();
layer.close(loading);
});
},
/**
* 监听tab切换
* @param options
*/
listenSwitch: function (options) {
options.filter = options.filter || null;
options.multiModule = options.multiModule || false;
options.urlHashLocation = options.urlHashLocation || false;
options.listenSwichCallback = options.listenSwichCallback || function () {
};
element.on('tab(' + options.filter + ')', function (data) {
var tabId = $(this).attr('lay-id');
if (options.urlHashLocation) {
location.hash = '/' + tabId;
}
if (typeof options.listenSwichCallback === 'function') {
options.listenSwichCallback();
}
// 判断是否为新增窗口
if ($('.layuimini-menu-left').attr('layuimini-tab-tag') === 'add') {
$('.layuimini-menu-left').attr('layuimini-tab-tag', 'no')
} else {
$("[layuimini-href]").parent().removeClass('layui-this');
if (options.multiModule) {
miniTab.listenSwitchMultiModule(tabId);
} else {
miniTab.listenSwitchSingleModule(tabId);
}
}
miniTab.rollPosition();
});
},
/**
* 监听hash变化
* @param options
* @returns {boolean}
*/
listenHash: function (options) {
options.urlHashLocation = options.urlHashLocation || false;
options.maxTabNum = options.maxTabNum || 20;
options.homeInfo = options.homeInfo || {};
options.menuList = options.menuList || [];
if (!options.urlHashLocation) return false;
var tabId = location.hash.replace(/^#\//, '');
if (tabId === null || tabId === undefined || tabId ==='') return false;
// 判断是否为首页
if(tabId ===options.homeInfo.href) return false;
// 判断是否为右侧菜单
var menu = miniTab.searchMenu(tabId, options.menuList);
if (menu !== undefined) {
miniTab.create({
hash:true,
tabId: tabId,
href: tabId,
title: menu.title,
name: menu.name,
isIframe: false,
maxTabNum: options.maxTabNum,
});
$('.layuimini-menu-left').attr('layuimini-tab-tag', 'no');
element.tabChange('layuiminiTab', tabId);
return false;
}
// 判断是否为快捷菜单
var isSearchMenu = false;
$("[layuimini-content-href]").each(function () {
if ($(this).attr("layuimini-content-href") === tabId) {
var title = $(this).attr("data-title");
miniTab.create({
tabId: tabId,
href: tabId,
title: title,
isIframe: false,
maxTabNum: options.maxTabNum,
});
$('.layuimini-menu-left').attr('layuimini-tab-tag', 'no');
element.tabChange('layuiminiTab', tabId);
isSearchMenu = true;
return false;
}
});
if (isSearchMenu) return false;
// 既不是右侧菜单、快捷菜单,就直接打开
var title = sessionStorage.getItem('layuiminimenu_' + tabId) === null ? tabId : sessionStorage.getItem('layuiminimenu_' + tabId);
miniTab.create({
tabId: tabId,
href: tabId,
title: title,
isIframe: false,
maxTabNum: options.maxTabNum,
});
element.tabChange('layuiminiTab', tabId);
return false;
},
/**
* 监听滚动
*/
listenRoll: function () {
$(".layuimini-tab-roll-left").click(function () {
miniTab.rollClick("left");
});
$(".layuimini-tab-roll-right").click(function () {
miniTab.rollClick("right");
});
},
/**
* 单模块切换
* @param tabId
*/
listenSwitchSingleModule: function (tabId) {
$("[layuimini-href]").each(function () {
if ($(this).attr("layuimini-href") === tabId) {
// 自动展开菜单栏
var addMenuClass = function ($element, type) {
if (type === 1) {
$element.addClass('layui-this');
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-this')) {
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
} else {
addMenuClass($element.parent().parent(), 2);
}
} else {
$element.addClass('layui-nav-itemed');
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-nav-itemed')) {
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
} else {
addMenuClass($element.parent().parent(), 2);
}
}
};
addMenuClass($(this).parent(), 1);
return false;
}
});
},
/**
* 多模块切换
* @param tabId
*/
listenSwitchMultiModule: function (tabId) {
$("[layuimini-href]").each(function () {
if ($(this).attr("layuimini-href") === tabId) {
// 自动展开菜单栏
var addMenuClass = function ($element, type) {
if (type === 1) {
$element.addClass('layui-this');
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-this')) {
var moduleId = $element.parent().attr('id');
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
$("#" + moduleId + "HeaderId").addClass("layui-this");
$(".layuimini-menu-left .layui-nav.layui-nav-tree").attr('class', 'layui-nav layui-nav-tree layui-hide');
$("#" + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
} else {
addMenuClass($element.parent().parent(), 2);
}
} else {
$element.addClass('layui-nav-itemed');
if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-nav-itemed')) {
var moduleId = $element.parent().attr('id');
$(".layuimini-header-menu li").attr('class', 'layui-nav-item');
$("#" + moduleId + "HeaderId").addClass("layui-this");
$(".layuimini-menu-left .layui-nav.layui-nav-tree").attr('class', 'layui-nav layui-nav-tree layui-hide');
$("#" + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
} else {
addMenuClass($element.parent().parent(), 2);
}
}
};
addMenuClass($(this).parent(), 1);
return false;
}
});
},
/**
* 自动定位
*/
rollPosition: function () {
var $tabTitle = $('.layuimini-tab .layui-tab-title');
var autoLeft = 0;
$tabTitle.children("li").each(function () {
if ($(this).hasClass('layui-this')) {
return false;
} else {
autoLeft += $(this).outerWidth();
}
});
$tabTitle.animate({
scrollLeft: autoLeft - $tabTitle.width() / 3
}, 200);
},
/**
* 点击滚动
* @param direction
*/
rollClick: function (direction) {
var $tabTitle = $('.layuimini-tab .layui-tab-title');
var left = $tabTitle.scrollLeft();
if ('left' === direction) {
$tabTitle.animate({
scrollLeft: left - 450
}, 200);
} else {
$tabTitle.animate({
scrollLeft: left + 450
}, 200);
}
}
};
exports("miniTab", miniTab);
});
+469
View File
@@ -0,0 +1,469 @@
/**
* date:2020/02/28
* author:Mr.Chung
* version:2.0
* description:layuimini tab框架扩展
*/
layui.define(["jquery", "layer"], function (exports) {
var $ = layui.$,
layer = layui.layer;
var miniTheme = {
/**
* 主题配置项
* @param bgcolorId
* @returns {{headerLogo, menuLeftHover, headerRight, menuLeft, headerRightThis, menuLeftThis}|*|*[]}
*/
config: function (bgcolorId) {
var bgColorConfig = [
{
headerRightBg: '#ffffff', //头部右侧背景色
headerRightBgThis: '#e4e4e4', //头部右侧选中背景色,
headerRightColor: 'rgba(107, 107, 107, 0.7)', //头部右侧字体颜色,
headerRightChildColor: 'rgba(107, 107, 107, 0.7)', //头部右侧下拉字体颜色,
headerRightColorThis: '#565656', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(160, 160, 160, 0.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#1E9FFF', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#565656', //头部缩放按钮样式,
headerLogoBg: '#192027', //logo背景颜色,
headerLogoColor: 'rgb(191, 187, 187)', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#28333E', //左侧菜单背景,
leftMenuBgThis: '#1E9FFF', //左侧菜单选中背景,
leftMenuChildBg: '#0c0f13', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#1e9fff', //tab选项卡选中颜色,
},
{
headerRightBg: '#23262e', //头部右侧背景色
headerRightBgThis: '#0c0c0c', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#1aa094', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#0c0c0c', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#23262e', //左侧菜单背景,
leftMenuBgThis: '#737373', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#23262e', //tab选项卡选中颜色,
},
{
headerRightBg: '#ffa4d1', //头部右侧背景色
headerRightBgThis: '#bf7b9d', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#ffa4d1', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#e694bd', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#1f1f1f', //左侧菜单背景,
leftMenuBgThis: '#737373', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#ffa4d1', //tab选项卡选中颜色,
},
{
headerRightBg: '#1aa094', //头部右侧背景色
headerRightBgThis: '#197971', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#1aa094', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#0c0c0c', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#23262e', //左侧菜单背景,
leftMenuBgThis: '#1aa094', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#1aa094', //tab选项卡选中颜色,
},
{
headerRightBg: '#1e9fff', //头部右侧背景色
headerRightBgThis: '#0069b7', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#1e9fff', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#0c0c0c', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#1f1f1f', //左侧菜单背景,
leftMenuBgThis: '#1e9fff', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#1e9fff', //tab选项卡选中颜色,
},
{
headerRightBg: '#ffb800', //头部右侧背景色
headerRightBgThis: '#d09600', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#d09600', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#243346', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#2f4056', //左侧菜单背景,
leftMenuBgThis: '#8593a7', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#ffb800', //tab选项卡选中颜色,
},
{
headerRightBg: '#e82121', //头部右侧背景色
headerRightBgThis: '#ae1919', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#ae1919', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#0c0c0c', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#1f1f1f', //左侧菜单背景,
leftMenuBgThis: '#3b3f4b', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#e82121', //tab选项卡选中颜色,
},
{
headerRightBg: '#963885', //头部右侧背景色
headerRightBgThis: '#772c6a', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#772c6a', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#243346', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#2f4056', //左侧菜单背景,
leftMenuBgThis: '#586473', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#963885', //tab选项卡选中颜色,
},
{
headerRightBg: '#2D8CF0', //头部右侧背景色
headerRightBgThis: '#0069b7', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#0069b7', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#0069b7', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#1f1f1f', //左侧菜单背景,
leftMenuBgThis: '#2D8CF0', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#2d8cf0', //tab选项卡选中颜色,
},
{
headerRightBg: '#ffb800', //头部右侧背景色
headerRightBgThis: '#d09600', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#d09600', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#d09600', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#2f4056', //左侧菜单背景,
leftMenuBgThis: '#3b3f4b', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#ffb800', //tab选项卡选中颜色,
},
{
headerRightBg: '#e82121', //头部右侧背景色
headerRightBgThis: '#ae1919', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#ae1919', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#d91f1f', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#1f1f1f', //左侧菜单背景,
leftMenuBgThis: '#3b3f4b', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#e82121', //tab选项卡选中颜色,
},
{
headerRightBg: '#963885', //头部右侧背景色
headerRightBgThis: '#772c6a', //头部右侧选中背景色,
headerRightColor: 'rgba(255,255,255,.7)', //头部右侧字体颜色,
headerRightChildColor: '#676767', //头部右侧下拉字体颜色,
headerRightColorThis: '#ffffff', //头部右侧鼠标选中,
headerRightNavMore: 'rgba(255,255,255,.7)', //头部右侧更多下拉颜色,
headerRightNavMoreBg: '#772c6a', //头部右侧更多下拉列表选中背景色,
headerRightNavMoreColor: '#ffffff', //头部右侧更多下拉列表字体色,
headerRightToolColor: '#bbe3df', //头部缩放按钮样式,
headerLogoBg: '#772c6a', //logo背景颜色,
headerLogoColor: '#ffffff', //logo字体颜色,
leftMenuNavMore: 'rgb(191, 187, 187)', //左侧菜单更多下拉样式,
leftMenuBg: '#2f4056', //左侧菜单背景,
leftMenuBgThis: '#626f7f', //左侧菜单选中背景,
leftMenuChildBg: 'rgba(0,0,0,.3)', //左侧菜单子菜单背景,
leftMenuColor: 'rgb(191, 187, 187)', //左侧菜单字体颜色,
leftMenuColorThis: '#ffffff', //左侧菜单选中字体颜色,
tabActiveColor: '#963885', //tab选项卡选中颜色,
}
];
if (bgcolorId === undefined) {
return bgColorConfig;
} else {
return bgColorConfig[bgcolorId];
}
},
/**
* 初始化
* @param options
*/
render: function (options) {
options.bgColorDefault = options.bgColorDefault || false;
options.listen = options.listen || false;
var bgcolorId = sessionStorage.getItem('layuiminiBgcolorId');
if (bgcolorId === null || bgcolorId === undefined || bgcolorId === '') {
bgcolorId = options.bgColorDefault;
}
miniTheme.buildThemeCss(bgcolorId);
if (options.listen) miniTheme.listen(options);
},
/**
* 构建主题样式
* @param bgcolorId
* @returns {boolean}
*/
buildThemeCss: function (bgcolorId) {
if (!bgcolorId) {
return false;
}
var bgcolorData = miniTheme.config(bgcolorId);
var styleHtml = '/*头部右侧背景色 headerRightBg */\n' +
'.layui-layout-admin .layui-header {\n' +
' background-color: ' + bgcolorData.headerRightBg + ' !important;\n' +
'}\n' +
'\n' +
'/*头部右侧选中背景色 headerRightBgThis */\n' +
'.layui-layout-admin .layui-header .layuimini-header-content > ul > .layui-nav-item.layui-this, .layuimini-tool i:hover {\n' +
' background-color: ' + bgcolorData.headerRightBgThis + ' !important;\n' +
'}\n' +
'\n' +
'/*头部右侧字体颜色 headerRightColor */\n' +
'.layui-layout-admin .layui-header .layui-nav .layui-nav-item a {\n' +
' color: ' + bgcolorData.headerRightColor + ';\n' +
'}\n' +
'/**头部右侧下拉字体颜色 headerRightChildColor */\n' +
'.layui-layout-admin .layui-header .layui-nav .layui-nav-item .layui-nav-child a {\n' +
' color: ' + bgcolorData.headerRightChildColor + '!important;\n' +
'}\n'+
'\n' +
'/*头部右侧鼠标选中 headerRightColorThis */\n' +
'.layui-header .layuimini-menu-header-pc.layui-nav .layui-nav-item a:hover, .layui-header .layuimini-header-menu.layuimini-pc-show.layui-nav .layui-this a {\n' +
' color: ' + bgcolorData.headerRightColorThis + ' !important;\n' +
'}\n' +
'\n' +
'/*头部右侧更多下拉颜色 headerRightNavMore */\n' +
'.layui-header .layui-nav .layui-nav-more {\n' +
' border-top-color: ' + bgcolorData.headerRightNavMore + ' !important;\n' +
'}\n' +
'\n' +
'/*头部右侧更多下拉颜色 headerRightNavMore */\n' +
'.layui-header .layui-nav .layui-nav-mored, .layui-header .layui-nav-itemed > a .layui-nav-more {\n' +
' border-color: transparent transparent ' + bgcolorData.headerRightNavMore + ' !important;\n' +
'}\n' +
'\n' +
'/**头部右侧更多下拉配置色 headerRightNavMoreBg headerRightNavMoreColor */\n' +
'.layui-header .layui-nav .layui-nav-child dd.layui-this a, .layui-header .layui-nav-child dd.layui-this, .layui-layout-admin .layui-header .layui-nav .layui-nav-item .layui-nav-child .layui-this a {\n' +
' background-color: ' + bgcolorData.headerRightNavMoreBg + ' !important;\n' +
' color:' + bgcolorData.headerRightNavMoreColor + ' !important;\n' +
'}\n' +
'\n' +
'/*头部缩放按钮样式 headerRightToolColor */\n' +
'.layui-layout-admin .layui-header .layuimini-tool i {\n' +
' color: ' + bgcolorData.headerRightToolColor + ';\n' +
'}\n' +
'\n' +
'/*logo背景颜色 headerLogoBg */\n' +
'.layui-layout-admin .layuimini-logo {\n' +
' background-color: ' + bgcolorData.headerLogoBg + ' !important;\n' +
'}\n' +
'\n' +
'/*logo字体颜色 headerLogoColor */\n' +
'.layui-layout-admin .layuimini-logo h1 {\n' +
' color: ' + bgcolorData.headerLogoColor + ';\n' +
'}\n' +
'\n' +
'/*左侧菜单更多下拉样式 leftMenuNavMore */\n' +
'.layuimini-menu-left .layui-nav .layui-nav-more,.layuimini-menu-left-zoom.layui-nav .layui-nav-more {\n' +
' border-top-color: ' + bgcolorData.leftMenuNavMore + ';\n' +
'}\n' +
'\n' +
'/*左侧菜单更多下拉样式 leftMenuNavMore */\n' +
'.layuimini-menu-left .layui-nav .layui-nav-mored, .layuimini-menu-left .layui-nav-itemed > a .layui-nav-more, .layuimini-menu-left-zoom.layui-nav .layui-nav-mored, .layuimini-menu-left-zoom.layui-nav-itemed > a .layui-nav-more {\n' +
' border-color: transparent transparent ' + bgcolorData.leftMenuNavMore + ' !important;\n' +
'}\n' +
'\n' +
'/*左侧菜单背景 leftMenuBg */\n' +
'.layui-side.layui-bg-black, .layui-side.layui-bg-black > .layuimini-menu-left > ul, .layuimini-menu-left-zoom > ul {\n' +
' background-color: ' + bgcolorData.leftMenuBg + ' !important;\n' +
'}\n' +
'\n' +
'/*左侧菜单选中背景 leftMenuBgThis */\n' +
'.layuimini-menu-left .layui-nav-tree .layui-this, .layuimini-menu-left .layui-nav-tree .layui-this > a, .layuimini-menu-left .layui-nav-tree .layui-nav-child dd.layui-this, .layuimini-menu-left .layui-nav-tree .layui-nav-child dd.layui-this a, .layuimini-menu-left-zoom.layui-nav-tree .layui-this, .layuimini-menu-left-zoom.layui-nav-tree .layui-this > a, .layuimini-menu-left-zoom.layui-nav-tree .layui-nav-child dd.layui-this, .layuimini-menu-left-zoom.layui-nav-tree .layui-nav-child dd.layui-this a {\n' +
' background-color: ' + bgcolorData.leftMenuBgThis + ' !important\n' +
'}\n' +
'\n' +
'/*左侧菜单子菜单背景 leftMenuChildBg */\n' +
'.layuimini-menu-left .layui-nav-itemed > .layui-nav-child{\n' +
' background-color: ' + bgcolorData.leftMenuChildBg + ' !important;\n' +
'}\n' +
'\n' +
'/*左侧菜单字体颜色 leftMenuColor */\n' +
'.layuimini-menu-left .layui-nav .layui-nav-item a, .layuimini-menu-left-zoom.layui-nav .layui-nav-item a {\n' +
' color: ' + bgcolorData.leftMenuColor + ' !important;\n' +
'}\n' +
'\n' +
'/*左侧菜单选中字体颜色 leftMenuColorThis */\n' +
'.layuimini-menu-left .layui-nav .layui-nav-item a:hover, .layuimini-menu-left .layui-nav .layui-this a, .layuimini-menu-left-zoom.layui-nav .layui-nav-item a:hover, .layuimini-menu-left-zoom.layui-nav .layui-this a {\n' +
' color:' + bgcolorData.leftMenuColorThis + ' !important;\n' +
'}\n' +
'\n' +
'/**tab选项卡选中颜色 tabActiveColor */\n' +
'.layuimini-tab .layui-tab-title .layui-this .layuimini-tab-active {\n' +
' background-color: ' + bgcolorData.tabActiveColor + ';\n' +
'}\n';
$('#layuimini-bg-color').html(styleHtml);
},
/**
* 构建主题选择html
* @param options
* @returns {string}
*/
buildBgColorHtml: function (options) {
options.bgColorDefault = options.bgColorDefault || 0;
var bgcolorId = parseInt(sessionStorage.getItem('layuiminiBgcolorId'));
if (isNaN(bgcolorId)) bgcolorId = options.bgColorDefault;
var bgColorConfig = miniTheme.config();
var html = '';
$.each(bgColorConfig, function (key, val) {
if (key === bgcolorId) {
html += '<li class="layui-this" data-select-bgcolor="' + key + '">\n';
} else {
html += '<li data-select-bgcolor="' + key + '">\n';
}
html += '<a href="javascript:;" data-skin="skin-blue" style="" class="clearfix full-opacity-hover">\n' +
'<div><span style="display:block; width: 20%; float: left; height: 12px; background: ' + val.headerLogoBg + ';"></span><span style="display:block; width: 80%; float: left; height: 12px; background: ' + val.headerRightBg + ';"></span></div>\n' +
'<div><span style="display:block; width: 20%; float: left; height: 40px; background: ' + val.leftMenuBg + ';"></span><span style="display:block; width: 80%; float: left; height: 40px; background: #ffffff;"></span></div>\n' +
'</a>\n' +
'</li>';
});
return html;
},
/**
* 监听
* @param options
*/
listen: function (options) {
$('body').on('click', '[data-bgcolor]', function () {
var loading = layer.load(0, {shade: false, time: 2 * 1000});
var clientHeight = (document.documentElement.clientHeight) - 60;
var bgColorHtml = miniTheme.buildBgColorHtml(options);
var html = '<div class="layuimini-color">\n' +
'<div class="color-title">\n' +
'<span>配色方案</span>\n' +
'</div>\n' +
'<div class="color-content">\n' +
'<ul>\n' + bgColorHtml + '</ul>\n' +
'</div>\n' +
'</div>';
layer.open({
type: 1,
title: false,
closeBtn: 0,
shade: 0.2,
anim: 2,
shadeClose: true,
id: 'layuiminiBgColor',
area: ['340px', clientHeight + 'px'],
offset: 'rb',
content: html,
success: function (index, layero) {
},
end: function () {
$('.layuimini-select-bgcolor').removeClass('layui-this');
}
});
layer.close(loading);
});
$('body').on('click', '[data-select-bgcolor]', function () {
var bgcolorId = $(this).attr('data-select-bgcolor');
$('.layuimini-color .color-content ul .layui-this').attr('class', '');
$(this).attr('class', 'layui-this');
sessionStorage.setItem('layuiminiBgcolorId', bgcolorId);
miniTheme.render({
bgColorDefault: bgcolorId,
listen: false,
});
});
}
};
exports("miniTheme", miniTheme);
})
;
+40
View File
@@ -0,0 +1,40 @@
/**
* date:2020/03/01
* author:Mr.Chung
* version:2.0
* description:layuimini 统计框架扩展
*/
layui.define(["jquery"], function (exports) {
var $ = layui.$;
var miniTongji = {
/**
* 初始化
* @param options
*/
render: function (options) {
options.specific = options.specific || false;
options.domains = options.domains || [];
var domain = window.location.hostname;
if (options.specific === false || (options.specific === true && options.domains.indexOf(domain) >=0)) {
miniTongji.listen();
}
},
/**
* 监听统计代码
*/
listen: function () {
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?d97abf6d61c21d773f97835defbdef4e";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
}
};
exports("miniTongji", miniTongji);
});
+79
View File
@@ -0,0 +1,79 @@
.lay-step {
font-size: 0;
width: 400px;
margin: 0 auto;
max-width: 100%;
padding-left: 200px;
}
.step-item {
display: inline-block;
line-height: 26px;
position: relative;
font-size: 14px;
}
.step-item-tail {
width: 100%;
padding: 0 10px;
position: absolute;
left: 0;
top: 13px;
}
.step-item-tail i {
display: inline-block;
width: 100%;
height: 1px;
vertical-align: top;
background: #c2c2c2;
position: relative;
}
.step-item-tail .step-item-tail-done {
background: #009688;
}
.step-item-head {
position: relative;
display: inline-block;
height: 26px;
width: 26px;
text-align: center;
vertical-align: top;
color: #009688;
border: 1px solid #009688;
border-radius: 50%;
background: #ffffff;
}
.step-item-head.step-item-head-active {
background: #009688;
color: #ffffff;
}
.step-item-main {
display: block;
position: relative;
margin-left: -50%;
margin-right: 50%;
padding-left: 26px;
text-align: center;
}
.step-item-main-title {
font-weight: bolder;
color: #555555;
}
.step-item-main-desc {
color: #aaaaaa;
}
.lay-step + [carousel-item]:before {
display: none;
}
.lay-step + [carousel-item] > * {
background-color: transparent;
}
+101
View File
@@ -0,0 +1,101 @@
layui.define(['layer', 'carousel'], function (exports) {
var $ = layui.jquery;
var layer = layui.layer;
var carousel = layui.carousel;
// 添加步骤条dom节点
var renderDom = function (elem, stepItems, postion) {
var stepDiv = '<div class="lay-step">';
for (var i = 0; i < stepItems.length; i++) {
stepDiv += '<div class="step-item">';
// 线
if (i < (stepItems.length - 1)) {
if (i < postion) {
stepDiv += '<div class="step-item-tail"><i class="step-item-tail-done"></i></div>';
} else {
stepDiv += '<div class="step-item-tail"><i class=""></i></div>';
}
}
// 数字
var number = stepItems[i].number;
if (!number) {
number = i + 1;
}
if (i == postion) {
stepDiv += '<div class="step-item-head step-item-head-active"><i class="layui-icon">' + number + '</i></div>';
} else if (i < postion) {
stepDiv += '<div class="step-item-head"><i class="layui-icon layui-icon-ok"></i></div>';
} else {
stepDiv += '<div class="step-item-head "><i class="layui-icon">' + number + '</i></div>';
}
// 标题和描述
var title = stepItems[i].title;
var desc = stepItems[i].desc;
if (title || desc) {
stepDiv += '<div class="step-item-main">';
if (title) {
stepDiv += '<div class="step-item-main-title">' + title + '</div>';
}
if (desc) {
stepDiv += '<div class="step-item-main-desc">' + desc + '</div>';
}
stepDiv += '</div>';
}
stepDiv += '</div>';
}
stepDiv += '</div>';
$(elem).prepend(stepDiv);
// 计算每一个条目的宽度
var bfb = 100 / stepItems.length;
$('.step-item').css('width', bfb + '%');
};
var step = {
// 渲染步骤条
render: function (param) {
param.indicator = 'none'; // 不显示指示器
param.arrow = 'always'; // 始终显示箭头
param.autoplay = false; // 关闭自动播放
if (!param.stepWidth) {
param.stepWidth = '400px';
}
// 渲染轮播图
carousel.render(param);
// 渲染步骤条
var stepItems = param.stepItems;
renderDom(param.elem, stepItems, 0);
$('.lay-step').css('width', param.stepWidth);
//监听轮播切换事件
carousel.on('change(' + param.filter + ')', function (obj) {
$(param.elem).find('.lay-step').remove();
renderDom(param.elem, stepItems, obj.index);
$('.lay-step').css('width', param.stepWidth);
});
// 隐藏左右箭头按钮
$(param.elem).find('.layui-carousel-arrow').css('display', 'none');
// 去掉轮播图的背景颜色
$(param.elem).css('background-color', 'transparent');
},
// 下一步
next: function (elem) {
$(elem).find('.layui-carousel-arrow[lay-type=add]').trigger('click');
},
// 上一步
pre: function (elem) {
$(elem).find('.layui-carousel-arrow[lay-type=sub]').trigger('click');
}
};
layui.link(layui.cache.base + 'step-lay/step.css');
exports('step', step);
});
+272
View File
@@ -0,0 +1,272 @@
layui.define(['table', 'jquery', 'form'], function (exports) {
"use strict";
var MOD_NAME = 'tableSelect',
$ = layui.jquery,
table = layui.table,
form = layui.form;
var tableSelect = function () {
this.v = '1.1.0';
};
/**
* 初始化表格选择器
*/
tableSelect.prototype.render = function (opt) {
var elem = $(opt.elem);
var tableDone = opt.table.done || function(){};
//默认设置
opt.searchKey = opt.searchKey || 'keyword';
opt.searchPlaceholder = opt.searchPlaceholder || '关键词搜索';
opt.checkedKey = opt.checkedKey;
opt.table.page = opt.table.page || true;
opt.table.height = opt.height || 315;
//最小宽度
opt.width = opt.width || '530';
//多搜索条件
opt.searchType = opt.searchType || 'one';
opt.searchList = opt.searchList || [{key: opt.searchKey, placeholder: opt.searchPlaceholder}];
elem.off('click').on('click', function(e) {
e.stopPropagation();
if($('div.tableSelect').length >= 1){
return false;
}
var t = elem.offset().top + elem.outerHeight()+"px";
var l = elem.offset().left +"px";
var tableName = "tableSelect_table_" + new Date().getTime();
var tableBox = '<div class="tableSelect layui-anim layui-anim-upbit" style="left:'+l+';top:'+t+';border: 1px solid #d2d2d2;background-color: #fff;box-shadow: 0 2px 4px rgba(0,0,0,.12);padding:10px 10px 0 10px;position: absolute;z-index:66666666;margin: 5px 0;border-radius: 2px;min-width:'+opt.width+'px;">';
tableBox += '<div class="tableSelectBar">';
tableBox += '<form class="layui-form" action="" style="display:inline-block;">';
//判断是否多搜索条件
if(opt.searchType == 'more'){
$.each(opt.searchList, function (index, item) {
tableBox += '<input style="display:inline-block;width:190px;height:30px;vertical-align:middle;margin-right:-1px;border: 1px solid #C9C9C9;" type="text" name="'+item.searchKey+'" placeholder="'+item.searchPlaceholder+'" autocomplete="off" class="layui-input">';
});
}else{
tableBox += '<input style="display:inline-block;width:190px;height:30px;vertical-align:middle;margin-right:-1px;border: 1px solid #C9C9C9;" type="text" name="'+opt.searchKey+'" placeholder="'+opt.searchPlaceholder+'" autocomplete="off" class="layui-input">';
}
tableBox += '<button class="layui-btn layui-btn-sm layui-btn-primary tableSelect_btn_search" lay-submit lay-filter="tableSelect_btn_search"><i class="layui-icon layui-icon-search"></i></button>';
tableBox += '</form>';
tableBox += '<button style="float:right;" class="layui-btn layui-btn-sm tableSelect_btn_select">选择<span></span></button>';
tableBox += '</div>';
tableBox += '<table id="'+tableName+'" lay-filter="'+tableName+'"></table>';
tableBox += '</div>';
tableBox = $(tableBox);
$('body').append(tableBox);
//数据缓存
var checkedData = [];
//渲染TABLE
opt.table.elem = "#"+tableName;
opt.table.id = tableName;
opt.table.done = function(res, curr, count){
defaultChecked(res, curr, count);
setChecked(res, curr, count);
tableDone(res, curr, count);
};
var tableSelect_table = table.render(opt.table);
//分页选中保存数组
table.on('radio('+tableName+')', function(obj){
if(opt.checkedKey){
checkedData = table.checkStatus(tableName).data
}
updataButton(table.checkStatus(tableName).data.length)
})
table.on('checkbox('+tableName+')', function(obj){
if(opt.checkedKey){
if(obj.checked){
for (var i=0;i<table.checkStatus(tableName).data.length;i++){
checkedData.push(table.checkStatus(tableName).data[i])
}
}else{
if(obj.type=='all'){
for (var j=0;j<table.cache[tableName].length;j++) {
for (var i=0;i<checkedData.length;i++){
if(checkedData[i][opt.checkedKey] == table.cache[tableName][j][opt.checkedKey]){
checkedData.splice(i,1)
}
}
}
}else{
//因为LAYUI问题,操作到变化全选状态时获取到的obj为空,这里用函数获取未选中的项。
function nu (){
var noCheckedKey = '';
for (var i=0;i<table.cache[tableName].length;i++){
if(!table.cache[tableName][i].LAY_CHECKED){
noCheckedKey = table.cache[tableName][i][opt.checkedKey];
}
}
return noCheckedKey
}
var noCheckedKey = obj.data[opt.checkedKey] || nu();
for (var i=0;i<checkedData.length;i++){
if(checkedData[i][opt.checkedKey] == noCheckedKey){
checkedData.splice(i,1);
}
}
}
}
checkedData = uniqueObjArray(checkedData, opt.checkedKey);
updataButton(checkedData.length)
}else{
updataButton(table.checkStatus(tableName).data.length)
}
});
//渲染表格后选中
function setChecked (res, curr, count) {
for(var i=0;i<res.data.length;i++){
for (var j=0;j<checkedData.length;j++) {
if(res.data[i][opt.checkedKey] == checkedData[j][opt.checkedKey]){
res.data[i].LAY_CHECKED = true;
var index= res.data[i]['LAY_TABLE_INDEX'];
var checkbox = $('#'+tableName+'').next().find('tr[data-index=' + index + '] input[type="checkbox"]');
checkbox.prop('checked', true).next().addClass('layui-form-checked');
var radio = $('#'+tableName+'').next().find('tr[data-index=' + index + '] input[type="radio"]');
radio.prop('checked', true).next().addClass('layui-form-radioed').find("i").html('&#xe643;');
}
}
}
var checkStatus = table.checkStatus(tableName);
if(checkStatus.isAll){
$('#'+tableName+'').next().find('.layui-table-header th[data-field="0"] input[type="checkbox"]').prop('checked', true);
$('#'+tableName+'').next().find('.layui-table-header th[data-field="0"] input[type="checkbox"]').next().addClass('layui-form-checked');
}
updataButton(checkedData.length)
}
//写入默认选中值(puash checkedData)
function defaultChecked (res, curr, count){
if(opt.checkedKey && elem.attr('ts-selected')){
var selected = elem.attr('ts-selected').split(",");
for(var i=0;i<res.data.length;i++){
for(var j=0;j<selected.length;j++){
if(res.data[i][opt.checkedKey] == selected[j]){
checkedData.push(res.data[i])
}
}
}
checkedData = uniqueObjArray(checkedData, opt.checkedKey);
}
}
//更新选中数量
function updataButton (n) {
tableBox.find('.tableSelect_btn_select span').html(n==0?'':'('+n+')')
}
//数组去重
function uniqueObjArray(arr, type){
var newArr = [];
var tArr = [];
if(arr.length == 0){
return arr;
}else{
if(type){
for(var i=0;i<arr.length;i++){
if(!tArr[arr[i][type]]){
newArr.push(arr[i]);
tArr[arr[i][type]] = true;
}
}
return newArr;
}else{
for(var i=0;i<arr.length;i++){
if(!tArr[arr[i]]){
newArr.push(arr[i]);
tArr[arr[i]] = true;
}
}
return newArr;
}
}
}
//FIX位置
var overHeight = (elem.offset().top + elem.outerHeight() + tableBox.outerHeight() - $(window).scrollTop()) > $(window).height();
var overWidth = (elem.offset().left + tableBox.outerWidth()) > $(window).width();
overHeight && tableBox.css({'top':'auto','bottom':'0px'});
overWidth && tableBox.css({'left':'auto','right':'5px'})
//关键词搜索
form.on('submit(tableSelect_btn_search)', function(data){
tableSelect_table.reload({
where: data.field,
page: {
curr: 1
}
});
return false;
});
//双击行选中
table.on('rowDouble('+tableName+')', function(obj){
var checkStatus = {data:[obj.data]};
selectDone(checkStatus);
})
//按钮选中
tableBox.find('.tableSelect_btn_select').on('click', function() {
var checkStatus = table.checkStatus(tableName);
if(checkedData.length > 1){
checkStatus.data = checkedData;
}
selectDone(checkStatus);
})
//写值回调和关闭
function selectDone (checkStatus){
if(opt.checkedKey){
var selected = [];
for(var i=0;i<checkStatus.data.length;i++){
selected.push(checkStatus.data[i][opt.checkedKey])
}
elem.attr("ts-selected",selected.join(","));
}
opt.done(elem, checkStatus);
tableBox.remove();
delete table.cache[tableName];
checkedData = [];
}
//点击其他区域关闭
$(document).mouseup(function(e){
var userSet_con = $(''+opt.elem+',.tableSelect');
if(!userSet_con.is(e.target) && userSet_con.has(e.target).length === 0){
tableBox.remove();
delete table.cache[tableName];
checkedData = [];
}
});
})
}
/**
* 隐藏选择器
*/
tableSelect.prototype.hide = function (opt) {
$('.tableSelect').remove();
}
//自动完成渲染
var tableSelect = new tableSelect();
//FIX 滚动时错位
if(window.top == window.self){
$(window).scroll(function () {
tableSelect.hide();
});
}
exports(MOD_NAME, tableSelect);
})
+261
View File
@@ -0,0 +1,261 @@
// http://tinymce.ax-z.cn/ 中文文档
layui.define(['jquery'],function (exports) {
var $ = layui.$
var modFile = layui.cache.modules['tinymce'];
var modPath = modFile.substr(0, modFile.lastIndexOf('.'))
var setter = layui.setter || {}//兼容layuiadmin
var response = setter.response || {}//兼容layuiadmin
// ---------------- 以上代码无需修改 ----------------
var plugin_filename = 'tinymce.min.js'//插件路径,不包含base_url部分
var settings = {
base_url: modPath
, images_upload_url: ''//图片上传接口,可在option传入,也可在这里修改,option的值优先
, language:localStorage.getItem('language')?localStorage.getItem('language'):"zh"//语言,可在option传入,也可在这里修改,option的值优先
, response: {//后台返回数据格式设置
statusName: response.statusName || 'code'//返回状态字段
, msgName: response.msgName || 'msg'//返回消息字段
, dataName: response.dataName || 'data'//返回的数据
, statusCode: response.statusCode || {
ok: 0//数据正常
}
}
, success: function (res, succFun, failFun) {//图片上传完成回调 根据自己需要修改
if (res[this.response.statusName] == this.response.statusCode.ok) {
succFun(res[this.response.dataName]["image_url"]);
} else {
failFun(res[this.response.msgName]["image_url"]);
}
}
};
// ---------------- 以下代码无需修改 ----------------
var t = {};
//初始化
t.render = function (option,callback) {
var admin = layui.admin || {}
var form = option.form || {}
var file_field = form.name || 'edit' //文件字段名
var form_data = form.data || {} //其他表单数据 {key:value, ...}
option.suffix= isset(option.suffix) ? option.suffix : (plugin_filename.indexOf('.min')>-1 ? '.min' : '')
option.base_url = isset(option.base_url) ? option.base_url : settings.base_url
option.language = isset(option.language) ? option.language : settings.language
option.selector = isset(option.selector) ? option.selector : option.elem
option.quickbars_selection_toolbar = isset(option.quickbars_selection_toolbar) ? option.quickbars_selection_toolbar : 'cut copy | bold italic underline strikethrough '
option.plugins = isset(option.plugins) ? option.plugins : 'quickbars print preview searchreplace autolink fullscreen image link media codesample table charmap hr advlist lists wordcount imagetools indent2em';
option.toolbar = isset(option.toolbar) ? option.toolbar : 'undo redo | forecolor backcolor bold italic underline strikethrough | indent2em alignleft aligncenter alignright alignjustify outdent indent | link bullist numlist image table codesample | formatselect fontselect fontsizeselect';
option.resize = isset(option.resize) ? option.resize : false;
option.elementpath = isset(option.elementpath) ? option.elementpath : false;
option.branding = isset(option.branding) ? option.branding : false;
option.contextmenu_never_use_native = isset(option.contextmenu_never_use_native) ? option.contextmenu_never_use_native : true;
option.menubar = isset(option.menubar) ? option.menubar : 'file edit insert format table';
option.images_upload_url = isset(option.images_upload_url) ? option.images_upload_url : settings.images_upload_url;
option.images_upload_handler = isset(option.images_upload_handler) ? option.images_upload_handler : function (blobInfo, succFun, failFun) {
if(isEmpty(option.images_upload_url)){
failFun("上传接口未配置");
return console.error('images_upload_url未配置');
}
var formData = new FormData();
formData.append(file_field, blobInfo.blob());
if(typeof form_data == 'object'){
for(var key in form_data){
formData.append(key, form_data[key]);
}
}
var ajaxOpt = {
url: option.images_upload_url,
dataType: 'json',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success: function (res) {
settings.success(res, succFun, failFun)
},
error: function (res) {
failFun("网络错误:" + res.status);
}
};
if (typeof admin.req == 'function') {
admin.req(ajaxOpt);
} else {
$.ajax(ajaxOpt);
}
}
var edit = t.get(option.elem);
if (edit) {
edit.destroy();
}
option.menu = isset(option.menu) ? option.menu : {
file: {title: '文件', items: 'newdocument | print preview fullscreen | wordcount'},
edit: {title: '编辑', items: 'undo redo | cut copy paste pastetext selectall | searchreplace'},
format: {
title: '格式',
items: 'bold italic underline strikethrough superscript subscript | formats | forecolor backcolor | removeformat'
},
table: {title: '表格', items: 'inserttable tableprops deletetable | cell row column'},
};
initTinymce();
layui.sessionData('layui-tinymce',{
key:option.selector,
value:option
})
tinymce.init(option);
if(typeof callback == 'function'){
callback.call(option)
}
return tinymce.activeEditor;
};
t.init = t.render
// 获取ID对应的编辑器对象
t.get = function (elem) {
initTinymce();
if (elem && /^#|\./.test(elem)) {
var id = elem.substr(1);
var edit = tinymce.editors[id];
return edit
} else {
return false;
}
}
//重载
t.reload = function (option,callback) {
option = option || {}
var edit = t.get(option.elem);
var optionCache = layui.sessionData('layui-tinymce')[option.elem]
edit.destroy()
$.extend(optionCache,option)
tinymce.init(optionCache)
if(typeof callback == 'function'){
callback.call(optionCache)
}
return tinymce.activeEditor;
}
// 适配单页应用的渲染
t.autoRender = function (option, callback) {
if (typeof tinymce == 'undefined') {
return t.render(option, callback);
}
if (!tinymce.editors[option.elem.substr(1)]) {
return t.render(option, callback);
}
return t.reload(option, callback);
}
function initTinymce(){
if (typeof tinymce == 'undefined') {
$.ajax({//获取插件
url: settings.base_url + '/' + plugin_filename,
dataType: 'script',
cache: true,
async: false,
});
}
}
function isset(value){
return typeof value !== 'undefined' && value !== null
}
function isEmpty(value){
if(typeof value === 'undefined' || value === null|| value === ''){
return true
} else if (value instanceof Array && value.length === 0){
return true
} else if (typeof value === 'object' && Object.keys(value).length === 0){
return true
}
return false
}
exports('tinymce', t);
});
File diff suppressed because one or more lines are too long
+92
View File
@@ -0,0 +1,92 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
/**
* Jquery integration plugin.
*
* @class tinymce.core.JqueryIntegration
* @private
*/
!function(){var f,c,u,s=[],p="undefined"!=typeof global?global:window,d=p.jQuery,v=function(){
// Reference to tinymce needs to be lazily evaluated since tinymce
// might be loaded through the compressor or other means
return p.tinymce};d.fn.tinymce=function(o){var e,t,i,l=this,r="";
// No match then just ignore the call
if(!l.length)return l;
// Get editor instance
if(!o)return v()?v().get(l[0].id):null;l.css("visibility","hidden");// Hide textarea to avoid flicker
var n,a=function(){var a=[],c=0;
// Apply patches to the jQuery object, only once
u||(m(),u=!0),
// Create an editor instance for each matched node
l.each(function(e,t){var n,i=t.id,r=o.oninit;
// Generate unique id for target element if needed
i||(t.id=i=v().DOM.uniqueId()),
// Only init the editor once
v().get(i)||(
// Create editor instance and render it
n=v().createEditor(i,o),a.push(n),n.on("init",function(){var e,t=r;l.css("visibility",""),
// Run this if the oninit setting is defined
// this logic will fire the oninit callback ones each
// matched editor instance is initialized
r&&++c==a.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:v().resolve(t.replace(/\.\w+$/,"")),t=v().resolve(t)),
// Call the oninit function with the object
t.apply(e||v(),a))}))}),
// Render the editor instances in a separate loop since we
// need to have the full editors array used in the onInit calls
d.each(a,function(e,t){t.render()})};
// Load TinyMCE on demand, if we need to
return p.tinymce||c||!(e=o.script_url)?
// Delay the init call until tinymce is loaded
1===c?s.push(a):a():(c=1,t=e.substring(0,e.lastIndexOf("/")),
// Check if it's a dev/src version they want to load then
// make sure that all plugins, themes etc are loaded in source mode as well
-1!=e.indexOf(".min")&&(r=".min"),
// Setup tinyMCEPreInit object this will later be used by the TinyMCE
// core script to locate other resources like CSS files, dialogs etc
// You can also predefined a tinyMCEPreInit object and then it will use that instead
p.tinymce=p.tinyMCEPreInit||{base:t,suffix:r},
// url contains gzip then we assume it's a compressor
-1!=e.indexOf("gzip")&&(i=o.language||"en",e=e+(/\?/.test(e)?"&":"?")+"js=true&core=true&suffix="+escape(r)+"&themes="+escape(o.theme||"modern")+"&plugins="+escape(o.plugins||"")+"&languages="+(i||""),
// Check if compressor script is already loaded otherwise setup a basic one
p.tinyMCE_GZ||(p.tinyMCE_GZ={start:function(){var n=function(e){v().ScriptLoader.markDone(v().baseURI.toAbsolute(e))};
// Add core languages
n("langs/"+i+".js"),
// Add themes with languages
n("themes/"+o.theme+"/theme"+r+".js"),n("themes/"+o.theme+"/langs/"+i+".js"),
// Add plugins with languages
d.each(o.plugins.split(","),function(e,t){t&&(n("plugins/"+t+"/plugin"+r+".js"),n("plugins/"+t+"/langs/"+i+".js"))})},end:function(){}})),(n=document.createElement("script")).type="text/javascript",n.onload=n.onreadystatechange=function(e){e=e||window.event,2===c||"load"!=e.type&&!/complete|loaded/.test(n.readyState)||(v().dom.Event.domLoaded=1,c=2,
// Execute callback after mainscript has been loaded and before the initialization occurs
o.script_loaded&&o.script_loaded(),a(),d.each(s,function(e,t){t()}))},n.src=e,document.body.appendChild(n)),l},
// Add :tinymce pseudo selector this will select elements that has been converted into editor instances
// it's now possible to use things like $('*:tinymce') to get all TinyMCE bound elements.
d.extend(d.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in p&&(t=v().get(e.id))&&t.editorManager===v())}});
// This function patches internal jQuery functions so that if
// you for example remove an div element containing an editor it's
// automatically destroyed by the TinyMCE API
var m=function(){
// Removes any child editor instances by looking for editor wrapper elements
var r=function(e){
// If the function is remove
"remove"===e&&this.each(function(e,t){var n=l(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=v().get(t.id.replace(/_parent$/,""));n&&n.remove()})},o=function(i){var e,t=this;
// Handle set value
/*jshint eqnull:true */if(null!=i)r.call(t),
// Saves the contents before get/set value of textarea/div
t.each(function(e,t){var n;(n=v().get(t.id))&&n.setContent(i)});else if(0<t.length&&(e=v().get(t[0].id)))return e.getContent()},l=function(e){var t=null;return e&&e.id&&p.tinymce&&(t=v().get(e.id)),t},u=function(e){return!!(e&&e.length&&p.tinymce&&e.is(":tinymce"))},s={};
// Loads or saves contents from/to textarea if the value
// argument is defined it will set the TinyMCE internal contents
// Patch some setter/getter functions these will
// now be able to set/get the contents of editor instances for
// example $('#editorid').html('Content'); will update the TinyMCE iframe instance
d.each(["text","html","val"],function(e,t){var a=s[t]=d.fn[t],c="text"===t;d.fn[t]=function(e){var t=this;if(!u(t))return a.apply(t,arguments);if(e!==f)return o.call(t.filter(":tinymce"),e),a.apply(t.not(":tinymce"),arguments),t;// return original set for chaining
var i="",r=arguments;return(c?t:t.eq(0)).each(function(e,t){var n=l(t);i+=n?c?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):a.apply(d(t),r)}),i}}),
// Makes it possible to use $('#id').append("content"); to append contents to the TinyMCE editor iframe
d.each(["append","prepend"],function(e,t){var n=s[t]=d.fn[t],r="prepend"===t;d.fn[t]=function(i){var e=this;return u(e)?i!==f?("string"==typeof i&&e.filter(":tinymce").each(function(e,t){var n=l(t);n&&n.setContent(r?i+n.getContent():n.getContent()+i)}),n.apply(e.not(":tinymce"),arguments),e):void 0:n.apply(e,arguments)}}),
// Makes sure that the editor instance gets properly destroyed when the parent element is removed
d.each(["remove","replaceWith","replaceAll","empty"],function(e,t){var n=s[t]=d.fn[t];d.fn[t]=function(){return r.call(this,t),n.apply(this,arguments)}}),s.attr=d.fn.attr,
// Makes sure that $('#tinymce_id').attr('value') gets the editors current HTML contents
d.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!u(n))return s.attr.apply(n,i);if(t!==f)return o.call(n.filter(":tinymce"),t),s.attr.apply(n.not(":tinymce"),i),n;// return original set for chaining
var r=n[0],a=l(r);return a?a.getContent({save:!0}):s.attr.apply(d(r),i)}}}();
+3
View File
@@ -0,0 +1,3 @@
This is where language files should be placed.
Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/
@@ -0,0 +1,419 @@
tinymce.addI18n('zh_CN',{
"Redo": "\u91cd\u505a",
"Undo": "\u64a4\u9500",
"Cut": "\u526a\u5207",
"Copy": "\u590d\u5236",
"Paste": "\u7c98\u8d34",
"Select all": "\u5168\u9009",
"New document": "\u65b0\u6587\u4ef6",
"Ok": "\u786e\u5b9a",
"Cancel": "\u53d6\u6d88",
"Visual aids": "\u7f51\u683c\u7ebf",
"Bold": "\u7c97\u4f53",
"Italic": "\u659c\u4f53",
"Underline": "\u4e0b\u5212\u7ebf",
"Strikethrough": "\u5220\u9664\u7ebf",
"Superscript": "\u4e0a\u6807",
"Subscript": "\u4e0b\u6807",
"Clear formatting": "\u6e05\u9664\u683c\u5f0f",
"Align left": "\u5de6\u8fb9\u5bf9\u9f50",
"Align center": "\u4e2d\u95f4\u5bf9\u9f50",
"Align right": "\u53f3\u8fb9\u5bf9\u9f50",
"Justify": "\u4e24\u7aef\u5bf9\u9f50",
"Bullet list": "\u9879\u76ee\u7b26\u53f7",
"Numbered list": "\u7f16\u53f7\u5217\u8868",
"Decrease indent": "\u51cf\u5c11\u7f29\u8fdb",
"Increase indent": "\u589e\u52a0\u7f29\u8fdb",
"Close": "\u5173\u95ed",
"Formats": "\u683c\u5f0f",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6253\u5f00\u526a\u8d34\u677f\uff0c\u8bf7\u4f7f\u7528Ctrl+X\/C\/V\u7b49\u5feb\u6377\u952e\u3002",
"Headers": "\u6807\u9898",
"Header 1": "\u6807\u98981",
"Header 2": "\u6807\u98982",
"Header 3": "\u6807\u98983",
"Header 4": "\u6807\u98984",
"Header 5": "\u6807\u98985",
"Header 6": "\u6807\u98986",
"Headings": "\u6807\u9898",
"Heading 1": "\u6807\u98981",
"Heading 2": "\u6807\u98982",
"Heading 3": "\u6807\u98983",
"Heading 4": "\u6807\u98984",
"Heading 5": "\u6807\u98985",
"Heading 6": "\u6807\u98986",
"Preformatted": "\u9884\u5148\u683c\u5f0f\u5316\u7684",
"Div": "Div",
"Pre": "Pre",
"Code": "\u4ee3\u7801",
"Paragraph": "\u6bb5\u843d",
"Blockquote": "\u5f15\u6587\u533a\u5757",
"Inline": "\u6587\u672c",
"Blocks": "\u57fa\u5757",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "\u5f53\u524d\u4e3a\u7eaf\u6587\u672c\u7c98\u8d34\u6a21\u5f0f\uff0c\u518d\u6b21\u70b9\u51fb\u53ef\u4ee5\u56de\u5230\u666e\u901a\u7c98\u8d34\u6a21\u5f0f\u3002",
"Fonts": "\u5b57\u4f53",
"Font Sizes": "\u5b57\u53f7",
"Class": "\u7c7b\u578b",
"Browse for an image": "\u6d4f\u89c8\u56fe\u50cf",
"OR": "\u6216",
"Drop an image here": "\u62d6\u653e\u4e00\u5f20\u56fe\u50cf\u81f3\u6b64",
"Upload": "\u4e0a\u4f20",
"Block": "\u5757",
"Align": "\u5bf9\u9f50",
"Default": "\u9ed8\u8ba4",
"Circle": "\u7a7a\u5fc3\u5706",
"Disc": "\u5b9e\u5fc3\u5706",
"Square": "\u65b9\u5757",
"Lower Alpha": "\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd",
"Lower Greek": "\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd",
"Lower Roman": "\u5c0f\u5199\u7f57\u9a6c\u5b57\u6bcd",
"Upper Alpha": "\u5927\u5199\u82f1\u6587\u5b57\u6bcd",
"Upper Roman": "\u5927\u5199\u7f57\u9a6c\u5b57\u6bcd",
"Anchor...": "\u951a\u70b9...",
"Name": "\u540d\u79f0",
"Id": "\u6807\u8bc6\u7b26",
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "\u6807\u8bc6\u7b26\u5e94\u8be5\u4ee5\u5b57\u6bcd\u5f00\u5934\uff0c\u540e\u8ddf\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u7834\u6298\u53f7\u3001\u70b9\u3001\u5192\u53f7\u6216\u4e0b\u5212\u7ebf\u3002",
"You have unsaved changes are you sure you want to navigate away?": "\u4f60\u8fd8\u6709\u6587\u6863\u5c1a\u672a\u4fdd\u5b58\uff0c\u786e\u5b9a\u8981\u79bb\u5f00\uff1f",
"Restore last draft": "\u6062\u590d\u4e0a\u6b21\u7684\u8349\u7a3f",
"Special character...": "\u7279\u6b8a\u5b57\u7b26...",
"Source code": "\u6e90\u4ee3\u7801",
"Insert\/Edit code sample": "\u63d2\u5165\/\u7f16\u8f91\u4ee3\u7801\u793a\u4f8b",
"Language": "\u8bed\u8a00",
"Code sample...": "\u793a\u4f8b\u4ee3\u7801...",
"Color Picker": "\u9009\u8272\u5668",
"R": "R",
"G": "G",
"B": "B",
"Left to right": "\u4ece\u5de6\u5230\u53f3",
"Right to left": "\u4ece\u53f3\u5230\u5de6",
"Emoticons...": "\u8868\u60c5\u7b26\u53f7...",
"Metadata and Document Properties": "\u5143\u6570\u636e\u548c\u6587\u6863\u5c5e\u6027",
"Title": "\u6807\u9898",
"Keywords": "\u5173\u952e\u8bcd",
"Description": "\u63cf\u8ff0",
"Robots": "\u673a\u5668\u4eba",
"Author": "\u4f5c\u8005",
"Encoding": "\u7f16\u7801",
"Fullscreen": "\u5168\u5c4f",
"Action": "\u64cd\u4f5c",
"Shortcut": "\u5feb\u6377\u952e",
"Help": "\u5e2e\u52a9",
"Address": "\u5730\u5740",
"Focus to menubar": "\u79fb\u52a8\u7126\u70b9\u5230\u83dc\u5355\u680f",
"Focus to toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u5de5\u5177\u680f",
"Focus to element path": "\u79fb\u52a8\u7126\u70b9\u5230\u5143\u7d20\u8def\u5f84",
"Focus to contextual toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u4e0a\u4e0b\u6587\u83dc\u5355",
"Insert link (if link plugin activated)": "\u63d2\u5165\u94fe\u63a5 (\u5982\u679c\u94fe\u63a5\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Save (if save plugin activated)": "\u4fdd\u5b58(\u5982\u679c\u4fdd\u5b58\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Find (if searchreplace plugin activated)": "\u67e5\u627e(\u5982\u679c\u67e5\u627e\u66ff\u6362\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Plugins installed ({0}):": "\u5df2\u5b89\u88c5\u63d2\u4ef6 ({0}):",
"Premium plugins:": "\u4f18\u79c0\u63d2\u4ef6\uff1a",
"Learn more...": "\u4e86\u89e3\u66f4\u591a...",
"You are using {0}": "\u4f60\u6b63\u5728\u4f7f\u7528 {0}",
"Plugins": "\u63d2\u4ef6",
"Handy Shortcuts": "\u5feb\u6377\u952e",
"Horizontal line": "\u6c34\u5e73\u5206\u5272\u7ebf",
"Insert\/edit image": "\u63d2\u5165\/\u7f16\u8f91\u56fe\u7247",
"Image description": "\u56fe\u7247\u63cf\u8ff0",
"Source": "\u5730\u5740",
"Dimensions": "\u5927\u5c0f",
"Constrain proportions": "\u4fdd\u6301\u7eb5\u6a2a\u6bd4",
"General": "\u666e\u901a",
"Advanced": "\u9ad8\u7ea7",
"Style": "\u6837\u5f0f",
"Vertical space": "\u5782\u76f4\u8fb9\u8ddd",
"Horizontal space": "\u6c34\u5e73\u8fb9\u8ddd",
"Border": "\u8fb9\u6846",
"Insert image": "\u63d2\u5165\u56fe\u7247",
"Image...": "\u56fe\u7247...",
"Image list": "\u56fe\u7247\u5217\u8868",
"Rotate counterclockwise": "\u9006\u65f6\u9488\u65cb\u8f6c",
"Rotate clockwise": "\u987a\u65f6\u9488\u65cb\u8f6c",
"Flip vertically": "\u5782\u76f4\u7ffb\u8f6c",
"Flip horizontally": "\u6c34\u5e73\u7ffb\u8f6c",
"Edit image": "\u7f16\u8f91\u56fe\u7247",
"Image options": "\u56fe\u7247\u9009\u9879",
"Zoom in": "\u653e\u5927",
"Zoom out": "\u7f29\u5c0f",
"Crop": "\u88c1\u526a",
"Resize": "\u8c03\u6574\u5927\u5c0f",
"Orientation": "\u65b9\u5411",
"Brightness": "\u4eae\u5ea6",
"Sharpen": "\u9510\u5316",
"Contrast": "\u5bf9\u6bd4\u5ea6",
"Color levels": "\u989c\u8272\u5c42\u6b21",
"Gamma": "\u4f3d\u9a6c\u503c",
"Invert": "\u53cd\u8f6c",
"Apply": "\u5e94\u7528",
"Back": "\u540e\u9000",
"Insert date\/time": "\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4",
"Date\/time": "\u65e5\u671f\/\u65f6\u95f4",
"Insert\/Edit Link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5",
"Insert\/edit link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5",
"Text to display": "\u663e\u793a\u6587\u5b57",
"Url": "\u5730\u5740",
"Open link in...": "\u94fe\u63a5\u6253\u5f00\u4f4d\u7f6e...",
"Current window": "\u5f53\u524d\u7a97\u53e3",
"None": "\u65e0",
"New window": "\u5728\u65b0\u7a97\u53e3\u6253\u5f00",
"Remove link": "\u5220\u9664\u94fe\u63a5",
"Anchors": "\u951a\u70b9",
"Link...": "\u94fe\u63a5...",
"Paste or type a link": "\u7c98\u8d34\u6216\u8f93\u5165\u94fe\u63a5",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u4e3a\u90ae\u4ef6\u5730\u5740\uff0c\u9700\u8981\u52a0\u4e0amailto:\u524d\u7f00\u5417\uff1f",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u5c5e\u4e8e\u5916\u90e8\u94fe\u63a5\uff0c\u9700\u8981\u52a0\u4e0ahttp:\/\/:\u524d\u7f00\u5417\uff1f",
"Link list": "\u94fe\u63a5\u5217\u8868",
"Insert video": "\u63d2\u5165\u89c6\u9891",
"Insert\/edit video": "\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891",
"Insert\/edit media": "\u63d2\u5165\/\u7f16\u8f91\u5a92\u4f53",
"Alternative source": "\u955c\u50cf",
"Alternative source URL": "\u66ff\u4ee3\u6765\u6e90\u7f51\u5740",
"Media poster (Image URL)": "\u5c01\u9762(\u56fe\u7247\u5730\u5740)",
"Paste your embed code below:": "\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:",
"Embed": "\u5185\u5d4c",
"Media...": "\u591a\u5a92\u4f53...",
"Nonbreaking space": "\u4e0d\u95f4\u65ad\u7a7a\u683c",
"Page break": "\u5206\u9875\u7b26",
"Paste as text": "\u7c98\u8d34\u4e3a\u6587\u672c",
"Preview": "\u9884\u89c8",
"Print...": "\u6253\u5370...",
"Save": "\u4fdd\u5b58",
"Find": "\u67e5\u627e",
"Replace with": "\u66ff\u6362\u4e3a",
"Replace": "\u66ff\u6362",
"Replace all": "\u5168\u90e8\u66ff\u6362",
"Previous": "\u4e0a\u4e00\u4e2a",
"Next": "\u4e0b\u4e00\u4e2a",
"Find and replace...": "\u67e5\u627e\u5e76\u66ff\u6362...",
"Could not find the specified string.": "\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.",
"Match case": "\u533a\u5206\u5927\u5c0f\u5199",
"Find whole words only": "\u5168\u5b57\u5339\u914d",
"Spell check": "\u62fc\u5199\u68c0\u67e5",
"Ignore": "\u5ffd\u7565",
"Ignore all": "\u5168\u90e8\u5ffd\u7565",
"Finish": "\u5b8c\u6210",
"Add to Dictionary": "\u6dfb\u52a0\u5230\u5b57\u5178",
"Insert table": "\u63d2\u5165\u8868\u683c",
"Table properties": "\u8868\u683c\u5c5e\u6027",
"Delete table": "\u5220\u9664\u8868\u683c",
"Cell": "\u5355\u5143\u683c",
"Row": "\u884c",
"Column": "\u5217",
"Cell properties": "\u5355\u5143\u683c\u5c5e\u6027",
"Merge cells": "\u5408\u5e76\u5355\u5143\u683c",
"Split cell": "\u62c6\u5206\u5355\u5143\u683c",
"Insert row before": "\u5728\u4e0a\u65b9\u63d2\u5165",
"Insert row after": "\u5728\u4e0b\u65b9\u63d2\u5165",
"Delete row": "\u5220\u9664\u884c",
"Row properties": "\u884c\u5c5e\u6027",
"Cut row": "\u526a\u5207\u884c",
"Copy row": "\u590d\u5236\u884c",
"Paste row before": "\u7c98\u8d34\u5230\u4e0a\u65b9",
"Paste row after": "\u7c98\u8d34\u5230\u4e0b\u65b9",
"Insert column before": "\u5728\u5de6\u4fa7\u63d2\u5165",
"Insert column after": "\u5728\u53f3\u4fa7\u63d2\u5165",
"Delete column": "\u5220\u9664\u5217",
"Cols": "\u5217",
"Rows": "\u884c",
"Width": "\u5bbd",
"Height": "\u9ad8",
"Cell spacing": "\u5355\u5143\u683c\u5916\u95f4\u8ddd",
"Cell padding": "\u5355\u5143\u683c\u5185\u8fb9\u8ddd",
"Show caption": "\u663e\u793a\u6807\u9898",
"Left": "\u5de6\u5bf9\u9f50",
"Center": "\u5c45\u4e2d",
"Right": "\u53f3\u5bf9\u9f50",
"Cell type": "\u5355\u5143\u683c\u7c7b\u578b",
"Scope": "\u8303\u56f4",
"Alignment": "\u5bf9\u9f50\u65b9\u5f0f",
"H Align": "\u6c34\u5e73\u5bf9\u9f50",
"V Align": "\u5782\u76f4\u5bf9\u9f50",
"Top": "\u9876\u90e8\u5bf9\u9f50",
"Middle": "\u5782\u76f4\u5c45\u4e2d",
"Bottom": "\u5e95\u90e8\u5bf9\u9f50",
"Header cell": "\u8868\u5934\u5355\u5143\u683c",
"Row group": "\u884c\u7ec4",
"Column group": "\u5217\u7ec4",
"Row type": "\u884c\u7c7b\u578b",
"Header": "\u8868\u5934",
"Body": "\u8868\u4f53",
"Footer": "\u8868\u5c3e",
"Border color": "\u8fb9\u6846\u989c\u8272",
"Insert template...": "\u63d2\u5165\u6a21\u677f...",
"Templates": "\u6a21\u677f",
"Template": "\u6a21\u677f",
"Text color": "\u6587\u5b57\u989c\u8272",
"Background color": "\u80cc\u666f\u8272",
"Custom...": "\u81ea\u5b9a\u4e49...",
"Custom color": "\u81ea\u5b9a\u4e49\u989c\u8272",
"No color": "\u65e0",
"Remove color": "\u79fb\u9664\u989c\u8272",
"Table of Contents": "\u5185\u5bb9\u5217\u8868",
"Show blocks": "\u663e\u793a\u533a\u5757\u8fb9\u6846",
"Show invisible characters": "\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26",
"Word count": "\u5b57\u6570",
"Count": "\u8ba1\u6570",
"Document": "\u6587\u6863",
"Selection": "\u9009\u62e9",
"Words": "\u5355\u8bcd",
"Words: {0}": "\u5b57\u6570\uff1a{0}",
"{0} words": "{0} \u5b57",
"File": "\u6587\u4ef6",
"Edit": "\u7f16\u8f91",
"Insert": "\u63d2\u5165",
"View": "\u89c6\u56fe",
"Format": "\u683c\u5f0f",
"Table": "\u8868\u683c",
"Tools": "\u5de5\u5177",
"Powered by {0}": "\u7531{0}\u9a71\u52a8",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "\u5728\u7f16\u8f91\u533a\u6309ALT-F9\u6253\u5f00\u83dc\u5355\uff0c\u6309ALT-F10\u6253\u5f00\u5de5\u5177\u680f\uff0c\u6309ALT-0\u67e5\u770b\u5e2e\u52a9",
"Image title": "\u56fe\u7247\u6807\u9898",
"Border width": "\u8fb9\u6846\u5bbd\u5ea6",
"Border style": "\u8fb9\u6846\u6837\u5f0f",
"Error": "\u9519\u8bef",
"Warn": "\u8b66\u544a",
"Valid": "\u6709\u6548",
"To open the popup, press Shift+Enter": "\u6309Shitf+Enter\u952e\u6253\u5f00\u5bf9\u8bdd\u6846",
"Rich Text Area. Press ALT-0 for help.": "\u7f16\u8f91\u533a\u3002\u6309Alt+0\u952e\u6253\u5f00\u5e2e\u52a9\u3002",
"System Font": "\u7cfb\u7edf\u5b57\u4f53",
"Failed to upload image: {0}": "\u56fe\u7247\u4e0a\u4f20\u5931\u8d25: {0}",
"Failed to load plugin: {0} from url {1}": "\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25: {0} \u6765\u81ea\u94fe\u63a5 {1}",
"Failed to load plugin url: {0}": "\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25 \u94fe\u63a5: {0}",
"Failed to initialize plugin: {0}": "\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25: {0}",
"example": "\u793a\u4f8b",
"Search": "\u641c\u7d22",
"All": "\u5168\u90e8",
"Currency": "\u8d27\u5e01",
"Text": "\u6587\u5b57",
"Quotations": "\u5f15\u7528",
"Mathematical": "\u6570\u5b66",
"Extended Latin": "\u62c9\u4e01\u8bed\u6269\u5145",
"Symbols": "\u7b26\u53f7",
"Arrows": "\u7bad\u5934",
"User Defined": "\u81ea\u5b9a\u4e49",
"dollar sign": "\u7f8e\u5143\u7b26\u53f7",
"currency sign": "\u8d27\u5e01\u7b26\u53f7",
"euro-currency sign": "\u6b27\u5143\u7b26\u53f7",
"colon sign": "\u5192\u53f7",
"cruzeiro sign": "\u514b\u9c81\u8d5b\u7f57\u5e01\u7b26\u53f7",
"french franc sign": "\u6cd5\u90ce\u7b26\u53f7",
"lira sign": "\u91cc\u62c9\u7b26\u53f7",
"mill sign": "\u5bc6\u5c14\u7b26\u53f7",
"naira sign": "\u5948\u62c9\u7b26\u53f7",
"peseta sign": "\u6bd4\u585e\u5854\u7b26\u53f7",
"rupee sign": "\u5362\u6bd4\u7b26\u53f7",
"won sign": "\u97e9\u5143\u7b26\u53f7",
"new sheqel sign": "\u65b0\u8c22\u514b\u5c14\u7b26\u53f7",
"dong sign": "\u8d8a\u5357\u76fe\u7b26\u53f7",
"kip sign": "\u8001\u631d\u57fa\u666e\u7b26\u53f7",
"tugrik sign": "\u56fe\u683c\u91cc\u514b\u7b26\u53f7",
"drachma sign": "\u5fb7\u62c9\u514b\u9a6c\u7b26\u53f7",
"german penny symbol": "\u5fb7\u56fd\u4fbf\u58eb\u7b26\u53f7",
"peso sign": "\u6bd4\u7d22\u7b26\u53f7",
"guarani sign": "\u74dc\u62c9\u5c3c\u7b26\u53f7",
"austral sign": "\u6fb3\u5143\u7b26\u53f7",
"hryvnia sign": "\u683c\u91cc\u592b\u5c3c\u4e9a\u7b26\u53f7",
"cedi sign": "\u585e\u5730\u7b26\u53f7",
"livre tournois sign": "\u91cc\u5f17\u5f17\u5c14\u7b26\u53f7",
"spesmilo sign": "spesmilo\u7b26\u53f7",
"tenge sign": "\u575a\u6208\u7b26\u53f7",
"indian rupee sign": "\u5370\u5ea6\u5362\u6bd4",
"turkish lira sign": "\u571f\u8033\u5176\u91cc\u62c9",
"nordic mark sign": "\u5317\u6b27\u9a6c\u514b",
"manat sign": "\u9a6c\u7eb3\u7279\u7b26\u53f7",
"ruble sign": "\u5362\u5e03\u7b26\u53f7",
"yen character": "\u65e5\u5143\u5b57\u6837",
"yuan character": "\u4eba\u6c11\u5e01\u5143\u5b57\u6837",
"yuan character, in hong kong and taiwan": "\u5143\u5b57\u6837\uff08\u6e2f\u53f0\u5730\u533a\uff09",
"yen\/yuan character variant one": "\u5143\u5b57\u6837\uff08\u5927\u5199\uff09",
"Loading emoticons...": "\u52a0\u8f7d\u8868\u60c5\u7b26\u53f7...",
"Could not load emoticons": "\u4e0d\u80fd\u52a0\u8f7d\u8868\u60c5\u7b26\u53f7",
"People": "\u4eba\u7c7b",
"Animals and Nature": "\u52a8\u7269\u548c\u81ea\u7136",
"Food and Drink": "\u98df\u7269\u548c\u996e\u54c1",
"Activity": "\u6d3b\u52a8",
"Travel and Places": "\u65c5\u6e38\u548c\u5730\u70b9",
"Objects": "\u7269\u4ef6",
"Flags": "\u65d7\u5e1c",
"Characters": "\u5b57\u7b26",
"Characters (no spaces)": "\u5b57\u7b26(\u65e0\u7a7a\u683c)",
"{0} characters": "{0} \u4e2a\u5b57\u7b26",
"Error: Form submit field collision.": "\u9519\u8bef: \u8868\u5355\u63d0\u4ea4\u5b57\u6bb5\u51b2\u7a81\u3002",
"Error: No form element found.": "\u9519\u8bef: \u6ca1\u6709\u8868\u5355\u63a7\u4ef6\u3002",
"Update": "\u66f4\u65b0",
"Color swatch": "\u989c\u8272\u6837\u672c",
"Turquoise": "\u9752\u7eff\u8272",
"Green": "\u7eff\u8272",
"Blue": "\u84dd\u8272",
"Purple": "\u7d2b\u8272",
"Navy Blue": "\u6d77\u519b\u84dd",
"Dark Turquoise": "\u6df1\u84dd\u7eff\u8272",
"Dark Green": "\u6df1\u7eff\u8272",
"Medium Blue": "\u4e2d\u84dd\u8272",
"Medium Purple": "\u4e2d\u7d2b\u8272",
"Midnight Blue": "\u6df1\u84dd\u8272",
"Yellow": "\u9ec4\u8272",
"Orange": "\u6a59\u8272",
"Red": "\u7ea2\u8272",
"Light Gray": "\u6d45\u7070\u8272",
"Gray": "\u7070\u8272",
"Dark Yellow": "\u6697\u9ec4\u8272",
"Dark Orange": "\u6df1\u6a59\u8272",
"Dark Red": "\u6df1\u7ea2\u8272",
"Medium Gray": "\u4e2d\u7070\u8272",
"Dark Gray": "\u6df1\u7070\u8272",
"Light Green": "\u6d45\u7eff\u8272",
"Light Yellow": "\u6d45\u9ec4\u8272",
"Light Red": "\u6d45\u7ea2\u8272",
"Light Purple": "\u6d45\u7d2b\u8272",
"Light Blue": "\u6d45\u84dd\u8272",
"Dark Purple": "\u6df1\u7d2b\u8272",
"Dark Blue": "\u6df1\u84dd\u8272",
"Black": "\u9ed1\u8272",
"White": "\u767d\u8272",
"Switch to or from fullscreen mode": "\u5207\u6362\u5168\u5c4f\u6a21\u5f0f",
"Open help dialog": "\u6253\u5f00\u5e2e\u52a9\u5bf9\u8bdd\u6846",
"history": "\u5386\u53f2",
"styles": "\u6837\u5f0f",
"formatting": "\u683c\u5f0f\u5316",
"alignment": "\u5bf9\u9f50",
"indentation": "\u7f29\u8fdb",
"permanent pen": "\u8bb0\u53f7\u7b14",
"comments": "\u5907\u6ce8",
"Format Painter": "\u683c\u5f0f\u5237",
"Insert\/edit iframe": "\u63d2\u5165\/\u7f16\u8f91\u6846\u67b6",
"Capitalization": "\u5927\u5199",
"lowercase": "\u5c0f\u5199",
"UPPERCASE": "\u5927\u5199",
"Title Case": "\u9996\u5b57\u6bcd\u5927\u5199",
"Permanent Pen Properties": "\u6c38\u4e45\u7b14\u5c5e\u6027",
"Permanent pen properties...": "\u6c38\u4e45\u7b14\u5c5e\u6027...",
"Font": "\u5b57\u4f53",
"Size": "\u5b57\u53f7",
"More...": "\u66f4\u591a...",
"Spellcheck Language": "\u62fc\u5199\u68c0\u67e5\u8bed\u8a00",
"Select...": "\u9009\u62e9...",
"Preferences": "\u9996\u9009\u9879",
"Yes": "\u662f",
"No": "\u5426",
"Keyboard Navigation": "\u952e\u76d8\u6307\u5f15",
"Version": "\u7248\u672c",
"Anchor": "\u951a\u70b9",
"Special character": "\u7279\u6b8a\u7b26\u53f7",
"Code sample": "\u4ee3\u7801\u793a\u4f8b",
"Color": "\u989c\u8272",
"Emoticons": "\u8868\u60c5",
"Document properties": "\u6587\u6863\u5c5e\u6027",
"Image": "\u56fe\u7247",
"Insert link": "\u63d2\u5165\u94fe\u63a5",
"Target": "\u6253\u5f00\u65b9\u5f0f",
"Link": "\u94fe\u63a5",
"Poster": "\u5c01\u9762",
"Media": "\u5a92\u4f53",
"Print": "\u6253\u5370",
"Prev": "\u4e0a\u4e00\u4e2a",
"Find and replace": "\u67e5\u627e\u548c\u66ff\u6362",
"Whole words": "\u5168\u5b57\u5339\u914d",
"Spellcheck": "\u62fc\u5199\u68c0\u67e5",
"Caption": "\u6807\u9898",
"Insert template": "\u63d2\u5165\u6a21\u677f"
});
+837
View File
@@ -0,0 +1,837 @@
tinymce.addI18n('zh',{
"Redo": "\u91cd\u505a",
"Undo": "\u64a4\u9500",
"Cut": "\u526a\u5207",
"Copy": "\u590d\u5236",
"Paste": "\u7c98\u8d34",
"Select all": "\u5168\u9009",
"New document": "\u65b0\u6587\u4ef6",
"Ok": "\u786e\u5b9a",
"Cancel": "\u53d6\u6d88",
"Visual aids": "\u7f51\u683c\u7ebf",
"Bold": "\u7c97\u4f53",
"Italic": "\u659c\u4f53",
"Underline": "\u4e0b\u5212\u7ebf",
"Strikethrough": "\u5220\u9664\u7ebf",
"Superscript": "\u4e0a\u6807",
"Subscript": "\u4e0b\u6807",
"Clear formatting": "\u6e05\u9664\u683c\u5f0f",
"Align left": "\u5de6\u8fb9\u5bf9\u9f50",
"Align center": "\u4e2d\u95f4\u5bf9\u9f50",
"Align right": "\u53f3\u8fb9\u5bf9\u9f50",
"Justify": "\u4e24\u7aef\u5bf9\u9f50",
"Bullet list": "\u9879\u76ee\u7b26\u53f7",
"Numbered list": "\u7f16\u53f7\u5217\u8868",
"Decrease indent": "\u51cf\u5c11\u7f29\u8fdb",
"Increase indent": "\u589e\u52a0\u7f29\u8fdb",
"Close": "\u5173\u95ed",
"Formats": "\u683c\u5f0f",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6253\u5f00\u526a\u8d34\u677f\uff0c\u8bf7\u4f7f\u7528Ctrl+X\/C\/V\u7b49\u5feb\u6377\u952e\u3002",
"Headers": "\u6807\u9898",
"Header 1": "\u6807\u98981",
"Header 2": "\u6807\u98982",
"Header 3": "\u6807\u98983",
"Header 4": "\u6807\u98984",
"Header 5": "\u6807\u98985",
"Header 6": "\u6807\u98986",
"Headings": "\u6807\u9898",
"Heading 1": "\u6807\u98981",
"Heading 2": "\u6807\u98982",
"Heading 3": "\u6807\u98983",
"Heading 4": "\u6807\u98984",
"Heading 5": "\u6807\u98985",
"Heading 6": "\u6807\u98986",
"Preformatted": "\u9884\u5148\u683c\u5f0f\u5316\u7684",
"Div": "Div",
"Pre": "Pre",
"Code": "\u4ee3\u7801",
"Paragraph": "\u6bb5\u843d",
"Blockquote": "\u5f15\u6587\u533a\u5757",
"Inline": "\u6587\u672c",
"Blocks": "\u57fa\u5757",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "\u5f53\u524d\u4e3a\u7eaf\u6587\u672c\u7c98\u8d34\u6a21\u5f0f\uff0c\u518d\u6b21\u70b9\u51fb\u53ef\u4ee5\u56de\u5230\u666e\u901a\u7c98\u8d34\u6a21\u5f0f\u3002",
"Fonts": "\u5b57\u4f53",
"Font Sizes": "\u5b57\u53f7",
"Class": "\u7c7b\u578b",
"Browse for an image": "\u6d4f\u89c8\u56fe\u50cf",
"OR": "\u6216",
"Drop an image here": "\u62d6\u653e\u4e00\u5f20\u56fe\u50cf\u81f3\u6b64",
"Upload": "\u4e0a\u4f20",
"Block": "\u5757",
"Align": "\u5bf9\u9f50",
"Default": "\u9ed8\u8ba4",
"Circle": "\u7a7a\u5fc3\u5706",
"Disc": "\u5b9e\u5fc3\u5706",
"Square": "\u65b9\u5757",
"Lower Alpha": "\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd",
"Lower Greek": "\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd",
"Lower Roman": "\u5c0f\u5199\u7f57\u9a6c\u5b57\u6bcd",
"Upper Alpha": "\u5927\u5199\u82f1\u6587\u5b57\u6bcd",
"Upper Roman": "\u5927\u5199\u7f57\u9a6c\u5b57\u6bcd",
"Anchor...": "\u951a\u70b9...",
"Name": "\u540d\u79f0",
"Id": "\u6807\u8bc6\u7b26",
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "\u6807\u8bc6\u7b26\u5e94\u8be5\u4ee5\u5b57\u6bcd\u5f00\u5934\uff0c\u540e\u8ddf\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u7834\u6298\u53f7\u3001\u70b9\u3001\u5192\u53f7\u6216\u4e0b\u5212\u7ebf\u3002",
"You have unsaved changes are you sure you want to navigate away?": "\u4f60\u8fd8\u6709\u6587\u6863\u5c1a\u672a\u4fdd\u5b58\uff0c\u786e\u5b9a\u8981\u79bb\u5f00\uff1f",
"Restore last draft": "\u6062\u590d\u4e0a\u6b21\u7684\u8349\u7a3f",
"Special character...": "\u7279\u6b8a\u5b57\u7b26...",
"Source code": "\u6e90\u4ee3\u7801",
"Insert\/Edit code sample": "\u63d2\u5165\/\u7f16\u8f91\u4ee3\u7801\u793a\u4f8b",
"Language": "\u8bed\u8a00",
"Code sample...": "\u793a\u4f8b\u4ee3\u7801...",
"Color Picker": "\u9009\u8272\u5668",
"R": "R",
"G": "G",
"B": "B",
"Left to right": "\u4ece\u5de6\u5230\u53f3",
"Right to left": "\u4ece\u53f3\u5230\u5de6",
"Emoticons...": "\u8868\u60c5\u7b26\u53f7...",
"Metadata and Document Properties": "\u5143\u6570\u636e\u548c\u6587\u6863\u5c5e\u6027",
"Title": "\u6807\u9898",
"Keywords": "\u5173\u952e\u8bcd",
"Description": "\u63cf\u8ff0",
"Robots": "\u673a\u5668\u4eba",
"Author": "\u4f5c\u8005",
"Encoding": "\u7f16\u7801",
"Fullscreen": "\u5168\u5c4f",
"Action": "\u64cd\u4f5c",
"Shortcut": "\u5feb\u6377\u952e",
"Help": "\u5e2e\u52a9",
"Address": "\u5730\u5740",
"Focus to menubar": "\u79fb\u52a8\u7126\u70b9\u5230\u83dc\u5355\u680f",
"Focus to toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u5de5\u5177\u680f",
"Focus to element path": "\u79fb\u52a8\u7126\u70b9\u5230\u5143\u7d20\u8def\u5f84",
"Focus to contextual toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u4e0a\u4e0b\u6587\u83dc\u5355",
"Insert link (if link plugin activated)": "\u63d2\u5165\u94fe\u63a5 (\u5982\u679c\u94fe\u63a5\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Save (if save plugin activated)": "\u4fdd\u5b58(\u5982\u679c\u4fdd\u5b58\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Find (if searchreplace plugin activated)": "\u67e5\u627e(\u5982\u679c\u67e5\u627e\u66ff\u6362\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Plugins installed ({0}):": "\u5df2\u5b89\u88c5\u63d2\u4ef6 ({0}):",
"Premium plugins:": "\u4f18\u79c0\u63d2\u4ef6\uff1a",
"Learn more...": "\u4e86\u89e3\u66f4\u591a...",
"You are using {0}": "\u4f60\u6b63\u5728\u4f7f\u7528 {0}",
"Plugins": "\u63d2\u4ef6",
"Handy Shortcuts": "\u5feb\u6377\u952e",
"Horizontal line": "\u6c34\u5e73\u5206\u5272\u7ebf",
"Insert\/edit image": "\u63d2\u5165\/\u7f16\u8f91\u56fe\u7247",
"Image description": "\u56fe\u7247\u63cf\u8ff0",
"Source": "\u5730\u5740",
"Dimensions": "\u5927\u5c0f",
"Constrain proportions": "\u4fdd\u6301\u7eb5\u6a2a\u6bd4",
"General": "\u666e\u901a",
"Advanced": "\u9ad8\u7ea7",
"Style": "\u6837\u5f0f",
"Vertical space": "\u5782\u76f4\u8fb9\u8ddd",
"Horizontal space": "\u6c34\u5e73\u8fb9\u8ddd",
"Border": "\u8fb9\u6846",
"Insert image": "\u63d2\u5165\u56fe\u7247",
"Image...": "\u56fe\u7247...",
"Image list": "\u56fe\u7247\u5217\u8868",
"Rotate counterclockwise": "\u9006\u65f6\u9488\u65cb\u8f6c",
"Rotate clockwise": "\u987a\u65f6\u9488\u65cb\u8f6c",
"Flip vertically": "\u5782\u76f4\u7ffb\u8f6c",
"Flip horizontally": "\u6c34\u5e73\u7ffb\u8f6c",
"Edit image": "\u7f16\u8f91\u56fe\u7247",
"Image options": "\u56fe\u7247\u9009\u9879",
"Zoom in": "\u653e\u5927",
"Zoom out": "\u7f29\u5c0f",
"Crop": "\u88c1\u526a",
"Resize": "\u8c03\u6574\u5927\u5c0f",
"Orientation": "\u65b9\u5411",
"Brightness": "\u4eae\u5ea6",
"Sharpen": "\u9510\u5316",
"Contrast": "\u5bf9\u6bd4\u5ea6",
"Color levels": "\u989c\u8272\u5c42\u6b21",
"Gamma": "\u4f3d\u9a6c\u503c",
"Invert": "\u53cd\u8f6c",
"Apply": "\u5e94\u7528",
"Back": "\u540e\u9000",
"Insert date\/time": "\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4",
"Date\/time": "\u65e5\u671f\/\u65f6\u95f4",
"Insert\/Edit Link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5",
"Insert\/edit link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5",
"Text to display": "\u663e\u793a\u6587\u5b57",
"Url": "\u5730\u5740",
"Open link in...": "\u94fe\u63a5\u6253\u5f00\u4f4d\u7f6e...",
"Current window": "\u5f53\u524d\u7a97\u53e3",
"None": "\u65e0",
"New window": "\u5728\u65b0\u7a97\u53e3\u6253\u5f00",
"Remove link": "\u5220\u9664\u94fe\u63a5",
"Anchors": "\u951a\u70b9",
"Link...": "\u94fe\u63a5...",
"Paste or type a link": "\u7c98\u8d34\u6216\u8f93\u5165\u94fe\u63a5",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u4e3a\u90ae\u4ef6\u5730\u5740\uff0c\u9700\u8981\u52a0\u4e0amailto:\u524d\u7f00\u5417\uff1f",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u5c5e\u4e8e\u5916\u90e8\u94fe\u63a5\uff0c\u9700\u8981\u52a0\u4e0ahttp:\/\/:\u524d\u7f00\u5417\uff1f",
"Link list": "\u94fe\u63a5\u5217\u8868",
"Insert video": "\u63d2\u5165\u89c6\u9891",
"Insert\/edit video": "\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891",
"Insert\/edit media": "\u63d2\u5165\/\u7f16\u8f91\u5a92\u4f53",
"Alternative source": "\u955c\u50cf",
"Alternative source URL": "\u66ff\u4ee3\u6765\u6e90\u7f51\u5740",
"Media poster (Image URL)": "\u5c01\u9762(\u56fe\u7247\u5730\u5740)",
"Paste your embed code below:": "\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:",
"Embed": "\u5185\u5d4c",
"Media...": "\u591a\u5a92\u4f53...",
"Nonbreaking space": "\u4e0d\u95f4\u65ad\u7a7a\u683c",
"Page break": "\u5206\u9875\u7b26",
"Paste as text": "\u7c98\u8d34\u4e3a\u6587\u672c",
"Preview": "\u9884\u89c8",
"Print...": "\u6253\u5370...",
"Save": "\u4fdd\u5b58",
"Find": "\u67e5\u627e",
"Replace with": "\u66ff\u6362\u4e3a",
"Replace": "\u66ff\u6362",
"Replace all": "\u5168\u90e8\u66ff\u6362",
"Previous": "\u4e0a\u4e00\u4e2a",
"Next": "\u4e0b\u4e00\u4e2a",
"Find and replace...": "\u67e5\u627e\u5e76\u66ff\u6362...",
"Could not find the specified string.": "\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.",
"Match case": "\u533a\u5206\u5927\u5c0f\u5199",
"Find whole words only": "\u5168\u5b57\u5339\u914d",
"Spell check": "\u62fc\u5199\u68c0\u67e5",
"Ignore": "\u5ffd\u7565",
"Ignore all": "\u5168\u90e8\u5ffd\u7565",
"Finish": "\u5b8c\u6210",
"Add to Dictionary": "\u6dfb\u52a0\u5230\u5b57\u5178",
"Insert table": "\u63d2\u5165\u8868\u683c",
"Table properties": "\u8868\u683c\u5c5e\u6027",
"Delete table": "\u5220\u9664\u8868\u683c",
"Cell": "\u5355\u5143\u683c",
"Row": "\u884c",
"Column": "\u5217",
"Cell properties": "\u5355\u5143\u683c\u5c5e\u6027",
"Merge cells": "\u5408\u5e76\u5355\u5143\u683c",
"Split cell": "\u62c6\u5206\u5355\u5143\u683c",
"Insert row before": "\u5728\u4e0a\u65b9\u63d2\u5165",
"Insert row after": "\u5728\u4e0b\u65b9\u63d2\u5165",
"Delete row": "\u5220\u9664\u884c",
"Row properties": "\u884c\u5c5e\u6027",
"Cut row": "\u526a\u5207\u884c",
"Copy row": "\u590d\u5236\u884c",
"Paste row before": "\u7c98\u8d34\u5230\u4e0a\u65b9",
"Paste row after": "\u7c98\u8d34\u5230\u4e0b\u65b9",
"Insert column before": "\u5728\u5de6\u4fa7\u63d2\u5165",
"Insert column after": "\u5728\u53f3\u4fa7\u63d2\u5165",
"Delete column": "\u5220\u9664\u5217",
"Cols": "\u5217",
"Rows": "\u884c",
"Width": "\u5bbd",
"Height": "\u9ad8",
"Cell spacing": "\u5355\u5143\u683c\u5916\u95f4\u8ddd",
"Cell padding": "\u5355\u5143\u683c\u5185\u8fb9\u8ddd",
"Show caption": "\u663e\u793a\u6807\u9898",
"Left": "\u5de6\u5bf9\u9f50",
"Center": "\u5c45\u4e2d",
"Right": "\u53f3\u5bf9\u9f50",
"Cell type": "\u5355\u5143\u683c\u7c7b\u578b",
"Scope": "\u8303\u56f4",
"Alignment": "\u5bf9\u9f50\u65b9\u5f0f",
"H Align": "\u6c34\u5e73\u5bf9\u9f50",
"V Align": "\u5782\u76f4\u5bf9\u9f50",
"Top": "\u9876\u90e8\u5bf9\u9f50",
"Middle": "\u5782\u76f4\u5c45\u4e2d",
"Bottom": "\u5e95\u90e8\u5bf9\u9f50",
"Header cell": "\u8868\u5934\u5355\u5143\u683c",
"Row group": "\u884c\u7ec4",
"Column group": "\u5217\u7ec4",
"Row type": "\u884c\u7c7b\u578b",
"Header": "\u8868\u5934",
"Body": "\u8868\u4f53",
"Footer": "\u8868\u5c3e",
"Border color": "\u8fb9\u6846\u989c\u8272",
"Insert template...": "\u63d2\u5165\u6a21\u677f...",
"Templates": "\u6a21\u677f",
"Template": "\u6a21\u677f",
"Text color": "\u6587\u5b57\u989c\u8272",
"Background color": "\u80cc\u666f\u8272",
"Custom...": "\u81ea\u5b9a\u4e49...",
"Custom color": "\u81ea\u5b9a\u4e49\u989c\u8272",
"No color": "\u65e0",
"Remove color": "\u79fb\u9664\u989c\u8272",
"Table of Contents": "\u5185\u5bb9\u5217\u8868",
"Show blocks": "\u663e\u793a\u533a\u5757\u8fb9\u6846",
"Show invisible characters": "\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26",
"Word count": "\u5b57\u6570",
"Count": "\u8ba1\u6570",
"Document": "\u6587\u6863",
"Selection": "\u9009\u62e9",
"Words": "\u5355\u8bcd",
"Words: {0}": "\u5b57\u6570\uff1a{0}",
"{0} words": "{0} \u5b57",
"File": "\u6587\u4ef6",
"Edit": "\u7f16\u8f91",
"Insert": "\u63d2\u5165",
"View": "\u89c6\u56fe",
"Format": "\u683c\u5f0f",
"Table": "\u8868\u683c",
"Tools": "\u5de5\u5177",
"Powered by {0}": "\u7531{0}\u9a71\u52a8",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "\u5728\u7f16\u8f91\u533a\u6309ALT-F9\u6253\u5f00\u83dc\u5355\uff0c\u6309ALT-F10\u6253\u5f00\u5de5\u5177\u680f\uff0c\u6309ALT-0\u67e5\u770b\u5e2e\u52a9",
"Image title": "\u56fe\u7247\u6807\u9898",
"Border width": "\u8fb9\u6846\u5bbd\u5ea6",
"Border style": "\u8fb9\u6846\u6837\u5f0f",
"Error": "\u9519\u8bef",
"Warn": "\u8b66\u544a",
"Valid": "\u6709\u6548",
"To open the popup, press Shift+Enter": "\u6309Shitf+Enter\u952e\u6253\u5f00\u5bf9\u8bdd\u6846",
"Rich Text Area. Press ALT-0 for help.": "\u7f16\u8f91\u533a\u3002\u6309Alt+0\u952e\u6253\u5f00\u5e2e\u52a9\u3002",
"System Font": "\u7cfb\u7edf\u5b57\u4f53",
"Failed to upload image: {0}": "\u56fe\u7247\u4e0a\u4f20\u5931\u8d25: {0}",
"Failed to load plugin: {0} from url {1}": "\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25: {0} \u6765\u81ea\u94fe\u63a5 {1}",
"Failed to load plugin url: {0}": "\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25 \u94fe\u63a5: {0}",
"Failed to initialize plugin: {0}": "\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25: {0}",
"example": "\u793a\u4f8b",
"Search": "\u641c\u7d22",
"All": "\u5168\u90e8",
"Currency": "\u8d27\u5e01",
"Text": "\u6587\u5b57",
"Quotations": "\u5f15\u7528",
"Mathematical": "\u6570\u5b66",
"Extended Latin": "\u62c9\u4e01\u8bed\u6269\u5145",
"Symbols": "\u7b26\u53f7",
"Arrows": "\u7bad\u5934",
"User Defined": "\u81ea\u5b9a\u4e49",
"dollar sign": "\u7f8e\u5143\u7b26\u53f7",
"currency sign": "\u8d27\u5e01\u7b26\u53f7",
"euro-currency sign": "\u6b27\u5143\u7b26\u53f7",
"colon sign": "\u5192\u53f7",
"cruzeiro sign": "\u514b\u9c81\u8d5b\u7f57\u5e01\u7b26\u53f7",
"french franc sign": "\u6cd5\u90ce\u7b26\u53f7",
"lira sign": "\u91cc\u62c9\u7b26\u53f7",
"mill sign": "\u5bc6\u5c14\u7b26\u53f7",
"naira sign": "\u5948\u62c9\u7b26\u53f7",
"peseta sign": "\u6bd4\u585e\u5854\u7b26\u53f7",
"rupee sign": "\u5362\u6bd4\u7b26\u53f7",
"won sign": "\u97e9\u5143\u7b26\u53f7",
"new sheqel sign": "\u65b0\u8c22\u514b\u5c14\u7b26\u53f7",
"dong sign": "\u8d8a\u5357\u76fe\u7b26\u53f7",
"kip sign": "\u8001\u631d\u57fa\u666e\u7b26\u53f7",
"tugrik sign": "\u56fe\u683c\u91cc\u514b\u7b26\u53f7",
"drachma sign": "\u5fb7\u62c9\u514b\u9a6c\u7b26\u53f7",
"german penny symbol": "\u5fb7\u56fd\u4fbf\u58eb\u7b26\u53f7",
"peso sign": "\u6bd4\u7d22\u7b26\u53f7",
"guarani sign": "\u74dc\u62c9\u5c3c\u7b26\u53f7",
"austral sign": "\u6fb3\u5143\u7b26\u53f7",
"hryvnia sign": "\u683c\u91cc\u592b\u5c3c\u4e9a\u7b26\u53f7",
"cedi sign": "\u585e\u5730\u7b26\u53f7",
"livre tournois sign": "\u91cc\u5f17\u5f17\u5c14\u7b26\u53f7",
"spesmilo sign": "spesmilo\u7b26\u53f7",
"tenge sign": "\u575a\u6208\u7b26\u53f7",
"indian rupee sign": "\u5370\u5ea6\u5362\u6bd4",
"turkish lira sign": "\u571f\u8033\u5176\u91cc\u62c9",
"nordic mark sign": "\u5317\u6b27\u9a6c\u514b",
"manat sign": "\u9a6c\u7eb3\u7279\u7b26\u53f7",
"ruble sign": "\u5362\u5e03\u7b26\u53f7",
"yen character": "\u65e5\u5143\u5b57\u6837",
"yuan character": "\u4eba\u6c11\u5e01\u5143\u5b57\u6837",
"yuan character, in hong kong and taiwan": "\u5143\u5b57\u6837\uff08\u6e2f\u53f0\u5730\u533a\uff09",
"yen\/yuan character variant one": "\u5143\u5b57\u6837\uff08\u5927\u5199\uff09",
"Loading emoticons...": "\u52a0\u8f7d\u8868\u60c5\u7b26\u53f7...",
"Could not load emoticons": "\u4e0d\u80fd\u52a0\u8f7d\u8868\u60c5\u7b26\u53f7",
"People": "\u4eba\u7c7b",
"Animals and Nature": "\u52a8\u7269\u548c\u81ea\u7136",
"Food and Drink": "\u98df\u7269\u548c\u996e\u54c1",
"Activity": "\u6d3b\u52a8",
"Travel and Places": "\u65c5\u6e38\u548c\u5730\u70b9",
"Objects": "\u7269\u4ef6",
"Flags": "\u65d7\u5e1c",
"Characters": "\u5b57\u7b26",
"Characters (no spaces)": "\u5b57\u7b26(\u65e0\u7a7a\u683c)",
"{0} characters": "{0} \u4e2a\u5b57\u7b26",
"Error: Form submit field collision.": "\u9519\u8bef: \u8868\u5355\u63d0\u4ea4\u5b57\u6bb5\u51b2\u7a81\u3002",
"Error: No form element found.": "\u9519\u8bef: \u6ca1\u6709\u8868\u5355\u63a7\u4ef6\u3002",
"Update": "\u66f4\u65b0",
"Color swatch": "\u989c\u8272\u6837\u672c",
"Turquoise": "\u9752\u7eff\u8272",
"Green": "\u7eff\u8272",
"Blue": "\u84dd\u8272",
"Purple": "\u7d2b\u8272",
"Navy Blue": "\u6d77\u519b\u84dd",
"Dark Turquoise": "\u6df1\u84dd\u7eff\u8272",
"Dark Green": "\u6df1\u7eff\u8272",
"Medium Blue": "\u4e2d\u84dd\u8272",
"Medium Purple": "\u4e2d\u7d2b\u8272",
"Midnight Blue": "\u6df1\u84dd\u8272",
"Yellow": "\u9ec4\u8272",
"Orange": "\u6a59\u8272",
"Red": "\u7ea2\u8272",
"Light Gray": "\u6d45\u7070\u8272",
"Gray": "\u7070\u8272",
"Dark Yellow": "\u6697\u9ec4\u8272",
"Dark Orange": "\u6df1\u6a59\u8272",
"Dark Red": "\u6df1\u7ea2\u8272",
"Medium Gray": "\u4e2d\u7070\u8272",
"Dark Gray": "\u6df1\u7070\u8272",
"Light Green": "\u6d45\u7eff\u8272",
"Light Yellow": "\u6d45\u9ec4\u8272",
"Light Red": "\u6d45\u7ea2\u8272",
"Light Purple": "\u6d45\u7d2b\u8272",
"Light Blue": "\u6d45\u84dd\u8272",
"Dark Purple": "\u6df1\u7d2b\u8272",
"Dark Blue": "\u6df1\u84dd\u8272",
"Black": "\u9ed1\u8272",
"White": "\u767d\u8272",
"Switch to or from fullscreen mode": "\u5207\u6362\u5168\u5c4f\u6a21\u5f0f",
"Open help dialog": "\u6253\u5f00\u5e2e\u52a9\u5bf9\u8bdd\u6846",
"history": "\u5386\u53f2",
"styles": "\u6837\u5f0f",
"formatting": "\u683c\u5f0f\u5316",
"alignment": "\u5bf9\u9f50",
"indentation": "\u7f29\u8fdb",
"permanent pen": "\u8bb0\u53f7\u7b14",
"comments": "\u5907\u6ce8",
"Format Painter": "\u683c\u5f0f\u5237",
"Insert\/edit iframe": "\u63d2\u5165\/\u7f16\u8f91\u6846\u67b6",
"Capitalization": "\u5927\u5199",
"lowercase": "\u5c0f\u5199",
"UPPERCASE": "\u5927\u5199",
"Title Case": "\u9996\u5b57\u6bcd\u5927\u5199",
"Permanent Pen Properties": "\u6c38\u4e45\u7b14\u5c5e\u6027",
"Permanent pen properties...": "\u6c38\u4e45\u7b14\u5c5e\u6027...",
"Font": "\u5b57\u4f53",
"Size": "\u5b57\u53f7",
"More...": "\u66f4\u591a...",
"Spellcheck Language": "\u62fc\u5199\u68c0\u67e5\u8bed\u8a00",
"Select...": "\u9009\u62e9...",
"Preferences": "\u9996\u9009\u9879",
"Yes": "\u662f",
"No": "\u5426",
"Keyboard Navigation": "\u952e\u76d8\u6307\u5f15",
"Version": "\u7248\u672c",
"Anchor": "\u951a\u70b9",
"Special character": "\u7279\u6b8a\u7b26\u53f7",
"Code sample": "\u4ee3\u7801\u793a\u4f8b",
"Color": "\u989c\u8272",
"Emoticons": "\u8868\u60c5",
"Document properties": "\u6587\u6863\u5c5e\u6027",
"Image": "\u56fe\u7247",
"Insert link": "\u63d2\u5165\u94fe\u63a5",
"Target": "\u6253\u5f00\u65b9\u5f0f",
"Link": "\u94fe\u63a5",
"Poster": "\u5c01\u9762",
"Media": "\u5a92\u4f53",
"Print": "\u6253\u5370",
"Prev": "\u4e0a\u4e00\u4e2a",
"Find and replace": "\u67e5\u627e\u548c\u66ff\u6362",
"Whole words": "\u5168\u5b57\u5339\u914d",
"Spellcheck": "\u62fc\u5199\u68c0\u67e5",
"Caption": "\u6807\u9898",
"Insert template": "\u63d2\u5165\u6a21\u677f"
},"en":{
"Redo": "Redo",
"Undo": "Undo",
"Cut": "Cut",
"Copy": "Copy",
"Paste": "Paste",
"Select all": "Select all",
"New document": "New document",
"Ok": "Ok",
"Cancel": "Cancel",
"Visual aids": "Visual aids",
"Bold": "Bold",
"Italic": "Italic",
"Underline": "Underline",
"Strikethrough": "Strikethrough",
"Superscript": "Superscript",
"Subscript": "Subscript",
"Clear formatting": "Clear formatting",
"Align left": "Align left",
"Align center": "Align center",
"Align right": "Align right",
"Justify": "Justify",
"Bullet list": "Bullet list",
"Numbered list": "Numbered list",
"Decrease indent": "Decrease indent",
"Increase indent": "Increase indent",
"Close": "Close",
"Formats": "Formats",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.": "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.",
"Headers": "Headers",
"Header 1": "Header 1",
"Header 2": "Header 2",
"Header 3": "Header 3",
"Header 4": "Header 4",
"Header 5": "Header 5",
"Header 6": "Header 6",
"Headings": "Headings",
"Heading 1": "Heading 1",
"Heading 2": "Heading 2",
"Heading 3": "Heading 3",
"Heading 4": "Heading 4",
"Heading 5": "Heading 5",
"Heading 6": "Heading 6",
"Preformatted": "Preformatted",
"Div": "Div",
"Pre": "Pre",
"Code": "Code",
"Paragraph": "Paragraph",
"Blockquote": "Blockquote",
"Inline": "Inline",
"Blocks": "Blocks",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",
"Fonts": "Fonts",
"Font Sizes": "Font Sizes",
"Class": "Class",
"Browse for an image": "Browse for an image",
"OR": "OR",
"Drop an image here": "Drop an image here",
"Upload": "Upload",
"Block": "Block",
"Align": "Align",
"Default": "Default",
"Circle": "Circle",
"Disc": "Disc",
"Square": "Square",
"Lower Alpha": "Lower Alpha",
"Lower Greek": "Lower Greek",
"Lower Roman": "Lower Roman",
"Upper Alpha": "Upper Alpha",
"Upper Roman": "Upper Roman",
"Anchor...": "Anchor...",
"Name": "Name",
"Id": "Id",
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.",
"You have unsaved changes are you sure you want to navigate away?": "You have unsaved changes are you sure you want to navigate away?",
"Restore last draft": "Restore last draft",
"Special character...": "Special character...",
"Source code": "Source code",
"Insert/Edit code sample": "Insert/Edit code sample",
"Language": "Language",
"Code sample...": "Code sample...",
"Color Picker": "Color Picker",
"R": "R",
"G": "G",
"B": "B",
"Left to right": "Left to right",
"Right to left": "Right to left",
"Emoticons...": "Emoticons...",
"Metadata and Document Properties": "Metadata and Document Properties",
"Title": "Title",
"Keywords": "Keywords",
"Description": "Description",
"Robots": "Robots",
"Author": "Author",
"Encoding": "Encoding",
"Fullscreen": "Fullscreen",
"Action": "Action",
"Shortcut": "Shortcut",
"Help": "Help",
"Address": "Address",
"Focus to menubar": "Focus to menubar",
"Focus to toolbar": "Focus to toolbar",
"Focus to element path": "Focus to element path",
"Focus to contextual toolbar": "Focus to contextual toolbar",
"Insert link (if link plugin activated)": "Insert link (if link plugin activated)",
"Save (if save plugin activated)": "Save (if save plugin activated)",
"Find (if searchreplace plugin activated)": "Find (if searchreplace plugin activated)",
"Plugins installed ({0}):": "Plugins installed ({0}):",
"Premium plugins:": "Premium plugins:",
"Learn more...": "Learn more...",
"You are using {0}": "You are using {0}",
"Plugins": "Plugins",
"Handy Shortcuts": "Handy Shortcuts",
"Horizontal line": "Horizontal line",
"Insert/edit image": "Insert/edit image",
"Image description": "Image description",
"Source": "Source",
"Dimensions": "Dimensions",
"Constrain proportions": "Constrain proportions",
"General": "General",
"Advanced": "Advanced",
"Style": "Style",
"Vertical space": "Vertical space",
"Horizontal space": "Horizontal space",
"Border": "Border",
"Insert image": "Insert image",
"Image...": "Image...",
"Image list": "Image list",
"Rotate counterclockwise": "Rotate counterclockwise",
"Rotate clockwise": "Rotate clockwise",
"Flip vertically": "Flip vertically",
"Flip horizontally": "Flip horizontally",
"Edit image": "Edit image",
"Image options": "Image options",
"Zoom in": "Zoom in",
"Zoom out": "Zoom out",
"Crop": "Crop",
"Resize": "Resize",
"Orientation": "Orientation",
"Brightness": "Brightness",
"Sharpen": "Sharpen",
"Contrast": "Contrast",
"Color levels": "Color levels",
"Gamma": "Gamma",
"Invert": "Invert",
"Apply": "Apply",
"Back": "Back",
"Insert date/time": "Insert date/time",
"Date/time": "Date/time",
"Insert/Edit Link": "Insert/Edit Link",
"Insert/edit link": "Insert/edit link",
"Text to display": "Text to display",
"Url": "Url",
"Open link in...": "Open link in...",
"Current window": "Current window",
"None": "None",
"New window": "New window",
"Remove link": "Remove link",
"Anchors": "Anchors",
"Link...": "Link...",
"Paste or type a link": "Paste or type a link",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",
"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?": "The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",
"Link list": "Link list",
"Insert video": "Insert video",
"Insert/edit video": "Insert/edit video",
"Insert/edit media": "Insert/edit media",
"Alternative source": "Alternative source",
"Alternative source URL": "Alternative source URL",
"Media poster (Image URL)": "Media poster (Image URL)",
"Paste your embed code below:": "Paste your embed code below:",
"Embed": "Embed",
"Media...": "Media...",
"Nonbreaking space": "Nonbreaking space",
"Page break": "Page break",
"Paste as text": "Paste as text",
"Preview": "Preview",
"Print...": "Print...",
"Save": "Save",
"Find": "Find",
"Replace with": "Replace with",
"Replace": "Replace",
"Replace all": "Replace all",
"Previous": "Previous",
"Next": "Next",
"Find and replace...": "Find and replace...",
"Could not find the specified string.": "Could not find the specified string.",
"Match case": "Match case",
"Find whole words only": "Find whole words only",
"Spell check": "Spell check",
"Ignore": "Ignore",
"Ignore all": "Ignore all",
"Finish": "Finish",
"Add to Dictionary": "Add to Dictionary",
"Insert table": "Insert table",
"Table properties": "Table properties",
"Delete table": "Delete table",
"Cell": "Cell",
"Row": "Row",
"Column": "Column",
"Cell properties": "Cell properties",
"Merge cells": "Merge cells",
"Split cell": "Split cell",
"Insert row before": "Insert row before",
"Insert row after": "Insert row after",
"Delete row": "Delete row",
"Row properties": "Row properties",
"Cut row": "Cut row",
"Copy row": "Copy row",
"Paste row before": "Paste row before",
"Paste row after": "Paste row after",
"Insert column before": "Insert column before",
"Insert column after": "Insert column after",
"Delete column": "Delete column",
"Cols": "Cols",
"Rows": "Rows",
"Width": "Width",
"Height": "Height",
"Cell spacing": "Cell spacing",
"Cell padding": "Cell padding",
"Show caption": "Show caption",
"Left": "Left",
"Center": "Center",
"Right": "Right",
"Cell type": "Cell type",
"Scope": "Scope",
"Alignment": "Alignment",
"H Align": "H Align",
"V Align": "V Align",
"Top": "Top",
"Middle": "Middle",
"Bottom": "Bottom",
"Header cell": "Header cell",
"Row group": "Row group",
"Column group": "Column group",
"Row type": "Row type",
"Header": "Header",
"Body": "Body",
"Footer": "Footer",
"Border color": "Border color",
"Insert template...": "Insert template...",
"Templates": "Templates",
"Template": "Template",
"Text color": "Text color",
"Background color": "Background color",
"Custom...": "Custom...",
"Custom color": "Custom color",
"No color": "No color",
"Remove color": "Remove color",
"Table of Contents": "Table of Contents",
"Show blocks": "Show blocks",
"Show invisible characters": "Show invisible characters",
"Word count": "Word count",
"Count": "Count",
"Document": "Document",
"Selection": "Selection",
"Words": "Words",
"Words: {0}": "Words: {0}",
"{0} words": "{0} words",
"File": "File",
"Edit": "Edit",
"Insert": "Insert",
"View": "View",
"Format": "Format",
"Table": "Table",
"Tools": "Tools",
"Powered by {0}": "Powered by {0}",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help",
"Image title": "Image title",
"Border width": "Border width",
"Border style": "Border style",
"Error": "Error",
"Warn": "Warn",
"Valid": "Valid",
"To open the popup, press Shift+Enter": "To open the popup, press Shift+Enter",
"Rich Text Area. Press ALT-0 for help.": "Rich Text Area. Press ALT-0 for help.",
"System Font": "System Font",
"Failed to upload image: {0}": "Failed to upload image: {0}",
"Failed to load plugin: {0} from url {1}": "Failed to load plugin: {0} from url {1}",
"Failed to load plugin url: {0}": "Failed to load plugin url: {0}",
"Failed to initialize plugin: {0}": "Failed to initialize plugin: {0}",
"example": "example",
"Search": "Search",
"All": "All",
"Currency": "Currency",
"Text": "Text",
"Quotations": "Quotations",
"Mathematical": "Mathematical",
"Extended Latin": "Extended Latin",
"Symbols": "Symbols",
"Arrows": "Arrows",
"User Defined": "User Defined",
"dollar sign": "dollar sign",
"currency sign": "currency sign",
"euro-currency sign": "euro-currency sign",
"colon sign": "colon sign",
"cruzeiro sign": "cruzeiro sign",
"french franc sign": "french franc sign",
"lira sign": "lira sign",
"mill sign": "mill sign",
"naira sign": "naira sign",
"peseta sign": "peseta sign",
"rupee sign": "rupee sign",
"won sign": "won sign",
"new sheqel sign": "new sheqel sign",
"dong sign": "dong sign",
"kip sign": "kip sign",
"tugrik sign": "tugrik sign",
"drachma sign": "drachma sign",
"german penny symbol": "german penny symbol",
"peso sign": "peso sign",
"guarani sign": "guarani sign",
"austral sign": "austral sign",
"hryvnia sign": "hryvnia sign",
"cedi sign": "cedi sign",
"livre tournois sign": "livre tournois sign",
"spesmilo sign": "spesmilo sign",
"tenge sign": "tenge sign",
"indian rupee sign": "indian rupee sign",
"turkish lira sign": "turkish lira sign",
"nordic mark sign": "nordic mark sign",
"manat sign": "manat sign",
"ruble sign": "ruble sign",
"yen character": "yen character",
"yuan character": "yuan character",
"yuan character, in hong kong and taiwan": "yuan character, in hong kong and taiwan",
"yen/yuan character variant one": "yen/yuan character variant one",
"Loading emoticons...": "Loading emoticons...",
"Could not load emoticons": "Could not load emoticons",
"People": "People",
"Animals and Nature": "Animals and Nature",
"Food and Drink": "Food and Drink",
"Activity": "Activity",
"Travel and Places": "Travel and Places",
"Objects": "Objects",
"Flags": "Flags",
"Characters": "Characters",
"Characters (no spaces)": "Characters (no spaces)",
"{0} characters": "{0} characters",
"Error: Form submit field collision.": "Error: Form submit field collision.",
"Error: No form element found.": "Error: No form element found.",
"Update": "Update",
"Color swatch": "Color swatch",
"Turquoise": "Turquoise",
"Green": "Green",
"Blue": "Blue",
"Purple": "Purple",
"Navy Blue": "Navy Blue",
"Dark Turquoise": "Dark Turquoise",
"Dark Green": "Dark Green",
"Medium Blue": "Medium Blue",
"Medium Purple": "Medium Purple",
"Midnight Blue": "Midnight Blue",
"Yellow": "Yellow",
"Orange": "Orange",
"Red": "Red",
"Light Gray": "Light Gray",
"Gray": "Gray",
"Dark Yellow": "Dark Yellow",
"Dark Orange": "Dark Orange",
"Dark Red": "Dark Red",
"Medium Gray": "Medium Gray",
"Dark Gray": "Dark Gray",
"Light Green": "Light Green",
"Light Yellow": "Light Yellow",
"Light Red": "Light Red",
"Light Purple": "Light Purple",
"Light Blue": "Light Blue",
"Dark Purple": "Dark Purple",
"Dark Blue": "Dark Blue",
"Black": "Black",
"White": "White",
"Switch to or from fullscreen mode": "Switch to or from fullscreen mode",
"Open help dialog": "Open help dialog",
"history": "history",
"styles": "styles",
"formatting": "formatting",
"alignment": "alignment",
"indentation": "indentation",
"permanent pen": "permanent pen",
"comments": "comments",
"Format Painter": "Format Painter",
"Insert/edit iframe": "Insert/edit iframe",
"Capitalization": "Capitalization",
"lowercase": "lowercase",
"UPPERCASE": "UPPERCASE",
"Title Case": "Title Case",
"Permanent Pen Properties": "Permanent Pen Properties",
"Permanent pen properties...": "Permanent pen properties...",
"Font": "Font",
"Size": "Size",
"More...": "More...",
"Spellcheck Language": "Spellcheck Language",
"Select...": "Select...",
"Preferences": "Preferences",
"Yes": "Yes",
"No": "No",
"Keyboard Navigation": "Keyboard Navigation",
"Version": "Version",
"Anchor": "Anchor",
"Special character": "Special character",
"Code sample": "Code sample",
"Color": "Color",
"Emoticons": "Emoticons",
"Document properties": "Document properties",
"Image": "Image",
"Insert link": "Insert link",
"Target": "Target",
"Link": "Link",
"Poster": "Poster",
"Media": "Media",
"Print": "Print",
"Prev": "Prev",
"Find and replace": "Find and replace",
"Whole words": "Whole words",
"Spellcheck": "Spellcheck",
"Caption": "Caption",
"Insert template": "Insert template"
});
+504
View File
@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
@@ -0,0 +1,281 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var applyListFormat = function (editor, listName, styleValue) {
var cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList';
editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue });
};
var register = function (editor) {
editor.addCommand('ApplyUnorderedListStyle', function (ui, value) {
applyListFormat(editor, 'UL', value['list-style-type']);
});
editor.addCommand('ApplyOrderedListStyle', function (ui, value) {
applyListFormat(editor, 'OL', value['list-style-type']);
});
};
var getNumberStyles = function (editor) {
var styles = editor.getParam('advlist_number_styles', 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman');
return styles ? styles.split(/[ ,]/) : [];
};
var getBulletStyles = function (editor) {
var styles = editor.getParam('advlist_bullet_styles', 'default,circle,square');
return styles ? styles.split(/[ ,]/) : [];
};
var noop = function () {
};
var constant = function (value) {
return function () {
return value;
};
};
var never = constant(false);
var always = constant(true);
var none = function () {
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
getOrThunk: call,
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
},
getOrNull: constant(null),
getOrUndefined: constant(undefined),
or: id,
orThunk: call,
map: none,
each: noop,
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
toArray: function () {
return [];
},
toString: constant('none()')
};
return me;
}();
var some = function (a) {
var constant_a = constant(a);
var self = function () {
return me;
};
var bind = function (f) {
return f(a);
};
var me = {
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
getOrThunk: constant_a,
getOrDie: constant_a,
getOrNull: constant_a,
getOrUndefined: constant_a,
or: self,
orThunk: self,
map: function (f) {
return some(f(a));
},
each: function (f) {
f(a);
},
bind: bind,
exists: bind,
forall: bind,
filter: function (f) {
return f(a) ? me : NONE;
},
toArray: function () {
return [a];
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
};
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
some: some,
none: none,
from: from
};
var isChildOfBody = function (editor, elm) {
return editor.$.contains(editor.getBody(), elm);
};
var isTableCellNode = function (node) {
return node && /^(TH|TD)$/.test(node.nodeName);
};
var isListNode = function (editor) {
return function (node) {
return node && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node);
};
};
var getSelectedStyleType = function (editor) {
var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
var style = editor.dom.getStyle(listElm, 'listStyleType');
return Option.from(style);
};
var findIndex = function (list, predicate) {
for (var index = 0; index < list.length; index++) {
var element = list[index];
if (predicate(element)) {
return index;
}
}
return -1;
};
var styleValueToText = function (styleValue) {
return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function (chr) {
return chr.toUpperCase();
});
};
var isWithinList = function (editor, e, nodeName) {
var tableCellIndex = findIndex(e.parents, isTableCellNode);
var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
var lists = global$1.grep(parents, isListNode(editor));
return lists.length > 0 && lists[0].nodeName === nodeName;
};
var addSplitButton = function (editor, id, tooltip, cmd, nodeName, styles) {
editor.ui.registry.addSplitButton(id, {
tooltip: tooltip,
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
presets: 'listpreview',
columns: 3,
fetch: function (callback) {
var items = global$1.map(styles, function (styleValue) {
var iconStyle = nodeName === 'OL' ? 'num' : 'bull';
var iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue;
var itemValue = styleValue === 'default' ? '' : styleValue;
var displayText = styleValueToText(styleValue);
return {
type: 'choiceitem',
value: itemValue,
icon: 'list-' + iconStyle + '-' + iconName,
text: displayText
};
});
callback(items);
},
onAction: function () {
return editor.execCommand(cmd);
},
onItemAction: function (_splitButtonApi, value) {
applyListFormat(editor, nodeName, value);
},
select: function (value) {
var listStyleType = getSelectedStyleType(editor);
return listStyleType.map(function (listStyle) {
return value === listStyle;
}).getOr(false);
},
onSetup: function (api) {
var nodeChangeHandler = function (e) {
api.setActive(isWithinList(editor, e, nodeName));
};
editor.on('NodeChange', nodeChangeHandler);
return function () {
return editor.off('NodeChange', nodeChangeHandler);
};
}
});
};
var addButton = function (editor, id, tooltip, cmd, nodeName, _styles) {
editor.ui.registry.addToggleButton(id, {
active: false,
tooltip: tooltip,
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
onSetup: function (api) {
var nodeChangeHandler = function (e) {
api.setActive(isWithinList(editor, e, nodeName));
};
editor.on('NodeChange', nodeChangeHandler);
return function () {
return editor.off('NodeChange', nodeChangeHandler);
};
},
onAction: function () {
return editor.execCommand(cmd);
}
});
};
var addControl = function (editor, id, tooltip, cmd, nodeName, styles) {
if (styles.length > 1) {
addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
} else {
addButton(editor, id, tooltip, cmd, nodeName);
}
};
var register$1 = function (editor) {
addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', getNumberStyles(editor));
addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', getBulletStyles(editor));
};
function Plugin () {
global.add('advlist', function (editor) {
var hasPlugin = function (editor, plugin) {
return global$1.inArray(editor.getParam('plugins', '', 'string').split(/[ ,]/), plugin) !== -1;
};
if (hasPlugin(editor, 'lists')) {
register$1(editor);
register(editor);
}
});
}
Plugin();
}());
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(){"use strict";var n,t,e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},i=function(n){return function(){return n}},u=i(!1),s=i(!0),o=function(){return a},a=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:u,isSome:u,isNone:s,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:e,orThunk:t,map:o,each:function(){},bind:o,exists:u,forall:s,filter:o,equals:n,equals_:n,toArray:function(){return[]},toString:i("none()")}),f=function(e){var n=i(e),t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:s,isNone:u,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return f(n(e))},each:function(n){n(e)},bind:r,exists:r,forall:r,filter:function(n){return n(e)?o:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(u,function(n){return t(e,n)})}};return o},d=function(n){return null===n||n===undefined?a:f(n)},g=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},m=function(r){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&(e=n,(t=r).$.contains(t.getBody(),e));var t,e}},p=function(n,t,e){var r=function(n,t){for(var e=0;e<n.length;e++){if(t(n[e]))return e}return-1}(t.parents,g),o=-1!==r?t.parents.slice(0,r):t.parents,i=l.grep(o,m(n));return 0<i.length&&i[0].nodeName===e},y=function(o,n,t,e,r,i){o.ui.registry.addSplitButton(n,{tooltip:t,icon:"OL"===r?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(n){n(l.map(i,function(n){return{type:"choiceitem",value:"default"===n?"":n,icon:"list-"+("OL"===r?"num":"bull")+"-"+("disc"===n||"decimal"===n?"default":n),text:n.replace(/\-/g," ").replace(/\b\w/g,function(n){return n.toUpperCase()})}}))},onAction:function(){return o.execCommand(e)},onItemAction:function(n,t){c(o,r,t)},select:function(t){var n,e,r;return(e=(n=o).dom.getParent(n.selection.getNode(),"ol,ul"),r=n.dom.getStyle(e,"listStyleType"),d(r)).map(function(n){return t===n}).getOr(!1)},onSetup:function(t){var n=function(n){t.setActive(p(o,n,r))};return o.on("NodeChange",n),function(){return o.off("NodeChange",n)}}})},v=function(n,t,e,r,o,i){var u,l,c,s,a;1<i.length?y(n,t,e,r,o,i):(l=t,c=e,s=r,a=o,(u=n).ui.registry.addToggleButton(l,{active:!1,tooltip:c,icon:"OL"===a?"ordered-list":"unordered-list",onSetup:function(t){var n=function(n){t.setActive(p(u,n,a))};return u.on("NodeChange",n),function(){return u.off("NodeChange",n)}},onAction:function(){return u.execCommand(s)}}))};!function O(){r.add("advlist",function(n){var e,t,r,o,i,u;i=n,u="lists",-1!==l.inArray(i.getParam("plugins","","string").split(/[ ,]/),u)&&(v(t=n,"numlist","Numbered list","InsertOrderedList","OL",(r=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"))?r.split(/[ ,]/):[]),v(t,"bullist","Bullet list","InsertUnorderedList","UL",(o=t.getParam("advlist_bullet_styles","default,circle,square"))?o.split(/[ ,]/):[]),(e=n).addCommand("ApplyUnorderedListStyle",function(n,t){c(e,"UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(n,t){c(e,"OL",t["list-style-type"])}))})}()}();
@@ -0,0 +1,216 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var allowHtmlInNamedAnchor = function (editor) {
return editor.getParam('allow_html_in_named_anchor', false, 'boolean');
};
var namedAnchorSelector = 'a:not([href])';
var isEmptyString = function (str) {
return !str;
};
var getIdFromAnchor = function (elm) {
var id = elm.getAttribute('id') || elm.getAttribute('name');
return id || '';
};
var isAnchor = function (elm) {
return elm && elm.nodeName.toLowerCase() === 'a';
};
var isNamedAnchor = function (elm) {
return isAnchor(elm) && !elm.getAttribute('href') && getIdFromAnchor(elm) !== '';
};
var isEmptyNamedAnchor = function (elm) {
return isNamedAnchor(elm) && !elm.firstChild;
};
var removeEmptyNamedAnchorsInSelection = function (editor) {
var dom = editor.dom;
global$1(dom).walk(editor.selection.getRng(), function (nodes) {
global$2.each(nodes, function (node) {
if (isEmptyNamedAnchor(node)) {
dom.remove(node, false);
}
});
});
};
var isValidId = function (id) {
return /^[A-Za-z][A-Za-z0-9\-:._]*$/.test(id);
};
var getNamedAnchor = function (editor) {
return editor.dom.getParent(editor.selection.getStart(), namedAnchorSelector);
};
var getId = function (editor) {
var anchor = getNamedAnchor(editor);
if (anchor) {
return getIdFromAnchor(anchor);
} else {
return '';
}
};
var createAnchor = function (editor, id) {
editor.undoManager.transact(function () {
if (!allowHtmlInNamedAnchor(editor)) {
editor.selection.collapse(true);
}
if (editor.selection.isCollapsed()) {
editor.insertContent(editor.dom.createHTML('a', { id: id }));
} else {
removeEmptyNamedAnchorsInSelection(editor);
editor.formatter.remove('namedAnchor', null, null, true);
editor.formatter.apply('namedAnchor', { value: id });
editor.addVisual();
}
});
};
var updateAnchor = function (editor, id, anchorElement) {
anchorElement.removeAttribute('name');
anchorElement.id = id;
editor.addVisual();
editor.undoManager.add();
};
var insert = function (editor, id) {
var anchor = getNamedAnchor(editor);
if (anchor) {
updateAnchor(editor, id, anchor);
} else {
createAnchor(editor, id);
}
editor.focus();
};
var insertAnchor = function (editor, newId) {
if (!isValidId(newId)) {
editor.windowManager.alert('Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.');
return false;
} else {
insert(editor, newId);
return true;
}
};
var open = function (editor) {
var currentId = getId(editor);
editor.windowManager.open({
title: 'Anchor',
size: 'normal',
body: {
type: 'panel',
items: [{
name: 'id',
type: 'input',
label: 'ID',
placeholder: 'example'
}]
},
buttons: [
{
type: 'cancel',
name: 'cancel',
text: 'Cancel'
},
{
type: 'submit',
name: 'save',
text: 'Save',
primary: true
}
],
initialData: { id: currentId },
onSubmit: function (api) {
if (insertAnchor(editor, api.getData().id)) {
api.close();
}
}
});
};
var register = function (editor) {
editor.addCommand('mceAnchor', function () {
open(editor);
});
};
var isNamedAnchorNode = function (node) {
return node && isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name'));
};
var isEmptyNamedAnchorNode = function (node) {
return isNamedAnchorNode(node) && !node.firstChild;
};
var setContentEditable = function (state) {
return function (nodes) {
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (isEmptyNamedAnchorNode(node)) {
node.attr('contenteditable', state);
}
}
};
};
var setup = function (editor) {
editor.on('PreInit', function () {
editor.parser.addNodeFilter('a', setContentEditable('false'));
editor.serializer.addNodeFilter('a', setContentEditable(null));
});
};
var registerFormats = function (editor) {
editor.formatter.register('namedAnchor', {
inline: 'a',
selector: namedAnchorSelector,
remove: 'all',
split: true,
deep: true,
attributes: { id: '%value' },
onmatch: function (node, _fmt, _itemName) {
return isNamedAnchor(node);
}
});
};
var register$1 = function (editor) {
editor.ui.registry.addToggleButton('anchor', {
icon: 'bookmark',
tooltip: 'Anchor',
onAction: function () {
return editor.execCommand('mceAnchor');
},
onSetup: function (buttonApi) {
return editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind;
}
});
editor.ui.registry.addMenuItem('anchor', {
icon: 'bookmark',
text: 'Anchor...',
onAction: function () {
return editor.execCommand('mceAnchor');
}
});
};
function Plugin () {
global.add('anchor', function (editor) {
setup(editor);
register(editor);
register$1(editor);
editor.on('PreInit', function () {
registerFormats(editor);
});
});
}
Plugin();
}());
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),a="a:not([href])",n=function(e){return e.getAttribute("id")||e.getAttribute("name")||""},r=function(e){return(t=e)&&"a"===t.nodeName.toLowerCase()&&!e.getAttribute("href")&&""!==n(e);var t},l=function(e){var n=e.dom;t(n).walk(e.selection.getRng(),function(e){o.each(e,function(e){var t;r(t=e)&&!t.firstChild&&n.remove(e,!1)})})},u=function(e){return e.dom.getParent(e.selection.getStart(),a)},i=function(e,t){var n,o,a,r,i,c=u(e);c?(a=e,r=t,(i=c).removeAttribute("name"),i.id=r,a.addVisual(),a.undoManager.add()):(o=t,(n=e).undoManager.transact(function(){n.getParam("allow_html_in_named_anchor",!1,"boolean")||n.selection.collapse(!0),n.selection.isCollapsed()?n.insertContent(n.dom.createHTML("a",{id:o})):(l(n),n.formatter.remove("namedAnchor",null,null,!0),n.formatter.apply("namedAnchor",{value:o}),n.addVisual())})),e.focus()},c=function(o){var e,t=(e=u(o))?n(e):"";o.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(e){var t,n;t=o,n=e.getData().id,(/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(n)?(i(t,n),1):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),0))&&e.close()}})},d=function(r){return function(e){for(var t=0;t<e.length;t++){var n=e[t];a=void 0,!(a=o=n)||a.attr("href")||!a.attr("id")&&!a.attr("name")||o.firstChild||n.attr("contenteditable",r)}var o,a}};!function s(){e.add("anchor",function(e){var t,n,o;(t=e).on("PreInit",function(){t.parser.addNodeFilter("a",d("false")),t.serializer.addNodeFilter("a",d(null))}),(n=e).addCommand("mceAnchor",function(){c(n)}),(o=e).ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return o.execCommand("mceAnchor")},onSetup:function(e){return o.selection.selectorChangedWithUnbind("a:not([href])",e.setActive).unbind}}),o.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return o.execCommand("mceAnchor")}}),e.on("PreInit",function(){e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:function(e,t,n){return r(e)}})})})}()}();
@@ -0,0 +1,185 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var getAutoLinkPattern = function (editor) {
return editor.getParam('autolink_pattern', /^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i);
};
var getDefaultLinkTarget = function (editor) {
return editor.getParam('default_link_target', false);
};
var getDefaultLinkProtocol = function (editor) {
return editor.getParam('link_default_protocol', 'http', 'string');
};
var rangeEqualsDelimiterOrSpace = function (rangeString, delimiter) {
return rangeString === delimiter || rangeString === ' ' || rangeString.charCodeAt(0) === 160;
};
var handleEclipse = function (editor) {
parseCurrentLine(editor, -1, '(');
};
var handleSpacebar = function (editor) {
parseCurrentLine(editor, 0, '');
};
var handleEnter = function (editor) {
parseCurrentLine(editor, -1, '');
};
var scopeIndex = function (container, index) {
if (index < 0) {
index = 0;
}
if (container.nodeType === 3) {
var len = container.data.length;
if (index > len) {
index = len;
}
}
return index;
};
var setStart = function (rng, container, offset) {
if (container.nodeType !== 1 || container.hasChildNodes()) {
rng.setStart(container, scopeIndex(container, offset));
} else {
rng.setStartBefore(container);
}
};
var setEnd = function (rng, container, offset) {
if (container.nodeType !== 1 || container.hasChildNodes()) {
rng.setEnd(container, scopeIndex(container, offset));
} else {
rng.setEndAfter(container);
}
};
var parseCurrentLine = function (editor, endOffset, delimiter) {
var end, endContainer, bookmark, text, prev, len, rngText;
var autoLinkPattern = getAutoLinkPattern(editor);
var defaultLinkTarget = getDefaultLinkTarget(editor);
if (editor.selection.getNode().tagName === 'A') {
return;
}
var rng = editor.selection.getRng().cloneRange();
if (rng.startOffset < 5) {
prev = rng.endContainer.previousSibling;
if (!prev) {
if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) {
return;
}
prev = rng.endContainer.firstChild.nextSibling;
}
len = prev.length;
setStart(rng, prev, len);
setEnd(rng, prev, len);
if (rng.endOffset < 5) {
return;
}
end = rng.endOffset;
endContainer = prev;
} else {
endContainer = rng.endContainer;
if (endContainer.nodeType !== 3 && endContainer.firstChild) {
while (endContainer.nodeType !== 3 && endContainer.firstChild) {
endContainer = endContainer.firstChild;
}
if (endContainer.nodeType === 3) {
setStart(rng, endContainer, 0);
setEnd(rng, endContainer, endContainer.nodeValue.length);
}
}
if (rng.endOffset === 1) {
end = 2;
} else {
end = rng.endOffset - 1 - endOffset;
}
}
var start = end;
do {
setStart(rng, endContainer, end >= 2 ? end - 2 : 0);
setEnd(rng, endContainer, end >= 1 ? end - 1 : 0);
end -= 1;
rngText = rng.toString();
} while (rngText !== ' ' && rngText !== '' && rngText.charCodeAt(0) !== 160 && end - 2 >= 0 && rngText !== delimiter);
if (rangeEqualsDelimiterOrSpace(rng.toString(), delimiter)) {
setStart(rng, endContainer, end);
setEnd(rng, endContainer, start);
end += 1;
} else if (rng.startOffset === 0) {
setStart(rng, endContainer, 0);
setEnd(rng, endContainer, start);
} else {
setStart(rng, endContainer, end);
setEnd(rng, endContainer, start);
}
text = rng.toString();
if (text.charAt(text.length - 1) === '.') {
setEnd(rng, endContainer, start - 1);
}
text = rng.toString().trim();
var matches = text.match(autoLinkPattern);
var protocol = getDefaultLinkProtocol(editor);
if (matches) {
if (matches[1] === 'www.') {
matches[1] = protocol + '://www.';
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
matches[1] = 'mailto:' + matches[1];
}
bookmark = editor.selection.getBookmark();
editor.selection.setRng(rng);
editor.execCommand('createlink', false, matches[1] + matches[2]);
if (defaultLinkTarget !== false) {
editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget);
}
editor.selection.moveToBookmark(bookmark);
editor.nodeChanged();
}
};
var setup = function (editor) {
var autoUrlDetectState;
editor.on('keydown', function (e) {
if (e.keyCode === 13) {
return handleEnter(editor);
}
});
if (global$1.browser.isIE()) {
editor.on('focus', function () {
if (!autoUrlDetectState) {
autoUrlDetectState = true;
try {
editor.execCommand('AutoUrlDetect', false, true);
} catch (ex) {
}
}
});
return;
}
editor.on('keypress', function (e) {
if (e.keyCode === 41) {
return handleEclipse(editor);
}
});
editor.on('keyup', function (e) {
if (e.keyCode === 32) {
return handleSpacebar(editor);
}
});
};
function Plugin () {
global.add('autolink', function (editor) {
setup(editor);
});
}
Plugin();
}());
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.Env"),o=function(e,t){if(t<0&&(t=0),3===e.nodeType){var n=e.data.length;n<t&&(t=n)}return t},y=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)},k=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)},r=function(e,t,n){var i,o,r,a,s,f,l,d=e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i),c=e.getParam("default_link_target",!1);if("A"!==e.selection.getNode().tagName){var g=e.selection.getRng().cloneRange();if(g.startOffset<5){if(!(s=g.endContainer.previousSibling)){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;s=g.endContainer.firstChild.nextSibling}if(f=s.length,y(g,s,f),k(g,s,f),g.endOffset<5)return;i=g.endOffset,o=s}else{if(3!==(o=g.endContainer).nodeType&&o.firstChild){for(;3!==o.nodeType&&o.firstChild;)o=o.firstChild;3===o.nodeType&&(y(g,o,0),k(g,o,o.nodeValue.length))}i=1===g.endOffset?2:g.endOffset-1-t}for(var u,h=i;y(g,o,2<=i?i-2:0),k(g,o,1<=i?i-1:0),--i," "!==(l=g.toString())&&""!==l&&160!==l.charCodeAt(0)&&0<=i-2&&l!==n;);(u=g.toString())===n||" "===u||160===u.charCodeAt(0)?(y(g,o,i),k(g,o,h),i+=1):(0===g.startOffset?y(g,o,0):y(g,o,i),k(g,o,h)),"."===(a=g.toString()).charAt(a.length-1)&&k(g,o,h-1);var m=(a=g.toString().trim()).match(d),C=e.getParam("link_default_protocol","http","string");m&&("www."===m[1]?m[1]=C+"://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),r=e.selection.getBookmark(),e.selection.setRng(g),e.execCommand("createlink",!1,m[1]+m[2]),!1!==c&&e.dom.setAttrib(e.selection.getNode(),"target",c),e.selection.moveToBookmark(r),e.nodeChanged())}},t=function(t){var n;t.on("keydown",function(e){if(13!==e.keyCode);else r(t,-1,"")}),i.browser.isIE()?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){if(41!==e.keyCode);else r(t,-1,"(")}),t.on("keyup",function(e){if(32!==e.keyCode);else r(t,0,"")}))};!function n(){e.add("autolink",function(e){t(e)})}()}();
@@ -0,0 +1,171 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function () {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
return {
get: get,
set: set
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var fireResizeEditor = function (editor) {
return editor.fire('ResizeEditor');
};
var getAutoResizeMinHeight = function (editor) {
return editor.getParam('min_height', editor.getElement().offsetHeight, 'number');
};
var getAutoResizeMaxHeight = function (editor) {
return editor.getParam('max_height', 0, 'number');
};
var getAutoResizeOverflowPadding = function (editor) {
return editor.getParam('autoresize_overflow_padding', 1, 'number');
};
var getAutoResizeBottomMargin = function (editor) {
return editor.getParam('autoresize_bottom_margin', 50, 'number');
};
var shouldAutoResizeOnInit = function (editor) {
return editor.getParam('autoresize_on_init', true, 'boolean');
};
var isFullscreen = function (editor) {
return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
};
var wait = function (editor, oldSize, times, interval, callback) {
global$2.setEditorTimeout(editor, function () {
resize(editor, oldSize);
if (times--) {
wait(editor, oldSize, times, interval, callback);
} else if (callback) {
callback();
}
}, interval);
};
var toggleScrolling = function (editor, state) {
var body = editor.getBody();
if (body) {
body.style.overflowY = state ? '' : 'hidden';
if (!state) {
body.scrollTop = 0;
}
}
};
var parseCssValueToInt = function (dom, elm, name, computed) {
var value = parseInt(dom.getStyle(elm, name, computed), 10);
return isNaN(value) ? 0 : value;
};
var resize = function (editor, oldSize) {
var dom = editor.dom;
var doc = editor.getDoc();
if (!doc) {
return;
}
if (isFullscreen(editor)) {
toggleScrolling(editor, true);
return;
}
var docEle = doc.documentElement;
var resizeBottomMargin = getAutoResizeBottomMargin(editor);
var resizeHeight = getAutoResizeMinHeight(editor);
var marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true);
var marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true);
var contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin;
if (contentHeight < 0) {
contentHeight = 0;
}
var containerHeight = editor.getContainer().offsetHeight;
var contentAreaHeight = editor.getContentAreaContainer().offsetHeight;
var chromeHeight = containerHeight - contentAreaHeight;
if (contentHeight + chromeHeight > getAutoResizeMinHeight(editor)) {
resizeHeight = contentHeight + chromeHeight;
}
var maxHeight = getAutoResizeMaxHeight(editor);
if (maxHeight && resizeHeight > maxHeight) {
resizeHeight = maxHeight;
toggleScrolling(editor, true);
} else {
toggleScrolling(editor, false);
}
if (resizeHeight !== oldSize.get()) {
var deltaSize = resizeHeight - oldSize.get();
dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px');
oldSize.set(resizeHeight);
fireResizeEditor(editor);
if (global$1.browser.isSafari() && global$1.mac) {
var win = editor.getWin();
win.scrollTo(win.pageXOffset, win.pageYOffset);
}
if (editor.hasFocus()) {
editor.selection.scrollIntoView(editor.selection.getNode());
}
if (global$1.webkit && deltaSize < 0) {
resize(editor, oldSize);
}
}
};
var setup = function (editor, oldSize) {
editor.on('init', function () {
var overflowPadding = getAutoResizeOverflowPadding(editor);
var dom = editor.dom;
dom.setStyles(editor.getDoc().documentElement, { height: 'auto' });
dom.setStyles(editor.getBody(), {
'paddingLeft': overflowPadding,
'paddingRight': overflowPadding,
'min-height': 0
});
});
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function () {
resize(editor, oldSize);
});
if (shouldAutoResizeOnInit(editor)) {
editor.on('init', function () {
wait(editor, oldSize, 20, 100, function () {
wait(editor, oldSize, 5, 1000);
});
});
}
};
var register = function (editor, oldSize) {
editor.addCommand('mceAutoResize', function () {
resize(editor, oldSize);
});
};
function Plugin () {
global.add('autoresize', function (editor) {
if (!editor.settings.hasOwnProperty('resize')) {
editor.settings.resize = false;
}
if (!editor.inline) {
var oldSize = Cell(0);
register(editor, oldSize);
setup(editor, oldSize);
}
});
}
Plugin();
}());
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},s=function(e,t,n,i,o){r.setEditorTimeout(e,function(){b(e,t),n--?s(e,t,n,i,o):o&&o()},i)},y=function(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))},p=function(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o},b=function(e,t){var n=e.dom,i=e.getDoc();if(i)if((o=e).plugins.fullscreen&&o.plugins.fullscreen.isFullscreen())y(e,!0);else{var o,r=i.documentElement,a=e.getParam("autoresize_bottom_margin",50,"number"),s=v(e),u=p(n,r,"margin-top",!0),g=p(n,r,"margin-bottom",!0),l=r.offsetHeight+u+g+a;l<0&&(l=0);var f=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;l+f>v(e)&&(s=l+f);var c=e.getParam("max_height",0,"number");if(c&&c<s?(s=c,y(e,!0)):y(e,!1),s!==t.get()){var m=s-t.get();if(n.setStyle(e.getContainer(),"height",s+"px"),t.set(s),e.fire("ResizeEditor"),h.browser.isSafari()&&h.mac){var d=e.getWin();d.scrollTo(d.pageXOffset,d.pageYOffset)}e.hasFocus()&&e.selection.scrollIntoView(e.selection.getNode()),h.webkit&&m<0&&b(e,t)}}};!function t(){e.add("autoresize",function(e){if(e.settings.hasOwnProperty("resize")||(e.settings.resize=!1),!e.inline){var t=(a=0,{get:function(){return a},set:function(e){a=e}});r=t,(o=e).addCommand("mceAutoResize",function(){b(o,r)}),i=t,(n=e).on("init",function(){var e=n.getParam("autoresize_overflow_padding",1,"number"),t=n.dom;t.setStyles(n.getDoc().documentElement,{height:"auto"}),t.setStyles(n.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),n.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(){b(n,i)}),n.getParam("autoresize_on_init",!0,"boolean")&&n.on("init",function(){s(n,i,20,100,function(){s(n,i,5,1e3)})})}var n,i,o,r,a})}()}();
@@ -0,0 +1,214 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function (domGlobals) {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage');
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var fireRestoreDraft = function (editor) {
return editor.fire('RestoreDraft');
};
var fireStoreDraft = function (editor) {
return editor.fire('StoreDraft');
};
var fireRemoveDraft = function (editor) {
return editor.fire('RemoveDraft');
};
var parse = function (timeString, defaultTime) {
var multiples = {
s: 1000,
m: 60000
};
var toParse = timeString || defaultTime;
var parsedTime = /^(\d+)([ms]?)$/.exec('' + toParse);
return (parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(toParse, 10);
};
var shouldAskBeforeUnload = function (editor) {
return editor.getParam('autosave_ask_before_unload', true);
};
var getAutoSavePrefix = function (editor) {
var location = domGlobals.document.location;
return editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-').replace(/{path}/g, location.pathname).replace(/{query}/g, location.search).replace(/{hash}/g, location.hash).replace(/{id}/g, editor.id);
};
var shouldRestoreWhenEmpty = function (editor) {
return editor.getParam('autosave_restore_when_empty', false);
};
var getAutoSaveInterval = function (editor) {
return parse(editor.getParam('autosave_interval'), '30s');
};
var getAutoSaveRetention = function (editor) {
return parse(editor.getParam('autosave_retention'), '20m');
};
var eq = function (t) {
return function (a) {
return t === a;
};
};
var isUndefined = eq(undefined);
var isEmpty = function (editor, html) {
if (isUndefined(html)) {
return editor.dom.isEmpty(editor.getBody());
} else {
var trimmedHtml = global$3.trim(html);
if (trimmedHtml === '') {
return true;
} else {
var fragment = new domGlobals.DOMParser().parseFromString(trimmedHtml, 'text/html');
return editor.dom.isEmpty(fragment);
}
}
};
var hasDraft = function (editor) {
var time = parseInt(global$2.getItem(getAutoSavePrefix(editor) + 'time'), 10) || 0;
if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
removeDraft(editor, false);
return false;
}
return true;
};
var removeDraft = function (editor, fire) {
var prefix = getAutoSavePrefix(editor);
global$2.removeItem(prefix + 'draft');
global$2.removeItem(prefix + 'time');
if (fire !== false) {
fireRemoveDraft(editor);
}
};
var storeDraft = function (editor) {
var prefix = getAutoSavePrefix(editor);
if (!isEmpty(editor) && editor.isDirty()) {
global$2.setItem(prefix + 'draft', editor.getContent({
format: 'raw',
no_events: true
}));
global$2.setItem(prefix + 'time', new Date().getTime().toString());
fireStoreDraft(editor);
}
};
var restoreDraft = function (editor) {
var prefix = getAutoSavePrefix(editor);
if (hasDraft(editor)) {
editor.setContent(global$2.getItem(prefix + 'draft'), { format: 'raw' });
fireRestoreDraft(editor);
}
};
var startStoreDraft = function (editor) {
var interval = getAutoSaveInterval(editor);
global$1.setInterval(function () {
if (!editor.removed) {
storeDraft(editor);
}
}, interval);
};
var restoreLastDraft = function (editor) {
editor.undoManager.transact(function () {
restoreDraft(editor);
removeDraft(editor);
});
editor.focus();
};
var get = function (editor) {
return {
hasDraft: function () {
return hasDraft(editor);
},
storeDraft: function () {
return storeDraft(editor);
},
restoreDraft: function () {
return restoreDraft(editor);
},
removeDraft: function (fire) {
return removeDraft(editor, fire);
},
isEmpty: function (html) {
return isEmpty(editor, html);
}
};
};
var global$4 = tinymce.util.Tools.resolve('tinymce.EditorManager');
var setup = function (editor) {
editor.editorManager.on('BeforeUnload', function (e) {
var msg;
global$3.each(global$4.get(), function (editor) {
if (editor.plugins.autosave) {
editor.plugins.autosave.storeDraft();
}
if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) {
msg = editor.translate('You have unsaved changes are you sure you want to navigate away?');
}
});
if (msg) {
e.preventDefault();
e.returnValue = msg;
}
});
};
var makeSetupHandler = function (editor) {
return function (api) {
api.setDisabled(!hasDraft(editor));
var editorEventCallback = function () {
return api.setDisabled(!hasDraft(editor));
};
editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
return function () {
return editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
};
};
};
var register = function (editor) {
startStoreDraft(editor);
editor.ui.registry.addButton('restoredraft', {
tooltip: 'Restore last draft',
icon: 'restore-draft',
onAction: function () {
restoreLastDraft(editor);
},
onSetup: makeSetupHandler(editor)
});
editor.ui.registry.addMenuItem('restoredraft', {
text: 'Restore last draft',
icon: 'restore-draft',
onAction: function () {
restoreLastDraft(editor);
},
onSetup: makeSetupHandler(editor)
});
};
function Plugin () {
global.add('autosave', function (editor) {
setup(editor);
register(editor);
editor.on('init', function () {
if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) {
restoreDraft(editor);
}
});
return get(editor);
});
}
Plugin();
}(window));
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(a){"use strict";var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),n=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)},u=function(t){var e=a.document.location;return t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},s=(e=undefined,function(t){return e===t}),f=function(t,e){if(s(e))return t.dom.isEmpty(t.getBody());var r=o.trim(e);if(""===r)return!0;var n=(new a.DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(n)},c=function(t){var e=parseInt(n.getItem(u(t)+"time"),10)||0;return!((new Date).getTime()-e>i(t.getParam("autosave_retention"),"20m"))||(m(t,!1),!1)},m=function(t,e){var r=u(t);n.removeItem(r+"draft"),n.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},l=function(t){var e=u(t);!f(t)&&t.isDirty()&&(n.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),n.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))},v=function(t){var e=u(t);c(t)&&(t.setContent(n.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))},d=function(t){var e=i(t.getParam("autosave_interval"),"30s");r.setInterval(function(){t.removed||l(t)},e)},g=function(t){t.undoManager.transact(function(){v(t),m(t)}),t.focus()},y=tinymce.util.Tools.resolve("tinymce.EditorManager"),D=function(r){return function(t){t.setDisabled(!c(r));var e=function(){return t.setDisabled(!c(r))};return r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}};!function p(){t.add("autosave",function(t){var e,r;return t.editorManager.on("BeforeUnload",function(t){var e;o.each(y.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)}),d(e=t),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){g(e)},onSetup:D(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){g(e)},onSetup:D(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&v(t)}),r=t,{hasDraft:function(){return c(r)},storeDraft:function(){return l(r)},restoreDraft:function(){return v(r)},removeDraft:function(t){return m(r,t)},isEmpty:function(t){return f(r,t)}}})}()}(window);
@@ -0,0 +1,99 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var html2bbcode = function (s) {
s = global$1.trim(s);
var rep = function (re, str) {
s = s.replace(re, str);
};
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi, '[url=$1]$2[/url]');
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]');
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]');
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]');
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]');
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi, '[color=$1]$2[/color]');
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, '[color=$1]$2[/color]');
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi, '[size=$1]$2[/size]');
rep(/<font>(.*?)<\/font>/gi, '$1');
rep(/<img.*?src=\"(.*?)\".*?\/>/gi, '[img]$1[/img]');
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi, '[code]$1[/code]');
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi, '[quote]$1[/quote]');
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi, '[code][b]$1[/b][/code]');
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi, '[quote][b]$1[/b][/quote]');
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi, '[code][i]$1[/i][/code]');
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi, '[quote][i]$1[/i][/quote]');
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi, '[code][u]$1[/u][/code]');
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi, '[quote][u]$1[/u][/quote]');
rep(/<\/(strong|b)>/gi, '[/b]');
rep(/<(strong|b)>/gi, '[b]');
rep(/<\/(em|i)>/gi, '[/i]');
rep(/<(em|i)>/gi, '[i]');
rep(/<\/u>/gi, '[/u]');
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi, '[u]$1[/u]');
rep(/<u>/gi, '[u]');
rep(/<blockquote[^>]*>/gi, '[quote]');
rep(/<\/blockquote>/gi, '[/quote]');
rep(/<br \/>/gi, '\n');
rep(/<br\/>/gi, '\n');
rep(/<br>/gi, '\n');
rep(/<p>/gi, '');
rep(/<\/p>/gi, '\n');
rep(/&nbsp;|\u00a0/gi, ' ');
rep(/&quot;/gi, '"');
rep(/&lt;/gi, '<');
rep(/&gt;/gi, '>');
rep(/&amp;/gi, '&');
return s;
};
var bbcode2html = function (s) {
s = global$1.trim(s);
var rep = function (re, str) {
s = s.replace(re, str);
};
rep(/\n/gi, '<br />');
rep(/\[b\]/gi, '<strong>');
rep(/\[\/b\]/gi, '</strong>');
rep(/\[i\]/gi, '<em>');
rep(/\[\/i\]/gi, '</em>');
rep(/\[u\]/gi, '<u>');
rep(/\[\/u\]/gi, '</u>');
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, '<a href="$1">$2</a>');
rep(/\[url\](.*?)\[\/url\]/gi, '<a href="$1">$1</a>');
rep(/\[img\](.*?)\[\/img\]/gi, '<img src="$1" />');
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, '<font color="$1">$2</font>');
rep(/\[code\](.*?)\[\/code\]/gi, '<span class="codeStyle">$1</span>&nbsp;');
rep(/\[quote.*?\](.*?)\[\/quote\]/gi, '<span class="quoteStyle">$1</span>&nbsp;');
return s;
};
function Plugin () {
global.add('bbcode', function (editor) {
editor.on('BeforeSetContent', function (e) {
e.content = bbcode2html(e.content);
});
editor.on('PostProcess', function (e) {
if (e.set) {
e.content = bbcode2html(e.content);
}
if (e.get) {
e.content = html2bbcode(e.content);
}
});
});
}
Plugin();
}());
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/\n/gi,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),t};!function i(){o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=t(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=t(o.content)),o.get&&(o.content=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/<font>(.*?)<\/font>/gi,"$1"),o(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),o(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),o(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),o(/<u>/gi,"[u]"),o(/<blockquote[^>]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/<br \/>/gi,"\n"),o(/<br\/>/gi,"\n"),o(/<br>/gi,"\n"),o(/<p>/gi,""),o(/<\/p>/gi,"\n"),o(/&nbsp;|\u00a0/gi," "),o(/&quot;/gi,'"'),o(/&lt;/gi,"<"),o(/&gt;/gi,">"),o(/&amp;/gi,"&"),t}(o.content))})})}()}();
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,92 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var setContent = function (editor, html) {
editor.focus();
editor.undoManager.transact(function () {
editor.setContent(html);
});
editor.selection.setCursorLocation();
editor.nodeChanged();
};
var getContent = function (editor) {
return editor.getContent({ source_view: true });
};
var open = function (editor) {
var editorContent = getContent(editor);
editor.windowManager.open({
title: 'Source Code',
size: 'large',
body: {
type: 'panel',
items: [{
type: 'textarea',
name: 'code'
}]
},
buttons: [
{
type: 'cancel',
name: 'cancel',
text: 'Cancel'
},
{
type: 'submit',
name: 'save',
text: 'Save',
primary: true
}
],
initialData: { code: editorContent },
onSubmit: function (api) {
setContent(editor, api.getData().code);
api.close();
}
});
};
var register = function (editor) {
editor.addCommand('mceCodeEditor', function () {
open(editor);
});
};
var register$1 = function (editor) {
editor.ui.registry.addButton('code', {
icon: 'sourcecode',
tooltip: 'Source code',
onAction: function () {
return open(editor);
}
});
editor.ui.registry.addMenuItem('code', {
icon: 'sourcecode',
text: 'Source code',
onAction: function () {
return open(editor);
}
});
};
function Plugin () {
global.add('code', function (editor) {
register(editor);
register$1(editor);
return {};
});
}
Plugin();
}());
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(o){var e=o.getContent({source_view:!0});o.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){var t,n;t=o,n=e.getData().code,t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged(),e.close()}})};!function t(){e.add("code",function(e){var t,n;return(t=e).addCommand("mceCodeEditor",function(){o(t)}),(n=e).ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return o(n)}}),n.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return o(n)}}),{}})}()}();
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,22 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function (domGlobals) {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
function Plugin () {
global.add('colorpicker', function () {
domGlobals.console.warn('Color picker plugin is now built in to the core editor, please remove it from your editor configuration');
});
}
Plugin();
}(window));
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
@@ -0,0 +1,22 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function (domGlobals) {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
function Plugin () {
global.add('contextmenu', function () {
domGlobals.console.warn('Context menu plugin is now built in to the core editor, please remove it from your editor configuration');
});
}
Plugin();
}(window));
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(n){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager");!function e(){o.add("contextmenu",function(){n.console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
@@ -0,0 +1,314 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function (domGlobals) {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var setDir = function (editor, dir) {
var dom = editor.dom;
var curDir;
var blocks = editor.selection.getSelectedBlocks();
if (blocks.length) {
curDir = dom.getAttrib(blocks[0], 'dir');
global$1.each(blocks, function (block) {
if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) {
dom.setAttrib(block, 'dir', curDir !== dir ? dir : null);
}
});
editor.nodeChanged();
}
};
var register = function (editor) {
editor.addCommand('mceDirectionLTR', function () {
setDir(editor, 'ltr');
});
editor.addCommand('mceDirectionRTL', function () {
setDir(editor, 'rtl');
});
};
var noop = function () {
};
var compose1 = function (fbc, fab) {
return function (a) {
return fbc(fab(a));
};
};
var constant = function (value) {
return function () {
return value;
};
};
var never = constant(false);
var always = constant(true);
var none = function () {
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
getOrThunk: call,
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
},
getOrNull: constant(null),
getOrUndefined: constant(undefined),
or: id,
orThunk: call,
map: none,
each: noop,
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
toArray: function () {
return [];
},
toString: constant('none()')
};
return me;
}();
var some = function (a) {
var constant_a = constant(a);
var self = function () {
return me;
};
var bind = function (f) {
return f(a);
};
var me = {
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
getOrThunk: constant_a,
getOrDie: constant_a,
getOrNull: constant_a,
getOrUndefined: constant_a,
or: self,
orThunk: self,
map: function (f) {
return some(f(a));
},
each: function (f) {
f(a);
},
bind: bind,
exists: bind,
forall: bind,
filter: function (f) {
return f(a) ? me : NONE;
},
toArray: function () {
return [a];
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
};
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
some: some,
none: none,
from: from
};
var fromHtml = function (html, scope) {
var doc = scope || domGlobals.document;
var div = doc.createElement('div');
div.innerHTML = html;
if (!div.hasChildNodes() || div.childNodes.length > 1) {
domGlobals.console.error('HTML does not have a single root node', html);
throw new Error('HTML must have a single root node');
}
return fromDom(div.childNodes[0]);
};
var fromTag = function (tag, scope) {
var doc = scope || domGlobals.document;
var node = doc.createElement(tag);
return fromDom(node);
};
var fromText = function (text, scope) {
var doc = scope || domGlobals.document;
var node = doc.createTextNode(text);
return fromDom(node);
};
var fromDom = function (node) {
if (node === null || node === undefined) {
throw new Error('Node cannot be null or undefined');
}
return { dom: constant(node) };
};
var fromPoint = function (docElm, x, y) {
var doc = docElm.dom();
return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
};
var Element = {
fromHtml: fromHtml,
fromTag: fromTag,
fromText: fromText,
fromDom: fromDom,
fromPoint: fromPoint
};
var isSimpleType = function (type) {
return function (value) {
return typeof value === type;
};
};
var isFunction = isSimpleType('function');
var isSupported = function (dom) {
return dom.style !== undefined && isFunction(dom.style.getPropertyValue);
};
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
var DOCUMENT = 9;
var DOCUMENT_FRAGMENT = 11;
var TEXT = 3;
var type = function (element) {
return element.dom().nodeType;
};
var isType = function (t) {
return function (element) {
return type(element) === t;
};
};
var isText = isType(TEXT);
var isDocument = isType(DOCUMENT);
var isDocumentFragment = isType(DOCUMENT_FRAGMENT);
var owner = function (element) {
return Element.fromDom(element.dom().ownerDocument);
};
var documentOrOwner = function (dos) {
return isDocument(dos) ? dos : owner(dos);
};
var isShadowRoot = function (dos) {
return isDocumentFragment(dos);
};
var supported = isFunction(domGlobals.Element.prototype.attachShadow) && isFunction(domGlobals.Node.prototype.getRootNode);
var getRootNode = supported ? function (e) {
return Element.fromDom(e.dom().getRootNode());
} : documentOrOwner;
var getShadowRoot = function (e) {
var r = getRootNode(e);
return isShadowRoot(r) ? Option.some(r) : Option.none();
};
var getShadowHost = function (e) {
return Element.fromDom(e.dom().host);
};
var inBody = function (element) {
var dom = isText(element) ? element.dom().parentNode : element.dom();
if (dom === undefined || dom === null || dom.ownerDocument === null) {
return false;
}
return getShadowRoot(Element.fromDom(dom)).fold(function () {
return dom.ownerDocument.body.contains(dom);
}, compose1(inBody, getShadowHost));
};
var get = function (element, property) {
var dom = element.dom();
var styles = domGlobals.window.getComputedStyle(dom);
var r = styles.getPropertyValue(property);
return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;
};
var getUnsafeProperty = function (dom, property) {
return isSupported(dom) ? dom.style.getPropertyValue(property) : '';
};
var getDirection = function (element) {
return get(element, 'direction') === 'rtl' ? 'rtl' : 'ltr';
};
var getNodeChangeHandler = function (editor, dir) {
return function (api) {
var nodeChangeHandler = function (e) {
var element = Element.fromDom(e.element);
api.setActive(getDirection(element) === dir);
};
editor.on('NodeChange', nodeChangeHandler);
return function () {
return editor.off('NodeChange', nodeChangeHandler);
};
};
};
var register$1 = function (editor) {
editor.ui.registry.addToggleButton('ltr', {
tooltip: 'Left to right',
icon: 'ltr',
onAction: function () {
return editor.execCommand('mceDirectionLTR');
},
onSetup: getNodeChangeHandler(editor, 'ltr')
});
editor.ui.registry.addToggleButton('rtl', {
tooltip: 'Right to left',
icon: 'rtl',
onAction: function () {
return editor.execCommand('mceDirectionRTL');
},
onSetup: getNodeChangeHandler(editor, 'rtl')
});
};
function Plugin () {
global.add('directionality', function (editor) {
register(editor);
register$1(editor);
});
}
Plugin();
}(window));
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(u){"use strict";var n,t,e,o,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(n,t){var e,o=n.dom,r=n.selection.getSelectedBlocks();r.length&&(e=o.getAttrib(r[0],"dir"),i.each(r,function(n){o.getParent(n.parentNode,'*[dir="'+t+'"]',o.getRoot())||o.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},f=function(n){return function(){return n}},d=f(!1),l=f(!0),m=function(){return a},a=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:d,isSome:d,isNone:l,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(undefined),or:e,orThunk:t,map:m,each:function(){},bind:m,exists:d,forall:l,filter:m,equals:n,equals_:n,toArray:function(){return[]},toString:f("none()")}),s=function(e){var n=f(e),t=function(){return r},o=function(n){return n(e)},r={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:l,isNone:d,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return s(n(e))},each:function(n){n(e)},bind:o,exists:o,forall:o,filter:function(n){return n(e)?r:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(d,function(n){return t(e,n)})}};return r},g={some:s,none:m,from:function(n){return null===n||n===undefined?a:s(n)}},h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:f(n)}},y={fromHtml:function(n,t){var e=(t||u.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw u.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return h(e.childNodes[0])},fromTag:function(n,t){var e=(t||u.document).createElement(n);return h(e)},fromText:function(n,t){var e=(t||u.document).createTextNode(n);return h(e)},fromDom:h,fromPoint:function(n,t,e){var o=n.dom();return g.from(o.elementFromPoint(t,e)).map(h)}},v=(o="function",function(n){return typeof n===o}),p=("undefined"!=typeof u.window?u.window:Function("return this;")(),function(t){return function(n){return n.dom().nodeType===t}}),T=p(3),w=p(9),N=p(11),D=v(u.Element.prototype.attachShadow)&&v(u.Node.prototype.getRootNode)?function(n){return y.fromDom(n.dom().getRootNode())}:function(n){return w(n)?n:(t=n,y.fromDom(t.dom().ownerDocument));var t},O=function(n){var t=D(n);return N(t)?g.some(t):g.none()},C=function(n){return y.fromDom(n.dom().host)},S=function(n){var t,e,o=T(n)?n.dom().parentNode:n.dom();return o!==undefined&&null!==o&&null!==o.ownerDocument&&O(y.fromDom(o)).fold(function(){return o.ownerDocument.body.contains(o)},(t=S,e=C,function(n){return t(e(n))}))},L=function(n,t){return(e=n).style!==undefined&&v(e.style.getPropertyValue)?n.style.getPropertyValue(t):"";var e},R=function(n){return"rtl"===(e="direction",o=(t=n).dom(),""!==(r=u.window.getComputedStyle(o).getPropertyValue(e))||S(t)?r:L(o,e))?"rtl":"ltr";var t,e,o,r},A=function(t,o){return function(e){var n=function(n){var t=y.fromDom(n.element);e.setActive(R(t)===o)};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}};!function P(){r.add("directionality",function(n){var t,e;(t=n).addCommand("mceDirectionLTR",function(){c(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){c(t,"rtl")}),(e=n).ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return e.execCommand("mceDirectionLTR")},onSetup:A(e,"ltr")}),e.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return e.execCommand("mceDirectionRTL")},onSetup:A(e,"rtl")})})}()}(window);
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,564 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function (domGlobals) {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var noop = function () {
};
var constant = function (value) {
return function () {
return value;
};
};
var never = constant(false);
var always = constant(true);
var none = function () {
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
getOrThunk: call,
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
},
getOrNull: constant(null),
getOrUndefined: constant(undefined),
or: id,
orThunk: call,
map: none,
each: noop,
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
toArray: function () {
return [];
},
toString: constant('none()')
};
return me;
}();
var some = function (a) {
var constant_a = constant(a);
var self = function () {
return me;
};
var bind = function (f) {
return f(a);
};
var me = {
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
getOrThunk: constant_a,
getOrDie: constant_a,
getOrNull: constant_a,
getOrUndefined: constant_a,
or: self,
orThunk: self,
map: function (f) {
return some(f(a));
},
each: function (f) {
f(a);
},
bind: bind,
exists: bind,
forall: bind,
filter: function (f) {
return f(a) ? me : NONE;
},
toArray: function () {
return [a];
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
};
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
some: some,
none: none,
from: from
};
var exists = function (xs, pred) {
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
if (pred(x, i)) {
return true;
}
}
return false;
};
var map = function (xs, f) {
var len = xs.length;
var r = new Array(len);
for (var i = 0; i < len; i++) {
var x = xs[i];
r[i] = f(x, i);
}
return r;
};
var contains = function (str, substr) {
return str.indexOf(substr) !== -1;
};
var emojiMatches = function (emoji, lowerCasePattern) {
return contains(emoji.title.toLowerCase(), lowerCasePattern) || exists(emoji.keywords, function (k) {
return contains(k.toLowerCase(), lowerCasePattern);
});
};
var emojisFrom = function (list, pattern, maxResults) {
var matches = [];
var lowerCasePattern = pattern.toLowerCase();
var reachedLimit = maxResults.fold(function () {
return never;
}, function (max) {
return function (size) {
return size >= max;
};
});
for (var i = 0; i < list.length; i++) {
if (pattern.length === 0 || emojiMatches(list[i], lowerCasePattern)) {
matches.push({
value: list[i].char,
text: list[i].title,
icon: list[i].char
});
if (reachedLimit(matches.length)) {
break;
}
}
}
return matches;
};
var init = function (editor, database) {
editor.ui.registry.addAutocompleter('emoticons', {
ch: ':',
columns: 'auto',
minChars: 2,
fetch: function (pattern, maxResults) {
return database.waitForLoad().then(function () {
var candidates = database.listAll();
return emojisFrom(candidates, pattern, Option.some(maxResults));
});
},
onAction: function (autocompleteApi, rng, value) {
editor.selection.setRng(rng);
editor.insertContent(value);
autocompleteApi.hide();
}
});
};
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
return {
get: get,
set: set
};
};
var last = function (fn, rate) {
var timer = null;
var cancel = function () {
if (timer !== null) {
domGlobals.clearTimeout(timer);
timer = null;
}
};
var throttle = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (timer !== null) {
domGlobals.clearTimeout(timer);
}
timer = domGlobals.setTimeout(function () {
fn.apply(null, args);
timer = null;
}, rate);
};
return {
cancel: cancel,
throttle: throttle
};
};
var insertEmoticon = function (editor, ch) {
editor.insertContent(ch);
};
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var hasOwnProperty = Object.prototype.hasOwnProperty;
var shallow = function (old, nu) {
return nu;
};
var baseMerge = function (merger) {
return function () {
var objects = new Array(arguments.length);
for (var i = 0; i < objects.length; i++) {
objects[i] = arguments[i];
}
if (objects.length === 0) {
throw new Error('Can\'t merge zero objects');
}
var ret = {};
for (var j = 0; j < objects.length; j++) {
var curObject = objects[j];
for (var key in curObject) {
if (hasOwnProperty.call(curObject, key)) {
ret[key] = merger(ret[key], curObject[key]);
}
}
}
return ret;
};
};
var merge = baseMerge(shallow);
var keys = Object.keys;
var hasOwnProperty$1 = Object.hasOwnProperty;
var each = function (obj, f) {
var props = keys(obj);
for (var k = 0, len = props.length; k < len; k++) {
var i = props[k];
var x = obj[i];
f(x, i);
}
};
var map$1 = function (obj, f) {
return tupleMap(obj, function (x, i) {
return {
k: i,
v: f(x, i)
};
});
};
var tupleMap = function (obj, f) {
var r = {};
each(obj, function (x, i) {
var tuple = f(x, i);
r[tuple.k] = tuple.v;
});
return r;
};
var has = function (obj, key) {
return hasOwnProperty$1.call(obj, key);
};
var global$1 = tinymce.util.Tools.resolve('tinymce.Resource');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise');
var DEFAULT_ID = 'tinymce.plugins.emoticons';
var getEmoticonDatabaseUrl = function (editor, pluginUrl) {
return editor.getParam('emoticons_database_url', pluginUrl + '/js/emojis' + editor.suffix + '.js');
};
var getEmoticonDatabaseId = function (editor) {
return editor.getParam('emoticons_database_id', DEFAULT_ID, 'string');
};
var getAppendedEmoticons = function (editor) {
return editor.getParam('emoticons_append', {}, 'object');
};
var ALL_CATEGORY = 'All';
var categoryNameMap = {
symbols: 'Symbols',
people: 'People',
animals_and_nature: 'Animals and Nature',
food_and_drink: 'Food and Drink',
activity: 'Activity',
travel_and_places: 'Travel and Places',
objects: 'Objects',
flags: 'Flags',
user: 'User Defined'
};
var translateCategory = function (categories, name) {
return has(categories, name) ? categories[name] : name;
};
var getUserDefinedEmoticons = function (editor) {
var userDefinedEmoticons = getAppendedEmoticons(editor);
return map$1(userDefinedEmoticons, function (value) {
return __assign({
keywords: [],
category: 'user'
}, value);
});
};
var initDatabase = function (editor, databaseUrl, databaseId) {
var categories = Cell(Option.none());
var all = Cell(Option.none());
var processEmojis = function (emojis) {
var cats = {};
var everything = [];
each(emojis, function (lib, title) {
var entry = {
title: title,
keywords: lib.keywords,
char: lib.char,
category: translateCategory(categoryNameMap, lib.category)
};
var current = cats[entry.category] !== undefined ? cats[entry.category] : [];
cats[entry.category] = current.concat([entry]);
everything.push(entry);
});
categories.set(Option.some(cats));
all.set(Option.some(everything));
};
editor.on('init', function () {
global$1.load(databaseId, databaseUrl).then(function (emojis) {
var userEmojis = getUserDefinedEmoticons(editor);
processEmojis(merge(emojis, userEmojis));
}, function (err) {
domGlobals.console.log('Failed to load emoticons: ' + err);
categories.set(Option.some({}));
all.set(Option.some([]));
});
});
var listCategory = function (category) {
if (category === ALL_CATEGORY) {
return listAll();
}
return categories.get().bind(function (cats) {
return Option.from(cats[category]);
}).getOr([]);
};
var listAll = function () {
return all.get().getOr([]);
};
var listCategories = function () {
return [ALL_CATEGORY].concat(keys(categories.get().getOr({})));
};
var waitForLoad = function () {
if (hasLoaded()) {
return global$3.resolve(true);
} else {
return new global$3(function (resolve, reject) {
var numRetries = 15;
var interval = global$2.setInterval(function () {
if (hasLoaded()) {
global$2.clearInterval(interval);
resolve(true);
} else {
numRetries--;
if (numRetries < 0) {
domGlobals.console.log('Could not load emojis from url: ' + databaseUrl);
global$2.clearInterval(interval);
reject(false);
}
}
}, 100);
});
}
};
var hasLoaded = function () {
return categories.get().isSome() && all.get().isSome();
};
return {
listCategories: listCategories,
hasLoaded: hasLoaded,
waitForLoad: waitForLoad,
listAll: listAll,
listCategory: listCategory
};
};
var patternName = 'pattern';
var open = function (editor, database) {
var initialState = {
pattern: '',
results: emojisFrom(database.listAll(), '', Option.some(300))
};
var currentTab = Cell(ALL_CATEGORY);
var scan = function (dialogApi) {
var dialogData = dialogApi.getData();
var category = currentTab.get();
var candidates = database.listCategory(category);
var results = emojisFrom(candidates, dialogData[patternName], category === ALL_CATEGORY ? Option.some(300) : Option.none());
dialogApi.setData({ results: results });
};
var updateFilter = last(function (dialogApi) {
scan(dialogApi);
}, 200);
var searchField = {
label: 'Search',
type: 'input',
name: patternName
};
var resultsField = {
type: 'collection',
name: 'results'
};
var getInitialState = function () {
var body = {
type: 'tabpanel',
tabs: map(database.listCategories(), function (cat) {
return {
title: cat,
name: cat,
items: [
searchField,
resultsField
]
};
})
};
return {
title: 'Emoticons',
size: 'normal',
body: body,
initialData: initialState,
onTabChange: function (dialogApi, details) {
currentTab.set(details.newTabName);
updateFilter.throttle(dialogApi);
},
onChange: updateFilter.throttle,
onAction: function (dialogApi, actionData) {
if (actionData.name === 'results') {
insertEmoticon(editor, actionData.value);
dialogApi.close();
}
},
buttons: [{
type: 'cancel',
text: 'Close',
primary: true
}]
};
};
var dialogApi = editor.windowManager.open(getInitialState());
dialogApi.focus(patternName);
if (!database.hasLoaded()) {
dialogApi.block('Loading emoticons...');
database.waitForLoad().then(function () {
dialogApi.redial(getInitialState());
updateFilter.throttle(dialogApi);
dialogApi.focus(patternName);
dialogApi.unblock();
}).catch(function (_err) {
dialogApi.redial({
title: 'Emoticons',
body: {
type: 'panel',
items: [{
type: 'alertbanner',
level: 'error',
icon: 'warning',
text: '<p>Could not load emoticons</p>'
}]
},
buttons: [{
type: 'cancel',
text: 'Close',
primary: true
}],
initialData: {
pattern: '',
results: []
}
});
dialogApi.focus(patternName);
dialogApi.unblock();
});
}
};
var register = function (editor, database) {
var onAction = function () {
return open(editor, database);
};
editor.ui.registry.addButton('emoticons', {
tooltip: 'Emoticons',
icon: 'emoji',
onAction: onAction
});
editor.ui.registry.addMenuItem('emoticons', {
text: 'Emoticons...',
icon: 'emoji',
onAction: onAction
});
};
function Plugin () {
global.add('emoticons', function (editor, pluginUrl) {
var databaseUrl = getEmoticonDatabaseUrl(editor, pluginUrl);
var databaseId = getEmoticonDatabaseId(editor);
var database = initDatabase(editor, databaseUrl, databaseId);
register(editor, database);
init(editor, database);
});
}
Plugin();
}(window));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,544 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function (domGlobals) {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
return {
get: get,
set: set
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$2 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
var global$3 = tinymce.util.Tools.resolve('tinymce.html.Node');
var global$4 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
var shouldHideInSourceView = function (editor) {
return editor.getParam('fullpage_hide_in_source_view');
};
var getDefaultXmlPi = function (editor) {
return editor.getParam('fullpage_default_xml_pi');
};
var getDefaultEncoding = function (editor) {
return editor.getParam('fullpage_default_encoding');
};
var getDefaultFontFamily = function (editor) {
return editor.getParam('fullpage_default_font_family');
};
var getDefaultFontSize = function (editor) {
return editor.getParam('fullpage_default_font_size');
};
var getDefaultTextColor = function (editor) {
return editor.getParam('fullpage_default_text_color');
};
var getDefaultTitle = function (editor) {
return editor.getParam('fullpage_default_title');
};
var getDefaultDocType = function (editor) {
return editor.getParam('fullpage_default_doctype', '<!DOCTYPE html>');
};
var getProtect = function (editor) {
return editor.getParam('protect');
};
var parseHeader = function (head) {
return global$2({
validate: false,
root_name: '#document'
}).parse(head, { format: 'xhtml' });
};
var htmlToData = function (editor, head) {
var headerFragment = parseHeader(head);
var data = {};
var elm, matches;
function getAttr(elm, name) {
var value = elm.attr(name);
return value || '';
}
data.fontface = getDefaultFontFamily(editor);
data.fontsize = getDefaultFontSize(editor);
elm = headerFragment.firstChild;
if (elm.type === 7) {
data.xml_pi = true;
matches = /encoding="([^"]+)"/.exec(elm.value);
if (matches) {
data.docencoding = matches[1];
}
}
elm = headerFragment.getAll('#doctype')[0];
if (elm) {
data.doctype = '<!DOCTYPE' + elm.value + '>';
}
elm = headerFragment.getAll('title')[0];
if (elm && elm.firstChild) {
data.title = elm.firstChild.value;
}
global$1.each(headerFragment.getAll('meta'), function (meta) {
var name = meta.attr('name');
var httpEquiv = meta.attr('http-equiv');
var matches;
if (name) {
data[name.toLowerCase()] = meta.attr('content');
} else if (httpEquiv === 'Content-Type') {
matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
if (matches) {
data.docencoding = matches[1];
}
}
});
elm = headerFragment.getAll('html')[0];
if (elm) {
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
}
data.stylesheets = [];
global$1.each(headerFragment.getAll('link'), function (link) {
if (link.attr('rel') === 'stylesheet') {
data.stylesheets.push(link.attr('href'));
}
});
elm = headerFragment.getAll('body')[0];
if (elm) {
data.langdir = getAttr(elm, 'dir');
data.style = getAttr(elm, 'style');
data.visited_color = getAttr(elm, 'vlink');
data.link_color = getAttr(elm, 'link');
data.active_color = getAttr(elm, 'alink');
}
return data;
};
var dataToHtml = function (editor, data, head) {
var headElement, elm, value;
var dom = editor.dom;
function setAttr(elm, name, value) {
elm.attr(name, value ? value : undefined);
}
function addHeadNode(node) {
if (headElement.firstChild) {
headElement.insert(node, headElement.firstChild);
} else {
headElement.append(node);
}
}
var headerFragment = parseHeader(head);
headElement = headerFragment.getAll('head')[0];
if (!headElement) {
elm = headerFragment.getAll('html')[0];
headElement = new global$3('head', 1);
if (elm.firstChild) {
elm.insert(headElement, elm.firstChild, true);
} else {
elm.append(headElement);
}
}
elm = headerFragment.firstChild;
if (data.xml_pi) {
value = 'version="1.0"';
if (data.docencoding) {
value += ' encoding="' + data.docencoding + '"';
}
if (elm.type !== 7) {
elm = new global$3('xml', 7);
headerFragment.insert(elm, headerFragment.firstChild, true);
}
elm.value = value;
} else if (elm && elm.type === 7) {
elm.remove();
}
elm = headerFragment.getAll('#doctype')[0];
if (data.doctype) {
if (!elm) {
elm = new global$3('#doctype', 10);
if (data.xml_pi) {
headerFragment.insert(elm, headerFragment.firstChild);
} else {
addHeadNode(elm);
}
}
elm.value = data.doctype.substring(9, data.doctype.length - 1);
} else if (elm) {
elm.remove();
}
elm = null;
global$1.each(headerFragment.getAll('meta'), function (meta) {
if (meta.attr('http-equiv') === 'Content-Type') {
elm = meta;
}
});
if (data.docencoding) {
if (!elm) {
elm = new global$3('meta', 1);
elm.attr('http-equiv', 'Content-Type');
elm.shortEnded = true;
addHeadNode(elm);
}
elm.attr('content', 'text/html; charset=' + data.docencoding);
} else if (elm) {
elm.remove();
}
elm = headerFragment.getAll('title')[0];
if (data.title) {
if (!elm) {
elm = new global$3('title', 1);
addHeadNode(elm);
} else {
elm.empty();
}
elm.append(new global$3('#text', 3)).value = data.title;
} else if (elm) {
elm.remove();
}
global$1.each('keywords,description,author,copyright,robots'.split(','), function (name) {
var nodes = headerFragment.getAll('meta');
var i, meta;
var value = data[name];
for (i = 0; i < nodes.length; i++) {
meta = nodes[i];
if (meta.attr('name') === name) {
if (value) {
meta.attr('content', value);
} else {
meta.remove();
}
return;
}
}
if (value) {
elm = new global$3('meta', 1);
elm.attr('name', name);
elm.attr('content', value);
elm.shortEnded = true;
addHeadNode(elm);
}
});
var currentStyleSheetsMap = {};
global$1.each(headerFragment.getAll('link'), function (stylesheet) {
if (stylesheet.attr('rel') === 'stylesheet') {
currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet;
}
});
global$1.each(data.stylesheets, function (stylesheet) {
if (!currentStyleSheetsMap[stylesheet]) {
elm = new global$3('link', 1);
elm.attr({
rel: 'stylesheet',
text: 'text/css',
href: stylesheet
});
elm.shortEnded = true;
addHeadNode(elm);
}
delete currentStyleSheetsMap[stylesheet];
});
global$1.each(currentStyleSheetsMap, function (stylesheet) {
stylesheet.remove();
});
elm = headerFragment.getAll('body')[0];
if (elm) {
setAttr(elm, 'dir', data.langdir);
setAttr(elm, 'style', data.style);
setAttr(elm, 'vlink', data.visited_color);
setAttr(elm, 'link', data.link_color);
setAttr(elm, 'alink', data.active_color);
dom.setAttribs(editor.getBody(), {
style: data.style,
dir: data.dir,
vLink: data.visited_color,
link: data.link_color,
aLink: data.active_color
});
}
elm = headerFragment.getAll('html')[0];
if (elm) {
setAttr(elm, 'lang', data.langcode);
setAttr(elm, 'xml:lang', data.langcode);
}
if (!headElement.firstChild) {
headElement.remove();
}
var html = global$4({
validate: false,
indent: true,
indent_before: 'head,html,body,meta,title,script,link,style',
indent_after: 'head,html,body,meta,title,script,link,style'
}).serialize(headerFragment);
return html.substring(0, html.indexOf('</body>'));
};
var open = function (editor, headState) {
var data = htmlToData(editor, headState.get());
var defaultData = {
title: '',
keywords: '',
description: '',
robots: '',
author: '',
docencoding: ''
};
var initialData = __assign(__assign({}, defaultData), data);
editor.windowManager.open({
title: 'Metadata and Document Properties',
size: 'normal',
body: {
type: 'panel',
items: [
{
name: 'title',
type: 'input',
label: 'Title'
},
{
name: 'keywords',
type: 'input',
label: 'Keywords'
},
{
name: 'description',
type: 'input',
label: 'Description'
},
{
name: 'robots',
type: 'input',
label: 'Robots'
},
{
name: 'author',
type: 'input',
label: 'Author'
},
{
name: 'docencoding',
type: 'input',
label: 'Encoding'
}
]
},
buttons: [
{
type: 'cancel',
name: 'cancel',
text: 'Cancel'
},
{
type: 'submit',
name: 'save',
text: 'Save',
primary: true
}
],
initialData: initialData,
onSubmit: function (api) {
var nuData = api.getData();
var headHtml = dataToHtml(editor, global$1.extend(data, nuData), headState.get());
headState.set(headHtml);
api.close();
}
});
};
var register = function (editor, headState) {
editor.addCommand('mceFullPageProperties', function () {
open(editor, headState);
});
};
var protectHtml = function (protect, html) {
global$1.each(protect, function (pattern) {
html = html.replace(pattern, function (str) {
return '<!--mce:protected ' + escape(str) + '-->';
});
});
return html;
};
var unprotectHtml = function (html) {
return html.replace(/<!--mce:protected ([\s\S]*?)-->/g, function (a, m) {
return unescape(m);
});
};
var each = global$1.each;
var low = function (s) {
return s.replace(/<\/?[A-Z]+/g, function (a) {
return a.toLowerCase();
});
};
var handleSetContent = function (editor, headState, footState, evt) {
var startPos, endPos, content, styles = '';
var dom = editor.dom;
if (evt.selection) {
return;
}
content = protectHtml(getProtect(editor), evt.content);
if (evt.format === 'raw' && headState.get()) {
return;
}
if (evt.source_view && shouldHideInSourceView(editor)) {
return;
}
if (content.length === 0 && !evt.source_view) {
content = global$1.trim(headState.get()) + '\n' + global$1.trim(content) + '\n' + global$1.trim(footState.get());
}
content = content.replace(/<(\/?)BODY/gi, '<$1body');
startPos = content.indexOf('<body');
if (startPos !== -1) {
startPos = content.indexOf('>', startPos);
headState.set(low(content.substring(0, startPos + 1)));
endPos = content.indexOf('</body', startPos);
if (endPos === -1) {
endPos = content.length;
}
evt.content = global$1.trim(content.substring(startPos + 1, endPos));
footState.set(low(content.substring(endPos)));
} else {
headState.set(getDefaultHeader(editor));
footState.set('\n</body>\n</html>');
}
var headerFragment = parseHeader(headState.get());
each(headerFragment.getAll('style'), function (node) {
if (node.firstChild) {
styles += node.firstChild.value;
}
});
var bodyElm = headerFragment.getAll('body')[0];
if (bodyElm) {
dom.setAttribs(editor.getBody(), {
style: bodyElm.attr('style') || '',
dir: bodyElm.attr('dir') || '',
vLink: bodyElm.attr('vlink') || '',
link: bodyElm.attr('link') || '',
aLink: bodyElm.attr('alink') || ''
});
}
dom.remove('fullpage_styles');
var headElm = editor.getDoc().getElementsByTagName('head')[0];
if (styles) {
var styleElm = dom.add(headElm, 'style', { id: 'fullpage_styles' });
styleElm.appendChild(domGlobals.document.createTextNode(styles));
}
var currentStyleSheetsMap = {};
global$1.each(headElm.getElementsByTagName('link'), function (stylesheet) {
if (stylesheet.rel === 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) {
currentStyleSheetsMap[stylesheet.href] = stylesheet;
}
});
global$1.each(headerFragment.getAll('link'), function (stylesheet) {
var href = stylesheet.attr('href');
if (!href) {
return true;
}
if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') === 'stylesheet') {
dom.add(headElm, 'link', {
'rel': 'stylesheet',
'text': 'text/css',
href: href,
'data-mce-fullpage': '1'
});
}
delete currentStyleSheetsMap[href];
});
global$1.each(currentStyleSheetsMap, function (stylesheet) {
stylesheet.parentNode.removeChild(stylesheet);
});
};
var getDefaultHeader = function (editor) {
var header = '', value, styles = '';
if (getDefaultXmlPi(editor)) {
var piEncoding = getDefaultEncoding(editor);
header += '<?xml version="1.0" encoding="' + (piEncoding ? piEncoding : 'ISO-8859-1') + '" ?>\n';
}
header += getDefaultDocType(editor);
header += '\n<html>\n<head>\n';
if (value = getDefaultTitle(editor)) {
header += '<title>' + value + '</title>\n';
}
if (value = getDefaultEncoding(editor)) {
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
}
if (value = getDefaultFontFamily(editor)) {
styles += 'font-family: ' + value + ';';
}
if (value = getDefaultFontSize(editor)) {
styles += 'font-size: ' + value + ';';
}
if (value = getDefaultTextColor(editor)) {
styles += 'color: ' + value + ';';
}
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
return header;
};
var handleGetContent = function (editor, head, foot, evt) {
if (!evt.selection && (!evt.source_view || !shouldHideInSourceView(editor))) {
evt.content = unprotectHtml(global$1.trim(head) + '\n' + global$1.trim(evt.content) + '\n' + global$1.trim(foot));
}
};
var setup = function (editor, headState, footState) {
editor.on('BeforeSetContent', function (evt) {
handleSetContent(editor, headState, footState, evt);
});
editor.on('GetContent', function (evt) {
handleGetContent(editor, headState.get(), footState.get(), evt);
});
};
var register$1 = function (editor) {
editor.ui.registry.addButton('fullpage', {
tooltip: 'Metadata and document properties',
icon: 'document-properties',
onAction: function () {
editor.execCommand('mceFullPageProperties');
}
});
editor.ui.registry.addMenuItem('fullpage', {
text: 'Metadata and document properties',
icon: 'document-properties',
onAction: function () {
editor.execCommand('mceFullPageProperties');
}
});
};
function Plugin () {
global.add('fullpage', function (editor) {
var headState = Cell(''), footState = Cell('');
register(editor, headState);
register$1(editor);
setup(editor, headState, footState);
});
}
Plugin();
}(window));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,851 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function (domGlobals) {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
return {
get: get,
set: set
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var get = function (fullscreenState) {
return {
isFullscreen: function () {
return fullscreenState.get() !== null;
}
};
};
var noop = function () {
};
var compose = function (fa, fb) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return fa(fb.apply(null, args));
};
};
var compose1 = function (fbc, fab) {
return function (a) {
return fbc(fab(a));
};
};
var constant = function (value) {
return function () {
return value;
};
};
var never = constant(false);
var always = constant(true);
var none = function () {
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
getOrThunk: call,
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
},
getOrNull: constant(null),
getOrUndefined: constant(undefined),
or: id,
orThunk: call,
map: none,
each: noop,
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
toArray: function () {
return [];
},
toString: constant('none()')
};
return me;
}();
var some = function (a) {
var constant_a = constant(a);
var self = function () {
return me;
};
var bind = function (f) {
return f(a);
};
var me = {
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
getOrThunk: constant_a,
getOrDie: constant_a,
getOrNull: constant_a,
getOrUndefined: constant_a,
or: self,
orThunk: self,
map: function (f) {
return some(f(a));
},
each: function (f) {
f(a);
},
bind: bind,
exists: bind,
forall: bind,
filter: function (f) {
return f(a) ? me : NONE;
},
toArray: function () {
return [a];
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
};
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
some: some,
none: none,
from: from
};
var revocable = function (doRevoke) {
var subject = Cell(Option.none());
var revoke = function () {
subject.get().each(doRevoke);
};
var clear = function () {
revoke();
subject.set(Option.none());
};
var set = function (s) {
revoke();
subject.set(Option.some(s));
};
var isSet = function () {
return subject.get().isSome();
};
return {
clear: clear,
isSet: isSet,
set: set
};
};
var unbindable = function () {
return revocable(function (s) {
s.unbind();
});
};
var value = function () {
var subject = Cell(Option.none());
var clear = function () {
subject.set(Option.none());
};
var set = function (s) {
subject.set(Option.some(s));
};
var on = function (f) {
subject.get().each(f);
};
var isSet = function () {
return subject.get().isSome();
};
return {
clear: clear,
set: set,
isSet: isSet,
on: on
};
};
var typeOf = function (x) {
var t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
return 'array';
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
return 'string';
} else {
return t;
}
};
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
};
};
var isSimpleType = function (type) {
return function (value) {
return typeof value === type;
};
};
var isString = isType('string');
var isArray = isType('array');
var isBoolean = isSimpleType('boolean');
var isNullable = function (a) {
return a === null || a === undefined;
};
var isNonNullable = function (a) {
return !isNullable(a);
};
var isFunction = isSimpleType('function');
var isNumber = isSimpleType('number');
var nativePush = Array.prototype.push;
var map = function (xs, f) {
var len = xs.length;
var r = new Array(len);
for (var i = 0; i < len; i++) {
var x = xs[i];
r[i] = f(x, i);
}
return r;
};
var each = function (xs, f) {
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
f(x, i);
}
};
var filter = function (xs, pred) {
var r = [];
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
if (pred(x, i)) {
r.push(x);
}
}
return r;
};
var flatten = function (xs) {
var r = [];
for (var i = 0, len = xs.length; i < len; ++i) {
if (!isArray(xs[i])) {
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
}
nativePush.apply(r, xs[i]);
}
return r;
};
var bind = function (xs, f) {
return flatten(map(xs, f));
};
var head = function (xs) {
return xs.length === 0 ? Option.none() : Option.some(xs[0]);
};
var keys = Object.keys;
var each$1 = function (obj, f) {
var props = keys(obj);
for (var k = 0, len = props.length; k < len; k++) {
var i = props[k];
var x = obj[i];
f(x, i);
}
};
var isSupported = function (dom) {
return dom.style !== undefined && isFunction(dom.style.getPropertyValue);
};
var fromHtml = function (html, scope) {
var doc = scope || domGlobals.document;
var div = doc.createElement('div');
div.innerHTML = html;
if (!div.hasChildNodes() || div.childNodes.length > 1) {
domGlobals.console.error('HTML does not have a single root node', html);
throw new Error('HTML must have a single root node');
}
return fromDom(div.childNodes[0]);
};
var fromTag = function (tag, scope) {
var doc = scope || domGlobals.document;
var node = doc.createElement(tag);
return fromDom(node);
};
var fromText = function (text, scope) {
var doc = scope || domGlobals.document;
var node = doc.createTextNode(text);
return fromDom(node);
};
var fromDom = function (node) {
if (node === null || node === undefined) {
throw new Error('Node cannot be null or undefined');
}
return { dom: constant(node) };
};
var fromPoint = function (docElm, x, y) {
var doc = docElm.dom();
return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
};
var Element = {
fromHtml: fromHtml,
fromTag: fromTag,
fromText: fromText,
fromDom: fromDom,
fromPoint: fromPoint
};
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
var DOCUMENT = 9;
var DOCUMENT_FRAGMENT = 11;
var ELEMENT = 1;
var TEXT = 3;
var type = function (element) {
return element.dom().nodeType;
};
var isType$1 = function (t) {
return function (element) {
return type(element) === t;
};
};
var isElement = isType$1(ELEMENT);
var isText = isType$1(TEXT);
var isDocument = isType$1(DOCUMENT);
var isDocumentFragment = isType$1(DOCUMENT_FRAGMENT);
var is = function (element, selector) {
var dom = element.dom();
if (dom.nodeType !== ELEMENT) {
return false;
} else {
var elem = dom;
if (elem.matches !== undefined) {
return elem.matches(selector);
} else if (elem.msMatchesSelector !== undefined) {
return elem.msMatchesSelector(selector);
} else if (elem.webkitMatchesSelector !== undefined) {
return elem.webkitMatchesSelector(selector);
} else if (elem.mozMatchesSelector !== undefined) {
return elem.mozMatchesSelector(selector);
} else {
throw new Error('Browser lacks native selectors');
}
}
};
var bypassSelector = function (dom) {
return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0;
};
var all = function (selector, scope) {
var base = scope === undefined ? domGlobals.document : scope.dom();
return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element.fromDom);
};
var eq = function (e1, e2) {
return e1.dom() === e2.dom();
};
var owner = function (element) {
return Element.fromDom(element.dom().ownerDocument);
};
var documentOrOwner = function (dos) {
return isDocument(dos) ? dos : owner(dos);
};
var parent = function (element) {
return Option.from(element.dom().parentNode).map(Element.fromDom);
};
var parents = function (element, isRoot) {
var stop = isFunction(isRoot) ? isRoot : never;
var dom = element.dom();
var ret = [];
while (dom.parentNode !== null && dom.parentNode !== undefined) {
var rawParent = dom.parentNode;
var p = Element.fromDom(rawParent);
ret.push(p);
if (stop(p) === true) {
break;
} else {
dom = rawParent;
}
}
return ret;
};
var siblings = function (element) {
var filterSelf = function (elements) {
return filter(elements, function (x) {
return !eq(element, x);
});
};
return parent(element).map(children).map(filterSelf).getOr([]);
};
var children = function (element) {
return map(element.dom().childNodes, Element.fromDom);
};
var isShadowRoot = function (dos) {
return isDocumentFragment(dos);
};
var supported = isFunction(domGlobals.Element.prototype.attachShadow) && isFunction(domGlobals.Node.prototype.getRootNode);
var isSupported$1 = constant(supported);
var getRootNode = supported ? function (e) {
return Element.fromDom(e.dom().getRootNode());
} : documentOrOwner;
var getShadowRoot = function (e) {
var r = getRootNode(e);
return isShadowRoot(r) ? Option.some(r) : Option.none();
};
var getShadowHost = function (e) {
return Element.fromDom(e.dom().host);
};
var getOriginalEventTarget = function (event) {
if (isSupported$1() && isNonNullable(event.target)) {
var el = Element.fromDom(event.target);
if (isElement(el) && isOpenShadowHost(Element.fromDom(event.target))) {
var eventAny = event;
if (eventAny.composed && eventAny.composedPath) {
var composedPath = eventAny.composedPath();
if (composedPath) {
return head(composedPath);
}
}
}
}
return Option.from(event.target);
};
var isOpenShadowHost = function (element) {
return isNonNullable(element.dom().shadowRoot);
};
var inBody = function (element) {
var dom = isText(element) ? element.dom().parentNode : element.dom();
if (dom === undefined || dom === null || dom.ownerDocument === null) {
return false;
}
return getShadowRoot(Element.fromDom(dom)).fold(function () {
return dom.ownerDocument.body.contains(dom);
}, compose1(inBody, getShadowHost));
};
var rawSet = function (dom, key, value) {
if (isString(value) || isBoolean(value) || isNumber(value)) {
dom.setAttribute(key, value + '');
} else {
domGlobals.console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom);
throw new Error('Attribute value was not simple');
}
};
var set = function (element, key, value) {
rawSet(element.dom(), key, value);
};
var get$1 = function (element, key) {
var v = element.dom().getAttribute(key);
return v === null ? undefined : v;
};
var remove = function (element, key) {
element.dom().removeAttribute(key);
};
var internalSet = function (dom, property, value) {
if (!isString(value)) {
domGlobals.console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom);
throw new Error('CSS value must be a string: ' + value);
}
if (isSupported(dom)) {
dom.style.setProperty(property, value);
}
};
var setAll = function (element, css) {
var dom = element.dom();
each$1(css, function (v, k) {
internalSet(dom, k, v);
});
};
var get$2 = function (element, property) {
var dom = element.dom();
var styles = domGlobals.window.getComputedStyle(dom);
var r = styles.getPropertyValue(property);
return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;
};
var getUnsafeProperty = function (dom, property) {
return isSupported(dom) ? dom.style.getPropertyValue(property) : '';
};
var mkEvent = function (target, x, y, stop, prevent, kill, raw) {
return {
target: constant(target),
x: constant(x),
y: constant(y),
stop: stop,
prevent: prevent,
kill: kill,
raw: constant(raw)
};
};
var fromRawEvent = function (rawEvent) {
var target = Element.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target));
var stop = function () {
return rawEvent.stopPropagation();
};
var prevent = function () {
return rawEvent.preventDefault();
};
var kill = compose(prevent, stop);
return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent);
};
var r = function (left, top) {
var translate = function (x, y) {
return r(left + x, top + y);
};
return {
left: constant(left),
top: constant(top),
translate: translate
};
};
var Position = r;
var get$3 = function (_DOC) {
var doc = _DOC !== undefined ? _DOC.dom() : domGlobals.document;
var x = doc.body.scrollLeft || doc.documentElement.scrollLeft;
var y = doc.body.scrollTop || doc.documentElement.scrollTop;
return Position(x, y);
};
var get$4 = function (_win) {
var win = _win === undefined ? domGlobals.window : _win;
return Option.from(win['visualViewport']);
};
var bounds = function (x, y, width, height) {
return {
x: x,
y: y,
width: width,
height: height,
right: x + width,
bottom: y + height
};
};
var getBounds = function (_win) {
var win = _win === undefined ? domGlobals.window : _win;
var doc = win.document;
var scroll = get$3(Element.fromDom(doc));
return get$4(win).fold(function () {
var html = win.document.documentElement;
var width = html.clientWidth;
var height = html.clientHeight;
return bounds(scroll.left(), scroll.top(), width, height);
}, function (visualViewport) {
return bounds(Math.max(visualViewport.pageLeft, scroll.left()), Math.max(visualViewport.pageTop, scroll.top()), visualViewport.width, visualViewport.height);
});
};
var bind$1 = function (name, callback, _win) {
return get$4(_win).map(function (visualViewport) {
var handler = function (e) {
return callback(fromRawEvent(e));
};
visualViewport.addEventListener(name, handler);
return {
unbind: function () {
return visualViewport.removeEventListener(name, handler);
}
};
}).getOrThunk(function () {
return { unbind: noop };
});
};
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var global$2 = tinymce.util.Tools.resolve('tinymce.Env');
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var fireFullscreenStateChanged = function (editor, state) {
editor.fire('FullscreenStateChanged', { state: state });
};
var ancestors = function (scope, predicate, isRoot) {
return filter(parents(scope, isRoot), predicate);
};
var siblings$1 = function (scope, predicate) {
return filter(siblings(scope), predicate);
};
var all$1 = function (selector) {
return all(selector);
};
var ancestors$1 = function (scope, selector, isRoot) {
return ancestors(scope, function (e) {
return is(e, selector);
}, isRoot);
};
var siblings$2 = function (scope, selector) {
return siblings$1(scope, function (e) {
return is(e, selector);
});
};
var attr = 'data-ephox-mobile-fullscreen-style';
var siblingStyles = 'display:none!important;';
var ancestorPosition = 'position:absolute!important;';
var ancestorStyles = 'top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;';
var bgFallback = 'background-color:rgb(255,255,255)!important;';
var isAndroid = global$2.os.isAndroid();
var matchColor = function (editorBody) {
var color = get$2(editorBody, 'background-color');
return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback;
};
var clobberStyles = function (dom, container, editorBody) {
var gatherSibilings = function (element) {
return siblings$2(element, '*:not(.tox-silver-sink)');
};
var clobber = function (clobberStyle) {
return function (element) {
var styles = get$1(element, 'style');
var backup = styles === undefined ? 'no-styles' : styles.trim();
if (backup === clobberStyle) {
return;
} else {
set(element, attr, backup);
setAll(element, dom.parseStyle(clobberStyle));
}
};
};
var ancestors = ancestors$1(container, '*');
var siblings = bind(ancestors, gatherSibilings);
var bgColor = matchColor(editorBody);
each(siblings, clobber(siblingStyles));
each(ancestors, clobber(ancestorPosition + ancestorStyles + bgColor));
var containerStyles = isAndroid === true ? '' : ancestorPosition;
clobber(containerStyles + ancestorStyles + bgColor)(container);
};
var restoreStyles = function (dom) {
var clobberedEls = all$1('[' + attr + ']');
each(clobberedEls, function (element) {
var restore = get$1(element, attr);
if (restore !== 'no-styles') {
setAll(element, dom.parseStyle(restore));
} else {
remove(element, 'style');
}
remove(element, attr);
});
};
var DOM = global$1.DOM;
var getScrollPos = function () {
var vp = getBounds(domGlobals.window);
return {
x: vp.x,
y: vp.y
};
};
var setScrollPos = function (pos) {
domGlobals.window.scrollTo(pos.x, pos.y);
};
var viewportUpdate = get$4().fold(function () {
return {
bind: noop,
unbind: noop
};
}, function (visualViewport) {
var editorContainer = value();
var resizeBinder = unbindable();
var scrollBinder = unbindable();
var refreshScroll = function () {
domGlobals.document.body.scrollTop = 0;
domGlobals.document.documentElement.scrollTop = 0;
};
var refreshVisualViewport = function () {
domGlobals.window.requestAnimationFrame(function () {
editorContainer.on(function (container) {
return setAll(container, {
top: visualViewport.offsetTop + 'px',
left: visualViewport.offsetLeft + 'px',
height: visualViewport.height + 'px',
width: visualViewport.width + 'px'
});
});
});
};
var update = global$3.throttle(function () {
refreshScroll();
refreshVisualViewport();
}, 50);
var bind = function (element) {
editorContainer.set(element);
update();
resizeBinder.set(bind$1('resize', update));
scrollBinder.set(bind$1('scroll', update));
};
var unbind = function () {
editorContainer.on(function () {
resizeBinder.clear();
scrollBinder.clear();
});
editorContainer.clear();
};
return {
bind: bind,
unbind: unbind
};
});
var toggleFullscreen = function (editor, fullscreenState) {
var body = domGlobals.document.body;
var documentElement = domGlobals.document.documentElement;
var editorContainer = editor.getContainer();
var editorContainerS = Element.fromDom(editorContainer);
var fullscreenInfo = fullscreenState.get();
var editorBody = Element.fromDom(editor.getBody());
var isTouch = global$2.deviceType.isTouch();
var editorContainerStyle = editorContainer.style;
var iframe = editor.iframeElement;
var iframeStyle = iframe.style;
var cleanup = function () {
if (isTouch) {
restoreStyles(editor.dom);
}
DOM.removeClass(body, 'tox-fullscreen');
DOM.removeClass(documentElement, 'tox-fullscreen');
DOM.removeClass(editorContainer, 'tox-fullscreen');
viewportUpdate.unbind();
};
if (!fullscreenInfo) {
var newFullScreenInfo = {
scrollPos: getScrollPos(),
containerWidth: editorContainerStyle.width,
containerHeight: editorContainerStyle.height,
containerTop: editorContainerStyle.top,
containerLeft: editorContainerStyle.left,
iframeWidth: iframeStyle.width,
iframeHeight: iframeStyle.height
};
if (isTouch) {
clobberStyles(editor.dom, editorContainerS, editorBody);
}
iframeStyle.width = iframeStyle.height = '100%';
editorContainerStyle.width = editorContainerStyle.height = '';
DOM.addClass(body, 'tox-fullscreen');
DOM.addClass(documentElement, 'tox-fullscreen');
DOM.addClass(editorContainer, 'tox-fullscreen');
viewportUpdate.bind(editorContainerS);
editor.on('remove', cleanup);
fullscreenState.set(newFullScreenInfo);
fireFullscreenStateChanged(editor, true);
} else {
iframeStyle.width = fullscreenInfo.iframeWidth;
iframeStyle.height = fullscreenInfo.iframeHeight;
editorContainerStyle.width = fullscreenInfo.containerWidth;
editorContainerStyle.height = fullscreenInfo.containerHeight;
editorContainerStyle.top = fullscreenInfo.containerTop;
editorContainerStyle.left = fullscreenInfo.containerLeft;
setScrollPos(fullscreenInfo.scrollPos);
fullscreenState.set(null);
fireFullscreenStateChanged(editor, false);
cleanup();
editor.off('remove', cleanup);
}
};
var register = function (editor, fullscreenState) {
editor.addCommand('mceFullScreen', function () {
toggleFullscreen(editor, fullscreenState);
});
};
var makeSetupHandler = function (editor, fullscreenState) {
return function (api) {
api.setActive(fullscreenState.get() !== null);
var editorEventCallback = function (e) {
return api.setActive(e.state);
};
editor.on('FullscreenStateChanged', editorEventCallback);
return function () {
return editor.off('FullscreenStateChanged', editorEventCallback);
};
};
};
var register$1 = function (editor, fullscreenState) {
editor.ui.registry.addToggleMenuItem('fullscreen', {
text: 'Fullscreen',
icon: 'fullscreen',
shortcut: 'Meta+Shift+F',
onAction: function () {
return editor.execCommand('mceFullScreen');
},
onSetup: makeSetupHandler(editor, fullscreenState)
});
editor.ui.registry.addToggleButton('fullscreen', {
tooltip: 'Fullscreen',
icon: 'fullscreen',
onAction: function () {
return editor.execCommand('mceFullScreen');
},
onSetup: makeSetupHandler(editor, fullscreenState)
});
};
function Plugin () {
global.add('fullscreen', function (editor) {
var fullscreenState = Cell(null);
if (editor.inline) {
return get(fullscreenState);
}
register(editor, fullscreenState);
register$1(editor, fullscreenState);
editor.addShortcut('Meta+Shift+F', '', 'mceFullScreen');
return get(fullscreenState);
});
}
Plugin();
}(window));
File diff suppressed because one or more lines are too long
+846
View File
@@ -0,0 +1,846 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function () {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
return {
get: get,
set: set
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var get = function (customTabs) {
var addTab = function (spec) {
var currentCustomTabs = customTabs.get();
currentCustomTabs[spec.name] = spec;
customTabs.set(currentCustomTabs);
};
return { addTab: addTab };
};
var register = function (editor, dialogOpener) {
editor.addCommand('mceHelp', dialogOpener);
};
var register$1 = function (editor, dialogOpener) {
editor.ui.registry.addButton('help', {
icon: 'help',
tooltip: 'Help',
onAction: dialogOpener
});
editor.ui.registry.addMenuItem('help', {
text: 'Help',
icon: 'help',
shortcut: 'Alt+0',
onAction: dialogOpener
});
};
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var noop = function () {
};
var constant = function (value) {
return function () {
return value;
};
};
var never = constant(false);
var always = constant(true);
var none = function () {
return NONE;
};
var NONE = function () {
var eq = function (o) {
return o.isNone();
};
var call = function (thunk) {
return thunk();
};
var id = function (n) {
return n;
};
var me = {
fold: function (n, _s) {
return n();
},
is: never,
isSome: never,
isNone: always,
getOr: id,
getOrThunk: call,
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
},
getOrNull: constant(null),
getOrUndefined: constant(undefined),
or: id,
orThunk: call,
map: none,
each: noop,
bind: none,
exists: never,
forall: always,
filter: none,
equals: eq,
equals_: eq,
toArray: function () {
return [];
},
toString: constant('none()')
};
return me;
}();
var some = function (a) {
var constant_a = constant(a);
var self = function () {
return me;
};
var bind = function (f) {
return f(a);
};
var me = {
fold: function (n, s) {
return s(a);
},
is: function (v) {
return a === v;
},
isSome: always,
isNone: never,
getOr: constant_a,
getOrThunk: constant_a,
getOrDie: constant_a,
getOrNull: constant_a,
getOrUndefined: constant_a,
or: self,
orThunk: self,
map: function (f) {
return some(f(a));
},
each: function (f) {
f(a);
},
bind: bind,
exists: bind,
forall: bind,
filter: function (f) {
return f(a) ? me : NONE;
},
toArray: function () {
return [a];
},
toString: function () {
return 'some(' + a + ')';
},
equals: function (o) {
return o.is(a);
},
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
return elementEq(a, b);
});
}
};
return me;
};
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
};
var Option = {
some: some,
none: none,
from: from
};
var nativeIndexOf = Array.prototype.indexOf;
var rawIndexOf = function (ts, t) {
return nativeIndexOf.call(ts, t);
};
var contains = function (xs, x) {
return rawIndexOf(xs, x) > -1;
};
var map = function (xs, f) {
var len = xs.length;
var r = new Array(len);
for (var i = 0; i < len; i++) {
var x = xs[i];
r[i] = f(x, i);
}
return r;
};
var filter = function (xs, pred) {
var r = [];
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
if (pred(x, i)) {
r.push(x);
}
}
return r;
};
var findUntil = function (xs, pred, until) {
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
if (pred(x, i)) {
return Option.some(x);
} else if (until(x, i)) {
break;
}
}
return Option.none();
};
var find = function (xs, pred) {
return findUntil(xs, pred, never);
};
var keys = Object.keys;
var hasOwnProperty = Object.hasOwnProperty;
var get$1 = function (obj, key) {
return has(obj, key) ? Option.from(obj[key]) : Option.none();
};
var has = function (obj, key) {
return hasOwnProperty.call(obj, key);
};
var cat = function (arr) {
var r = [];
var push = function (x) {
r.push(x);
};
for (var i = 0; i < arr.length; i++) {
arr[i].each(push);
}
return r;
};
var getHelpTabs = function (editor) {
return Option.from(editor.getParam('help_tabs'));
};
var getForcedPlugins = function (editor) {
return editor.getParam('forced_plugins');
};
var shortcuts = [
{
shortcuts: ['Meta + B'],
action: 'Bold'
},
{
shortcuts: ['Meta + I'],
action: 'Italic'
},
{
shortcuts: ['Meta + U'],
action: 'Underline'
},
{
shortcuts: ['Meta + A'],
action: 'Select all'
},
{
shortcuts: [
'Meta + Y',
'Meta + Shift + Z'
],
action: 'Redo'
},
{
shortcuts: ['Meta + Z'],
action: 'Undo'
},
{
shortcuts: ['Access + 1'],
action: 'Header 1'
},
{
shortcuts: ['Access + 2'],
action: 'Header 2'
},
{
shortcuts: ['Access + 3'],
action: 'Header 3'
},
{
shortcuts: ['Access + 4'],
action: 'Header 4'
},
{
shortcuts: ['Access + 5'],
action: 'Header 5'
},
{
shortcuts: ['Access + 6'],
action: 'Header 6'
},
{
shortcuts: ['Access + 7'],
action: 'Paragraph'
},
{
shortcuts: ['Access + 8'],
action: 'Div'
},
{
shortcuts: ['Access + 9'],
action: 'Address'
},
{
shortcuts: ['Alt + 0'],
action: 'Open help dialog'
},
{
shortcuts: ['Alt + F9'],
action: 'Focus to menubar'
},
{
shortcuts: ['Alt + F10'],
action: 'Focus to toolbar'
},
{
shortcuts: ['Alt + F11'],
action: 'Focus to element path'
},
{
shortcuts: ['Ctrl + F9'],
action: 'Focus to contextual toolbar'
},
{
shortcuts: ['Shift + Enter'],
action: 'Open popup menu for split buttons'
},
{
shortcuts: ['Meta + K'],
action: 'Insert link (if link plugin activated)'
},
{
shortcuts: ['Meta + S'],
action: 'Save (if save plugin activated)'
},
{
shortcuts: ['Meta + F'],
action: 'Find (if searchreplace plugin activated)'
},
{
shortcuts: ['Meta + Shift + F'],
action: 'Switch to or from fullscreen mode'
}
];
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
var convertText = function (source) {
var mac = {
alt: '&#x2325;',
ctrl: '&#x2303;',
shift: '&#x21E7;',
meta: '&#x2318;',
access: '&#x2303;&#x2325;'
};
var other = {
meta: 'Ctrl ',
access: 'Shift + Alt '
};
var replace = global$1.mac ? mac : other;
var shortcut = source.split('+');
var updated = map(shortcut, function (segment) {
var search = segment.toLowerCase().trim();
return has(replace, search) ? replace[search] : segment;
});
return global$1.mac ? updated.join('').replace(/\s/, '') : updated.join('+');
};
var tab = function () {
var shortcutList = map(shortcuts, function (shortcut) {
var shortcutText = map(shortcut.shortcuts, convertText).join(' or ');
return [
shortcut.action,
shortcutText
];
});
var tablePanel = {
type: 'table',
header: [
'Action',
'Shortcut'
],
cells: shortcutList
};
return {
name: 'shortcuts',
title: 'Handy Shortcuts',
items: [tablePanel]
};
};
var global$2 = tinymce.util.Tools.resolve('tinymce.util.I18n');
var urls = [
{
key: 'advlist',
name: 'Advanced List'
},
{
key: 'anchor',
name: 'Anchor'
},
{
key: 'autolink',
name: 'Autolink'
},
{
key: 'autoresize',
name: 'Autoresize'
},
{
key: 'autosave',
name: 'Autosave'
},
{
key: 'bbcode',
name: 'BBCode'
},
{
key: 'charmap',
name: 'Character Map'
},
{
key: 'code',
name: 'Code'
},
{
key: 'codesample',
name: 'Code Sample'
},
{
key: 'colorpicker',
name: 'Color Picker'
},
{
key: 'directionality',
name: 'Directionality'
},
{
key: 'emoticons',
name: 'Emoticons'
},
{
key: 'fullpage',
name: 'Full Page'
},
{
key: 'fullscreen',
name: 'Full Screen'
},
{
key: 'help',
name: 'Help'
},
{
key: 'hr',
name: 'Horizontal Rule'
},
{
key: 'image',
name: 'Image'
},
{
key: 'imagetools',
name: 'Image Tools'
},
{
key: 'importcss',
name: 'Import CSS'
},
{
key: 'insertdatetime',
name: 'Insert Date/Time'
},
{
key: 'legacyoutput',
name: 'Legacy Output'
},
{
key: 'link',
name: 'Link'
},
{
key: 'lists',
name: 'Lists'
},
{
key: 'media',
name: 'Media'
},
{
key: 'nonbreaking',
name: 'Nonbreaking'
},
{
key: 'noneditable',
name: 'Noneditable'
},
{
key: 'pagebreak',
name: 'Page Break'
},
{
key: 'paste',
name: 'Paste'
},
{
key: 'preview',
name: 'Preview'
},
{
key: 'print',
name: 'Print'
},
{
key: 'save',
name: 'Save'
},
{
key: 'searchreplace',
name: 'Search and Replace'
},
{
key: 'spellchecker',
name: 'Spell Checker'
},
{
key: 'tabfocus',
name: 'Tab Focus'
},
{
key: 'table',
name: 'Table'
},
{
key: 'template',
name: 'Template'
},
{
key: 'textcolor',
name: 'Text Color'
},
{
key: 'textpattern',
name: 'Text Pattern'
},
{
key: 'toc',
name: 'Table of Contents'
},
{
key: 'visualblocks',
name: 'Visual Blocks'
},
{
key: 'visualchars',
name: 'Visual Characters'
},
{
key: 'wordcount',
name: 'Word Count'
},
{
key: 'advcode',
name: 'Advanced Code Editor*'
},
{
key: 'formatpainter',
name: 'Format Painter*'
},
{
key: 'powerpaste',
name: 'PowerPaste*'
},
{
key: 'tinydrive',
name: 'Tiny Drive*',
slug: 'drive'
},
{
key: 'tinymcespellchecker',
name: 'Spell Checker Pro*'
},
{
key: 'a11ychecker',
name: 'Accessibility Checker*'
},
{
key: 'linkchecker',
name: 'Link Checker*'
},
{
key: 'mentions',
name: 'Mentions*'
},
{
key: 'mediaembed',
name: 'Enhanced Media Embed*'
},
{
key: 'checklist',
name: 'Checklist*'
},
{
key: 'casechange',
name: 'Case Change*'
},
{
key: 'permanentpen',
name: 'Permanent Pen*'
},
{
key: 'pageembed',
name: 'Page Embed*'
},
{
key: 'tinycomments',
name: 'Tiny Comments*',
slug: 'comments'
},
{
key: 'advtable',
name: 'Advanced Tables*'
},
{
key: 'autocorrect',
name: 'Autocorrect*'
}
];
var tab$1 = function (editor) {
var availablePlugins = function () {
var premiumPlugins = [
'Accessibility Checker',
'Advanced Code Editor',
'Advanced Tables',
'Case Change',
'Checklist',
'Tiny Comments',
'Tiny Drive',
'Enhanced Media Embed',
'Format Painter',
'Link Checker',
'Mentions',
'MoxieManager',
'Page Embed',
'Permanent Pen',
'PowerPaste',
'Spell Checker Pro'
];
var premiumPluginList = map(premiumPlugins, function (plugin) {
return '<li>' + global$2.translate(plugin) + '</li>';
}).join('');
return '<div data-mce-tabstop="1" tabindex="-1">' + '<p><b>' + global$2.translate('Premium plugins:') + '</b></p>' + '<ul>' + premiumPluginList + '<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">' + global$2.translate('Learn more...') + '</a></li>' + '</ul>' + '</div>';
};
var makeLink = function (p) {
return '<a href="' + p.url + '" target="_blank" rel="noopener">' + p.name + '</a>';
};
var maybeUrlize = function (editor, key) {
return find(urls, function (x) {
return x.key === key;
}).fold(function () {
var getMetadata = editor.plugins[key].getMetadata;
return typeof getMetadata === 'function' ? makeLink(getMetadata()) : key;
}, function (x) {
var urlSlug = x.slug || x.key;
return makeLink({
name: x.name,
url: 'https://www.tiny.cloud/docs/plugins/' + urlSlug
});
});
};
var getPluginKeys = function (editor) {
var keys$1 = keys(editor.plugins);
var forced_plugins = getForcedPlugins(editor);
return forced_plugins === undefined ? keys$1 : filter(keys$1, function (k) {
return !contains(forced_plugins, k);
});
};
var pluginLister = function (editor) {
var pluginKeys = getPluginKeys(editor);
var pluginLis = map(pluginKeys, function (key) {
return '<li>' + maybeUrlize(editor, key) + '</li>';
});
var count = pluginLis.length;
var pluginsString = pluginLis.join('');
var html = '<p><b>' + global$2.translate([
'Plugins installed ({0}):',
count
]) + '</b></p>' + '<ul>' + pluginsString + '</ul>';
return html;
};
var installedPlugins = function (editor) {
if (editor == null) {
return '';
}
return '<div data-mce-tabstop="1" tabindex="-1">' + pluginLister(editor) + '</div>';
};
var htmlPanel = {
type: 'htmlpanel',
presets: 'document',
html: [
installedPlugins(editor),
availablePlugins()
].join('')
};
return {
name: 'plugins',
title: 'Plugins',
items: [htmlPanel]
};
};
var global$3 = tinymce.util.Tools.resolve('tinymce.EditorManager');
var tab$2 = function () {
var getVersion = function (major, minor) {
return major.indexOf('@') === 0 ? 'X.X.X' : major + '.' + minor;
};
var version = getVersion(global$3.majorVersion, global$3.minorVersion);
var changeLogLink = '<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE ' + version + '</a>';
var htmlPanel = {
type: 'htmlpanel',
html: '<p>' + global$2.translate([
'You are using {0}',
changeLogLink
]) + '</p>',
presets: 'document'
};
return {
name: 'versions',
title: 'Version',
items: [htmlPanel]
};
};
var description = '<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or &#x2325;F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or &#x2325;F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or &#x2325;F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or &#x2303;F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>';
var tab$3 = function () {
var body = {
type: 'htmlpanel',
presets: 'document',
html: description
};
return {
name: 'keyboardnav',
title: 'Keyboard Navigation',
items: [body]
};
};
var parseHelpTabsSetting = function (tabsFromSettings, tabs) {
var newTabs = {};
var names = map(tabsFromSettings, function (t) {
if (typeof t === 'string') {
if (has(tabs, t)) {
newTabs[t] = tabs[t];
}
return t;
} else {
newTabs[t.name] = t;
return t.name;
}
});
return {
tabs: newTabs,
names: names
};
};
var getNamesFromTabs = function (tabs) {
var names = keys(tabs);
var idx = names.indexOf('versions');
if (idx !== -1) {
names.splice(idx, 1);
names.push('versions');
}
return {
tabs: tabs,
names: names
};
};
var parseCustomTabs = function (editor, customTabs) {
var _a;
var shortcuts = tab();
var nav = tab$3();
var plugins = tab$1(editor);
var versions = tab$2();
var tabs = __assign((_a = {}, _a[shortcuts.name] = shortcuts, _a[nav.name] = nav, _a[plugins.name] = plugins, _a[versions.name] = versions, _a), customTabs.get());
return getHelpTabs(editor).fold(function () {
return getNamesFromTabs(tabs);
}, function (tabsFromSettings) {
return parseHelpTabsSetting(tabsFromSettings, tabs);
});
};
var init = function (editor, customTabs) {
return function () {
var _a = parseCustomTabs(editor, customTabs), tabs = _a.tabs, names = _a.names;
var foundTabs = map(names, function (name) {
return get$1(tabs, name);
});
var dialogTabs = cat(foundTabs);
var body = {
type: 'tabpanel',
tabs: dialogTabs
};
editor.windowManager.open({
title: 'Help',
size: 'medium',
body: body,
buttons: [{
type: 'cancel',
name: 'close',
text: 'Close',
primary: true
}],
initialData: {}
});
};
};
function Plugin () {
global.add('help', function (editor) {
var customTabs = Cell({});
var api = get(customTabs);
var dialogOpener = init(editor, customTabs);
register$1(editor, dialogOpener);
register(editor, dialogOpener);
editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp');
return api;
});
}
Plugin();
}());
File diff suppressed because one or more lines are too long
+46
View File
@@ -0,0 +1,46 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var register = function (editor) {
editor.addCommand('InsertHorizontalRule', function () {
editor.execCommand('mceInsertContent', false, '<hr />');
});
};
var register$1 = function (editor) {
editor.ui.registry.addButton('hr', {
icon: 'horizontal-rule',
tooltip: 'Horizontal line',
onAction: function () {
return editor.execCommand('InsertHorizontalRule');
}
});
editor.ui.registry.addMenuItem('hr', {
icon: 'horizontal-rule',
text: 'Horizontal line',
onAction: function () {
return editor.execCommand('InsertHorizontalRule');
}
});
};
function Plugin () {
global.add('hr', function (editor) {
register(editor);
register$1(editor);
});
}
Plugin();
}());
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");!function o(){n.add("hr",function(n){var o,t;(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"<hr />")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}})})}()}();
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,337 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var shouldMergeClasses = function (editor) {
return editor.getParam('importcss_merge_classes');
};
var shouldImportExclusive = function (editor) {
return editor.getParam('importcss_exclusive');
};
var getSelectorConverter = function (editor) {
return editor.getParam('importcss_selector_converter');
};
var getSelectorFilter = function (editor) {
return editor.getParam('importcss_selector_filter');
};
var getCssGroups = function (editor) {
return editor.getParam('importcss_groups');
};
var shouldAppend = function (editor) {
return editor.getParam('importcss_append');
};
var getFileFilter = function (editor) {
return editor.getParam('importcss_file_filter');
};
var getSkin = function (editor) {
var skin = editor.getParam('skin');
return skin !== false ? skin || 'oxide' : false;
};
var getSkinUrl = function (editor) {
return editor.getParam('skin_url');
};
var typeOf = function (x) {
var t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
return 'array';
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
return 'string';
} else {
return t;
}
};
var isType = function (type) {
return function (value) {
return typeOf(value) === type;
};
};
var isArray = isType('array');
var nativePush = Array.prototype.push;
var map = function (xs, f) {
var len = xs.length;
var r = new Array(len);
for (var i = 0; i < len; i++) {
var x = xs[i];
r[i] = f(x, i);
}
return r;
};
var flatten = function (xs) {
var r = [];
for (var i = 0, len = xs.length; i < len; ++i) {
if (!isArray(xs[i])) {
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
}
nativePush.apply(r, xs[i]);
}
return r;
};
var bind = function (xs, f) {
return flatten(map(xs, f));
};
var generate = function () {
var ungroupedOrder = [];
var groupOrder = [];
var groups = {};
var addItemToGroup = function (groupTitle, itemInfo) {
if (groups[groupTitle]) {
groups[groupTitle].push(itemInfo);
} else {
groupOrder.push(groupTitle);
groups[groupTitle] = [itemInfo];
}
};
var addItem = function (itemInfo) {
ungroupedOrder.push(itemInfo);
};
var toFormats = function () {
var groupItems = bind(groupOrder, function (g) {
var items = groups[g];
return items.length === 0 ? [] : [{
title: g,
items: items
}];
});
return groupItems.concat(ungroupedOrder);
};
return {
addItemToGroup: addItemToGroup,
addItem: addItem,
toFormats: toFormats
};
};
var removeCacheSuffix = function (url) {
var cacheSuffix = global$3.cacheSuffix;
if (typeof url === 'string') {
url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
}
return url;
};
var isSkinContentCss = function (editor, href) {
var skin = getSkin(editor);
if (skin) {
var skinUrlBase = getSkinUrl(editor);
var skinUrl = skinUrlBase ? editor.documentBaseURI.toAbsolute(skinUrlBase) : global$2.baseURL + '/skins/ui/' + skin;
var contentSkinUrlPart = global$2.baseURL + '/skins/content/';
return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css' || href.indexOf(contentSkinUrlPart) !== -1;
}
return false;
};
var compileFilter = function (filter) {
if (typeof filter === 'string') {
return function (value) {
return value.indexOf(filter) !== -1;
};
} else if (filter instanceof RegExp) {
return function (value) {
return filter.test(value);
};
}
return filter;
};
var getSelectors = function (editor, doc, fileFilter) {
var selectors = [], contentCSSUrls = {};
function append(styleSheet, imported) {
var href = styleSheet.href, rules;
href = removeCacheSuffix(href);
if (!href || !fileFilter(href, imported) || isSkinContentCss(editor, href)) {
return;
}
global$4.each(styleSheet.imports, function (styleSheet) {
append(styleSheet, true);
});
try {
rules = styleSheet.cssRules || styleSheet.rules;
} catch (e) {
}
global$4.each(rules, function (cssRule) {
if (cssRule.styleSheet) {
append(cssRule.styleSheet, true);
} else if (cssRule.selectorText) {
global$4.each(cssRule.selectorText.split(','), function (selector) {
selectors.push(global$4.trim(selector));
});
}
});
}
global$4.each(editor.contentCSS, function (url) {
contentCSSUrls[url] = true;
});
if (!fileFilter) {
fileFilter = function (href, imported) {
return imported || contentCSSUrls[href];
};
}
try {
global$4.each(doc.styleSheets, function (styleSheet) {
append(styleSheet);
});
} catch (e) {
}
return selectors;
};
var defaultConvertSelectorToFormat = function (editor, selectorText) {
var format;
var selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText);
if (!selector) {
return;
}
var elementName = selector[1];
var classes = selector[2].substr(1).split('.').join(' ');
var inlineSelectorElements = global$4.makeMap('a,img');
if (selector[1]) {
format = { title: selectorText };
if (editor.schema.getTextBlockElements()[elementName]) {
format.block = elementName;
} else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) {
format.selector = elementName;
} else {
format.inline = elementName;
}
} else if (selector[2]) {
format = {
inline: 'span',
title: selectorText.substr(1),
classes: classes
};
}
if (shouldMergeClasses(editor) !== false) {
format.classes = classes;
} else {
format.attributes = { class: classes };
}
return format;
};
var getGroupsBySelector = function (groups, selector) {
return global$4.grep(groups, function (group) {
return !group.filter || group.filter(selector);
});
};
var compileUserDefinedGroups = function (groups) {
return global$4.map(groups, function (group) {
return global$4.extend({}, group, {
original: group,
selectors: {},
filter: compileFilter(group.filter),
item: {
text: group.title,
menu: []
}
});
});
};
var isExclusiveMode = function (editor, group) {
return group === null || shouldImportExclusive(editor) !== false;
};
var isUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) {
return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
};
var markUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) {
if (isExclusiveMode(editor, group)) {
globallyUniqueSelectors[selector] = true;
} else {
group.selectors[selector] = true;
}
};
var convertSelectorToFormat = function (editor, plugin, selector, group) {
var selectorConverter;
if (group && group.selector_converter) {
selectorConverter = group.selector_converter;
} else if (getSelectorConverter(editor)) {
selectorConverter = getSelectorConverter(editor);
} else {
selectorConverter = function () {
return defaultConvertSelectorToFormat(editor, selector);
};
}
return selectorConverter.call(plugin, selector, group);
};
var setup = function (editor) {
editor.on('init', function (_e) {
var model = generate();
var globallyUniqueSelectors = {};
var selectorFilter = compileFilter(getSelectorFilter(editor));
var groups = compileUserDefinedGroups(getCssGroups(editor));
var processSelector = function (selector, group) {
if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) {
markUniqueSelector(editor, selector, group, globallyUniqueSelectors);
var format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
if (format) {
var formatName = format.name || global$1.DOM.uniqueId();
editor.formatter.register(formatName, format);
return global$4.extend({}, {
title: format.title,
format: formatName
});
}
}
return null;
};
global$4.each(getSelectors(editor, editor.getDoc(), compileFilter(getFileFilter(editor))), function (selector) {
if (selector.indexOf('.mce-') === -1) {
if (!selectorFilter || selectorFilter(selector)) {
var selectorGroups = getGroupsBySelector(groups, selector);
if (selectorGroups.length > 0) {
global$4.each(selectorGroups, function (group) {
var menuItem = processSelector(selector, group);
if (menuItem) {
model.addItemToGroup(group.title, menuItem);
}
});
} else {
var menuItem = processSelector(selector, null);
if (menuItem) {
model.addItem(menuItem);
}
}
}
}
});
var items = model.toFormats();
editor.fire('addStyleModifications', {
items: items,
replace: !shouldAppend(editor)
});
});
};
var get = function (editor) {
var convertSelectorToFormat = function (selectorText) {
return defaultConvertSelectorToFormat(editor, selectorText);
};
return { convertSelectorToFormat: convertSelectorToFormat };
};
function Plugin () {
global.add('importcss', function (editor) {
setup(editor);
return get(editor);
});
}
Plugin();
}());
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.4.2 (2020-08-17)
*/
!function(){"use strict";var n,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),m=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(t){return t.getParam("importcss_selector_converter")},i=(n="array",function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}),o=Array.prototype.push,l=function(t,e){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!i(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);o.apply(e,t[r])}return e}(function(t,e){for(var r=t.length,n=new Array(r),i=0;i<r;i++){var o=t[i];n[i]=e(o,i)}return n}(t,e))},p=function(e){return"string"==typeof e?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e},_=function(s,t,a){var u=[],r={};function l(t,e){var r,n,i,o=t.href;if(n=o,i=m.cacheSuffix,"string"==typeof n&&(n=n.replace("?"+i,"").replace("&"+i,"")),(o=n)&&a(o,e)&&!function(t,e){var r,n=!1!==(r=t.getParam("skin"))&&(r||"oxide");if(n){var i=t.getParam("skin_url"),o=i?t.documentBaseURI.toAbsolute(i):f.baseURL+"/skins/ui/"+n,c=f.baseURL+"/skins/content/";return e===o+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(c)}return!1}(s,o)){h.each(t.imports,function(t){l(t,!0)});try{r=t.cssRules||t.rules}catch(c){}h.each(r,function(t){t.styleSheet?l(t.styleSheet,!0):t.selectorText&&h.each(t.selectorText.split(","),function(t){u.push(h.trim(t))})})}}h.each(s.contentCSS,function(t){r[t]=!0}),a=a||function(t,e){return e||r[t]};try{h.each(t.styleSheets,function(t){l(t)})}catch(e){}return u},x=function(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var i=n[1],o=n[2].substr(1).split(".").join(" "),c=h.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[i]?r.block=i:t.schema.getBlockElements()[i]||c[i.toLowerCase()]?r.selector=i:r.inline=i):n[2]&&(r={inline:"span",title:e.substr(1),classes:o}),!1!==t.getParam("importcss_merge_classes")?r.classes=o:r.attributes={"class":o},r}},P=function(t,e){return null===e||!1!==t.getParam("importcss_exclusive")},r=function(g){g.on("init",function(t){var e,r,n,i,o=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return l(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]}).concat(e)}}),v={},c=p(g.getParam("importcss_selector_filter")),s=(i=g.getParam("importcss_groups"),h.map(i,function(t){return h.extend({},t,{original:t,selectors:{},filter:p(t.filter),item:{text:t.title,menu:[]}})})),a=function(t,e){if(f=t,p=v,!(P(g,m=e)?f in p:f in m.selectors)){a=t,l=v,P(g,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(o=(i=g).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:d(i)?d(i):function(){return x(i,c)}).call(o,c,s));if(r){var n=r.name||y.DOM.uniqueId();return g.formatter.register(n,r),h.extend({},{title:r.title,format:n})}}var i,o,c,s,a,u,l,f,m,p;return null};h.each(_(g,g.getDoc(),p(g.getParam("importcss_file_filter"))),function(r){if(-1===r.indexOf(".mce-")&&(!c||c(r))){var t=(n=s,i=r,h.grep(n,function(t){return!t.filter||t.filter(i)}));if(0<t.length)h.each(t,function(t){var e=a(r,t);e&&o.addItemToGroup(t.title,e)});else{var e=a(r,null);e&&o.addItem(e)}}var n,i});var u=o.toFormats();g.fire("addStyleModifications",{items:u,replace:!g.getParam("importcss_append")})})};!function e(){t.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return x(e,t)}};var e})}()}();

Some files were not shown because too many files have changed in this diff Show More