Merge branch 'master' of https://github.com/hogenwang/comcms_core
@@ -307,3 +307,4 @@ COMCMS.Web/wwwroot/userfiles/
|
||||
/COMCMS.Web/COMCMS.Web.csproj.DotSettings
|
||||
/COMCMS.Web/UploadFile
|
||||
/COMCMS.Web/UploadTemp
|
||||
/WebTest/wwwroot
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.6" />
|
||||
<PackageReference Include="NewLife.Core" Version="7.4.6881.41311" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" />
|
||||
<PackageReference Include="ZKWeb.System.Drawing" Version="4.0.1" />
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace COMCMS.Common
|
||||
{
|
||||
public class Pages
|
||||
{
|
||||
|
||||
#region 列表分页
|
||||
/// <summary>
|
||||
/// 显示分页2
|
||||
/// </summary>
|
||||
/// <param name="pageSize">每页显示记录数</param>
|
||||
/// <param name="recordCount">总记录数</param>
|
||||
/// <param name="page">当前页码</param>
|
||||
/// <param name="url">分页文件名字,静态:index.html;动态List.aspx</param>
|
||||
/// <param name="isRewrite">系统urlReWrite方案;99为ajax连接</param>
|
||||
/// <param name="maxShowPage">最大显示分页数量</param>
|
||||
/// <param name="filepath">目录名称(系统urlReWrite方案为5必填)</param>
|
||||
/// <returns></returns>
|
||||
public static string GetPageStr(int pageSize, int recordCount, int page, string url, int isRewrite, int maxShowPage, string filepath = "")
|
||||
{
|
||||
if (recordCount < 1)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
int pageCount = recordCount / pageSize;//总页数
|
||||
if (recordCount % pageSize > 0)
|
||||
{
|
||||
pageCount += 1;
|
||||
}
|
||||
if (pageCount < 2)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (page > pageCount) page = pageCount;
|
||||
StringBuilder strPage = new StringBuilder();
|
||||
string pageLink = "";// url + "?id=" + HttpContext.Current.Request.QueryString["id"] + "&page={0}";
|
||||
string strQueryString = MyHttpContext.Current.Request.QueryString.ToString().ToLower();
|
||||
if (isRewrite != 5)
|
||||
url = url.ToLower();
|
||||
pageLink = url + "?" + strQueryString;
|
||||
string currPage = MyHttpContext.Current.Request.Query["page"];
|
||||
string id = MyHttpContext.Current.Request.Query["id"];
|
||||
if (isRewrite == 5)
|
||||
{
|
||||
url = $"/{filepath}/index.html";
|
||||
}
|
||||
if (url == "memberdownloads.aspx" && isRewrite == 2)
|
||||
{
|
||||
string t = MyHttpContext.Current.Request.Query["t"];
|
||||
if (string.IsNullOrEmpty(t) || !Utils.IsInt(t))
|
||||
t = "1";
|
||||
url = string.Format("memberdownloads-{0}.aspx", t);
|
||||
}
|
||||
|
||||
switch (isRewrite)
|
||||
{
|
||||
case 1:
|
||||
url = url.Replace(".html", ".aspx");//避免设置错之后出现问题
|
||||
url = url.Replace(".", "-" + id + ".");
|
||||
pageLink = url.Replace(".", "-{0}.");
|
||||
break;
|
||||
case 2:
|
||||
url = url.Replace(".aspx", ".html");//避免设置错之后出现问题
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
url = url.Replace(".", "-" + id + ".");
|
||||
else
|
||||
url = url.Replace(".", "-0.");
|
||||
pageLink = url.Replace(".", "-{0}.");
|
||||
break;
|
||||
case 3:
|
||||
url = url.Replace(".aspx", ".html");//避免设置错之后出现问题
|
||||
pageLink = url.Replace(".", "-{0}.");
|
||||
break;
|
||||
case 5:
|
||||
pageLink = url.Replace(".", "-{0}.");
|
||||
break;
|
||||
case 99://调用ajax 连接
|
||||
pageLink = url;
|
||||
url = string.Format(pageLink, "1");
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
//动态链接
|
||||
if (pageLink.IndexOf("page=") > 0)
|
||||
{
|
||||
pageLink = pageLink.Replace("page=" + currPage, "page={0}");
|
||||
}
|
||||
else
|
||||
{
|
||||
pageLink = pageLink + "&page={0}";
|
||||
}
|
||||
url = string.Format(pageLink, "1");
|
||||
break;
|
||||
}
|
||||
strPage.Append("<div class=\"pages\">");
|
||||
if (page != 1)//显示[首页]
|
||||
{
|
||||
//strPage.AppendFormat("<span class=\"pageFirst\"><a href=\"{0}\" title=\"{1}\">{1}</a></span>", url, Lang.GetPagesLangVal("firstpage"));
|
||||
strPage.AppendFormat("<span class=\"prev\"><a href=\"{0}\" title=\"{1}\">{1}</a></span>", string.Format(pageLink, 1), "首页");
|
||||
}
|
||||
|
||||
if (page > 1)//上一页
|
||||
{
|
||||
if (page == 2)//[首页]要index.html
|
||||
{
|
||||
//strPage.AppendFormat("<span class=\"prev\"><a href=\"{0}\" title=\"{1}\">{1}</a></span>", url, Lang.GetPagesLangVal("prevpage"));
|
||||
strPage.AppendFormat("<span class=\"prev\"><a href=\"{0}\" title=\"{1}\">{1}</a></span>", string.Format(pageLink, (page - 1).ToString()), "上一页");
|
||||
}
|
||||
else
|
||||
{
|
||||
strPage.AppendFormat("<span class=\"prev\"><a href=\"{0}\" title=\"{1}\">{1}</a></span>", string.Format(pageLink, (page - 1).ToString()), "上一页");
|
||||
}
|
||||
}
|
||||
//显示中间所有页数,如果是当前页,则外加一个样式
|
||||
string strAllPage = "<span {2}><a href=\"{0}\" title=\"{1}\">[{1}]</a></span>";
|
||||
|
||||
//显示当前的多少页
|
||||
int cureSize = maxShowPage;
|
||||
int sizes = cureSize / 2;//中间
|
||||
int minPage = page - sizes;//最小起始页码
|
||||
int maxPage = page + sizes;//最大页码
|
||||
if (minPage <= 0)
|
||||
{
|
||||
minPage = 1;
|
||||
maxPage = cureSize;
|
||||
}
|
||||
if (maxPage >= pageCount)
|
||||
{
|
||||
minPage = pageCount - cureSize + 1;
|
||||
maxPage = pageCount;
|
||||
}
|
||||
|
||||
for (int i = 1; i <= pageCount; i++)
|
||||
{
|
||||
if (i >= minPage && i <= maxPage)//循环最小到最大页码中间所有页数
|
||||
{
|
||||
if (i == page)
|
||||
{
|
||||
strPage.Append(string.Format(strAllPage, "javascritp:;", i.ToString(), "class=\"curr\""));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i == 1)//第一页不能显示成index-1.html
|
||||
{
|
||||
if (isRewrite == 4)
|
||||
{
|
||||
strPage.Append(string.Format(strAllPage, string.Format(pageLink, i.ToString()), i.ToString(), ""));
|
||||
}
|
||||
else
|
||||
strPage.Append(string.Format(strAllPage, url, "1", ""));
|
||||
}
|
||||
else
|
||||
{
|
||||
strPage.Append(string.Format(strAllPage, string.Format(pageLink, i.ToString()), i.ToString(), ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (page < pageCount)//显示[下一页]/[尾页]
|
||||
{
|
||||
strPage.AppendFormat("<span class=\"next\"><a href=\"{0}\" title=\"{1}\">{1}</a></span>", string.Format(pageLink, (page + 1).ToString()), "下一页");
|
||||
strPage.AppendFormat("<span class=\"pageEnd\"><a href=\"{0}\" title=\"{1}\">{1}</a></span>", string.Format(pageLink, pageCount.ToString()), "尾页");
|
||||
}
|
||||
strPage.Append("</div>");
|
||||
return strPage.ToString().Replace("[", "").Replace("]", "");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -325,7 +325,7 @@ namespace COMCMS.Common
|
||||
{
|
||||
using (var md5 = System.Security.Cryptography.MD5.Create())
|
||||
{
|
||||
var result = md5.ComputeHash(Encoding.ASCII.GetBytes(str));
|
||||
var result = md5.ComputeHash(Encoding.UTF8.GetBytes(str));
|
||||
var strResult = BitConverter.ToString(result);
|
||||
return strResult.Replace("-", "");
|
||||
}
|
||||
@@ -339,7 +339,7 @@ namespace COMCMS.Common
|
||||
{
|
||||
using(var sha256 = System.Security.Cryptography.SHA256.Create())
|
||||
{
|
||||
var result = sha256.ComputeHash(Encoding.ASCII.GetBytes(str));
|
||||
var result = sha256.ComputeHash(Encoding.UTF8.GetBytes(str));
|
||||
var strResult = BitConverter.ToString(result);
|
||||
return strResult.Replace("-", "");
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewLife.XCode" Version="9.9.6881.41312" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -12,6 +13,8 @@ using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
{
|
||||
[DisplayName("文章系统")]
|
||||
[Description("文章系统管理,包括文章、文章栏目")]
|
||||
public class ArticleController : AdminBaseController
|
||||
{
|
||||
#region 文章栏目
|
||||
@@ -20,6 +23,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[MyAuthorize( "viewlist", "articlecategory")]
|
||||
[DisplayName("文章栏目")]
|
||||
public IActionResult ArticleCategoryList()
|
||||
{
|
||||
IList<ArticleCategory> list = ArticleCategory.GetListTree(0, -1, false, true);
|
||||
@@ -33,7 +37,20 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
//获取上级栏目
|
||||
IList<ArticleCategory> list = ArticleCategory.GetListTree(0, -1, true, false);
|
||||
ViewBag.ListTree = list;
|
||||
//获取模板
|
||||
//获取模板 模板规则,以Index_开头的,为栏目列表,以Detial_开头的为文章详情
|
||||
List<string> listTpls = new List<string>();
|
||||
var asms = AppDomain.CurrentDomain.GetAssemblies();
|
||||
foreach (var asmItem in asms)
|
||||
{
|
||||
var types = asmItem.GetTypes().Where(e => e.Name.StartsWith("Views_Article")).ToList();
|
||||
if (types.Count == 0) continue;
|
||||
foreach (var type in types)
|
||||
{
|
||||
string viewName = type.Name.Replace("Views_Article_", "") + ".cshtml";
|
||||
listTpls.Add(viewName);
|
||||
}
|
||||
}
|
||||
ViewBag.ListTpl = listTpls;
|
||||
Core.Admin.WriteLogActions("查看添加文章栏目页面;");
|
||||
return View();
|
||||
}
|
||||
@@ -69,9 +86,21 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
//获取上级栏目
|
||||
IList<ArticleCategory> list = ArticleCategory.GetListTree(0, -1, true, false);
|
||||
ViewBag.ListTree = list;
|
||||
//获取模板
|
||||
//List<string> listtpl = COMCMS.Common.IOHelper.GetDirFiles(new DirectoryInfo(Server.MapPath("~/Views/article")));
|
||||
//ViewBag.ListTpl = listtpl;
|
||||
|
||||
//获取模板 模板规则,以Index_开头的,为栏目列表,以Detial_开头的为文章详情
|
||||
List<string> listTpls = new List<string>();
|
||||
var asms = AppDomain.CurrentDomain.GetAssemblies();
|
||||
foreach (var asmItem in asms)
|
||||
{
|
||||
var types = asmItem.GetTypes().Where(e => e.Name.StartsWith("Views_Article")).ToList();
|
||||
if (types.Count == 0) continue;
|
||||
foreach (var type in types)
|
||||
{
|
||||
string viewName = type.Name.Replace("Views_Article_", "") + ".cshtml";
|
||||
listTpls.Add(viewName);
|
||||
}
|
||||
}
|
||||
ViewBag.ListTpl = listTpls;
|
||||
Core.Admin.WriteLogActions("查看/编辑文章栏目(id:" + id + ")页面;");
|
||||
return View(entity);
|
||||
}
|
||||
@@ -189,6 +218,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[MyAuthorize("viewlist", "article")]
|
||||
[DisplayName("文章")]
|
||||
public IActionResult ArticleList()
|
||||
{
|
||||
//获取上级栏目
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
ViewBag.ListKinds = list;
|
||||
return View();
|
||||
}
|
||||
[MyAuthorize("viewlist", "guestbook")]
|
||||
[MyAuthorize("viewlist", "guestbook","JSON")]
|
||||
public IActionResult GetGuesbookList(string keyword, int page = 1, int limit = 20)
|
||||
{
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
@@ -156,7 +156,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
}
|
||||
[HttpPost]
|
||||
[MyAuthorize("edit", "guestbook", "JSON")]
|
||||
public IActionResult EditGuestbook(FormCollection fc)
|
||||
public IActionResult EditGuestbook(IFormCollection fc)
|
||||
{
|
||||
string id = fc["Id"];
|
||||
if (!Utils.IsInt(id) || int.Parse(id) <= 0)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -19,6 +20,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
/// <summary>
|
||||
/// 后台用户管理控制器
|
||||
/// </summary>
|
||||
[DisplayName("管理员")]
|
||||
public class MemberController : AdminBaseController
|
||||
{
|
||||
#region 修改密码
|
||||
@@ -115,6 +117,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
|
||||
#region 管理组管理
|
||||
[MyAuthorize("viewlist", "adminrole")]
|
||||
[DisplayName("管理组")]
|
||||
public IActionResult AdminRole()
|
||||
{
|
||||
IList<AdminRoles> list = AdminRoles.FindAll(AdminRoles._.Id > 0, AdminRoles._.Rank.Asc(), null, 0, 0);
|
||||
@@ -366,6 +369,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
#region 管理员管理
|
||||
//管理员管理
|
||||
[MyAuthorize("viewlist", "admins")]
|
||||
[DisplayName("管理员")]
|
||||
public IActionResult Admins()
|
||||
{
|
||||
//加载管理组
|
||||
@@ -608,7 +612,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
//执行添加用户组
|
||||
[HttpPost]
|
||||
[MyAuthorize("add", "memberrole", "JSON")]
|
||||
public IActionResult AddMemberRole(FormCollection fc)
|
||||
public IActionResult AddMemberRole(IFormCollection fc)
|
||||
{
|
||||
string RoleName = fc["RoleName"];
|
||||
string RoleDescription = fc["RoleDescription"];
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -13,6 +14,7 @@ using Microsoft.AspNetCore.Http;
|
||||
namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
{
|
||||
[Area("AdminCP")]
|
||||
[DisplayName("后台权限")]
|
||||
public class PermissionController : AdminBaseController
|
||||
{
|
||||
#region 事件管理
|
||||
@@ -63,7 +65,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
|
||||
[MyAuthorize( "add", "eventkey", "JSON")]
|
||||
[HttpPost]
|
||||
public IActionResult AddEventKey(FormCollection fc)
|
||||
public IActionResult AddEventKey(IFormCollection fc)
|
||||
{
|
||||
TargetEvent entity = new TargetEvent();
|
||||
entity.EventKey = fc["EventKey"];
|
||||
@@ -107,6 +109,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
||||
#region 后台栏目管理
|
||||
//后台菜单列表
|
||||
[MyAuthorize( "viewlist", "adminmenu")]
|
||||
[DisplayName("后台栏目")]
|
||||
public IActionResult AdminMenuList()
|
||||
{
|
||||
IList<AdminMenu> list = AdminMenu.GetListTree(0, -1, false, true);
|
||||
|
||||
@@ -76,28 +76,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
<option value="@s" >@s</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">文章模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
if (s.ToLower().StartsWith("index"))
|
||||
{
|
||||
<option value="@s">@s</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>*@
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">文章模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
{
|
||||
if (s.ToLower().StartsWith("detail"))
|
||||
{
|
||||
<option value="@s">@s</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">隐藏栏目:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
@@ -76,28 +76,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" asp-for="TemplateFile">
|
||||
@foreach (string s in ViewBag.ListTpl)
|
||||
{
|
||||
if (s.ToLower().StartsWith("index"))
|
||||
{
|
||||
<option value="@s" @(Model.TemplateFile == s?"selected":"")>@s</option>
|
||||
<option value="@s">@s</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">文章模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
||||
@foreach (var s in ViewBag.ListTpl)
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">文章模板:</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" asp-for="DetailTemplateFile">
|
||||
@foreach (string s in ViewBag.ListTpl)
|
||||
{
|
||||
if (s.ToLower().StartsWith("detail"))
|
||||
{
|
||||
<option value="@s" @(Model.DetailTemplateFile == s?"selected":"")>@s</option>
|
||||
<option value="@s">@s</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>*@
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">隐藏栏目:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
@@ -81,6 +81,8 @@
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
//初始化上传控件
|
||||
$(".upload-img").InitUploader({ filesize: "10240", sendurl: "/AdminCP/Upload/DoWebuploaderImage", swf: "/js/webuploader/uploader.swf", filetypes: "gif,jpg,png,bmp,jpeg", notwater: true });
|
||||
DoPost("addLinkForm");
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@{
|
||||
ViewBag.title = "添加商品详情";
|
||||
}
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@{
|
||||
ViewBag.title = "编辑商品详情";
|
||||
}
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<script src="~/hplus/js/plugins/iCheck/icheck.min.js"></script>
|
||||
<script src="~/js/webuploader/webuploader.min.js"></script>
|
||||
<script src="~/js/uploader.js"></script>
|
||||
<script src="~/editor/ckeditor/ckeditor.js"></script>
|
||||
<script src="~/editor/ckeditor/ckeditor.js" asp-append-version="true"></script>
|
||||
<script src="~/js/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
|
||||
</environment>
|
||||
<environment names="Staging,Production">
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MailKit" Version="2.0.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.5" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.5" />
|
||||
<PackageReference Include="MimeKit" Version="2.0.7" />
|
||||
<PackageReference Include="MailKit" Version="2.1.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.6" />
|
||||
<PackageReference Include="MimeKit" Version="2.1.0" />
|
||||
<PackageReference Include="MySql.Data" Version="8.0.13" />
|
||||
<PackageReference Include="NewLife.XCode" Version="9.9.6881.41312" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
<PackageReference Include="Senparc.Weixin" Version="6.1.11" />
|
||||
<PackageReference Include="Senparc.Weixin.MP" Version="16.4.12" />
|
||||
<PackageReference Include="Senparc.Weixin.TenPay" Version="1.0.1" />
|
||||
<PackageReference Include="Senparc.Weixin.WxOpen" Version="3.1.17" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="Senparc.Weixin" Version="6.2.1" />
|
||||
<PackageReference Include="Senparc.Weixin.MP" Version="16.5.1" />
|
||||
<PackageReference Include="Senparc.Weixin.TenPay" Version="1.0.2" />
|
||||
<PackageReference Include="Senparc.Weixin.WxOpen" Version="3.2.1" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" />
|
||||
<PackageReference Include="ZKWeb.System.Drawing" Version="4.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using XCode;
|
||||
|
||||
namespace COMCMS.Web.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// 网站前台基础页
|
||||
/// </summary>
|
||||
public class HomeBaseController : Controller
|
||||
{
|
||||
public Config cfg;
|
||||
public JsonTip tip = new JsonTip();
|
||||
|
||||
public HomeBaseController()
|
||||
{
|
||||
cfg = Config.GetSystemConfig();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Alert提示并返回
|
||||
/// </summary>
|
||||
/// <param name="str">提示内容</param>
|
||||
public IActionResult AlertAndGoBack(string str)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(str)) str = str.Replace("'", "\\'");
|
||||
return Content($"<script type=\"text/javascript\">alert('{str}');window.history.go(-1)</script>");
|
||||
}
|
||||
/// <summary>
|
||||
/// Alert提示并跳转到指定URL
|
||||
/// </summary>
|
||||
/// <param name="str">提示内容</param>
|
||||
/// <param name="url">跳转地址</param>
|
||||
public IActionResult AlertAndRedirect(string str, string url)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(str)) str = str.Replace("'", "\\'");
|
||||
return Content($"<script type=\"text/javascript\">alert('{str}');window.location='{url}'</script>");
|
||||
}
|
||||
|
||||
#region MyRegion
|
||||
/// <summary>
|
||||
/// 显示提示页面
|
||||
/// </summary>
|
||||
/// <param name="Message">提示语</param>
|
||||
/// <param name="IsSuccess">成功/失败</param>
|
||||
/// <param name="ReturnURL">返回URL</param>
|
||||
/// <returns></returns>
|
||||
public IActionResult EchoTip(string Message, bool IsSuccess = false, string ReturnURL = "")
|
||||
{
|
||||
ViewBag.IsSuccess = IsSuccess;
|
||||
ViewBag.Message = Message;
|
||||
ViewBag.ReturnURL = ReturnURL;
|
||||
ViewBag.cfg = cfg;
|
||||
return View("EchoTip");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using COMCMS.Core;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NewLife.Reflection;
|
||||
using XCode;
|
||||
|
||||
namespace COMCMS.Web.Common
|
||||
{
|
||||
public class MenuRegister
|
||||
{
|
||||
private static void StartRegister()
|
||||
{
|
||||
if (AdminMenu.Meta.Count > 0)
|
||||
return;
|
||||
// 操作项定义
|
||||
var menuEventDic = new Dictionary<string, KeyValuePair<int, string>>
|
||||
{
|
||||
{ "add",new KeyValuePair<int, string>(1,"添加")},
|
||||
{ "edit",new KeyValuePair<int, string>(2,"修改")},
|
||||
{ "del",new KeyValuePair<int, string>(3,"删除")},
|
||||
{ "view",new KeyValuePair<int, string>(4,"查看")},
|
||||
{ "viewlist",new KeyValuePair<int, string>(5,"查看列表")},
|
||||
{ "import",new KeyValuePair<int, string>(6,"导入")},
|
||||
{ "export",new KeyValuePair<int, string>(7,"导出")},
|
||||
{ "filter",new KeyValuePair<int, string>(8,"搜索")},
|
||||
{ "batch",new KeyValuePair<int, string>(9,"批量操作")},
|
||||
{ "recycle",new KeyValuePair<int, string>(10,"回收站")},
|
||||
{ "confirm",new KeyValuePair<int, string>(11,"确认")},
|
||||
|
||||
};
|
||||
|
||||
var asms = AppDomain.CurrentDomain.GetAssemblies();
|
||||
foreach (var asmItem in asms)
|
||||
{
|
||||
var types = asmItem.GetTypes().Where(e => e.Name.EndsWith("Controller")).ToList();
|
||||
if (types.Count == 0) continue;
|
||||
|
||||
foreach (var type in types)
|
||||
{
|
||||
if (!type.Namespace.Contains(".AdminCP.Controller"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// 控制器名称
|
||||
var ctrName = type.Name.TrimEnd("Controller");
|
||||
|
||||
// 控制器展示名
|
||||
var ctrDpName = type.GetDisplayName();
|
||||
|
||||
var ctrDes = type.GetDescription();
|
||||
|
||||
var url = ctrName;
|
||||
|
||||
var fAdminMenu = AdminMenu.Find(AdminMenu._.MenuKey == ctrName + "Sys" & AdminMenu._.Link == "#");
|
||||
var nAdminMenu = new AdminMenu
|
||||
{
|
||||
Description = ctrDes,
|
||||
IsHide = 0,
|
||||
Level = 0,
|
||||
Link = "#",
|
||||
Location = "0,",
|
||||
MenuKey = ctrName + "Sys",
|
||||
MenuName = ctrDpName,
|
||||
PId = 0
|
||||
};
|
||||
var pAdminMenu = fAdminMenu ?? nAdminMenu;
|
||||
if (pAdminMenu.Id > 0)
|
||||
{
|
||||
pAdminMenu.Description = nAdminMenu.Description;
|
||||
pAdminMenu.MenuName = nAdminMenu.MenuName;
|
||||
}
|
||||
|
||||
// 控制器所有包含MyAuthorizeAttribute的方法
|
||||
var acts = type.GetMethods()
|
||||
.Where(w => w.IsDefined(typeof(MyAuthorizeAttribute)))
|
||||
.ToList();
|
||||
|
||||
if (!acts.Any()) continue;
|
||||
|
||||
pAdminMenu.Save();
|
||||
|
||||
var eventKeyDic = new Dictionary<string, int>();
|
||||
var adminMenuEventList = new List<AdminMenuEvent>();
|
||||
|
||||
foreach (var method in acts)
|
||||
{
|
||||
var dn = method.GetDisplayName();
|
||||
var methodDes = method.GetDescription();
|
||||
var actName = method.Name;
|
||||
var myAuthorize = method.GetCustomAttribute<MyAuthorizeAttribute>();
|
||||
|
||||
var menuKey = myAuthorize.GetValue("_menuKey").ToString();
|
||||
var eventKey = myAuthorize.GetValue("_eventKey").ToString();
|
||||
var returnType = myAuthorize.GetValue("_returnType").ToString();
|
||||
|
||||
//保存菜单
|
||||
if (eventKey == "viewlist" && returnType == "HTML")
|
||||
{
|
||||
var adminMenu = AdminMenu.Find(AdminMenu._.MenuKey == menuKey & AdminMenu._.Link == url + "/" + actName) ?? new AdminMenu
|
||||
{
|
||||
Description = methodDes,
|
||||
IsHide = 0,
|
||||
Level = pAdminMenu.Level + 1,
|
||||
Link = url + "/" + actName,
|
||||
Location = pAdminMenu.Location + ",",
|
||||
MenuKey = menuKey,
|
||||
MenuName = dn,
|
||||
PId = pAdminMenu.Id
|
||||
};
|
||||
adminMenu.Save();
|
||||
|
||||
eventKeyDic[menuKey] = adminMenu.Id;
|
||||
}
|
||||
|
||||
// 保存操作
|
||||
var adminmenuevent = AdminMenuEvent.Find(AdminMenuEvent._.MenuId == menuEventDic[eventKey].Key
|
||||
& AdminMenuEvent._.MenuKey == menuKey & AdminMenuEvent._.EventKey == eventKey)
|
||||
?? new AdminMenuEvent
|
||||
{
|
||||
MenuKey = menuKey,
|
||||
MenuId = menuEventDic[eventKey].Key,
|
||||
EventKey = eventKey,
|
||||
EventName = menuEventDic[eventKey].Value
|
||||
};
|
||||
adminMenuEventList.Add(adminmenuevent);
|
||||
}
|
||||
|
||||
adminMenuEventList.ForEach(f => f.MenuId = eventKeyDic.ContainsKey(f.MenuKey) ? eventKeyDic[f.MenuKey] : 0);
|
||||
adminMenuEventList.Save();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void Register()
|
||||
{
|
||||
Task.Run(() => { StartRegister(); }).LogException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using COMCMS.Core.Models;
|
||||
using COMCMS.Web.Common;
|
||||
using XCode;
|
||||
|
||||
namespace COMCMS.Web.Controllers
|
||||
{
|
||||
public class ArticleController : HomeBaseController
|
||||
{
|
||||
#region 显示列表
|
||||
// GET: Article
|
||||
[HttpGet]
|
||||
public IActionResult Index(int id = 0, int page = 1)
|
||||
{
|
||||
ArticleCategory model = ArticleCategory.FindById(id);
|
||||
if (model == null)
|
||||
{
|
||||
return AlertAndGoBack("系统找不到本记录");
|
||||
}
|
||||
//如果跳转到地址
|
||||
if (!string.IsNullOrEmpty(model.LinkURL))
|
||||
{
|
||||
if (Utils.IsInt(model.LinkURL))//如果是数字,则跳转到详情
|
||||
{
|
||||
//Redirect($"/aritcle/{model.LinkURL}.html");
|
||||
return Redirect($"/Article/Detail/{model.LinkURL}");
|
||||
}
|
||||
else
|
||||
{
|
||||
return Redirect(model.LinkURL);
|
||||
}
|
||||
|
||||
}
|
||||
if (page < 1) page = 1;
|
||||
|
||||
if (model.IsList == 1)
|
||||
{
|
||||
IList<Article> list = new List<Article>();
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
numPerPage = model.PageSize;
|
||||
if (page > 0)
|
||||
currentPage = page;
|
||||
else
|
||||
currentPage = 1;
|
||||
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
|
||||
var ex = Article._.IsHide != 1 & Article._.IsDel != 1;
|
||||
|
||||
//如果显示下级栏目文章
|
||||
if (model.IsShowSubDetail == 1)
|
||||
{
|
||||
//获取下级所有栏目
|
||||
List<int> allsubkids = new List<int>();
|
||||
allsubkids.Add(model.Id);
|
||||
|
||||
IList<ArticleCategory> allkind = ArticleCategory.FindAllSubKinds(model.Id);
|
||||
if (allkind != null && allkind.Count > 0)
|
||||
{
|
||||
foreach (var s in allkind)
|
||||
{
|
||||
allsubkids.Add(s.Id);
|
||||
}
|
||||
}
|
||||
ex &= Article._.KId.In(allsubkids);
|
||||
}
|
||||
else
|
||||
ex &= Article._.KId == model.Id;
|
||||
long totalCount = Article.FindCount(ex, Article._.Sequence.Asc().And(Article._.Id.Desc()), null, startRowIndex, numPerPage);
|
||||
int pageCount = (int)totalCount / numPerPage;//总页数
|
||||
if (totalCount % numPerPage > 0)
|
||||
{
|
||||
pageCount += 1;
|
||||
}
|
||||
list = Article.FindAll(ex, Article._.Sequence.Asc().And(Article._.Id.Desc()), null, startRowIndex, numPerPage);
|
||||
ViewBag.list = list;//列表
|
||||
//分页信息
|
||||
ViewBag.totalCount = totalCount;
|
||||
ViewBag.pageCount = pageCount;
|
||||
ViewBag.page = page;
|
||||
ViewBag.pagesize = numPerPage;
|
||||
}
|
||||
|
||||
ViewBag.cfg = cfg;
|
||||
string templatesname = "";//模板名称
|
||||
if (!string.IsNullOrEmpty(model.TemplateFile))
|
||||
{
|
||||
templatesname = model.TemplateFile.Replace(".cshtml", "").Replace(".aspx", "");
|
||||
return View(templatesname, model);
|
||||
}
|
||||
else
|
||||
{
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 显示详情
|
||||
[HttpGet]
|
||||
public IActionResult Detail(int id)
|
||||
{
|
||||
Article entity = Article.Find(Article._.Id == id);
|
||||
if (entity == null)
|
||||
{
|
||||
return AlertAndGoBack("系统找不到本记录!");
|
||||
}
|
||||
ArticleCategory kind = ArticleCategory.FindById(entity.KId);
|
||||
if (kind == null)
|
||||
{
|
||||
return AlertAndGoBack("系统找不到本文章栏目!");
|
||||
}
|
||||
//增加点击
|
||||
entity.Hits++;
|
||||
entity.Update();
|
||||
if (!string.IsNullOrEmpty(entity.LinkURL))
|
||||
{
|
||||
//return Content(entity.LinkURL);
|
||||
return Redirect(entity.LinkURL);
|
||||
}
|
||||
ViewBag.kind = kind;
|
||||
ViewBag.cfg = cfg;
|
||||
//文章更多图片列表
|
||||
if (!string.IsNullOrEmpty(entity.ItemImg))
|
||||
{
|
||||
string[] arrimg = entity.ItemImg.Split(new string[] { "|||" }, StringSplitOptions.None);
|
||||
List<string> listimg = new List<string>();
|
||||
foreach (string s in arrimg)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(s) && Utils.IsImgFilename(s))
|
||||
{
|
||||
listimg.Add(s.Trim());
|
||||
}
|
||||
}
|
||||
ViewBag.ListImg = listimg;
|
||||
}
|
||||
string templatesname = "";//模板名称
|
||||
if (!string.IsNullOrEmpty(kind.TemplateFile))
|
||||
{
|
||||
templatesname = kind.DetailTemplateFile.Replace(".cshtml", "").Replace(".aspx", "");
|
||||
return View(templatesname, entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
return View(entity);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -15,54 +15,30 @@ using Microsoft.Extensions.Configuration.Json;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Collections.Concurrent;
|
||||
using Newtonsoft.Json;
|
||||
using COMCMS.Web.Common;
|
||||
|
||||
namespace COMCMS.Web.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
public class HomeController : HomeBaseController
|
||||
{
|
||||
public static IConfiguration Configuration { get; set; }
|
||||
public ConcurrentDictionary<string, string> AllSession = new ConcurrentDictionary<string, string>();
|
||||
|
||||
public HomeController(IConfiguration configuration)
|
||||
{
|
||||
//Configuration = new ConfigurationBuilder()
|
||||
// .SetBasePath(Directory.GetCurrentDirectory())
|
||||
// .AddJsonFile("appsettings.json", optional: true, reloadOnChange : true)
|
||||
// .Build();
|
||||
Configuration = configuration;
|
||||
}
|
||||
#region 首页
|
||||
public IActionResult Index()
|
||||
{
|
||||
CookieOptions op = new CookieOptions
|
||||
{
|
||||
Expires = DateTime.Now.AddMinutes(10),
|
||||
Path = "/",
|
||||
HttpOnly = true
|
||||
};
|
||||
Response.Cookies.Append("abc", "123456", op);//用户名
|
||||
|
||||
|
||||
|
||||
ViewBag.cfg = cfg;
|
||||
ViewBag.about = Article.FindById(1);//关于我们
|
||||
return View();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
public IActionResult About()
|
||||
{
|
||||
ViewData["Message"] = "Your application description page.";
|
||||
CookiesHelper.WriteCookie("abc", Utils.GetRandomChar(20), 10);
|
||||
//sessiong
|
||||
SessionHelper.WriteSession("bcd", Utils.GetRandomChar(20));
|
||||
HttpContext.Session.SetString("abc", "123456");
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Contact()
|
||||
{
|
||||
Link l = Link.Find(Link._.Id == 1);
|
||||
l.Title = "😂😂😂😂";
|
||||
l.Save();
|
||||
return View(l);
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Error()
|
||||
@@ -70,84 +46,5 @@ namespace COMCMS.Web.Controllers
|
||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||
}
|
||||
|
||||
#region 测试
|
||||
public IActionResult Test()
|
||||
{
|
||||
var css = Configuration.GetSection("connectionStrings");
|
||||
var list = css.GetChildren();
|
||||
if(list !=null && list.Count() > 0)
|
||||
{
|
||||
|
||||
}
|
||||
string s = "";
|
||||
foreach (var item in list)
|
||||
{
|
||||
string connName = item.Path.Substring(item.Path.IndexOf(":") + 1);
|
||||
string connectionString = css.GetSection(connName).GetSection("connectionString").Value;
|
||||
string providerName = css.GetSection(connName).GetSection("providerName").Value;
|
||||
s += item.Path.Substring(item.Path.IndexOf(":")+1)+ "|"+ Configuration.GetSection(item.Path+ ":connectionString").Value+"|" + Configuration.GetSection(item.Path + ":providerName").Value +"|"+connectionString+"|"+ providerName +"|||" + list.Count();
|
||||
}
|
||||
|
||||
return Content(s);
|
||||
}
|
||||
|
||||
public IActionResult Test2()
|
||||
{
|
||||
var settings = Path.Combine(Directory.GetCurrentDirectory(), "appsettings.json");
|
||||
var css2 = new ConfigurationBuilder().AddJsonFile(settings).Build().GetSection("connectionStrings");
|
||||
|
||||
string s = "";
|
||||
if (css2 != null)
|
||||
{
|
||||
foreach (var item in css2.GetChildren())
|
||||
{
|
||||
var name = item.Path.Substring(item.Path.IndexOf(":") + 1);// item["name"];
|
||||
var constr = item["connectionString"];
|
||||
var provider = item["providerName"];
|
||||
s += $"{name}|{constr}|{provider}|||";
|
||||
//var type = DbFactory.GetProviderType(constr, provider);
|
||||
//if (type == null) XTrace.WriteLine("无法识别{0}的提供者{1}!", name, provider);
|
||||
|
||||
//cs.Add(name, constr);
|
||||
//_connTypes.Add(name, type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return Content(s);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region MyRegion
|
||||
public IActionResult Test3()
|
||||
{
|
||||
bool isok = false;
|
||||
if(AllSession.TryAdd(HttpContext.Session.Id, HttpContext.Session.Id))
|
||||
{
|
||||
isok = true;
|
||||
}
|
||||
|
||||
return Content(isok.ToString() + ":" + JsonConvert.SerializeObject(AllSession));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 测试
|
||||
[HttpGet]
|
||||
public IActionResult Article(string title)
|
||||
{
|
||||
return Content(title);
|
||||
}
|
||||
#endregion
|
||||
|
||||
public IActionResult Uploader()
|
||||
{
|
||||
return View("~/Areas/AdminCP/Views/WebUploader/Uploader.cshtml");
|
||||
}
|
||||
|
||||
public IActionResult FileTest()
|
||||
{
|
||||
return View();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using COMCMS.Core.Models;
|
||||
using COMCMS.Web.Common;
|
||||
using XCode;
|
||||
|
||||
namespace COMCMS.Web.Controllers
|
||||
{
|
||||
public class ProductController : HomeBaseController
|
||||
{
|
||||
#region 分类页面
|
||||
[HttpGet]
|
||||
public IActionResult Index(int id = 0, int page = 1)
|
||||
{
|
||||
Category entity = null;
|
||||
if (id > 0)
|
||||
{
|
||||
entity = Category.FindById(id);
|
||||
if (entity == null)
|
||||
{
|
||||
return EchoTip("系统找不到本分类!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
entity = new Category()
|
||||
{
|
||||
Id = 0,
|
||||
KindName = "所有分类",
|
||||
Keyword = "所有分类",
|
||||
Description = "所有分类",
|
||||
PageSize = 10
|
||||
};
|
||||
}
|
||||
Expression ex = Product._.IsHide == 0;
|
||||
if (entity.Id > 0)
|
||||
{
|
||||
ex &= Product._.KId == entity.Id;
|
||||
}
|
||||
|
||||
//计算分页
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
long totalCount = 0;
|
||||
|
||||
numPerPage = 10;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
|
||||
IList<Product> list = Product.FindAll(ex, null, null, startRowIndex, numPerPage);
|
||||
totalCount = Product.FindCount(ex, null, null, startRowIndex, numPerPage);
|
||||
|
||||
ViewBag.totalCount = totalCount;
|
||||
ViewBag.page = page;
|
||||
ViewBag.pagesize = numPerPage;
|
||||
ViewBag.cfg = cfg;
|
||||
ViewBag.list = list;
|
||||
|
||||
return View(entity);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 商品详情
|
||||
[HttpGet]
|
||||
public IActionResult Detail(int id)
|
||||
{
|
||||
Product entity = Product.FindById(id);
|
||||
if (entity == null || entity.IsHide == 1)
|
||||
{
|
||||
return EchoTip("系统找不到本记录!");
|
||||
}
|
||||
//文章更多图片列表
|
||||
if (!string.IsNullOrEmpty(entity.ItemImg))
|
||||
{
|
||||
string[] arrimg = entity.ItemImg.Split(new string[] { "|||" }, StringSplitOptions.None);
|
||||
List<string> listimg = new List<string>();
|
||||
foreach (string s in arrimg)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(s) && Utils.IsImgFilename(s))
|
||||
{
|
||||
listimg.Add(s.Trim());
|
||||
}
|
||||
}
|
||||
ViewBag.ListImg = listimg;
|
||||
}
|
||||
entity.Hits++;
|
||||
entity.Update();
|
||||
ViewBag.cfg = cfg;
|
||||
ViewBag.category = entity.Category;
|
||||
|
||||
return View(entity);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using COMCMS.Core.Models;
|
||||
using COMCMS.Web.Common;
|
||||
using XCode;
|
||||
|
||||
namespace COMCMS.Web.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 服务端处理
|
||||
/// </summary>
|
||||
public class ServerController : HomeBaseController
|
||||
{
|
||||
#region 提交前台底部留言
|
||||
[HttpPost]
|
||||
[AutoValidateAntiforgeryToken]
|
||||
public IActionResult DoPostMessage(string name,string phone,string content)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
tip.Message = "请填写您的姓名!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (!Utils.IsTel(phone))
|
||||
{
|
||||
tip.Message = "请填写正确的手机号码!";
|
||||
return Json(tip);
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(content))
|
||||
{
|
||||
tip.Message = "请填写您的留言内容!";
|
||||
return Json(tip);
|
||||
}
|
||||
|
||||
Guestbook entity = new Guestbook()
|
||||
{
|
||||
AddTime = DateTime.Now,
|
||||
IP = Utils.GetIP(),
|
||||
KId = 1,
|
||||
Nickname = name,
|
||||
Content = Utils.NoHTML(content),
|
||||
Tel = phone
|
||||
};
|
||||
entity.Insert();
|
||||
|
||||
tip.Message = "留言成功,感谢您的留言!";
|
||||
tip.Status = JsonTip.SUCCESS;
|
||||
return Json(tip);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Web.Common;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NewLife.Log;
|
||||
|
||||
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
|
||||
namespace COMCMS.Web.Controllers.api
|
||||
{
|
||||
[Produces("application/json")]
|
||||
[Route("api/[controller]/[action]")]
|
||||
[WebAPIHandleError]
|
||||
public class APIBaseController : Controller
|
||||
{
|
||||
public APIBaseController()
|
||||
{
|
||||
string url = MyHttpContext.Current.Request.Path;
|
||||
string querystring = MyHttpContext.Current.Request.QueryString.ToString();
|
||||
//XTrace.WriteLine($"访问API:{url}?{querystring}");
|
||||
}
|
||||
#region 通用信息
|
||||
public ReJSON reJson = new ReJSON() { code = 40000 };
|
||||
#endregion
|
||||
|
||||
#region 验证签名
|
||||
public bool CheckSignature(SortedDictionary<string, string> pars, string signature)
|
||||
{
|
||||
if (!MySign.CheckSign(pars, signature))
|
||||
{
|
||||
reJson.code = 40004;
|
||||
reJson.message = "signature 错误!";
|
||||
return false;
|
||||
}
|
||||
//判断是否超时
|
||||
string timeStamp = pars["timeStamp"];
|
||||
//判断时间有效性
|
||||
DateTime postTime = Utils.StampToDateTime(timeStamp);
|
||||
if (postTime < DateTime.UtcNow.AddSeconds(-120))//30秒有效期
|
||||
{
|
||||
reJson.code = 40004;
|
||||
reJson.message = "数据请求超时!";
|
||||
reJson.isReload = 1;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 自动验证QueryString 的签名
|
||||
/// <summary>
|
||||
/// 自动验证QueryString 的签名
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool AutoCheckQueryStringSignature()
|
||||
{
|
||||
var queryStrings = Request.Query;
|
||||
List<string> keys = new List<string>();
|
||||
//string[] keys = HttpContext.Current.Request.QueryString.AllKeys;
|
||||
if (queryStrings == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
foreach (var item in queryStrings.Keys)
|
||||
{
|
||||
keys.Add(item);
|
||||
}
|
||||
SortedDictionary<string, string> pars = new SortedDictionary<string, string>();
|
||||
string signature = "";
|
||||
foreach (var k in keys)
|
||||
{
|
||||
if (k != "signature")
|
||||
{
|
||||
string v = Request.Query[k];
|
||||
pars.Add(k, v);
|
||||
}
|
||||
else
|
||||
{
|
||||
signature = Request.Query[k];
|
||||
}
|
||||
}
|
||||
//没有签名返回错误
|
||||
if (string.IsNullOrEmpty(signature))
|
||||
return false;
|
||||
return CheckSignature(pars, signature);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region 通用返回信息
|
||||
public class ReJSON
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回代码 0 为正确
|
||||
/// </summary>
|
||||
public int code { get; set; } = 40000;
|
||||
|
||||
/// <summary>
|
||||
/// 提示语
|
||||
/// </summary>
|
||||
public string message { get; set; }
|
||||
/// <summary>
|
||||
/// 是否重新加载
|
||||
/// </summary>
|
||||
public int isReload { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 数据详情 object
|
||||
/// </summary>
|
||||
public object detail { get; set; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using COMCMS.Core.Models;
|
||||
using XCode;
|
||||
using System.Web;
|
||||
using COMCMS.Web.Filter;
|
||||
using NewLife.Log;
|
||||
using static COMCMS.Web.Models.APIModels;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Senparc.Weixin.WxOpen;
|
||||
|
||||
namespace COMCMS.Web.Controllers.api
|
||||
{
|
||||
public class ArticleController : APIBaseController
|
||||
{
|
||||
#region 获取文章列表
|
||||
/// <summary>
|
||||
/// 获取文章列表
|
||||
/// </summary>
|
||||
/// <param name="kid"></param>
|
||||
/// <param name="pagesize"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[CheckFilter]
|
||||
public object GetArticleList(int kid, int pagesize = 10, int page = 1, string random = "", string timeStamp = "", string signature = "")
|
||||
{
|
||||
var where = Article._.IsHide != 1;
|
||||
if (kid > 0)
|
||||
where &= Article._.KId == kid;
|
||||
|
||||
if (page <= 0) page = 1;
|
||||
//计算分页
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
|
||||
numPerPage = pagesize;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
|
||||
IList<Article> list = Article.FindAll(where, Article._.Sequence.Asc(), null, startRowIndex, numPerPage);
|
||||
long totalCount = Article.FindCount(where, Article._.Sequence.Asc(), null, startRowIndex, numPerPage);
|
||||
List<object> relist = new List<object>();
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
relist.Add(new
|
||||
{
|
||||
id = item.Id,
|
||||
title = item.Title,
|
||||
subTitle = item.SubTitle,
|
||||
pic = item.Pic,
|
||||
description = item.Description,
|
||||
addTime = item.AddTime.ToString("yyyy-MM-dd HH:mm"),
|
||||
origin = item.Origin
|
||||
});
|
||||
}
|
||||
}
|
||||
dynamic re = new { total = totalCount, page = page, list = relist };
|
||||
|
||||
reJson.code = 0;
|
||||
reJson.message = "获取成功";
|
||||
reJson.detail = re;
|
||||
return reJson;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取文章列表
|
||||
/// <summary>
|
||||
/// 获取文章列表
|
||||
/// </summary>
|
||||
/// <param name="kid"></param>
|
||||
/// <param name="pagesize"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[CheckFilter]
|
||||
public object GetArticleListWidthSub(int kid, int pagesize = 10, int page = 1, string key = "", string random = "", string timeStamp = "", string signature = "")
|
||||
{
|
||||
|
||||
var where = Article._.IsHide != 1;
|
||||
if (kid > 0)
|
||||
{
|
||||
//获取下属
|
||||
List<int> kids = new List<int>();
|
||||
kids.Add(kid);
|
||||
IList<ArticleCategory> subkinds = ArticleCategory.FindByParentID(kid);
|
||||
if (subkinds != null && subkinds.Count > 0)
|
||||
{
|
||||
foreach (var item in subkinds)
|
||||
{
|
||||
kids.Add(item.Id);
|
||||
}
|
||||
}
|
||||
where &= Article._.KId.In(kids);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(key))
|
||||
{
|
||||
where &= Article._.Title.Contains(key);
|
||||
}
|
||||
if (page <= 0) page = 1;
|
||||
//计算分页
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
|
||||
numPerPage = pagesize;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
|
||||
IList<Article> list = Article.FindAll(where, Article._.Sequence.Asc(), null, startRowIndex, numPerPage);
|
||||
long totalCount = Article.FindCount(where, Article._.Sequence.Asc(), null, startRowIndex, numPerPage);
|
||||
List<object> relist = new List<object>();
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
relist.Add(new
|
||||
{
|
||||
id = item.Id,
|
||||
title = item.Title,
|
||||
subTitle = item.SubTitle,
|
||||
pic = item.Pic,
|
||||
description = item.Description,
|
||||
addTime = item.AddTime.ToString("yyyy-MM-dd HH:mm"),
|
||||
origin = item.Origin
|
||||
});
|
||||
}
|
||||
}
|
||||
dynamic re = new { total = totalCount, page = page, list = relist };
|
||||
|
||||
reJson.code = 0;
|
||||
reJson.message = "获取成功";
|
||||
reJson.detail = re;
|
||||
return reJson;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取文章详情
|
||||
/// <summary>
|
||||
/// 获取文章详情
|
||||
/// </summary>
|
||||
/// <param name="id">文章id</param>
|
||||
/// <param name="random"></param>
|
||||
/// <param name="timeStamp"></param>
|
||||
/// <param name="signature"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[CheckFilter]
|
||||
public object GetArticleDetail(int id, string random = "", string timeStamp = "", string signature = "")
|
||||
{
|
||||
//获取商品
|
||||
Article entity = Article.FindById(id);
|
||||
if (entity == null || entity.IsHide == 1)
|
||||
{
|
||||
reJson.code = 40000;
|
||||
reJson.message = "系统找不到本记录";
|
||||
return reJson;
|
||||
}
|
||||
entity.Hits++;
|
||||
entity.Update();
|
||||
return entity;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取文章栏目详情,并带下一级栏目
|
||||
[HttpGet]
|
||||
[CheckFilter]
|
||||
public object GetArticleCategory(int id, string random = "", string timeStamp = "", string signature = "")
|
||||
{
|
||||
ArticleCategory entity = ArticleCategory.FindById(id);
|
||||
if (entity == null)
|
||||
{
|
||||
reJson.message = "系统找不到本记录";
|
||||
return reJson;
|
||||
}
|
||||
|
||||
//获取下属栏目
|
||||
IList<ArticleCategory> listsub = ArticleCategory.FindAll(ArticleCategory._.PId == entity.Id & ArticleCategory._.IsHide == 0, ArticleCategory._.Rank.Asc(), null, 0, 0);
|
||||
|
||||
List<object> reListSubs = new List<object>();
|
||||
if (listsub != null && listsub.Count > 0)
|
||||
{
|
||||
foreach (var item in listsub)
|
||||
{
|
||||
reListSubs.Add(new
|
||||
{
|
||||
kindName = item.KindName,
|
||||
id = item.Id
|
||||
});
|
||||
}
|
||||
}
|
||||
dynamic detail = new
|
||||
{
|
||||
category = entity,
|
||||
sublist = reListSubs
|
||||
};
|
||||
|
||||
reJson.code = 0;
|
||||
reJson.message = "获取成功!";
|
||||
reJson.detail = detail;
|
||||
return reJson;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using COMCMS.Core.Models;
|
||||
using XCode;
|
||||
using System.Web;
|
||||
using COMCMS.Web.Filter;
|
||||
using NewLife.Log;
|
||||
using static COMCMS.Web.Models.APIModels;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Senparc.Weixin.WxOpen;
|
||||
|
||||
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
|
||||
namespace COMCMS.Web.Controllers.api
|
||||
{
|
||||
public class ProductController : APIBaseController
|
||||
{
|
||||
#region 获取分类列表
|
||||
/// <summary>
|
||||
/// 获取分类列表
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
/// <param name="pid"></param>
|
||||
/// <param name="random"></param>
|
||||
/// <param name="timeStamp"></param>
|
||||
/// <param name="signature"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[CheckFilter]
|
||||
public object GetCategories(int level, int pid = 0, string random = "", string timeStamp = "", string signature = "")
|
||||
{
|
||||
var list = Category.GetListTree(pid, level, false, false);
|
||||
|
||||
List<object> relist = new List<object>();
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
relist.Add(new
|
||||
{
|
||||
id = item.Id,
|
||||
kindName = item.KindName,
|
||||
subTitle = item.SubTitle,
|
||||
pic = item.Pic,
|
||||
banner = item.BannerImg,
|
||||
description = item.Description
|
||||
});
|
||||
}
|
||||
}
|
||||
reJson.code = 0;
|
||||
reJson.message = "获取成功";
|
||||
reJson.detail = relist;
|
||||
return reJson;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取商品列表
|
||||
/// <summary>
|
||||
/// 获取商品列表
|
||||
/// </summary>
|
||||
/// <param name="kid">分类ID</param>
|
||||
/// <param name="page">第几页</param>
|
||||
/// <param name="pageSize">每页显示数量</param>
|
||||
/// <param name="random"></param>
|
||||
/// <param name="timeStamp"></param>
|
||||
/// <param name="signature"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[CheckFilter]
|
||||
public object GetProductList(int kid, int page, int pageSize = 10, string random = "", string timeStamp = "", string signature = "")
|
||||
{
|
||||
var where = Product._.IsHide == 0;
|
||||
if (kid > 0)
|
||||
where &= Product._.KId == kid;
|
||||
|
||||
if (page <= 0) page = 1;
|
||||
//计算分页
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
|
||||
numPerPage = pageSize;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
|
||||
IList<Product> list = Product.FindAll(where, Product._.Sequence.Asc(), null, startRowIndex, numPerPage);
|
||||
long totalCount = Product.FindCount(where, Product._.Sequence.Asc(), null, startRowIndex, numPerPage);
|
||||
List<object> relist = new List<object>();
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
relist.Add(new
|
||||
{
|
||||
id = item.Id,
|
||||
title = item.Title,
|
||||
subTitle = item.SubTitle,
|
||||
price = item.Price,
|
||||
marketPrice = item.MarketPrice,
|
||||
pic = item.Pic,
|
||||
description = item.Description,
|
||||
stock = item.Stock,
|
||||
addTime = item.AddTime.ToString("yyyy-MM-dd HH:mm")
|
||||
});
|
||||
}
|
||||
}
|
||||
dynamic re = new { total = totalCount, page = page, list = relist };
|
||||
|
||||
reJson.code = 0;
|
||||
reJson.message = "获取成功";
|
||||
reJson.detail = re;
|
||||
return reJson;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 商品详情
|
||||
/// <summary>
|
||||
/// 获取商品详情
|
||||
/// </summary>
|
||||
/// <param name="id">商品id</param>
|
||||
/// <param name="random"></param>
|
||||
/// <param name="timeStamp"></param>
|
||||
/// <param name="signature"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[CheckFilter]
|
||||
public object GetProductDetail(int id, string random = "", string timeStamp = "", string signature = "")
|
||||
{
|
||||
//获取商品
|
||||
Product entity = Product.FindById(id);
|
||||
if (entity == null || entity.IsHide == 1)
|
||||
{
|
||||
reJson.code = 40000;
|
||||
reJson.message = "系统找不到本记录";
|
||||
return reJson;
|
||||
}
|
||||
entity.Hits++;
|
||||
entity.Update();
|
||||
return entity;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 搜索商品
|
||||
/// <summary>
|
||||
/// 获取商品列表
|
||||
/// </summary>
|
||||
/// <param name="key">关键字</param>
|
||||
/// <param name="page">第几页</param>
|
||||
/// <param name="pageSize">每页显示数量</param>
|
||||
/// <param name="random"></param>
|
||||
/// <param name="timeStamp"></param>
|
||||
/// <param name="signature"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[CheckFilter]
|
||||
public object GetSearchProductList(string key, int page, int pageSize = 10, int kid = 0, string random = "", string timeStamp = "", string signature = "")
|
||||
{
|
||||
var where = Product._.IsHide == 0;
|
||||
|
||||
if (kid != 0)
|
||||
{
|
||||
where &= Product._.KId == kid;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(key))
|
||||
{
|
||||
key = Utils.NoHTML(key);
|
||||
where &= Product._.Title.Contains(key);
|
||||
}
|
||||
|
||||
if (page <= 0) page = 1;
|
||||
//计算分页
|
||||
int numPerPage, currentPage, startRowIndex;
|
||||
|
||||
numPerPage = pageSize;
|
||||
currentPage = page;
|
||||
startRowIndex = (currentPage - 1) * numPerPage;
|
||||
|
||||
IList<Product> list = Product.FindAll(where, Product._.Sequence.Asc(), null, startRowIndex, numPerPage);
|
||||
long totalCount = Product.FindCount(where, Product._.Sequence.Asc(), null, startRowIndex, numPerPage);
|
||||
List<object> relist = new List<object>();
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
relist.Add(new
|
||||
{
|
||||
id = item.Id,
|
||||
title = item.Title,
|
||||
subTitle = item.SubTitle,
|
||||
price = item.Price,
|
||||
marketPrice = item.MarketPrice,
|
||||
pic = item.Pic,
|
||||
description = item.Description,
|
||||
stock = item.Stock,
|
||||
addTime = item.AddTime.ToString("yyyy-MM-dd HH:mm")
|
||||
});
|
||||
}
|
||||
}
|
||||
dynamic re = new { total = totalCount, page = page, list = relist };
|
||||
|
||||
reJson.code = 0;
|
||||
reJson.message = "获取成功";
|
||||
reJson.detail = re;
|
||||
return reJson;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -126,6 +126,5 @@ namespace COMCMS.Web.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
public wxpaymentController(IConfiguration configuration) : base(configuration){}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace COMCMS.Web.Filter
|
||||
{
|
||||
public class CheckFilterAttribute : ActionFilterAttribute
|
||||
{
|
||||
public override async void OnActionExecuting(ActionExecutingContext context)
|
||||
public override void OnActionExecuting(ActionExecutingContext context)
|
||||
{
|
||||
if (!context.ModelState.IsValid)
|
||||
{
|
||||
|
||||
@@ -43,8 +43,11 @@ namespace COMCMS.Web
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// 注册菜单
|
||||
MenuRegister.Register();
|
||||
|
||||
//注入自己的HttpContext
|
||||
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
//services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
//services.AddMvc().AddSessionStateTempDataProvider();
|
||||
|
||||
//添加Configuration到静态变量
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
@model COMCMS.Core.Article
|
||||
@{
|
||||
ViewBag.title = Model.Title;
|
||||
ViewBag.keywords = Model.Keyword;
|
||||
ViewBag.description = Model.Description;
|
||||
IList<Article> alist = Article.FindAll(Article._.KId == Model.KId, Article._.Sequence.Asc(), null, 0, 0);
|
||||
int topkid = ViewBag.kind.PId >0? ViewBag.kind.PId : ViewBag.kind.Id;
|
||||
|
||||
}
|
||||
<div class="banner normal sec-banner">
|
||||
@if (string.IsNullOrEmpty(ViewBag.kind.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@ViewBag.kind.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
<div class="banner mobile sec-banner">
|
||||
@if (string.IsNullOrEmpty(ViewBag.kind.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@ViewBag.kind.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="sec-nav">
|
||||
<div class="cont">
|
||||
<ul class="sec-nav-list">
|
||||
@foreach (Article a in alist)
|
||||
{
|
||||
<li class="@(a.Id == Model.Id?"sec-on":"")"><a asp-controller="Article" asp-action="Detail" asp-route-id="@(a.Id)" title="@a.Title">@a.Title</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
function mbSecNav() {
|
||||
var num = $('.sec-nav-list li').length;
|
||||
if (num >= 3) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 3 / 100) + 'rem' });
|
||||
} else if (num == 2) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 2 / 100) + 'rem' });
|
||||
} else if (num == 1) {
|
||||
$('.sec-nav-list li').css({ 'width': (213 / 100) + 'rem' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 主体内容 -->
|
||||
<div class="content au">
|
||||
<div class="au-bg">
|
||||
<div class="cont">
|
||||
@Html.Raw(Model.Content)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$("#nav_@(topkid)").addClass("nav-on");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,65 @@
|
||||
@model COMCMS.Core.Article
|
||||
@{
|
||||
ViewBag.title = Model.Title;
|
||||
ViewBag.keywords = Model.Keyword;
|
||||
ViewBag.description = Model.Description;
|
||||
IList<Article> alist = Article.FindAll(Article._.KId == Model.KId, Article._.Sequence.Asc(), null, 0, 0);
|
||||
int topkid = ViewBag.kind.PId > 0 ? ViewBag.kind.PId : ViewBag.kind.Id;
|
||||
}
|
||||
<div class="banner normal sec-banner">
|
||||
@if (string.IsNullOrEmpty(ViewBag.kind.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@ViewBag.kind.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
<div class="banner mobile sec-banner">
|
||||
@if (string.IsNullOrEmpty(ViewBag.kind.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@ViewBag.kind.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="sec-nav">
|
||||
<div class="cont">
|
||||
<ul class="sec-nav-list">
|
||||
@foreach (Article a in alist)
|
||||
{
|
||||
<li class="@(a.Id == Model.Id?"sec-on":"")"><a asp-controller="Article" asp-action="Detail" asp-route-id="@(a.Id)" title="@a.Title">@a.Title</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
function mbSecNav() {
|
||||
var num = $('.sec-nav-list li').length;
|
||||
if (num >= 3) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 3 / 100) + 'rem' });
|
||||
} else if (num == 2) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 2 / 100) + 'rem' });
|
||||
} else if (num == 1) {
|
||||
$('.sec-nav-list li').css({ 'width': (213 / 100) + 'rem' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 主体内容 -->
|
||||
<div class="content au">
|
||||
<div class="au-bg">
|
||||
<div class="cont">
|
||||
@Html.Raw(Model.Content)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$("#nav_@(topkid)").addClass("nav-on");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,127 @@
|
||||
@model COMCMS.Core.Article
|
||||
@{
|
||||
ViewBag.title = Model.Title;
|
||||
ViewBag.keywords = Model.Keyword;
|
||||
ViewBag.description = Model.Description;
|
||||
IList<Article> alist = Article.FindAll(Article._.KId == Model.KId, Article._.Sequence.Asc(), null, 0, 0);
|
||||
int topkid = ViewBag.kind.PId > 0 ? ViewBag.kind.PId : ViewBag.kind.Id;
|
||||
//获取同级分类
|
||||
IList<ArticleCategory> sameList = ArticleCategory.FindAll(ArticleCategory._.PId == ViewBag.kind.PId, ArticleCategory._.Rank.Asc(), null, 0, 0);
|
||||
}
|
||||
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=VR85PcmdMnsofqPUCk6bD4ay"></script>
|
||||
<div class="banner normal sec-banner">
|
||||
@if (string.IsNullOrEmpty(ViewBag.kind.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@ViewBag.kind.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
<div class="banner mobile sec-banner">
|
||||
@if (string.IsNullOrEmpty(ViewBag.kind.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@ViewBag.kind.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="sec-nav">
|
||||
<div class="cont">
|
||||
<ul class="sec-nav-list">
|
||||
@foreach (var k in sameList)
|
||||
{
|
||||
<li class="@(k.Id == Model.KId?"sec-on":"")"><a asp-controller="Article" asp-action="Index" asp-route-id="@(k.Id)" title="@k.KindName">@k.KindName</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
function mbSecNav() {
|
||||
var num = $('.sec-nav-list li').length;
|
||||
if (num >= 3) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 3 / 100) + 'rem' });
|
||||
} else if (num == 2) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 2 / 100) + 'rem' });
|
||||
} else if (num == 1) {
|
||||
$('.sec-nav-list li').css({ 'width': (213 / 100) + 'rem' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 主体内容 -->
|
||||
<div class="content cu au">
|
||||
<div class="cu-bg">
|
||||
<div class="cont">
|
||||
<div class="cu-box">
|
||||
<!-- 地图 -->
|
||||
<div class="cu-left">
|
||||
<div class="maptxt" style="display:none">广东省广州市天河区天河城</div>
|
||||
<div id="map"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// 获取地址
|
||||
function map() {
|
||||
var index;
|
||||
var address = $(".maptxt").text();
|
||||
var title = $(".maptxt").text();
|
||||
showMap(address, title);
|
||||
}
|
||||
// 显示地图
|
||||
function showMap(address, title) {
|
||||
var map = new BMap.Map("map");
|
||||
map.enableScrollWheelZoom(); //启用滚轮放大缩小,默认禁用
|
||||
map.enableContinuousZoom(); //启用地图惯性拖拽,默认禁用
|
||||
map.addControl(new BMap.NavigationControl()); //添加默认缩放平移控件
|
||||
map.addControl(new BMap.OverviewMapControl({ isOpen: false, anchor: BMAP_ANCHOR_BOTTOM_RIGHT })); //右下角,打开, 控制地图的移动
|
||||
map.clearOverlays(); //清空原来的标注
|
||||
|
||||
// 根据地址获取经纬度
|
||||
var localSearch = new BMap.LocalSearch(map);
|
||||
searchByStationName();
|
||||
function searchByStationName() {
|
||||
// 显示地图
|
||||
localSearch.setSearchCompleteCallback(function (searchResult) {
|
||||
var poi = searchResult.getPoi(0);
|
||||
console.log(searchResult.getPoi(0));
|
||||
var marker = new BMap.Marker(new BMap.Point(poi.point.lng, poi.point.lat)); // 创建标注,为要查询的地方对应的经纬度
|
||||
map.centerAndZoom(poi.point, 15);
|
||||
map.addOverlay(marker); //将标注添加到地图中
|
||||
marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
|
||||
});
|
||||
localSearch.search(address);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<!-- 公司信息 -->
|
||||
<div class="cu-right">
|
||||
<div class="cu-title">
|
||||
<span>COMCMS 内容管理系统</span>
|
||||
<small>COMCMS Technology Co.,Ltd</small>
|
||||
</div>
|
||||
<div class="cu-info">
|
||||
<ul>
|
||||
<li>电话:+86-20-88888888</li>
|
||||
<li>传真:+86-20-88888888</li>
|
||||
<li>邮箱:<a href="hogenwang@vip.qq.com">hogenwang@vip.qq.com</a></li>
|
||||
<li>地址:广东省广州市天河区天河城</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("#nav_@(topkid)").addClass("nav-on");
|
||||
map();
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,88 @@
|
||||
@model COMCMS.Core.Article
|
||||
@{
|
||||
ViewBag.title = Model.Title;
|
||||
ViewBag.keywords = Model.Keyword;
|
||||
ViewBag.description = Model.Description;
|
||||
IList<Article> alist = Article.FindAll(Article._.KId == Model.KId, Article._.Sequence.Asc(), null, 0, 0);
|
||||
int topkid = ViewBag.kind.PId > 0 ? ViewBag.kind.PId : ViewBag.kind.Id;
|
||||
//获取同级分类
|
||||
IList<ArticleCategory> sameList = ArticleCategory.FindAll(ArticleCategory._.PId == ViewBag.kind.PId, ArticleCategory._.Rank.Asc(), null, 0, 0);
|
||||
|
||||
}
|
||||
<div class="banner normal sec-banner">
|
||||
@if (string.IsNullOrEmpty(ViewBag.kind.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@ViewBag.kind.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
<div class="banner mobile sec-banner">
|
||||
@if (string.IsNullOrEmpty(ViewBag.kind.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@ViewBag.kind.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="sec-nav">
|
||||
<div class="cont">
|
||||
<ul class="sec-nav-list">
|
||||
@foreach (var k in sameList)
|
||||
{
|
||||
<li class="@(k.Id == Model.KId?"sec-on":"")"><a asp-controller="Article" asp-action="Index" asp-route-id="@(k.Id)" title="@k.KindName">@k.KindName</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
function mbSecNav() {
|
||||
var num = $('.sec-nav-list li').length;
|
||||
if (num >= 3) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 3 / 100) + 'rem' });
|
||||
} else if (num == 2) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 2 / 100) + 'rem' });
|
||||
} else if (num == 1) {
|
||||
$('.sec-nav-list li').css({ 'width': (213 / 100) + 'rem' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 主体内容 -->
|
||||
<div class="content newsD au">
|
||||
<div class="news-bg">
|
||||
<div class="cont">
|
||||
<div class="newsD-title">
|
||||
<span>@Model.Title</span>
|
||||
<small>@Model.AddTime.ToString("yyyy-MM-dd HH:mm")</small>
|
||||
</div>
|
||||
<div class="newsD-text">
|
||||
@Html.Raw(Model.Content)
|
||||
</div>
|
||||
|
||||
<!-- 上下篇 返回 -->
|
||||
<div class="newsD-bottom normal">
|
||||
@*<div class="newsD-b-left">
|
||||
<p>
|
||||
<span>上一篇:</span><a href="/"></a>
|
||||
</p>
|
||||
<p>
|
||||
<span>下一篇:</span>已经最后一篇
|
||||
</p>
|
||||
</div>*@
|
||||
<a asp-controller="Article" asp-action="Index" asp-route-id="@(Model.KId)" class="back-list">[ 返回列表 ]</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("#nav_@(topkid)").addClass("nav-on");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,104 @@
|
||||
@model COMCMS.Core.ArticleCategory
|
||||
@{
|
||||
ViewBag.title = Model.KindName;
|
||||
ViewBag.keywords = Model.Keyword;
|
||||
ViewBag.description = Model.Description;
|
||||
//获取同级分类
|
||||
IList<ArticleCategory> sameList = ArticleCategory.FindAll(ArticleCategory._.PId == Model.PId, ArticleCategory._.Rank.Asc(), null, 0, 0);
|
||||
int topkid = Model.PId > 0 ? Model.PId : Model.Id;
|
||||
}
|
||||
|
||||
<div class="banner normal sec-banner">
|
||||
@if (string.IsNullOrEmpty(Model.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@Model.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
<!-- mb banner -->
|
||||
<div class="banner mobile sec-banner">
|
||||
@if (string.IsNullOrEmpty(Model.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@Model.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
@if (Model.PId > 0)
|
||||
{
|
||||
<div class="sec-nav">
|
||||
<div class="cont">
|
||||
<ul class="sec-nav-list">
|
||||
@foreach (var k in sameList)
|
||||
{
|
||||
<li class="@(k.Id == Model.Id?"sec-on":"")"><a asp-controller="Article" asp-action="Index" asp-route-id="@(k.Id)" title="@k.KindName">@k.KindName</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
function mbSecNav() {
|
||||
var num = $('.sec-nav-list li').length;
|
||||
if (num >= 3) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 3 / 100) + 'rem' });
|
||||
} else if (num == 2) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 2 / 100) + 'rem' });
|
||||
} else if (num == 1) {
|
||||
$('.sec-nav-list li').css({ 'width': (213 / 100) + 'rem' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="content newsC">
|
||||
<div class="news-bg">
|
||||
<div class="cont">
|
||||
<ul class="news-list" id="listComment">
|
||||
@foreach (Article a in ViewBag.list)
|
||||
{
|
||||
<li>
|
||||
<a asp-controller="Article" asp-action="Detail" asp-route-id="@(a.Id)" title="@a.Title">
|
||||
@if (!string.IsNullOrEmpty(a.Pic))
|
||||
{
|
||||
<div class="news-pic">
|
||||
<div class="pic-box">
|
||||
|
||||
<img src="@a.Pic" alt="@a.Title">
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="news-text">
|
||||
<span>@a.Title</span>
|
||||
<p>@Utils.CutString(Utils.NoHTML(a.Content), 200)</p>
|
||||
<small>@a.AddTime.ToString("yyyy-MM-dd HH:mm")</small>
|
||||
<b class="normal">查看详情</b>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
@if (ViewBag.list == null || ViewBag.list.Count < 1)
|
||||
{
|
||||
<li>暂无相关记录...</li>
|
||||
}
|
||||
</ul>
|
||||
<!-- 分页按钮 -->
|
||||
<div class="normal">
|
||||
@Html.Raw(Pages.GetPageStr(ViewBag.pagesize, (int)ViewBag.totalCount, ViewBag.page, $"/Article/Index/{Model.Id}" + "?page={0}", 99, 10, ""))
|
||||
</div>
|
||||
<!-- 点击加载更多 -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("#nav_@(topkid)").addClass("nav-on");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,83 @@
|
||||
@model COMCMS.Core.ArticleCategory
|
||||
@{
|
||||
ViewBag.title = Model.KindName;
|
||||
ViewBag.keywords = Model.Keyword;
|
||||
ViewBag.description = Model.Description;
|
||||
//获取同级分类
|
||||
IList<ArticleCategory> sameList = ArticleCategory.FindAll(ArticleCategory._.PId == Model.PId, ArticleCategory._.Rank.Asc(), null, 0, 0);
|
||||
int topkid = Model.PId > 0 ? Model.PId : Model.Id;
|
||||
}
|
||||
|
||||
<div class="banner normal sec-banner">
|
||||
@if (string.IsNullOrEmpty(Model.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@Model.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
<div class="banner mobile sec-banner">
|
||||
@if (string.IsNullOrEmpty(Model.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@Model.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
@if (Model.PId > 0)
|
||||
{
|
||||
<div class="sec-nav">
|
||||
<div class="cont">
|
||||
<ul class="sec-nav-list">
|
||||
@foreach (var k in sameList)
|
||||
{
|
||||
<li class="@(k.Id == Model.Id?"sec-on":"")"><a asp-controller="Article" asp-action="Index" asp-route-id="@(k.Id)" title="@k.KindName">@k.KindName</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
function mbSecNav() {
|
||||
var num = $('.sec-nav-list li').length;
|
||||
if (num >= 3) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 3 / 100) + 'rem' });
|
||||
} else if (num == 2) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 2 / 100) + 'rem' });
|
||||
} else if (num == 1) {
|
||||
$('.sec-nav-list li').css({ 'width': (213 / 100) + 'rem' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
<!-- 主体内容 -->
|
||||
<div class="content msg au">
|
||||
<div class="cu-bg">
|
||||
<div class="cont">
|
||||
<div class="msg-box">
|
||||
<div class="msg-title">
|
||||
<span>在线留言</span>
|
||||
</div>
|
||||
<form class="msg-form" id="msgForm" onsubmit="return doPostMessage();">
|
||||
<p><label class="normal">姓 名:</label><input type="text" name="name_txt" id="name_txt" value="" placeholder="姓 名:"></p>
|
||||
<p><label class="normal">联系电话:</label><input type="text" name="tel_txt" id="tel_txt" value="" placeholder="联系电话:"></p>
|
||||
<p class="msg-ta"><label class="normal">留言内容:</label><textarea name="content_txt" id="content_txt" rows="8" cols="80" placeholder="留言内容:"></textarea></p>
|
||||
<p><button type="submit">提交留言</button></p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("#nav_@(topkid)").addClass("nav-on");
|
||||
})
|
||||
</script>
|
||||
@@ -1,107 +1,487 @@
|
||||
@{
|
||||
Layout = null;
|
||||
ViewData["Title"] = "Home Page";
|
||||
@using COMCMS.Core.Models
|
||||
@{
|
||||
Config cfg = ViewBag.cfg;
|
||||
ViewBag.title = string.IsNullOrEmpty(cfg.IndexTitle) ? cfg.SiteName : cfg.IndexTitle;
|
||||
ViewBag.keywords = cfg.Keyword;
|
||||
ViewBag.description = cfg.Description;
|
||||
|
||||
Article about = ViewBag.about;
|
||||
|
||||
IList<Link> listLinks = Link.FindAll(Link._.KId == 1, Link._.Sequence.Asc(), null, 0, 0);
|
||||
|
||||
//处理bannr广告
|
||||
var bannerPC = Ads.GetSlideAds(1);
|
||||
var bannerMobile = Ads.GetSlideAds(2);
|
||||
}
|
||||
|
||||
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="1"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="2"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="3"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner" role="listbox">
|
||||
<div class="item active">
|
||||
<img src="~/images/banner1.svg" alt="ASP.NET" class="img-responsive" />
|
||||
<div class="carousel-caption" role="option">
|
||||
<p>
|
||||
Learn how to build ASP.NET apps that can run anywhere.
|
||||
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409">
|
||||
Learn More
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<!-- pc banner -->
|
||||
<div class="banner normal">
|
||||
<div class="swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
@foreach (var img in bannerPC)
|
||||
{
|
||||
<div class="swiper-slide">
|
||||
<a href="@img.link" title="@(img.alt)" style="background: url('@img.img') center top no-repeat; background-size:cover"></a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="~/images/banner2.svg" alt="Visual Studio" class="img-responsive" />
|
||||
<div class="carousel-caption" role="option">
|
||||
<p>
|
||||
There are powerful new features in Visual Studio for building modern web apps.
|
||||
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409">
|
||||
Learn More
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="~/images/banner3.svg" alt="Package Management" class="img-responsive" />
|
||||
<div class="carousel-caption" role="option">
|
||||
<p>
|
||||
Bring in libraries from NuGet and npm, and automate tasks using Grunt or Gulp.
|
||||
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525029&clcid=0x409">
|
||||
Learn More
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="~/images/banner4.svg" alt="Microsoft Azure" class="img-responsive" />
|
||||
<div class="carousel-caption" role="option">
|
||||
<p>
|
||||
Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
|
||||
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409">
|
||||
Learn More
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="cont">
|
||||
<span class="banner-prev"></span>
|
||||
<span class="banner-next"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- mb banner -->
|
||||
<div class="banner mobile">
|
||||
<div class="swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
@foreach (var img in bannerPC)
|
||||
{
|
||||
<div class="swiper-slide">
|
||||
<a href="@img.link" title="@(img.alt)" style="background: url('@img.img') center top no-repeat; background-size: 100%;"></a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
|
||||
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
|
||||
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<h2>Application uses</h2>
|
||||
<ul>
|
||||
<li>Sample pages using ASP.NET Core MVC</li>
|
||||
<li>Theming using <a href="https://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li>
|
||||
</ul>
|
||||
<!-- 主体内容 -->
|
||||
<div class="content">
|
||||
<!--电脑端 三大优势 -->
|
||||
<div class="i-advantage normal">
|
||||
<div class="cont">
|
||||
<ul class="adv-list">
|
||||
<li style="background: #3eb6ec;">
|
||||
<div class="adv-pic">
|
||||
<div class="pic-box">
|
||||
<i class="adv-ico1"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="adv-text">
|
||||
<div class="text-box">
|
||||
<p>
|
||||
<span>基于Asp.net Core开发</span>
|
||||
<small>Development with Asp.net core</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li style="background: #19aaeb;">
|
||||
<div class="adv-pic">
|
||||
<div class="pic-box">
|
||||
<i class="adv-ico2"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="adv-text">
|
||||
<div class="text-box">
|
||||
<p>
|
||||
<span>完全开源</span>
|
||||
<small>Open source</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li style="background: #00a1e9;">
|
||||
<div class="adv-pic" style="width: 140px; width: 1.4rem">
|
||||
<div class="pic-box" style="width: 140px; width: 1.4rem">
|
||||
<i class="adv-ico3"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="adv-text">
|
||||
<div class="text-box">
|
||||
<p>
|
||||
<span>应用广泛</span>
|
||||
<small>Use everywhere</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h2>How to</h2>
|
||||
<ul>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li>
|
||||
</ul>
|
||||
<!--手机端 三大优势 -->
|
||||
<div class="i-advantage mobile">
|
||||
<div class="cont">
|
||||
<ul class="adv-list">
|
||||
<li style="background: #3eb6ec;">
|
||||
<div class="adv-pic">
|
||||
<div class="pic-box">
|
||||
<i class="adv-ico1"></i>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 这一块里面的文字,客户可以后台更换 -->
|
||||
<div class="adv-text">
|
||||
<div class="text-box">
|
||||
<p>
|
||||
<span>基于Asp.net Core开发</span>
|
||||
<small>Development with Asp.net core</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li style="background: #19aaeb;">
|
||||
<div class="adv-pic">
|
||||
<div class="pic-box">
|
||||
<i class="adv-ico2"></i>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 这一块里面的文字,客户可以后台更换 -->
|
||||
<div class="adv-text">
|
||||
<div class="text-box">
|
||||
<p>
|
||||
<span>完全开源</span>
|
||||
<small>Open source</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li style="background: #00a1e9;">
|
||||
<div class="adv-pic" style="width: 140px; width: 1.4rem">
|
||||
<div class="pic-box" style="width: 140px; width: 1.4rem">
|
||||
<i class="adv-ico3"></i>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 这一块里面的文字,客户可以后台更换 -->
|
||||
<div class="adv-text">
|
||||
<div class="text-box">
|
||||
<p>
|
||||
<span>应用广泛</span>
|
||||
<small>Use everywhere</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h2>Overview</h2>
|
||||
<ul>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li>
|
||||
</ul>
|
||||
|
||||
<!-- 公司简介 -->
|
||||
<div class="i-au">
|
||||
<div class="cont">
|
||||
<div class="i-title">
|
||||
<p>
|
||||
<span>公司简介</span>
|
||||
<small>company profile</small>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="i-au-cont">
|
||||
<div class="i-au-left">
|
||||
<div class="pic-box">
|
||||
<a href="/Article/detail/1" title="关于我们">
|
||||
<img src="@(about.Pic)" alt="关于我们">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="i-au-right">
|
||||
<p>
|
||||
@(Utils.CutString(Utils.NoHTML(about.Content), 700))
|
||||
</p>
|
||||
<a href="/Article/detail/1" title="查看详情" class="read-d">查看详情</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h2>Run & Deploy</h2>
|
||||
<ul>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li>
|
||||
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li>
|
||||
</ul>
|
||||
|
||||
<!-- 产品展示 -->
|
||||
<div class="i-pro">
|
||||
<div class="cont">
|
||||
<div class="i-title">
|
||||
<p>
|
||||
<span>产品展示</span>
|
||||
<small>product display</small>
|
||||
</p>
|
||||
</div>
|
||||
@{
|
||||
//获取前5个商品
|
||||
IList<Product> listPorducts = Product.FindAll(null, null, null, 0, 5);
|
||||
}
|
||||
<div class="i-pro-cont" id="div1">
|
||||
<ul class="i-pro-list">
|
||||
@foreach(var p in listPorducts)
|
||||
{
|
||||
<li>
|
||||
<a asp-controller="Product" asp-action="Detail" asp-route-id="@(p.Id)" title="@(p.Title)">
|
||||
<div class="i-pro-top">
|
||||
<div class="i-pro-pic">
|
||||
<div class="pic-box">
|
||||
<img src="@p.Pic" alt="@(p.Title)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="i-pro-hover">
|
||||
<i></i>
|
||||
<span>@(p.Title)</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="i-pro-text mobile">
|
||||
<span>@(p.Title)</span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function proShow() {
|
||||
mr = parseFloat($('.i-pro-list li').css('margin-right'));
|
||||
var odiv = document.getElementById('div1');
|
||||
var oul = odiv.getElementsByTagName('ul')[0];
|
||||
var ali = oul.getElementsByTagName('li');
|
||||
var spa = -2;
|
||||
oul.innerHTML = oul.innerHTML + oul.innerHTML;
|
||||
oul.style.width = (ali[0].offsetWidth + mr) * ali.length + 3 + 'px';
|
||||
function move() {
|
||||
if (oul.offsetLeft < -oul.offsetWidth / 2) {
|
||||
oul.style.left = 0;
|
||||
}
|
||||
oul.style.left = oul.offsetLeft + spa + 'px';
|
||||
}
|
||||
var timer = setInterval(move, 30);
|
||||
|
||||
odiv.onmousemove = function () { clearInterval(timer); }
|
||||
odiv.onmouseout = function () { timer = setInterval(move, 30) };
|
||||
}
|
||||
</script>
|
||||
|
||||
<a asp-controller="Product" asp-action="Index" asp-route-id="1" title="查看更多" class="read-d">查看更多<i></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新闻资讯 -->
|
||||
<div class="i-news">
|
||||
<div class="cont">
|
||||
<div class="i-title">
|
||||
<p>
|
||||
<span>新闻资讯</span>
|
||||
<small>news information</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="i-news-cont">
|
||||
<div class="i-news-btn">
|
||||
<ul class="i-btn-list">
|
||||
<li class="i-news-on">公司新闻</li>
|
||||
<li>行业资讯</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="i-news-main">
|
||||
@{
|
||||
IList<Article> listNews1 = Article.FindAll(Article._.KId == 6, Article._.Sequence.Asc(), null, 0, 4);
|
||||
}
|
||||
<div class="i-news-box">
|
||||
<!-- 左边 -->
|
||||
@if (listNews1.Count > 0)
|
||||
{
|
||||
<div class="i-news-left">
|
||||
<a href="/article/detail/@listNews1[0].Id" title="@listNews1[0].Title">
|
||||
<div class="i-news-pic">
|
||||
<div class="pic-box">
|
||||
<img src="@listNews1[0].Pic" alt="@listNews1[0].Title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="i-news-text">
|
||||
<p class="i-news-title">
|
||||
<span>@listNews1[0].Title</span>
|
||||
<small>@listNews1[0].AddTime.ToString("yyyy-MM-dd")</small>
|
||||
</p>
|
||||
<p class="i-news-t"><span>@Utils.CutString(Utils.NoHTML(listNews1[0].Content),200)</span></p>
|
||||
<b class="normal read-d">查看详情</b>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
<!-- 右边 -->
|
||||
<div class="i-news-right">
|
||||
@if (listNews1.Count > 1)
|
||||
{
|
||||
<ul class="i-news-list">
|
||||
@for(int i=1; i < listNews1.Count; i++)
|
||||
{
|
||||
<li>
|
||||
<a href="/article/detail/@listNews1[i].Id" title="@listNews1[i].Title">
|
||||
<div class="i-news-time">
|
||||
<div class="pic-box">
|
||||
<p>
|
||||
<span>@listNews1[i].AddTime.ToString("dd")</span>
|
||||
<small>@listNews1[i].AddTime.ToString("yyyy-MM")</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="i-news-text2">
|
||||
<span>@listNews1[i].Title</span>
|
||||
<p>@Utils.CutString(Utils.NoHTML(listNews1[i].Content), 100)</p>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
|
||||
</ul>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="i-news-box">
|
||||
<!-- 左边 -->
|
||||
@{
|
||||
IList<Article> listNews2 = Article.FindAll(Article._.KId == 7, Article._.Sequence.Asc(), null, 0, 4);
|
||||
}
|
||||
@if (listNews2.Count > 0)
|
||||
{
|
||||
<div class="i-news-left">
|
||||
<a href="/article/detail/@listNews2[0].Id" title="@listNews2[0].Title">
|
||||
<div class="i-news-pic">
|
||||
<div class="pic-box">
|
||||
<img src="@listNews2[0].Pic" alt="@listNews2[0].Title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="i-news-text">
|
||||
<p class="i-news-title">
|
||||
<span>@listNews2[0].Title</span>
|
||||
<small>@listNews2[0].AddTime.ToString("yyyy-MM-dd")</small>
|
||||
</p>
|
||||
<p class="i-news-t"><span>@Utils.CutString(Utils.NoHTML(listNews2[0].Content), 200)</span></p>
|
||||
<b class="normal read-d">查看详情</b>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
<!-- 右边 -->
|
||||
<div class="i-news-right">
|
||||
@if (listNews2.Count > 1)
|
||||
{
|
||||
<ul class="i-news-list">
|
||||
@for (int i = 1; i < listNews2.Count; i++)
|
||||
{
|
||||
<li>
|
||||
<a href="/article/detail/@listNews2[i].Id" title="@listNews2[i].Title">
|
||||
<div class="i-news-time">
|
||||
<div class="pic-box">
|
||||
<p>
|
||||
<span>@listNews2[i].AddTime.ToString("dd")</span>
|
||||
<small>@listNews2[i].AddTime.ToString("yyyy-MM")</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="i-news-text2">
|
||||
<span>@listNews2[i].Title</span>
|
||||
<p>@Utils.CutString(Utils.NoHTML(listNews2[i].Content), 100)</p>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
iNews();
|
||||
function iNews() {
|
||||
var index = $('.i-news-on').index();
|
||||
$('.i-news-box').eq(index).show();
|
||||
var num = $('.i-btn-list li').length;
|
||||
|
||||
$('.i-btn-list').on('click', 'li', function () {
|
||||
index = $(this).index();
|
||||
for (var i = 0; i < num; i++) {
|
||||
$('.i-btn-list li').eq(i).removeClass('i-news-on');
|
||||
$('.i-news-box').eq(i).hide();
|
||||
}
|
||||
$(this).addClass('i-news-on');
|
||||
$('.i-news-box').eq(index).show();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<!-- 合作伙伴 -->
|
||||
<div class="i-coop">
|
||||
<div class="cont">
|
||||
<div class="i-title">
|
||||
<p>
|
||||
<span>合作伙伴</span>
|
||||
<small>cooperative partner</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="i-coop-cont">
|
||||
<!-- 链接到对应logo的公司官网 -->
|
||||
<div class="swiper-cont">
|
||||
<div class="swiper-container normal">
|
||||
<div class="swiper-wrapper">
|
||||
@foreach (var l in listLinks)
|
||||
{
|
||||
<div class="swiper-slide">
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<a href="@l.LinkURL" class="pic-box" title="@l.Title" target="_blank">
|
||||
<img src="@l.Logo" alt="@l.Title">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-container mobile">
|
||||
<div class="swiper-wrapper">
|
||||
@foreach (var l in listLinks)
|
||||
{
|
||||
<div class="swiper-slide">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="@l.LinkURL" class="pic-box" title="@l.Title" target="_blank">
|
||||
<img src="@l.Logo" alt="@l.Title">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<i class="coop-prev"></i>
|
||||
<i class="coop-next"></i>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var mySwiper2;
|
||||
var mySwiper3;
|
||||
function coopSwiper() {
|
||||
if ($('#main').attr('class') === 'pc') {
|
||||
mySwiper3 = new Swiper('.i-coop-cont .normal', {
|
||||
loop: true,
|
||||
autoplay: 3000,
|
||||
slidesPerView: 5,
|
||||
nextButton: '.coop-next',
|
||||
prevButton: '.coop-prev',
|
||||
});
|
||||
} else if ($('#main').attr('class') === 'mb') {
|
||||
mySwiper4 = new Swiper('.i-coop-cont .mobile', {
|
||||
loop: true,
|
||||
autoplay: 3000,
|
||||
slidesPerView: 2,
|
||||
nextButton: '.coop-next',
|
||||
prevButton: '.coop-prev',
|
||||
});
|
||||
}
|
||||
}
|
||||
var mySwiper = new Swiper('.banner .swiper-container', {
|
||||
loop: true,
|
||||
|
||||
// 如果需要前进后退按钮
|
||||
nextButton: '.banner-next',
|
||||
prevButton: '.banner-prev',
|
||||
autoplay: 3000,
|
||||
})
|
||||
$("#nav_0").addClass("nav-on");
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,87 @@
|
||||
@model COMCMS.Core.Product
|
||||
@{
|
||||
ViewBag.title = Model.Title;
|
||||
ViewBag.keywords = Model.Keyword;
|
||||
ViewBag.description = Model.Description;
|
||||
|
||||
IList<Category> sameList = Category.FindAll(Category._.PId == 0, Category._.Rank.Asc(), null, 0, 0);
|
||||
|
||||
}
|
||||
<div class="banner normal sec-banner">
|
||||
@if (string.IsNullOrEmpty(ViewBag.category.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@ViewBag.category.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
<div class="banner mobile sec-banner">
|
||||
@if (string.IsNullOrEmpty(ViewBag.category.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@ViewBag.category.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="sec-nav">
|
||||
<div class="cont">
|
||||
<ul class="sec-nav-list">
|
||||
@foreach (var k in sameList)
|
||||
{
|
||||
<li class="@(k.Id == Model.KId?"sec-on":"")"><a asp-controller="Product" asp-action="Index" asp-route-id="@(k.Id)" title="@k.KindName">@k.KindName</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
function mbSecNav() {
|
||||
var num = $('.sec-nav-list li').length;
|
||||
if (num >= 3) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 3 / 100) + 'rem' });
|
||||
} else if (num == 2) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 2 / 100) + 'rem' });
|
||||
} else if (num == 1) {
|
||||
$('.sec-nav-list li').css({ 'width': (213 / 100) + 'rem' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 主体内容 -->
|
||||
<div class="content proD proC">
|
||||
<div class="pro-bg">
|
||||
<div class="cont">
|
||||
<div class="proD-title">
|
||||
<span>@Model.Title</span>
|
||||
</div>
|
||||
<div class="proD-text">
|
||||
@if (!string.IsNullOrEmpty(Model.Pic))
|
||||
{
|
||||
<p style="text-align: center"><img alt="" src="@Model.Pic" style="width: 500px; height: 375px" /></p>
|
||||
}
|
||||
|
||||
|
||||
@Html.Raw(Model.Content)
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 主体内容 -->
|
||||
<div class="content au">
|
||||
<div class="au-bg">
|
||||
<div class="cont">
|
||||
@Html.Raw(Model.Content)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$("#nav_P").addClass("nav-on");
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,100 @@
|
||||
@model COMCMS.Core.Category
|
||||
@{
|
||||
ViewBag.title = Model.KindName;
|
||||
ViewBag.keywords = Model.Keyword;
|
||||
ViewBag.description = Model.Description;
|
||||
//获取同级分类
|
||||
IList<Category> sameList = Category.FindAll(Category._.PId == 0, Category._.Rank.Asc(), null, 0, 0);
|
||||
|
||||
}
|
||||
|
||||
<div class="banner normal sec-banner">
|
||||
@if (string.IsNullOrEmpty(Model.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@Model.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
<div class="banner mobile sec-banner">
|
||||
@if (string.IsNullOrEmpty(Model.BannerImg))
|
||||
{
|
||||
<em style="background: url('/images/default/slide-1.jpg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
else
|
||||
{
|
||||
<em style="background: url('@Model.BannerImg') center top no-repeat; background-size: 100%;"></em>
|
||||
}
|
||||
</div>
|
||||
<div class="sec-nav">
|
||||
<div class="cont">
|
||||
<ul class="sec-nav-list">
|
||||
@foreach (var k in sameList)
|
||||
{
|
||||
<li class="@(k.Id == Model.Id?"sec-on":"")"><a asp-controller="Product" asp-action="Index" asp-route-id="@(k.Id)" title="@k.KindName">@k.KindName</a></li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
function mbSecNav() {
|
||||
var num = $('.sec-nav-list li').length;
|
||||
if (num >= 3) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 3 / 100) + 'rem' });
|
||||
} else if (num == 2) {
|
||||
$('.sec-nav-list li').css({ 'width': (640 / 2 / 100) + 'rem' });
|
||||
} else if (num == 1) {
|
||||
$('.sec-nav-list li').css({ 'width': (213 / 100) + 'rem' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 主体内容 -->
|
||||
<div class="content proC">
|
||||
<div class="pro-bg">
|
||||
<div class="cont">
|
||||
<!-- 产品列表 -->
|
||||
<div class="pro-cont">
|
||||
<ul class="pro-list" id="listComment">
|
||||
@foreach (Product p in ViewBag.list)
|
||||
{
|
||||
<li>
|
||||
<a asp-controller="Product" asp-action="Detail" asp-route-id="@(p.Id)" title="@p.Title">
|
||||
<div class="pro-pic">
|
||||
<div class="pic-box">
|
||||
<img src="@p.Pic" alt="@p.Title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="pro-text">
|
||||
<div class="text-box">
|
||||
<span>@p.Title</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 分页按钮 -->
|
||||
<div class="normal">
|
||||
@Html.Raw(Pages.GetPageStr(ViewBag.pagesize, (int)ViewBag.totalCount, ViewBag.page, $"/Product/Index/{Model.Id}" + "?page={0}", 99, 10, ""))
|
||||
</div>
|
||||
<!-- 点击加载更多 -->
|
||||
<div class="click-more mobile" onclick="ShowNextPro();">
|
||||
<i></i>
|
||||
</div>
|
||||
<input type="hidden" name="page" value="1" id="page" />
|
||||
<input type="hidden" name="id" value="1" id="id" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("#nav_P").addClass("nav-on");
|
||||
})
|
||||
</script>
|
||||
@@ -1,71 +1,244 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - COMCMS.Web</title>
|
||||
|
||||
<environment include="Development">
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"
|
||||
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
|
||||
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
|
||||
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
|
||||
</environment>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>@ViewBag.title</title>
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="keywords" content="@ViewBag.keywords">
|
||||
<meta name="description" content="@ViewBag.description">
|
||||
<link href="~/js/swpier/swiper.min.css" rel="stylesheet" />
|
||||
<link href="~/images/default/style.css" rel="stylesheet" />
|
||||
<script src="~/js/html5shiv.min.js"></script>
|
||||
<script src="~/js/jquery2.min.js"></script>
|
||||
<script src="~/js/layer/layer.js"></script>
|
||||
<script src="~/js/jquery.form.js"></script>
|
||||
<script src="~/js/swpier/swiper.min.js"></script>
|
||||
<script src="~/js/public.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">COMCMS.Web</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
|
||||
<li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li>
|
||||
<li><a asp-area="" asp-controller="Home" asp-action="Contact">Contact</a></li>
|
||||
</ul>
|
||||
<div class="pc" id="main" data-change="1">
|
||||
<!-- 头部内容 -->
|
||||
<div class="header">
|
||||
<div class="cont">
|
||||
<a href="/" title="@ViewBag.cfg.SiteName" class="logo">
|
||||
<img src="@ViewBag.cfg.SiteLogo" alt="@ViewBag.cfg.SiteName">
|
||||
</a>
|
||||
<div class="menu-btn" onclick="mbNav()"><p class="pic-box"><i></i></p></div>
|
||||
|
||||
<div class="menu-box">
|
||||
<div class="menu-bg"></div>
|
||||
<ul class="nav-list">
|
||||
<li id="nav_0"><a href="/" title="首页">首页</a><i></i></li>
|
||||
<li id="nav_1"><a asp-controller="Article" asp-action="Index" asp-route-id="1" title="关于我们">关于我们</a><i></i></li>
|
||||
<li id="nav_P"><a asp-controller="Product" asp-action="Index" asp-route-id="1" title="产品中心">产品中心</a><i></i></li>
|
||||
<li id="nav_2"><a asp-controller="Article" asp-action="Index" asp-route-id="2" title="新闻资讯">新闻资讯</a><i></i></li>
|
||||
<li id="nav_3"><a asp-controller="Article" asp-action="Index" asp-route-id="3" title="项目案例">项目案例</a><i></i></li>
|
||||
<li id="nav_4"><a asp-controller="Article" asp-action="Index" asp-route-id="4" title="用户服务">用户服务</a><i></i></li>
|
||||
<li id="nav_5"><a asp-controller="Article" asp-action="Index" asp-route-id="5" title="联系我们">联系我们</a><i></i></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container body-content">
|
||||
@RenderBody()
|
||||
<hr />
|
||||
<footer>
|
||||
<p>© 2018 - COMCMS.Web</p>
|
||||
</footer>
|
||||
<!-- 底部内容 -->
|
||||
@{
|
||||
IList<ArticleCategory> allArticleCategorys = ArticleCategory.GetListTree(0, -1, false, false);
|
||||
IList<Article> aboutlist = Article.FindAll(Article._.KId == 1 & Article._.IsHide ==0, Article._.Sequence.Asc(), null, 0, 0);
|
||||
|
||||
IList<Category> allCategorys = Category.FindAll(Category._.PId==0 & Category._.IsHide ==0, Category._.Rank.Asc(),null,0,0);
|
||||
}
|
||||
<div class="footer">
|
||||
<div class="foot-top">
|
||||
<!-- 底部导航栏 移动端下显示 -->
|
||||
<div class="foot-nav mobile">
|
||||
<ul class="foot-list">
|
||||
|
||||
<li>
|
||||
<a href="javascript:;">关于我们<i></i></a>
|
||||
<ul class="foot-sec-nav">
|
||||
@foreach (Article a in aboutlist)
|
||||
{
|
||||
<li><a asp-controller="Article" asp-action="Detail" asp-route-id="@(a.Id)" title="@a.Title">@a.Title</a></li>
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">产品中心<i></i></a>
|
||||
<ul class="foot-sec-nav">
|
||||
@foreach(Category c in allCategorys)
|
||||
{
|
||||
<li><a asp-controller="Product" asp-action="Index" asp-route-id="@(c.Id)" title="@(c.KindName)">@(c.KindName)</a></li>
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">新闻资讯<i></i></a>
|
||||
<ul class="foot-sec-nav">
|
||||
@foreach (ArticleCategory ac in allArticleCategorys)
|
||||
{
|
||||
if (ac.PId == 2)
|
||||
{
|
||||
<li><a asp-controller="Article" asp-action="Index" asp-route-id="@(ac.Id)" title="@ac.KindName">@ac.KindName</a></li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">用户服务<i></i></a>
|
||||
<ul class="foot-sec-nav">
|
||||
@foreach (ArticleCategory ac in allArticleCategorys)
|
||||
{
|
||||
if (ac.PId == 4)
|
||||
{
|
||||
<li><a asp-controller="Article" asp-action="Index" asp-route-id="@(ac.Id)" title="@ac.KindName">@ac.KindName</a></li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">联系我们<i></i></a>
|
||||
<ul class="foot-sec-nav">
|
||||
@foreach (ArticleCategory ac in allArticleCategorys)
|
||||
{
|
||||
if (ac.PId == 5)
|
||||
{
|
||||
<li><a asp-controller="Article" asp-action="Index" asp-route-id="@(ac.Id)" title="@ac.KindName">@ac.KindName</a></li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<script type="text/javascript">
|
||||
$('.foot-list').on('click', 'a', function () {
|
||||
var num = $('.foot-list > li').length;
|
||||
var showed = $(this).parent('li').find('.foot-sec-nav').is(':visible');
|
||||
var length = $(this).parent('li').find('.foot-sec-nav').length;
|
||||
if (!showed) {
|
||||
for (var i = 0; i < num; i++) {
|
||||
$('.foot-sec-nav').eq(i).slideUp('slow');
|
||||
$('.foot-list > li').eq(i).find('i').stop().removeClass('round1');
|
||||
}
|
||||
if (length > 0) {
|
||||
$(this).parent('li').find('.foot-sec-nav').slideDown('slow');
|
||||
$(this).parent('li').find('i').addClass('round1');
|
||||
}
|
||||
} else {
|
||||
if (length > 0) {
|
||||
$(this).parent('li').find('.foot-sec-nav').slideUp('slow');
|
||||
$(this).parent('li').find('i').removeClass('round1');
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div class="cont">
|
||||
<!-- 底部公司信息 -->
|
||||
<div class="foot-info">
|
||||
<div class="foot-title">
|
||||
<span>COMCMS 内容管理系统</span>
|
||||
<small>COMCMS Technology Co.,Ltd</small>
|
||||
</div>
|
||||
<div class="foot-info-cont">
|
||||
<ul>
|
||||
<li><span><i class="foot-ico3"></i>电话:</span><span>+86-20-88888888</span></li>
|
||||
<li><span><i class="foot-ico1"></i>传真:</span><span>+86-20-88888888</span></li>
|
||||
<li><span><i class="foot-ico2"></i>邮箱:</span><span>hogenwang@vip.qq.com</span></li>
|
||||
<li><span><i class="foot-ico4"></i>地址:</span><span class="foot-address">广东省广州市天河区天河城</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 底部在线留言 -->
|
||||
<div class="foot-msg">
|
||||
<span>在线留言</span>
|
||||
<form class="foot-msg-box" id="footerMessageForm" name="footerMessageForm" onsubmit="return doPostFooterMessage();" asp-antiforgery="true">
|
||||
<p><input type="text" name="name" id="name" value="" placeholder="姓名" required></p>
|
||||
<p><input type="text" name="phone" id="phone" value="" placeholder="电话" required></p>
|
||||
<p class="f-ta"><textarea name="content" id="content" rows="8" cols="80" placeholder="留言内容" required></textarea></p>
|
||||
<p><button type="submit">提 交</button></p>
|
||||
</form>
|
||||
</div>
|
||||
<!-- 底部导航栏 PC版下显示-->
|
||||
<div class="foot-nav normal">
|
||||
<dl class="foot-nav-list">
|
||||
<dt>关于我们</dt>
|
||||
@foreach (Article a in aboutlist)
|
||||
{
|
||||
<dd><a asp-controller="Article" asp-action="Detail" asp-route-id="@(a.Id)" title="@a.Title">@a.Title</a></dd>
|
||||
}
|
||||
</dl>
|
||||
<dl class="foot-nav-list">
|
||||
<dt>新闻资讯</dt>
|
||||
@foreach (ArticleCategory ac in allArticleCategorys)
|
||||
{
|
||||
if (ac.PId == 2)
|
||||
{
|
||||
<dd><a asp-controller="Article" asp-action="Index" asp-route-id="@(ac.Id)" title="@ac.KindName">@ac.KindName</a></dd>
|
||||
}
|
||||
}
|
||||
</dl>
|
||||
<dl class="foot-nav-list">
|
||||
<dt>产品中心</dt>
|
||||
@foreach (Category c in allCategorys)
|
||||
{
|
||||
<dd><a asp-controller="Product" asp-action="Index" asp-route-id="@(c.Id)" title="@(c.KindName)">@(c.KindName)</a></dd>
|
||||
}
|
||||
</dl>
|
||||
<dl class="foot-nav-list">
|
||||
<dt>用户服务</dt>
|
||||
@foreach (ArticleCategory ac in allArticleCategorys)
|
||||
{
|
||||
if (ac.PId == 4)
|
||||
{
|
||||
<dd><a asp-controller="Article" asp-action="Index" asp-route-id="@(ac.Id)" title="@ac.KindName">@ac.KindName</a></dd>
|
||||
}
|
||||
}
|
||||
</dl>
|
||||
<dl class="foot-nav-list">
|
||||
<dt>联系我们</dt>
|
||||
@foreach (ArticleCategory ac in allArticleCategorys)
|
||||
{
|
||||
if (ac.PId == 5)
|
||||
{
|
||||
<dd><a asp-controller="Article" asp-action="Index" asp-route-id="@(ac.Id)" title="@ac.KindName">@ac.KindName</a></dd>
|
||||
}
|
||||
}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="foot-bottom">
|
||||
<div class="cont">
|
||||
<span>@ViewBag.cfg.Copyright <a href="http://www.comcms.com/" target="_blank"> 技术支持:COMCMS</a> <a href="http://www.miitbeian.gov.cn/" target="_blank">粤ICP备8888888号-1</a></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<environment include="Development">
|
||||
<script src="~/lib/jquery/dist/jquery.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js"
|
||||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
|
||||
asp-fallback-test="window.jQuery"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk">
|
||||
</script>
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"
|
||||
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa">
|
||||
</script>
|
||||
<script src="~/js/site.min.js" asp-append-version="true"></script>
|
||||
</environment>
|
||||
<script type="text/javascript">
|
||||
init();
|
||||
$(window).resize(function () {
|
||||
init();
|
||||
});
|
||||
if (!IsPC()) {
|
||||
cds();
|
||||
}
|
||||
//proShow();
|
||||
//coopSwiper();
|
||||
var mySwiper = new Swiper('.banner .swiper-container', {
|
||||
loop: true,
|
||||
|
||||
@RenderSection("Scripts", required: false)
|
||||
// 如果需要前进后退按钮
|
||||
nextButton: '.banner-next',
|
||||
prevButton: '.banner-prev',
|
||||
autoplay: 3000,
|
||||
})
|
||||
|
||||
var mySwiper1 = new Swiper('.banner .mobile', {
|
||||
loop: true,
|
||||
autoplay: 3000,
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
@using COMCMS.Web
|
||||
@using COMCMS.Web.Models
|
||||
@using COMCMS.Core
|
||||
@using COMCMS.Common
|
||||
@using XCode
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"connectionStrings": {
|
||||
"dbconn": {
|
||||
"connectionString": "Server=.;Port=3306;Database=comcms2;Uid=root;Pwd=123456;SslMode=None;charset=utf8mb4",
|
||||
"connectionString": "Server=.;Port=3306;Database=comcms2;Uid=root;Pwd=root;SslMode=None;charset=utf8mb4",
|
||||
"providerName": "MySql.Data.MySqlClient"
|
||||
},
|
||||
"mssqlconnon": {
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
* (1) http://ckeditor.com/builder
|
||||
* Visit online builder to build CKEditor from scratch.
|
||||
*
|
||||
* (2) http://ckeditor.com/builder/d92ab52ffca329d7b5e1b78ef77a81f9
|
||||
* (2) http://ckeditor.com/builder/c3fc0dcaa9c80d707aab3e60fdcddbfb
|
||||
* Visit online builder to build CKEditor, starting with the same setup as before.
|
||||
*
|
||||
* (3) http://ckeditor.com/builder/download/d92ab52ffca329d7b5e1b78ef77a81f9
|
||||
* (3) http://ckeditor.com/builder/download/c3fc0dcaa9c80d707aab3e60fdcddbfb
|
||||
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
|
||||
*
|
||||
* NOTE:
|
||||
@@ -38,6 +38,7 @@ var CKBUILDER_CONFIG = {
|
||||
'.jshintignore',
|
||||
'.jshintrc',
|
||||
'.mailmap',
|
||||
'.npm',
|
||||
'.travis.yml',
|
||||
'bender-err.log',
|
||||
'bender-out.log',
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
CKEDITOR.dialog.add("a11yHelp",function(e){var a=e.lang.a11yhelp,b=e.lang.common.keyboard,q=CKEDITOR.tools.getNextId(),d={8:b[8],9:a.tab,13:b[13],16:b[16],17:b[17],18:b[18],19:a.pause,20:a.capslock,27:a.escape,33:a.pageUp,34:a.pageDown,35:b[35],36:b[36],37:a.leftArrow,38:a.upArrow,39:a.rightArrow,40:a.downArrow,45:a.insert,46:b[46],91:a.leftWindowKey,92:a.rightWindowKey,93:a.selectKey,96:a.numpad0,97:a.numpad1,98:a.numpad2,99:a.numpad3,100:a.numpad4,101:a.numpad5,102:a.numpad6,103:a.numpad7,104:a.numpad8,
|
||||
105:a.numpad9,106:a.multiply,107:a.add,109:a.subtract,110:a.decimalPoint,111:a.divide,112:a.f1,113:a.f2,114:a.f3,115:a.f4,116:a.f5,117:a.f6,118:a.f7,119:a.f8,120:a.f9,121:a.f10,122:a.f11,123:a.f12,144:a.numLock,145:a.scrollLock,186:a.semiColon,187:a.equalSign,188:a.comma,189:a.dash,190:a.period,191:a.forwardSlash,192:a.graveAccent,219:a.openBracket,220:a.backSlash,221:a.closeBracket,222:a.singleQuote};d[CKEDITOR.ALT]=b[18];d[CKEDITOR.SHIFT]=b[16];d[CKEDITOR.CTRL]=CKEDITOR.env.mac?b[224]:b[17];var k=
|
||||
[CKEDITOR.ALT,CKEDITOR.SHIFT,CKEDITOR.CTRL],r=/\$\{(.*?)\}/g,t=function(a,b){var c=e.getCommandKeystroke(b);if(c){for(var l,f,h=[],g=0;g<k.length;g++)f=k[g],l=c/k[g],1<l&&2>=l&&(c-=f,h.push(d[f]));h.push(d[c]||String.fromCharCode(c));c=h.join("+")}else c=a;return c};return{title:a.title,minWidth:600,minHeight:400,contents:[{id:"info",label:e.lang.common.generalTab,expand:!0,elements:[{type:"html",id:"legends",style:"white-space:normal;",focus:function(){this.getElement().focus()},html:function(){for(var b=
|
||||
'\x3cdiv class\x3d"cke_accessibility_legend" role\x3d"document" aria-labelledby\x3d"'+q+'_arialbl" tabIndex\x3d"-1"\x3e%1\x3c/div\x3e\x3cspan id\x3d"'+q+'_arialbl" class\x3d"cke_voice_label"\x3e'+a.contents+" \x3c/span\x3e",d=[],c=a.legend,l=c.length,f=0;f<l;f++){for(var h=c[f],g=[],e=h.items,k=e.length,p=0;p<k;p++){var m=e[p],n=CKEDITOR.env.edge&&m.legendEdge?m.legendEdge:m.legend,n=n.replace(r,t);n.match(r)||g.push("\x3cdt\x3e%1\x3c/dt\x3e\x3cdd\x3e%2\x3c/dd\x3e".replace("%1",m.name).replace("%2",
|
||||
n))}d.push("\x3ch1\x3e%1\x3c/h1\x3e\x3cdl\x3e%2\x3c/dl\x3e".replace("%1",h.name).replace("%2",g.join("")))}return b.replace("%1",d.join(""))}()+'\x3cstyle type\x3d"text/css"\x3e.cke_accessibility_legend{width:600px;height:400px;padding-right:5px;overflow-y:auto;overflow-x:hidden;}.cke_browser_quirks .cke_accessibility_legend,{height:390px}.cke_accessibility_legend *{white-space:normal;}.cke_accessibility_legend h1{font-size: 20px;border-bottom: 1px solid #AAA;margin: 5px 0px 15px;}.cke_accessibility_legend dl{margin-left: 5px;}.cke_accessibility_legend dt{font-size: 13px;font-weight: bold;}.cke_accessibility_legend dd{margin:10px}\x3c/style\x3e'}]}],
|
||||
CKEDITOR.dialog.add("a11yHelp",function(f){function m(a){for(var b,c,h=[],d=0;d<g.length;d++)c=g[d],b=a/g[d],1<b&&2>=b&&(a-=c,h.push(e[c]));h.push(e[a]||String.fromCharCode(a));return h.join("+")}function t(a,b){var c=f.getCommandKeystroke(b,!0);return c.length?CKEDITOR.tools.array.map(c,m).join(" / "):a}var a=f.lang.a11yhelp,b=f.lang.common.keyboard,p=CKEDITOR.tools.getNextId(),q=/\$\{(.*?)\}/g,g=[CKEDITOR.ALT,CKEDITOR.SHIFT,CKEDITOR.CTRL],e={8:b[8],9:a.tab,13:b[13],16:b[16],17:b[17],18:b[18],19:a.pause,
|
||||
20:a.capslock,27:a.escape,33:a.pageUp,34:a.pageDown,35:b[35],36:b[36],37:a.leftArrow,38:a.upArrow,39:a.rightArrow,40:a.downArrow,45:a.insert,46:b[46],91:a.leftWindowKey,92:a.rightWindowKey,93:a.selectKey,96:a.numpad0,97:a.numpad1,98:a.numpad2,99:a.numpad3,100:a.numpad4,101:a.numpad5,102:a.numpad6,103:a.numpad7,104:a.numpad8,105:a.numpad9,106:a.multiply,107:a.add,109:a.subtract,110:a.decimalPoint,111:a.divide,112:a.f1,113:a.f2,114:a.f3,115:a.f4,116:a.f5,117:a.f6,118:a.f7,119:a.f8,120:a.f9,121:a.f10,
|
||||
122:a.f11,123:a.f12,144:a.numLock,145:a.scrollLock,186:a.semiColon,187:a.equalSign,188:a.comma,189:a.dash,190:a.period,191:a.forwardSlash,192:a.graveAccent,219:a.openBracket,220:a.backSlash,221:a.closeBracket,222:a.singleQuote};e[CKEDITOR.ALT]=b[18];e[CKEDITOR.SHIFT]=b[16];e[CKEDITOR.CTRL]=CKEDITOR.env.mac?b[224]:b[17];return{title:a.title,minWidth:600,minHeight:400,contents:[{id:"info",label:f.lang.common.generalTab,expand:!0,elements:[{type:"html",id:"legends",style:"white-space:normal;",focus:function(){this.getElement().focus()},
|
||||
html:function(){for(var b='\x3cdiv class\x3d"cke_accessibility_legend" role\x3d"document" aria-labelledby\x3d"'+p+'_arialbl" tabIndex\x3d"-1"\x3e%1\x3c/div\x3e\x3cspan id\x3d"'+p+'_arialbl" class\x3d"cke_voice_label"\x3e'+a.contents+" \x3c/span\x3e",e=[],c=a.legend,h=c.length,d=0;d<h;d++){for(var f=c[d],g=[],r=f.items,m=r.length,n=0;n<m;n++){var k=r[n],l=CKEDITOR.env.edge&&k.legendEdge?k.legendEdge:k.legend,l=l.replace(q,t);l.match(q)||g.push("\x3cdt\x3e%1\x3c/dt\x3e\x3cdd\x3e%2\x3c/dd\x3e".replace("%1",
|
||||
k.name).replace("%2",l))}e.push("\x3ch1\x3e%1\x3c/h1\x3e\x3cdl\x3e%2\x3c/dl\x3e".replace("%1",f.name).replace("%2",g.join("")))}return b.replace("%1",e.join(""))}()+'\x3cstyle type\x3d"text/css"\x3e.cke_accessibility_legend{width:600px;height:400px;padding-right:5px;overflow-y:auto;overflow-x:hidden;}.cke_browser_quirks .cke_accessibility_legend,{height:390px}.cke_accessibility_legend *{white-space:normal;}.cke_accessibility_legend h1{font-size: 20px;border-bottom: 1px solid #AAA;margin: 5px 0px 15px;}.cke_accessibility_legend dl{margin-left: 5px;}.cke_accessibility_legend dt{font-size: 13px;font-weight: bold;}.cke_accessibility_legend dd{margin:10px}\x3c/style\x3e'}]}],
|
||||
buttons:[CKEDITOR.dialog.cancelButton]}});
|
||||
@@ -6,7 +6,7 @@ CKEDITOR.plugins.setLang("a11yhelp","hu",{title:"Kisegítő utasítások",conten
|
||||
legend:"Párbeszédablakban nyomjon TAB-ot a következő párbeszédmezőhöz ugráshoz, nyomjon SHIFT + TAB-ot az előző mezőhöz ugráshoz, nyomjon ENTER-t a párbeszédablak elfogadásához, nyomjon ESC-et a párbeszédablak elvetéséhez. Azokhoz a párbeszédablakokhoz, amik több fület tartalmaznak, nyomjon ALT + F10-et vagy TAB-ot hogy a fülekre ugorjon. Ezután a TAB-al vagy a JOBB NYÍLLAL a következő fülre ugorhat."},{name:"Szerkesztő helyi menü",legend:"Nyomjon ${contextMenu}-t vagy ALKALMAZÁS BILLENTYŰT a helyi menü megnyitásához. Ezután a következő menüpontra léphet a TAB vagy LEFELÉ NYÍLLAL. Az előző opciót a SHIFT+TAB vagy FELFELÉ NYÍLLAL érheti el. Nyomjon SPACE-t vagy ENTER-t a menüpont kiválasztásához. A jelenlegi menüpont almenüjének megnyitásához nyomjon SPACE-t vagy ENTER-t, vagy JOBB NYILAT. A főmenühöz való visszatéréshez nyomjon ESC-et vagy BAL NYILAT. A helyi menü bezárása az ESC billentyűvel lehetséges."},
|
||||
{name:"Szerkesztő lista",legend:"A listán belül a következő elemre a TAB vagy LEFELÉ NYÍLLAL mozoghat. Az előző elem kiválasztásához nyomjon SHIFT+TAB-ot vagy FELFELÉ NYILAT. Nyomjon SPACE-t vagy ENTER-t az elem kiválasztásához. Az ESC billentyű megnyomásával bezárhatja a listát."},{name:"Szerkesztő elem utak sáv",legend:"Nyomj ${elementsPathFocus} hogy kijelöld a elemek út sávját. A következő elem gombhoz a TAB-al vagy a JOBB NYÍLLAL juthatsz el. Az előző gombhoz a SHIFT+TAB vagy BAL NYÍLLAL mehetsz. A SPACE vagy ENTER billentyűvel kiválaszthatod az elemet a szerkesztőben."}]},
|
||||
{name:"Parancsok",items:[{name:"Parancs visszavonása",legend:"Nyomj ${undo}"},{name:"Parancs megismétlése",legend:"Nyomjon ${redo}"},{name:"Félkövér parancs",legend:"Nyomjon ${bold}"},{name:"Dőlt parancs",legend:"Nyomjon ${italic}"},{name:"Aláhúzott parancs",legend:"Nyomjon ${underline}"},{name:"Link parancs",legend:"Nyomjon ${link}"},{name:"Szerkesztősáv összecsukása parancs",legend:"Nyomjon ${toolbarCollapse}"},{name:"Hozzáférés az előző fókusz helyhez parancs",legend:"Nyomj ${accessNextSpace} hogy hozzáférj a legközelebbi elérhetetlen fókusz helyhez a hiányjel előtt, például: két szomszédos HR elemhez. Ismételd meg a billentyűkombinációt hogy megtaláld a távolabbi fókusz helyeket."},
|
||||
{name:"Hozzáférés a következő fókusz helyhez parancs",legend:"Nyomj ${accessNextSpace} hogy hozzáférj a legközelebbi elérhetetlen fókusz helyhez a hiányjel után, például: két szomszédos HR elemhez. Ismételd meg a billentyűkombinációt hogy megtaláld a távolabbi fókusz helyeket."},{name:"Kisegítő súgó",legend:"Nyomjon ${a11yHelp}"},{name:"Beillesztés egyszerű szövegként",legend:"Nyomd meg: ${pastetext}",legendEdge:"Nyomj ${pastetext}, majd ${paste}"}]}],tab:"Tab",pause:"Pause",capslock:"Caps Lock",
|
||||
{name:"Hozzáférés a következő fókusz helyhez parancs",legend:"Nyomj ${accessNextSpace} hogy hozzáférj a legközelebbi elérhetetlen fókusz helyhez a hiányjel után, például: két szomszédos HR elemhez. Ismételd meg a billentyűkombinációt hogy megtaláld a távolabbi fókusz helyeket."},{name:"Kisegítő súgó",legend:"Nyomjon ${a11yHelp}"},{name:"Beillesztés egyszerű szövegként",legend:"Nyomja meg: ${pastetext}",legendEdge:"Nyomjon ${pastetext}-t, majd ${paste}-t"}]}],tab:"Tab",pause:"Pause",capslock:"Caps Lock",
|
||||
escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",leftArrow:"balra nyíl",upArrow:"felfelé nyíl",rightArrow:"jobbra nyíl",downArrow:"lefelé nyíl",insert:"Insert",leftWindowKey:"bal Windows-billentyű",rightWindowKey:"jobb Windows-billentyű",selectKey:"Billentyű választása",numpad0:"Számbillentyűk 0",numpad1:"Számbillentyűk 1",numpad2:"Számbillentyűk 2",numpad3:"Számbillentyűk 3",numpad4:"Számbillentyűk 4",numpad5:"Számbillentyűk 5",numpad6:"Számbillentyűk 6",numpad7:"Számbillentyűk 7",numpad8:"Számbillentyűk 8",
|
||||
numpad9:"Számbillentyűk 9",multiply:"Szorzás",add:"Hozzáadás",subtract:"Kivonás",decimalPoint:"Tizedespont",divide:"Osztás",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Pontosvessző",equalSign:"Egyenlőségjel",comma:"Vessző",dash:"Kötőjel",period:"Pont",forwardSlash:"Perjel",graveAccent:"Visszafelé dőlő ékezet",openBracket:"Nyitó szögletes zárójel",backSlash:"fordított perjel",closeBracket:"Záró szögletes zárójel",
|
||||
singleQuote:"szimpla idézőjel"});
|
||||
@@ -3,9 +3,10 @@
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
CKEDITOR.plugins.setLang("a11yhelp","sq",{title:"Udhëzimet e Qasjes",contents:"Përmbajtja ndihmëse. Për ta mbyllur dialogun shtyp ESC.",legend:[{name:"Të përgjithshme",items:[{name:"Shiriti i Redaktuesit",legend:"Shtyp ${toolbarFocus} për të shfletuar kokështrirjen. Kalo tek grupi paraprak ose pasues i shiritit përmes kombinacionit TAB dhe SHIFT+TAB, në tastierë. Kalo tek pulla paraprake ose pasuese e kokështrirjes përmes SHIGJETË DJATHTAS ose SHIGJETËS MAJTAS, në tastierë. Shtyp HAPËSIRË ose ENTER Move to the next and previous toolbar button with RIGHT ARROW për të aktivizuar pullën e kokështrirjes."},
|
||||
{name:"Dialogu i Redaktuesit",legend:"Inside a dialog, press TAB to navigate to the next dialog element, press SHIFT+TAB to move to the previous dialog element, press ENTER to submit the dialog, press ESC to cancel the dialog. When a dialog has multiple tabs, the tab list can be reached either with ALT+F10 or with TAB as part of the dialog tabbing order. With tab list focused, move to the next and previous tab with RIGHT and LEFT ARROW, respectively."},{name:"Menyja Kontestuese e Redaktorit",legend:"Press ${contextMenu} or APPLICATION KEY to open context-menu. Then move to next menu option with TAB or DOWN ARROW. Move to previous option with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the menu option. Open sub-menu of current option with SPACE or ENTER or RIGHT ARROW. Go back to parent menu item with ESC or LEFT ARROW. Close context menu with ESC."},
|
||||
{name:"Kutiza e Listës së Redaktuesit",legend:"Inside a list-box, move to next list item with TAB OR DOWN ARROW. Move to previous list item with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the list option. Press ESC to close the list-box."},{name:"Shiriti i Rrugës së Elementeve të Redaktorit",legend:"Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor."}]},
|
||||
{name:"Komandat",items:[{name:"Rikthe komandën",legend:"Shtyp ${undo}"},{name:"Ribëj komandën",legend:"Shtyp ${redo}"},{name:"Komanda e trashjes së tekstit",legend:"Shtyp ${bold}"},{name:"Komanda kursive",legend:"Shtyp ${italic}"},{name:"Komanda e nënvijëzimit",legend:"Shtyp ${underline}"},{name:"Komanda e Nyjes",legend:"Shtyp ${link}"},{name:"Komanda e Mbjedhjes së Kokështrirjes",legend:"Shtyp ${toolbarCollapse}"},{name:" Access previous focus space command",legend:"Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},
|
||||
{name:" Access next focus space command",legend:"Press ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},{name:"Ndihmë Qasjeje",legend:"Shtyp ${a11yHelp}"},{name:"Hidhe tërë tekstin e thjeshtë",legend:"Shtyp ${pastetext}",legendEdge:"Shtyp ${pastetext}, pasuar nga ${paste}"}]}],tab:"Fletë",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",
|
||||
leftArrow:"Shenja majtas",upArrow:"Shenja sipër",rightArrow:"Shenja djathtas",downArrow:"Shenja poshtë",insert:"Shto",leftWindowKey:"Pulla Majtas e Windows-it",rightWindowKey:"Pulla Djathtas e Windows-it",selectKey:"Pulla Përzgjedhëse",numpad0:"Numpad 0",numpad1:"Numpad 1",numpad2:"Numpad 2",numpad3:"Numpad 3",numpad4:"Numpad 4",numpad5:"Numpad 5",numpad6:"Numpad 6",numpad7:"Numpad 7",numpad8:"Numpad 8",numpad9:"Numpad 9",multiply:"Shumëzo",add:"Shto",subtract:"Zbrit",decimalPoint:"Pika Decimale",
|
||||
divide:"Pjesëto",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Semicolon",equalSign:"Shenja e Barazimit",comma:"Presje",dash:"vizë",period:"Pikë",forwardSlash:"Forward Slash",graveAccent:"Grave Accent",openBracket:"Hape kllapën",backSlash:"Backslash",closeBracket:"Mbylle kllapën",singleQuote:"Thonjëz e vetme"});
|
||||
{name:"Dialogu i Redaktuesit",legend:"Në brendi të dialogut, shtyp TAB për të kaluar tek elementi tjetër i dialogut, shtyp SHIFT+TAB për të kaluar tek elementi paraprak i dialogut, shtyp ENTER për të shtuar dialogun, shtyp ESC për të anuluar dialogun. Kur një dialog ka më shumë fletë, lista e fletëve mund të hapet përmes ALT+F10 ose përmes TAB si pjesë e radhitjes së fletëve të dialogut. Me listën e fokusuar të fletëve,kalo tek fleta paraprake dhe pasuese përmes SHIGJETËS MAJSA ose DJATHTAS."},{name:"Menyja Kontestuese e Redaktorit",
|
||||
legend:"Shtyp ${contextMenu} ose APPLICATION KEY për të hapur menynë kontekstuale. Pastaj kalo tek mundësia tjetër e menysë përmes TAB ose SHIGJETËS POSHTË. Kalo tek mundësia paraprake përmes SHIFT+TAB ose SHIGJETA SIPËR. Shtyp SPACE ose ENTER për të përzgjedhur mundësinë e menysë. Hape nënmenynë e mundësisë aktuale përmes tastës HAPËSIRË ose ENTER ose SHIGJETËS DJATHTAS. Kalo prapa tek artikulli i menysë prind përmes ESC ose SHIGJETËS MAJTAS. Mbylle menynë kontekstuale përmes ESC."},{name:"Kutiza e Listës së Redaktuesit",
|
||||
legend:"Brenda kutisë së listës, kalo tek artikulli pasues i listës përmes TAB ose SHIGJETËS POSHTË. Kalo tek artikulli paraprak i listës përmes SHIFT+TAB ose SHIGJETËS SIPËR. Shtyp tastën HAPËSIRË ose ENTER për të përzgjedhur mundësitë e listës. Shtyp ESC për të mbyllur kutinë e listës."},{name:"Shiriti i Rrugës së Elementeve të Redaktorit",legend:"Shtyp ${elementsPathFocus} për të lëvizur tek shiriti i elementeve. Kalo tek pulla pasuese e elementit përmes TAB ose SHIGJETËS DJATHTAS. Kalo tek pulla paraprake përmes SHIFT+TAB ose SHIGJETËS MAJTAS. Shtyp tastën HAPËSIRË ose ENTER për të përzgjedhur elementin tek redaktuesi."}]},
|
||||
{name:"Komandat",items:[{name:"Rikthe komandën",legend:"Shtyp ${undo}"},{name:"Ribëj komandën",legend:"Shtyp ${redo}"},{name:"Komanda e trashjes së tekstit",legend:"Shtyp ${bold}"},{name:"Komanda kursive",legend:"Shtyp ${italic}"},{name:"Komanda e nënvijëzimit",legend:"Shtyp ${underline}"},{name:"Komanda e Nyjes",legend:"Shtyp ${link}"},{name:"Komanda e Mbjedhjes së Kokështrirjes",legend:"Shtyp ${toolbarCollapse}"},{name:"Qasu komandës paraprake të hapësirës së fokusimit",legend:"Shtyp ${accessPreviousSpace} për t'iu qasur hapësirës më të afërt të paarritshme të fokusimit para simbolit ^, për shembull: dy elemente të afërt HR. Përsërit kombinacionin e tasteve për të arritur hapësirë të largët fokusimi."},
|
||||
{name:"Qasu komandës pasuese të hapësirës së fokusimit",legend:"Shtyp ${accessNextSpace} për t'iu qasur hapësirës më të afërt të paarritshme të fokusimit pas shenjës ^, për shembull: dy elemente të afërt HR. Përsërit kombinacionin e tasteve për të arritur hapësirën e largët të fokusimit."},{name:"Ndihmë Qasjeje",legend:"Shtyp ${a11yHelp}"},{name:"Hidhe si tekst të thjeshtë",legend:"Shtyp ${pastetext}",legendEdge:"Shtyp ${pastetext}, pasuar nga ${paste}"}]}],tab:"Tab",pause:"Pause",capslock:"Caps Lock",
|
||||
escape:"Escape",pageUp:"Faqja sipër",pageDown:"Faqja poshtë",leftArrow:"Shigjeta majtas",upArrow:"Shigjeta sipër",rightArrow:"Shigjeta djathtas",downArrow:"Shigjeta poshtë",insert:"Insert",leftWindowKey:"Pulla Majtas e Windows-it",rightWindowKey:"Pulla Djathtas e Windows-it",selectKey:"Pulla Përzgjedhëse",numpad0:"Numpad 0",numpad1:"Numpad 1",numpad2:"Numpad 2",numpad3:"Numpad 3",numpad4:"Numpad 4",numpad5:"Numpad 5",numpad6:"Numpad 6",numpad7:"Numpad 7",numpad8:"Numpad 8",numpad9:"Numpad 9",multiply:"Shumëzo",
|
||||
add:"Shto",subtract:"Zbrit",decimalPoint:"Pika Decimale",divide:"Pjesëto",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Pikëpresje",equalSign:"Shenja e Barazimit",comma:"Presje",dash:"minus",period:"Pikë",forwardSlash:"Vija e pjerrët përpara",graveAccent:"Shenja e theksit",openBracket:"Hape kllapën",backSlash:"Vija e pjerrët prapa",closeBracket:"Mbylle kllapën",singleQuote:"Thonjëz e vetme"});
|
||||
@@ -3,7 +3,7 @@
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
CKEDITOR.dialog.add("paste",function(c){function k(a){var b=new CKEDITOR.dom.document(a.document),g=b.getBody(),d=b.getById("cke_actscrpt");d&&d.remove();g.setAttribute("contenteditable",!0);g.on(e.mainPasteEvent,function(a){a=e.initPasteDataTransfer(a);f?a!=f&&(f=e.initPasteDataTransfer()):f=a});if(CKEDITOR.env.ie&&8>CKEDITOR.env.version)b.getWindow().on("blur",function(){b.$.selection.empty()});b.on("keydown",function(a){a=a.data;var b;switch(a.getKeystroke()){case 27:this.hide();b=1;break;case 9:case CKEDITOR.SHIFT+
|
||||
9:this.changeFocus(1),b=1}b&&a.preventDefault()},this);c.fire("ariaWidget",new CKEDITOR.dom.element(a.frameElement));b.getWindow().getFrame().removeCustomData("pendingFocus")&&g.focus()}var h=c.lang.clipboard,e=CKEDITOR.plugins.clipboard,f;c.on("pasteDialogCommit",function(a){a.data&&c.fire("paste",{type:"auto",dataValue:a.data.dataValue,method:"paste",dataTransfer:a.data.dataTransfer||e.initPasteDataTransfer()})},null,null,1E3);return{title:h.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:
|
||||
9:this.changeFocus(1),b=1}b&&a.preventDefault()},this);c.fire("ariaWidget",new CKEDITOR.dom.element(a.frameElement));b.getWindow().getFrame().removeCustomData("pendingFocus")&&g.focus()}var h=c.lang.clipboard,e=CKEDITOR.plugins.clipboard,f;c.on("pasteDialogCommit",function(a){a.data&&c.fire("paste",{type:"auto",dataValue:a.data.dataValue,method:"paste",dataTransfer:a.data.dataTransfer||e.initPasteDataTransfer()})},null,null,1E3);return{title:h.paste,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:
|
||||
350,minHeight:CKEDITOR.env.quirks?250:245,onShow:function(){this.parts.dialog.$.offsetHeight;this.setupContent();this._.committed=!1},onLoad:function(){(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&"rtl"==c.lang.dir&&this.parts.contents.setStyle("overflow","hidden")},onOk:function(){this.commitContent()},contents:[{id:"general",label:c.lang.common.generalTab,elements:[{type:"html",id:"pasteMsg",html:'\x3cdiv style\x3d"white-space:normal;width:340px"\x3e'+h.pasteMsg+"\x3c/div\x3e"},{type:"html",
|
||||
id:"editing_area",style:"width:100%;height:100%",html:"",focus:function(){var a=this.getInputElement(),b=a.getFrameDocument().getBody();!b||b.isReadOnly()?a.setCustomData("pendingFocus",1):b.focus()},setup:function(){var a=this.getDialog(),b='\x3chtml dir\x3d"'+c.config.contentsLangDirection+'" lang\x3d"'+(c.config.contentsLanguage||c.langCode)+'"\x3e\x3chead\x3e\x3cstyle\x3ebody{margin:3px;height:95%;word-break:break-all;}\x3c/style\x3e\x3c/head\x3e\x3cbody\x3e\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"\x3ewindow.parent.CKEDITOR.tools.callFunction('+
|
||||
CKEDITOR.tools.addFunction(k,a)+",this);\x3c/script\x3e\x3c/body\x3e\x3c/html\x3e",g=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+'})())"':"",d=CKEDITOR.dom.element.createFromHtml('\x3ciframe class\x3d"cke_pasteframe" frameborder\x3d"0" allowTransparency\x3d"true" src\x3d"'+g+'" aria-label\x3d"'+h.pasteArea+'" aria-describedby\x3d"'+a.getContentElement("general",
|
||||
|
||||
@@ -6,4 +6,4 @@ CKEDITOR.dialog.add("checkbox",function(d){return{title:d.lang.forms.checkboxAnd
|
||||
label:d.lang.forms.checkboxAndRadio.checkboxTitle,title:d.lang.forms.checkboxAndRadio.checkboxTitle,startupFocus:"txtName",elements:[{id:"txtName",type:"text",label:d.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"txtValue",type:"text",label:d.lang.forms.checkboxAndRadio.value,
|
||||
"default":"",accessKey:"V",setup:function(a){a=a.getAttribute("value");this.setValue(CKEDITOR.env.ie&&"on"==a?"":a)},commit:function(a){var b=a.element,c=this.getValue();!c||CKEDITOR.env.ie&&"on"==c?CKEDITOR.env.ie?(c=new CKEDITOR.dom.element("input",b.getDocument()),b.copyAttributes(c,{value:1}),c.replace(b),d.getSelection().selectElement(c),a.element=c):b.removeAttribute("value"):b.setAttribute("value",c)}},{id:"cmbSelected",type:"checkbox",label:d.lang.forms.checkboxAndRadio.selected,"default":"",
|
||||
accessKey:"S",value:"checked",setup:function(a){this.setValue(a.getAttribute("checked"))},commit:function(a){var b=a.element;if(CKEDITOR.env.ie){var c=!!b.getAttribute("checked"),e=!!this.getValue();c!=e&&(c=CKEDITOR.dom.element.createFromHtml('\x3cinput type\x3d"checkbox"'+(e?' checked\x3d"checked"':"")+"/\x3e",d.document),b.copyAttributes(c,{type:1,checked:1}),c.replace(b),d.getSelection().selectElement(c),a.element=c)}else a=this.getValue(),CKEDITOR.env.webkit&&(b.$.checked=a),a?b.setAttribute("checked",
|
||||
"checked"):b.removeAttribute("checked")}},{id:"required",type:"checkbox",label:d.lang.forms.checkboxAndRadio.required,"default":"",accessKey:"Q",value:"required",setup:function(a){this.setValue(a.getAttribute("required"))},commit:function(a){a=a.element;this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
|
||||
"checked"):b.removeAttribute("checked")}},{id:"required",type:"checkbox",label:d.lang.forms.checkboxAndRadio.required,"default":"",accessKey:"Q",value:"required",setup:CKEDITOR.plugins.forms._setupRequiredAttribute,commit:function(a){a=a.element;this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
|
||||
@@ -5,5 +5,5 @@
|
||||
CKEDITOR.dialog.add("radio",function(c){return{title:c.lang.forms.checkboxAndRadio.radioTitle,minWidth:350,minHeight:140,onShow:function(){delete this.radioButton;var a=this.getParentEditor().getSelection().getSelectedElement();a&&"input"==a.getName()&&"radio"==a.getAttribute("type")&&(this.radioButton=a,this.setupContent(a))},onOk:function(){var a,b=this.radioButton;b||(a=this.getParentEditor(),b=a.document.createElement("input"),b.setAttribute("type","radio"),a.insertElement(b));this.commitContent({element:b})},
|
||||
contents:[{id:"info",label:c.lang.forms.checkboxAndRadio.radioTitle,title:c.lang.forms.checkboxAndRadio.radioTitle,elements:[{id:"name",type:"text",label:c.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"value",type:"text",label:c.lang.forms.checkboxAndRadio.value,"default":"",
|
||||
accessKey:"V",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:function(a){a=a.element;this.getValue()?a.setAttribute("value",this.getValue()):a.removeAttribute("value")}},{id:"checked",type:"checkbox",label:c.lang.forms.checkboxAndRadio.selected,"default":"",accessKey:"S",value:"checked",setup:function(a){this.setValue(a.getAttribute("checked"))},commit:function(a){var b=a.element;if(CKEDITOR.env.ie){var d=b.getAttribute("checked"),e=!!this.getValue();d!=e&&(d=CKEDITOR.dom.element.createFromHtml('\x3cinput type\x3d"radio"'+
|
||||
(e?' checked\x3d"checked"':"")+"\x3e\x3c/input\x3e",c.document),b.copyAttributes(d,{type:1,checked:1}),d.replace(b),e&&d.setAttribute("checked","checked"),c.getSelection().selectElement(d),a.element=d)}else a=this.getValue(),CKEDITOR.env.webkit&&(b.$.checked=a),a?b.setAttribute("checked","checked"):b.removeAttribute("checked")}},{id:"required",type:"checkbox",label:c.lang.forms.checkboxAndRadio.required,"default":"",accessKey:"Q",value:"required",setup:function(a){this.setValue(a.getAttribute("required"))},
|
||||
(e?' checked\x3d"checked"':"")+"\x3e\x3c/input\x3e",c.document),b.copyAttributes(d,{type:1,checked:1}),d.replace(b),e&&d.setAttribute("checked","checked"),c.getSelection().selectElement(d),a.element=d)}else a=this.getValue(),CKEDITOR.env.webkit&&(b.$.checked=a),a?b.setAttribute("checked","checked"):b.removeAttribute("checked")}},{id:"required",type:"checkbox",label:c.lang.forms.checkboxAndRadio.required,"default":"",accessKey:"Q",value:"required",setup:CKEDITOR.plugins.forms._setupRequiredAttribute,
|
||||
commit:function(a){a=a.element;this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
|
||||
@@ -17,4 +17,5 @@ setup:function(a,b){if("clear"==a)m(this);else if("option"==a){var e=b.getValue(
|
||||
a.getContentElement("info","cmbName"),a=a.getContentElement("info","cmbValue"),c=g(d);0<=c&&(q(d,c,b.getValue(),b.getValue()),q(a,c,e.getValue(),e.getValue()))}},{type:"button",id:"btnUp",style:"width:100%;",label:c.lang.forms.select.btnUp,title:c.lang.forms.select.btnUp,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue");l(b,-1,a.getParentEditor().document);l(c,-1,a.getParentEditor().document)}},{type:"button",id:"btnDown",style:"width:100%;",
|
||||
label:c.lang.forms.select.btnDown,title:c.lang.forms.select.btnDown,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue");l(b,1,a.getParentEditor().document);l(c,1,a.getParentEditor().document)}}]}]},{type:"hbox",widths:["40%","20%","40%"],children:[{type:"button",id:"btnSetValue",label:c.lang.forms.select.btnSetValue,title:c.lang.forms.select.btnSetValue,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbValue");
|
||||
a.getContentElement("info","txtValue").setValue(b.getValue())}},{type:"button",id:"btnDelete",label:c.lang.forms.select.btnDelete,title:c.lang.forms.select.btnDelete,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue"),d=a.getContentElement("info","txtOptName"),a=a.getContentElement("info","txtOptValue");p(b);p(c);d.setValue("");a.setValue("")}},{type:"vbox",children:[{id:"chkMulti",type:"checkbox",label:c.lang.forms.select.chkMulti,
|
||||
"default":"",accessKey:"M",value:"checked",setup:function(a,b){"select"==a&&this.setValue(b.getAttribute("multiple"))},commit:function(a){this.getValue()?a.setAttribute("multiple",this.getValue()):a.removeAttribute("multiple")}},{id:"required",type:"checkbox",label:c.lang.forms.select.required,"default":"",accessKey:"Q",value:"checked",setup:function(a,b){"select"==a&&this.setValue(b.getAttribute("required"))},commit:function(a){this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}]}]}});
|
||||
"default":"",accessKey:"M",value:"checked",setup:function(a,b){"select"==a&&this.setValue(b.getAttribute("multiple"))},commit:function(a){this.getValue()?a.setAttribute("multiple",this.getValue()):a.removeAttribute("multiple")}},{id:"required",type:"checkbox",label:c.lang.forms.select.required,"default":"",accessKey:"Q",value:"checked",setup:function(a,b){"select"==a&&CKEDITOR.plugins.forms._setupRequiredAttribute.call(this,b)},commit:function(a){this.getValue()?a.setAttribute("required","required"):
|
||||
a.removeAttribute("required")}}]}]}]}]}});
|
||||
@@ -5,4 +5,4 @@
|
||||
CKEDITOR.dialog.add("textarea",function(b){return{title:b.lang.forms.textarea.title,minWidth:350,minHeight:220,onShow:function(){delete this.textarea;var a=this.getParentEditor().getSelection().getSelectedElement();a&&"textarea"==a.getName()&&(this.textarea=a,this.setupContent(a))},onOk:function(){var a,b=this.textarea,c=!b;c&&(a=this.getParentEditor(),b=a.document.createElement("textarea"));this.commitContent(b);c&&a.insertElement(b)},contents:[{id:"info",label:b.lang.forms.textarea.title,title:b.lang.forms.textarea.title,
|
||||
elements:[{id:"_cke_saved_name",type:"text",label:b.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{type:"hbox",widths:["50%","50%"],children:[{id:"cols",type:"text",label:b.lang.forms.textarea.cols,"default":"",accessKey:"C",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),
|
||||
setup:function(a){a=a.hasAttribute("cols")&&a.getAttribute("cols");this.setValue(a||"")},commit:function(a){this.getValue()?a.setAttribute("cols",this.getValue()):a.removeAttribute("cols")}},{id:"rows",type:"text",label:b.lang.forms.textarea.rows,"default":"",accessKey:"R",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),setup:function(a){a=a.hasAttribute("rows")&&a.getAttribute("rows");this.setValue(a||"")},commit:function(a){this.getValue()?a.setAttribute("rows",
|
||||
this.getValue()):a.removeAttribute("rows")}}]},{id:"value",type:"textarea",label:b.lang.forms.textfield.value,"default":"",setup:function(a){this.setValue(a.$.defaultValue)},commit:function(a){a.$.value=a.$.defaultValue=this.getValue()}},{id:"required",type:"checkbox",label:b.lang.forms.textfield.required,"default":"",accessKey:"Q",value:"required",setup:function(a){this.setValue(a.getAttribute("required"))},commit:function(a){this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
|
||||
this.getValue()):a.removeAttribute("rows")}}]},{id:"value",type:"textarea",label:b.lang.forms.textfield.value,"default":"",setup:function(a){this.setValue(a.$.defaultValue)},commit:function(a){a.$.value=a.$.defaultValue=this.getValue()}},{id:"required",type:"checkbox",label:b.lang.forms.textfield.required,"default":"",accessKey:"Q",value:"required",setup:CKEDITOR.plugins.forms._setupRequiredAttribute,commit:function(a){this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
|
||||
@@ -7,5 +7,5 @@ a.getAttribute("type")||(this.textField=a,this.setupContent(a))},onOk:function()
|
||||
elements:[{type:"hbox",widths:["50%","50%"],children:[{id:"_cke_saved_name",type:"text",label:b.lang.forms.textfield.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"value",type:"text",label:b.lang.forms.textfield.value,"default":"",accessKey:"V",commit:function(a){if(CKEDITOR.env.ie&&
|
||||
!this.getValue()){var d=a.element,c=new CKEDITOR.dom.element("input",b.document);d.copyAttributes(c,{value:1});c.replace(d);a.element=c}else e.call(this,a)}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"size",type:"text",label:b.lang.forms.textfield.charWidth,"default":"",accessKey:"C",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed)},{id:"maxLength",type:"text",label:b.lang.forms.textfield.maxChars,"default":"",accessKey:"M",style:"width:50px",
|
||||
validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed)}],onLoad:function(){CKEDITOR.env.ie7Compat&&this.getElement().setStyle("zoom","100%")}},{id:"type",type:"select",label:b.lang.forms.textfield.type,"default":"text",accessKey:"M",items:[[b.lang.forms.textfield.typeEmail,"email"],[b.lang.forms.textfield.typePass,"password"],[b.lang.forms.textfield.typeSearch,"search"],[b.lang.forms.textfield.typeTel,"tel"],[b.lang.forms.textfield.typeText,"text"],[b.lang.forms.textfield.typeUrl,
|
||||
"url"]],setup:function(a){this.setValue(a.getAttribute("type"))},commit:function(a){var d=a.element;if(CKEDITOR.env.ie){var c=d.getAttribute("type"),e=this.getValue();c!=e&&(c=CKEDITOR.dom.element.createFromHtml('\x3cinput type\x3d"'+e+'"\x3e\x3c/input\x3e',b.document),d.copyAttributes(c,{type:1}),c.replace(d),a.element=c)}else d.setAttribute("type",this.getValue())}},{id:"required",type:"checkbox",label:b.lang.forms.textfield.required,"default":"",accessKey:"Q",value:"required",setup:function(a){this.setValue(a.getAttribute("required"))},
|
||||
"url"]],setup:function(a){this.setValue(a.getAttribute("type"))},commit:function(a){var d=a.element;if(CKEDITOR.env.ie){var c=d.getAttribute("type"),e=this.getValue();c!=e&&(c=CKEDITOR.dom.element.createFromHtml('\x3cinput type\x3d"'+e+'"\x3e\x3c/input\x3e',b.document),d.copyAttributes(c,{type:1}),c.replace(d),a.element=c)}else d.setAttribute("type",this.getValue())}},{id:"required",type:"checkbox",label:b.lang.forms.textfield.required,"default":"",accessKey:"Q",value:"required",setup:CKEDITOR.plugins.forms._setupRequiredAttribute,
|
||||
commit:function(a){a=a.element;this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
|
||||
@@ -2,37 +2,37 @@
|
||||
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
(function(){var v=function(d,l){function v(){var a=arguments,b=this.getContentElement("advanced","txtdlgGenStyle");b&&b.commit.apply(b,a);this.foreach(function(b){b.commit&&"txtdlgGenStyle"!=b.id&&b.commit.apply(b,a)})}function k(a){if(!w){w=1;var b=this.getDialog(),c=b.imageElement;if(c){this.commit(1,c);a=[].concat(a);for(var d=a.length,f,g=0;g<d;g++)(f=b.getContentElement.apply(b,a[g].split(":")))&&f.setup(1,c)}w=0}}var m=/^\s*(\d+)((px)|\%)?\s*$/i,z=/(^\s*(\d+)((px)|\%)?\s*$)|^$/i,r=/^\d+px$/,
|
||||
A=function(){var a=this.getValue(),b=this.getDialog(),c=a.match(m);c&&("%"==c[2]&&n(b,!1),a=c[1]);b.lockRatio&&(c=b.originalElement,"true"==c.getCustomData("isReady")&&("txtHeight"==this.id?(a&&"0"!=a&&(a=Math.round(a/c.$.height*c.$.width)),isNaN(a)||b.setValueOf("info","txtWidth",a)):(a&&"0"!=a&&(a=Math.round(a/c.$.width*c.$.height)),isNaN(a)||b.setValueOf("info","txtHeight",a))));e(b)},e=function(a){if(!a.originalElement||!a.preview)return 1;a.commitContent(4,a.preview);return 0},w,n=function(a,
|
||||
b){if(!a.getContentElement("info","ratioLock"))return null;var c=a.originalElement;if(!c)return null;if("check"==b){if(!a.userlockRatio&&"true"==c.getCustomData("isReady")){var d=a.getValueOf("info","txtWidth"),f=a.getValueOf("info","txtHeight"),c=1E3*c.$.width/c.$.height,g=1E3*d/f;a.lockRatio=!1;d||f?isNaN(c)||isNaN(g)||Math.round(c)!=Math.round(g)||(a.lockRatio=!0):a.lockRatio=!0}}else void 0!==b?a.lockRatio=b:(a.userlockRatio=1,a.lockRatio=!a.lockRatio);d=CKEDITOR.document.getById(t);a.lockRatio?
|
||||
d.removeClass("cke_btn_unlocked"):d.addClass("cke_btn_unlocked");d.setAttribute("aria-checked",a.lockRatio);CKEDITOR.env.hc&&d.getChild(0).setHtml(a.lockRatio?CKEDITOR.env.ie?"■":"▣":CKEDITOR.env.ie?"□":"▢");return a.lockRatio},B=function(a,b){var c=a.originalElement;if("true"==c.getCustomData("isReady")){var d=a.getContentElement("info","txtWidth"),f=a.getContentElement("info","txtHeight"),g;b?c=g=0:(g=c.$.width,c=c.$.height);d&&d.setValue(g);f&&f.setValue(c)}e(a)},C=function(a,b){function c(a,b){var c=
|
||||
a.match(m);return c?("%"==c[2]&&(c[1]+="%",n(d,!1)),c[1]):b}if(1==a){var d=this.getDialog(),f="",g="txtWidth"==this.id?"width":"height",e=b.getAttribute(g);e&&(f=c(e,f));f=c(b.getStyle(g),f);this.setValue(f)}},x,u=function(){var a=this.originalElement,b=CKEDITOR.document.getById(p);a.setCustomData("isReady","true");a.removeListener("load",u);a.removeListener("error",h);a.removeListener("abort",h);b&&b.setStyle("display","none");this.dontResetSize||B(this,!1===d.config.image_prefillDimensions);this.firstLoad&&
|
||||
CKEDITOR.tools.setTimeout(function(){n(this,"check")},0,this);this.dontResetSize=this.firstLoad=!1;e(this)},h=function(){var a=this.originalElement,b=CKEDITOR.document.getById(p);a.removeListener("load",u);a.removeListener("error",h);a.removeListener("abort",h);a=CKEDITOR.getUrl(CKEDITOR.plugins.get("image").path+"images/noimage.png");this.preview&&this.preview.setAttribute("src",a);b&&b.setStyle("display","none");n(this,!1)},q=function(a){return CKEDITOR.tools.getNextId()+"_"+a},t=q("btnLockSizes"),
|
||||
y=q("btnResetSize"),p=q("ImagePreviewLoader"),E=q("previewLink"),D=q("previewImage");return{title:d.lang.image["image"==l?"title":"titleButton"],minWidth:"moono-lisa"==(CKEDITOR.skinName||d.config.skin)?500:420,minHeight:360,onShow:function(){this.linkEditMode=this.imageEditMode=this.linkElement=this.imageElement=!1;this.lockRatio=!0;this.userlockRatio=0;this.dontResetSize=!1;this.firstLoad=!0;this.addLink=!1;var a=this.getParentEditor(),b=a.getSelection(),c=(b=b&&b.getSelectedElement())&&a.elementPath(b).contains("a",
|
||||
1),d=CKEDITOR.document.getById(p);d&&d.setStyle("display","none");x=new CKEDITOR.dom.element("img",a.document);this.preview=CKEDITOR.document.getById(D);this.originalElement=a.document.createElement("img");this.originalElement.setAttribute("alt","");this.originalElement.setCustomData("isReady","false");c&&(this.linkElement=c,this.addLink=this.linkEditMode=!0,a=c.getChildren(),1==a.count()&&(d=a.getItem(0),d.type==CKEDITOR.NODE_ELEMENT&&(d.is("img")||d.is("input"))&&(this.imageElement=a.getItem(0),
|
||||
this.imageElement.is("img")?this.imageEditMode="img":this.imageElement.is("input")&&(this.imageEditMode="input"))),"image"==l&&this.setupContent(2,c));if(this.customImageElement)this.imageEditMode="img",this.imageElement=this.customImageElement,delete this.customImageElement;else if(b&&"img"==b.getName()&&!b.data("cke-realelement")||b&&"input"==b.getName()&&"image"==b.getAttribute("type"))this.imageEditMode=b.getName(),this.imageElement=b;this.imageEditMode&&(this.cleanImageElement=this.imageElement,
|
||||
this.imageElement=this.cleanImageElement.clone(!0,!0),this.setupContent(1,this.imageElement));n(this,!0);CKEDITOR.tools.trim(this.getValueOf("info","txtUrl"))||(this.preview.removeAttribute("src"),this.preview.setStyle("display","none"))},onOk:function(){if(this.imageEditMode){var a=this.imageEditMode;"image"==l&&"input"==a&&confirm(d.lang.image.button2Img)?(this.imageElement=d.document.createElement("img"),this.imageElement.setAttribute("alt",""),d.insertElement(this.imageElement)):"image"!=l&&"img"==
|
||||
a&&confirm(d.lang.image.img2Button)?(this.imageElement=d.document.createElement("input"),this.imageElement.setAttributes({type:"image",alt:""}),d.insertElement(this.imageElement)):(this.imageElement=this.cleanImageElement,delete this.cleanImageElement)}else"image"==l?this.imageElement=d.document.createElement("img"):(this.imageElement=d.document.createElement("input"),this.imageElement.setAttribute("type","image")),this.imageElement.setAttribute("alt","");this.linkEditMode||(this.linkElement=d.document.createElement("a"));
|
||||
this.commitContent(1,this.imageElement);this.commitContent(2,this.linkElement);this.imageElement.getAttribute("style")||this.imageElement.removeAttribute("style");this.imageEditMode?!this.linkEditMode&&this.addLink?(d.insertElement(this.linkElement),this.imageElement.appendTo(this.linkElement)):this.linkEditMode&&!this.addLink&&(d.getSelection().selectElement(this.linkElement),d.insertElement(this.imageElement)):this.addLink?this.linkEditMode?this.linkElement.equals(d.getSelection().getSelectedElement())?
|
||||
(this.linkElement.setHtml(""),this.linkElement.append(this.imageElement,!1)):d.insertElement(this.imageElement):(d.insertElement(this.linkElement),this.linkElement.append(this.imageElement,!1)):d.insertElement(this.imageElement)},onLoad:function(){"image"!=l&&this.hidePage("Link");var a=this._.element.getDocument();this.getContentElement("info","ratioLock")&&(this.addFocusable(a.getById(y),5),this.addFocusable(a.getById(t),5));this.commitContent=v},onHide:function(){this.preview&&this.commitContent(8,
|
||||
this.preview);this.originalElement&&(this.originalElement.removeListener("load",u),this.originalElement.removeListener("error",h),this.originalElement.removeListener("abort",h),this.originalElement.remove(),this.originalElement=!1);delete this.imageElement},contents:[{id:"info",label:d.lang.image.infoTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["280px","110px"],align:"right",className:"cke_dialog_image_url",children:[{id:"txtUrl",type:"text",label:d.lang.common.url,
|
||||
required:!0,onChange:function(){var a=this.getDialog(),b=this.getValue();if(0<b.length){var a=this.getDialog(),c=a.originalElement;a.preview&&a.preview.removeStyle("display");c.setCustomData("isReady","false");var d=CKEDITOR.document.getById(p);d&&d.setStyle("display","");c.on("load",u,a);c.on("error",h,a);c.on("abort",h,a);c.setAttribute("src",b);a.preview&&(x.setAttribute("src",b),a.preview.setAttribute("src",x.$.src),e(a))}else a.preview&&(a.preview.removeAttribute("src"),a.preview.setStyle("display",
|
||||
"none"))},setup:function(a,b){if(1==a){var c=b.data("cke-saved-src")||b.getAttribute("src");this.getDialog().dontResetSize=!0;this.setValue(c);this.setInitValue()}},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())?(b.data("cke-saved-src",this.getValue()),b.setAttribute("src",this.getValue())):8==a&&(b.setAttribute("src",""),b.removeAttribute("src"))},validate:CKEDITOR.dialog.validate.notEmpty(d.lang.image.urlMissing)},{type:"button",id:"browse",style:"display:inline-block;margin-top:14px;",
|
||||
align:"center",label:d.lang.common.browseServer,hidden:!0,filebrowser:"info:txtUrl"}]}]},{id:"txtAlt",type:"text",label:d.lang.image.alt,accessKey:"T","default":"",onChange:function(){e(this.getDialog())},setup:function(a,b){1==a&&this.setValue(b.getAttribute("alt"))},commit:function(a,b){1==a?(this.getValue()||this.isChanged())&&b.setAttribute("alt",this.getValue()):4==a?b.setAttribute("alt",this.getValue()):8==a&&b.removeAttribute("alt")}},{type:"hbox",children:[{id:"basic",type:"vbox",children:[{type:"hbox",
|
||||
requiredContent:"img{width,height}",widths:["50%","50%"],children:[{type:"vbox",padding:1,children:[{type:"text",width:"45px",id:"txtWidth",label:d.lang.common.width,onKeyUp:A,onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(z);(a=!(!a||0===parseInt(a[1],10)))||alert(d.lang.common.invalidLength.replace("%1",d.lang.common.width).replace("%2","px, %"));return a},setup:C,commit:function(a,b){var c=this.getValue();1==a?(c&&d.activeFilter.check("img{width,height}")?
|
||||
b.setStyle("width",CKEDITOR.tools.cssLength(c)):b.removeStyle("width"),b.removeAttribute("width")):4==a?c.match(m)?b.setStyle("width",CKEDITOR.tools.cssLength(c)):(c=this.getDialog().originalElement,"true"==c.getCustomData("isReady")&&b.setStyle("width",c.$.width+"px")):8==a&&(b.removeAttribute("width"),b.removeStyle("width"))}},{type:"text",id:"txtHeight",width:"45px",label:d.lang.common.height,onKeyUp:A,onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(z);
|
||||
(a=!(!a||0===parseInt(a[1],10)))||alert(d.lang.common.invalidLength.replace("%1",d.lang.common.height).replace("%2","px, %"));return a},setup:C,commit:function(a,b){var c=this.getValue();1==a?(c&&d.activeFilter.check("img{width,height}")?b.setStyle("height",CKEDITOR.tools.cssLength(c)):b.removeStyle("height"),b.removeAttribute("height")):4==a?c.match(m)?b.setStyle("height",CKEDITOR.tools.cssLength(c)):(c=this.getDialog().originalElement,"true"==c.getCustomData("isReady")&&b.setStyle("height",c.$.height+
|
||||
"px")):8==a&&(b.removeAttribute("height"),b.removeStyle("height"))}}]},{id:"ratioLock",type:"html",className:"cke_dialog_image_ratiolock",style:"margin-top:30px;width:40px;height:40px;",onLoad:function(){var a=CKEDITOR.document.getById(y),b=CKEDITOR.document.getById(t);a&&(a.on("click",function(a){B(this);a.data&&a.data.preventDefault()},this.getDialog()),a.on("mouseover",function(){this.addClass("cke_btn_over")},a),a.on("mouseout",function(){this.removeClass("cke_btn_over")},a));b&&(b.on("click",
|
||||
function(a){n(this);var b=this.originalElement,d=this.getValueOf("info","txtWidth");"true"==b.getCustomData("isReady")&&d&&(b=b.$.height/b.$.width*d,isNaN(b)||(this.setValueOf("info","txtHeight",Math.round(b)),e(this)));a.data&&a.data.preventDefault()},this.getDialog()),b.on("mouseover",function(){this.addClass("cke_btn_over")},b),b.on("mouseout",function(){this.removeClass("cke_btn_over")},b))},html:'\x3cdiv\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+d.lang.image.lockRatio+
|
||||
'" class\x3d"cke_btn_locked" id\x3d"'+t+'" role\x3d"checkbox"\x3e\x3cspan class\x3d"cke_icon"\x3e\x3c/span\x3e\x3cspan class\x3d"cke_label"\x3e'+d.lang.image.lockRatio+'\x3c/span\x3e\x3c/a\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+d.lang.image.resetSize+'" class\x3d"cke_btn_reset" id\x3d"'+y+'" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3e'+d.lang.image.resetSize+"\x3c/span\x3e\x3c/a\x3e\x3c/div\x3e"}]},{type:"vbox",padding:1,children:[{type:"text",id:"txtBorder",
|
||||
requiredContent:"img{border-width}",width:"60px",label:d.lang.image.border,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateBorder),setup:function(a,b){if(1==a){var c;c=(c=(c=b.getStyle("border-width"))&&c.match(/^(\d+px)(?: \1 \1 \1)?$/))&&parseInt(c[1],10);isNaN(parseInt(c,10))&&(c=b.getAttribute("border"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),
|
||||
10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&b.removeStyle("border"):(b.setStyle("border-width",CKEDITOR.tools.cssLength(c)),b.setStyle("border-style","solid")),1==a&&b.removeAttribute("border")):8==a&&(b.removeAttribute("border"),b.removeStyle("border-width"),b.removeStyle("border-style"),b.removeStyle("border-color"))}},{type:"text",id:"txtHSpace",requiredContent:"img{margin-left,margin-right}",width:"60px",label:d.lang.image.hSpace,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){k.call(this,
|
||||
"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateHSpace),setup:function(a,b){if(1==a){var c,d;c=b.getStyle("margin-left");d=b.getStyle("margin-right");c=c&&c.match(r);d=d&&d.match(r);c=parseInt(c,10);d=parseInt(d,10);c=c==d&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("hspace"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&(b.removeStyle("margin-left"),b.removeStyle("margin-right")):(b.setStyle("margin-left",
|
||||
CKEDITOR.tools.cssLength(c)),b.setStyle("margin-right",CKEDITOR.tools.cssLength(c))),1==a&&b.removeAttribute("hspace")):8==a&&(b.removeAttribute("hspace"),b.removeStyle("margin-left"),b.removeStyle("margin-right"))}},{type:"text",id:"txtVSpace",requiredContent:"img{margin-top,margin-bottom}",width:"60px",label:d.lang.image.vSpace,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateVSpace),
|
||||
setup:function(a,b){if(1==a){var c,d;c=b.getStyle("margin-top");d=b.getStyle("margin-bottom");c=c&&c.match(r);d=d&&d.match(r);c=parseInt(c,10);d=parseInt(d,10);c=c==d&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("vspace"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&(b.removeStyle("margin-top"),b.removeStyle("margin-bottom")):(b.setStyle("margin-top",CKEDITOR.tools.cssLength(c)),b.setStyle("margin-bottom",CKEDITOR.tools.cssLength(c))),
|
||||
1==a&&b.removeAttribute("vspace")):8==a&&(b.removeAttribute("vspace"),b.removeStyle("margin-top"),b.removeStyle("margin-bottom"))}},{id:"cmbAlign",requiredContent:"img{float}",type:"select",widths:["35%","65%"],style:"width:90px",label:d.lang.common.align,"default":"",items:[[d.lang.common.notSet,""],[d.lang.common.left,"left"],[d.lang.common.right,"right"]],onChange:function(){e(this.getDialog());k.call(this,"advanced:txtdlgGenStyle")},setup:function(a,b){if(1==a){var c=b.getStyle("float");switch(c){case "inherit":case "none":c=
|
||||
""}!c&&(c=(b.getAttribute("align")||"").toLowerCase());this.setValue(c)}},commit:function(a,b){var c=this.getValue();if(1==a||4==a){if(c?b.setStyle("float",c):b.removeStyle("float"),1==a)switch(c=(b.getAttribute("align")||"").toLowerCase(),c){case "left":case "right":b.removeAttribute("align")}}else 8==a&&b.removeStyle("float")}}]}]},{type:"vbox",height:"250px",children:[{type:"html",id:"htmlPreview",style:"width:95%;",html:"\x3cdiv\x3e"+CKEDITOR.tools.htmlEncode(d.lang.common.preview)+'\x3cbr\x3e\x3cdiv id\x3d"'+
|
||||
p+'" class\x3d"ImagePreviewLoader" style\x3d"display:none"\x3e\x3cdiv class\x3d"loading"\x3e\x26nbsp;\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"ImagePreviewBox"\x3e\x3ctable\x3e\x3ctr\x3e\x3ctd\x3e\x3ca href\x3d"javascript:void(0)" target\x3d"_blank" onclick\x3d"return false;" id\x3d"'+E+'"\x3e\x3cimg id\x3d"'+D+'" alt\x3d"" /\x3e\x3c/a\x3e'+(d.config.image_previewText||"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.")+
|
||||
(function(){var u=function(d,k){function u(){var a=arguments,b=this.getContentElement("advanced","txtdlgGenStyle");b&&b.commit.apply(b,a);this.foreach(function(b){b.commit&&"txtdlgGenStyle"!=b.id&&b.commit.apply(b,a)})}function g(a){if(!v){v=1;var b=this.getDialog(),c=b.imageElement;if(c){this.commit(1,c);a=[].concat(a);for(var d=a.length,h,e=0;e<d;e++)(h=b.getContentElement.apply(b,a[e].split(":")))&&h.setup(1,c)}v=0}}var l=/^\s*(\d+)((px)|\%)?\s*$/i,y=/(^\s*(\d+)((px)|\%)?\s*$)|^$/i,q=/^\d+px$/,
|
||||
z=function(){var a=this.getValue(),b=this.getDialog(),c=a.match(l);c&&("%"==c[2]&&m(b,!1),a=c[1]);b.lockRatio&&(c=b.originalElement,"true"==c.getCustomData("isReady")&&("txtHeight"==this.id?(a&&"0"!=a&&(a=Math.round(a/c.$.height*c.$.width)),isNaN(a)||b.setValueOf("info","txtWidth",a)):(a&&"0"!=a&&(a=Math.round(a/c.$.width*c.$.height)),isNaN(a)||b.setValueOf("info","txtHeight",a))));e(b)},e=function(a){if(!a.originalElement||!a.preview)return 1;a.commitContent(4,a.preview);return 0},v,m=function(a,
|
||||
b){if(!a.getContentElement("info","ratioLock"))return null;var c=a.originalElement;if(!c)return null;if("check"==b){if(!a.userlockRatio&&"true"==c.getCustomData("isReady")){var d=a.getValueOf("info","txtWidth"),h=a.getValueOf("info","txtHeight"),c=c.$.width/c.$.height,e=d/h;a.lockRatio=!1;d||h?1==Math.round(c/e*100)/100&&(a.lockRatio=!0):a.lockRatio=!0}}else void 0!==b?a.lockRatio=b:(a.userlockRatio=1,a.lockRatio=!a.lockRatio);d=CKEDITOR.document.getById(r);a.lockRatio?d.removeClass("cke_btn_unlocked"):
|
||||
d.addClass("cke_btn_unlocked");d.setAttribute("aria-checked",a.lockRatio);CKEDITOR.env.hc&&d.getChild(0).setHtml(a.lockRatio?CKEDITOR.env.ie?"■":"▣":CKEDITOR.env.ie?"□":"▢");return a.lockRatio},A=function(a,b){var c=a.originalElement;if("true"==c.getCustomData("isReady")){var d=a.getContentElement("info","txtWidth"),h=a.getContentElement("info","txtHeight"),f;b?c=f=0:(f=c.$.width,c=c.$.height);d&&d.setValue(f);h&&h.setValue(c)}e(a)},B=function(a,b){function c(a,b){var c=a.match(l);return c?("%"==
|
||||
c[2]&&(c[1]+="%",m(d,!1)),c[1]):b}if(1==a){var d=this.getDialog(),e="",f="txtWidth"==this.id?"width":"height",g=b.getAttribute(f);g&&(e=c(g,e));e=c(b.getStyle(f),e);this.setValue(e)}},w,t=function(){var a=this.originalElement,b=CKEDITOR.document.getById(n);a.setCustomData("isReady","true");a.removeListener("load",t);a.removeListener("error",f);a.removeListener("abort",f);b&&b.setStyle("display","none");this.dontResetSize||A(this,!1===d.config.image_prefillDimensions);this.firstLoad&&CKEDITOR.tools.setTimeout(function(){m(this,
|
||||
"check")},0,this);this.dontResetSize=this.firstLoad=!1;e(this)},f=function(){var a=this.originalElement,b=CKEDITOR.document.getById(n);a.removeListener("load",t);a.removeListener("error",f);a.removeListener("abort",f);a=CKEDITOR.getUrl(CKEDITOR.plugins.get("image").path+"images/noimage.png");this.preview&&this.preview.setAttribute("src",a);b&&b.setStyle("display","none");m(this,!1)},p=function(a){return CKEDITOR.tools.getNextId()+"_"+a},r=p("btnLockSizes"),x=p("btnResetSize"),n=p("ImagePreviewLoader"),
|
||||
D=p("previewLink"),C=p("previewImage");return{title:d.lang.image["image"==k?"title":"titleButton"],minWidth:"moono-lisa"==(CKEDITOR.skinName||d.config.skin)?500:420,minHeight:360,onShow:function(){this.linkEditMode=this.imageEditMode=this.linkElement=this.imageElement=!1;this.lockRatio=!0;this.userlockRatio=0;this.dontResetSize=!1;this.firstLoad=!0;this.addLink=!1;var a=this.getParentEditor(),b=a.getSelection(),c=(b=b&&b.getSelectedElement())&&a.elementPath(b).contains("a",1),d=CKEDITOR.document.getById(n);
|
||||
d&&d.setStyle("display","none");w=new CKEDITOR.dom.element("img",a.document);this.preview=CKEDITOR.document.getById(C);this.originalElement=a.document.createElement("img");this.originalElement.setAttribute("alt","");this.originalElement.setCustomData("isReady","false");c&&(this.linkElement=c,this.addLink=this.linkEditMode=!0,a=c.getChildren(),1==a.count()&&(d=a.getItem(0),d.type==CKEDITOR.NODE_ELEMENT&&(d.is("img")||d.is("input"))&&(this.imageElement=a.getItem(0),this.imageElement.is("img")?this.imageEditMode=
|
||||
"img":this.imageElement.is("input")&&(this.imageEditMode="input"))),"image"==k&&this.setupContent(2,c));if(this.customImageElement)this.imageEditMode="img",this.imageElement=this.customImageElement,delete this.customImageElement;else if(b&&"img"==b.getName()&&!b.data("cke-realelement")||b&&"input"==b.getName()&&"image"==b.getAttribute("type"))this.imageEditMode=b.getName(),this.imageElement=b;this.imageEditMode&&(this.cleanImageElement=this.imageElement,this.imageElement=this.cleanImageElement.clone(!0,
|
||||
!0),this.setupContent(1,this.imageElement));m(this,!0);CKEDITOR.tools.trim(this.getValueOf("info","txtUrl"))||(this.preview.removeAttribute("src"),this.preview.setStyle("display","none"))},onOk:function(){if(this.imageEditMode){var a=this.imageEditMode;"image"==k&&"input"==a&&confirm(d.lang.image.button2Img)?(this.imageElement=d.document.createElement("img"),this.imageElement.setAttribute("alt",""),d.insertElement(this.imageElement)):"image"!=k&&"img"==a&&confirm(d.lang.image.img2Button)?(this.imageElement=
|
||||
d.document.createElement("input"),this.imageElement.setAttributes({type:"image",alt:""}),d.insertElement(this.imageElement)):(this.imageElement=this.cleanImageElement,delete this.cleanImageElement)}else"image"==k?this.imageElement=d.document.createElement("img"):(this.imageElement=d.document.createElement("input"),this.imageElement.setAttribute("type","image")),this.imageElement.setAttribute("alt","");this.linkEditMode||(this.linkElement=d.document.createElement("a"));this.commitContent(1,this.imageElement);
|
||||
this.commitContent(2,this.linkElement);this.imageElement.getAttribute("style")||this.imageElement.removeAttribute("style");this.imageEditMode?!this.linkEditMode&&this.addLink?(d.insertElement(this.linkElement),this.imageElement.appendTo(this.linkElement)):this.linkEditMode&&!this.addLink&&(d.getSelection().selectElement(this.linkElement),d.insertElement(this.imageElement)):this.addLink?this.linkEditMode?this.linkElement.equals(d.getSelection().getSelectedElement())?(this.linkElement.setHtml(""),this.linkElement.append(this.imageElement,
|
||||
!1)):d.insertElement(this.imageElement):(d.insertElement(this.linkElement),this.linkElement.append(this.imageElement,!1)):d.insertElement(this.imageElement)},onLoad:function(){"image"!=k&&this.hidePage("Link");var a=this._.element.getDocument();this.getContentElement("info","ratioLock")&&(this.addFocusable(a.getById(x),5),this.addFocusable(a.getById(r),5));this.commitContent=u},onHide:function(){this.preview&&this.commitContent(8,this.preview);this.originalElement&&(this.originalElement.removeListener("load",
|
||||
t),this.originalElement.removeListener("error",f),this.originalElement.removeListener("abort",f),this.originalElement.remove(),this.originalElement=!1);delete this.imageElement},contents:[{id:"info",label:d.lang.image.infoTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["280px","110px"],align:"right",className:"cke_dialog_image_url",children:[{id:"txtUrl",type:"text",label:d.lang.common.url,required:!0,onChange:function(){var a=this.getDialog(),b=this.getValue();if(0<
|
||||
b.length){var a=this.getDialog(),c=a.originalElement;a.preview&&a.preview.removeStyle("display");c.setCustomData("isReady","false");var d=CKEDITOR.document.getById(n);d&&d.setStyle("display","");c.on("load",t,a);c.on("error",f,a);c.on("abort",f,a);c.setAttribute("src",b);a.preview&&(w.setAttribute("src",b),a.preview.setAttribute("src",w.$.src),e(a))}else a.preview&&(a.preview.removeAttribute("src"),a.preview.setStyle("display","none"))},setup:function(a,b){if(1==a){var c=b.data("cke-saved-src")||
|
||||
b.getAttribute("src");this.getDialog().dontResetSize=!0;this.setValue(c);this.setInitValue()}},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())?(b.data("cke-saved-src",this.getValue()),b.setAttribute("src",this.getValue())):8==a&&(b.setAttribute("src",""),b.removeAttribute("src"))},validate:CKEDITOR.dialog.validate.notEmpty(d.lang.image.urlMissing)},{type:"button",id:"browse",style:"display:inline-block;margin-top:14px;",align:"center",label:d.lang.common.browseServer,hidden:!0,filebrowser:"info:txtUrl"}]}]},
|
||||
{id:"txtAlt",type:"text",label:d.lang.image.alt,accessKey:"T","default":"",onChange:function(){e(this.getDialog())},setup:function(a,b){1==a&&this.setValue(b.getAttribute("alt"))},commit:function(a,b){1==a?(this.getValue()||this.isChanged())&&b.setAttribute("alt",this.getValue()):4==a?b.setAttribute("alt",this.getValue()):8==a&&b.removeAttribute("alt")}},{type:"hbox",children:[{id:"basic",type:"vbox",children:[{type:"hbox",requiredContent:"img{width,height}",widths:["50%","50%"],children:[{type:"vbox",
|
||||
padding:1,children:[{type:"text",width:"45px",id:"txtWidth",label:d.lang.common.width,onKeyUp:z,onChange:function(){g.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(y);(a=!(!a||0===parseInt(a[1],10)))||alert(d.lang.common.invalidLength.replace("%1",d.lang.common.width).replace("%2","px, %"));return a},setup:B,commit:function(a,b){var c=this.getValue();1==a?(c&&d.activeFilter.check("img{width,height}")?b.setStyle("width",CKEDITOR.tools.cssLength(c)):b.removeStyle("width"),
|
||||
b.removeAttribute("width")):4==a?c.match(l)?b.setStyle("width",CKEDITOR.tools.cssLength(c)):(c=this.getDialog().originalElement,"true"==c.getCustomData("isReady")&&b.setStyle("width",c.$.width+"px")):8==a&&(b.removeAttribute("width"),b.removeStyle("width"))}},{type:"text",id:"txtHeight",width:"45px",label:d.lang.common.height,onKeyUp:z,onChange:function(){g.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(y);(a=!(!a||0===parseInt(a[1],10)))||alert(d.lang.common.invalidLength.replace("%1",
|
||||
d.lang.common.height).replace("%2","px, %"));return a},setup:B,commit:function(a,b){var c=this.getValue();1==a?(c&&d.activeFilter.check("img{width,height}")?b.setStyle("height",CKEDITOR.tools.cssLength(c)):b.removeStyle("height"),b.removeAttribute("height")):4==a?c.match(l)?b.setStyle("height",CKEDITOR.tools.cssLength(c)):(c=this.getDialog().originalElement,"true"==c.getCustomData("isReady")&&b.setStyle("height",c.$.height+"px")):8==a&&(b.removeAttribute("height"),b.removeStyle("height"))}}]},{id:"ratioLock",
|
||||
type:"html",className:"cke_dialog_image_ratiolock",style:"margin-top:30px;width:40px;height:40px;",onLoad:function(){var a=CKEDITOR.document.getById(x),b=CKEDITOR.document.getById(r);a&&(a.on("click",function(a){A(this);a.data&&a.data.preventDefault()},this.getDialog()),a.on("mouseover",function(){this.addClass("cke_btn_over")},a),a.on("mouseout",function(){this.removeClass("cke_btn_over")},a));b&&(b.on("click",function(a){m(this);var b=this.originalElement,d=this.getValueOf("info","txtWidth");"true"==
|
||||
b.getCustomData("isReady")&&d&&(b=b.$.height/b.$.width*d,isNaN(b)||(this.setValueOf("info","txtHeight",Math.round(b)),e(this)));a.data&&a.data.preventDefault()},this.getDialog()),b.on("mouseover",function(){this.addClass("cke_btn_over")},b),b.on("mouseout",function(){this.removeClass("cke_btn_over")},b))},html:'\x3cdiv\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+d.lang.image.lockRatio+'" class\x3d"cke_btn_locked" id\x3d"'+r+'" role\x3d"checkbox"\x3e\x3cspan class\x3d"cke_icon"\x3e\x3c/span\x3e\x3cspan class\x3d"cke_label"\x3e'+
|
||||
d.lang.image.lockRatio+'\x3c/span\x3e\x3c/a\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+d.lang.image.resetSize+'" class\x3d"cke_btn_reset" id\x3d"'+x+'" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3e'+d.lang.image.resetSize+"\x3c/span\x3e\x3c/a\x3e\x3c/div\x3e"}]},{type:"vbox",padding:1,children:[{type:"text",id:"txtBorder",requiredContent:"img{border-width}",width:"60px",label:d.lang.image.border,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){g.call(this,
|
||||
"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateBorder),setup:function(a,b){if(1==a){var c;c=(c=(c=b.getStyle("border-width"))&&c.match(/^(\d+px)(?: \1 \1 \1)?$/))&&parseInt(c[1],10);isNaN(parseInt(c,10))&&(c=b.getAttribute("border"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&b.removeStyle("border"):(b.setStyle("border-width",CKEDITOR.tools.cssLength(c)),b.setStyle("border-style",
|
||||
"solid")),1==a&&b.removeAttribute("border")):8==a&&(b.removeAttribute("border"),b.removeStyle("border-width"),b.removeStyle("border-style"),b.removeStyle("border-color"))}},{type:"text",id:"txtHSpace",requiredContent:"img{margin-left,margin-right}",width:"60px",label:d.lang.image.hSpace,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){g.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateHSpace),setup:function(a,b){if(1==a){var c,
|
||||
d;c=b.getStyle("margin-left");d=b.getStyle("margin-right");c=c&&c.match(q);d=d&&d.match(q);c=parseInt(c,10);d=parseInt(d,10);c=c==d&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("hspace"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&(b.removeStyle("margin-left"),b.removeStyle("margin-right")):(b.setStyle("margin-left",CKEDITOR.tools.cssLength(c)),b.setStyle("margin-right",CKEDITOR.tools.cssLength(c))),1==a&&b.removeAttribute("hspace")):
|
||||
8==a&&(b.removeAttribute("hspace"),b.removeStyle("margin-left"),b.removeStyle("margin-right"))}},{type:"text",id:"txtVSpace",requiredContent:"img{margin-top,margin-bottom}",width:"60px",label:d.lang.image.vSpace,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){g.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateVSpace),setup:function(a,b){if(1==a){var c,d;c=b.getStyle("margin-top");d=b.getStyle("margin-bottom");c=c&&c.match(q);
|
||||
d=d&&d.match(q);c=parseInt(c,10);d=parseInt(d,10);c=c==d&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("vspace"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&(b.removeStyle("margin-top"),b.removeStyle("margin-bottom")):(b.setStyle("margin-top",CKEDITOR.tools.cssLength(c)),b.setStyle("margin-bottom",CKEDITOR.tools.cssLength(c))),1==a&&b.removeAttribute("vspace")):8==a&&(b.removeAttribute("vspace"),b.removeStyle("margin-top"),b.removeStyle("margin-bottom"))}},
|
||||
{id:"cmbAlign",requiredContent:"img{float}",type:"select",widths:["35%","65%"],style:"width:90px",label:d.lang.common.align,"default":"",items:[[d.lang.common.notSet,""],[d.lang.common.left,"left"],[d.lang.common.right,"right"]],onChange:function(){e(this.getDialog());g.call(this,"advanced:txtdlgGenStyle")},setup:function(a,b){if(1==a){var c=b.getStyle("float");switch(c){case "inherit":case "none":c=""}!c&&(c=(b.getAttribute("align")||"").toLowerCase());this.setValue(c)}},commit:function(a,b){var c=
|
||||
this.getValue();if(1==a||4==a){if(c?b.setStyle("float",c):b.removeStyle("float"),1==a)switch(c=(b.getAttribute("align")||"").toLowerCase(),c){case "left":case "right":b.removeAttribute("align")}}else 8==a&&b.removeStyle("float")}}]}]},{type:"vbox",height:"250px",children:[{type:"html",id:"htmlPreview",style:"width:95%;",html:"\x3cdiv\x3e"+CKEDITOR.tools.htmlEncode(d.lang.common.preview)+'\x3cbr\x3e\x3cdiv id\x3d"'+n+'" class\x3d"ImagePreviewLoader" style\x3d"display:none"\x3e\x3cdiv class\x3d"loading"\x3e\x26nbsp;\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"ImagePreviewBox"\x3e\x3ctable\x3e\x3ctr\x3e\x3ctd\x3e\x3ca href\x3d"javascript:void(0)" target\x3d"_blank" onclick\x3d"return false;" id\x3d"'+
|
||||
D+'"\x3e\x3cimg id\x3d"'+C+'" alt\x3d"" /\x3e\x3c/a\x3e'+(d.config.image_previewText||"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.")+
|
||||
"\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/div\x3e"}]}]}]},{id:"Link",requiredContent:"a[href]",label:d.lang.image.linkTab,padding:0,elements:[{id:"txtUrl",type:"text",label:d.lang.common.url,style:"width: 100%","default":"",setup:function(a,b){if(2==a){var c=b.data("cke-saved-href");c||(c=b.getAttribute("href"));this.setValue(c)}},commit:function(a,b){if(2==a&&(this.getValue()||this.isChanged())){var c=this.getValue();b.data("cke-saved-href",c);b.setAttribute("href",c);this.getValue()||
|
||||
!d.config.image_removeLinkByEmptyURL?this.getDialog().addLink=!0:this.getDialog().addLink=!1}}},{type:"button",id:"browse",className:"cke_dialog_image_browse",filebrowser:{action:"Browse",target:"Link:txtUrl",url:d.config.filebrowserImageBrowseLinkUrl},style:"float:right",hidden:!0,label:d.lang.common.browseServer},{id:"cmbTarget",type:"select",requiredContent:"a[target]",label:d.lang.common.target,"default":"",items:[[d.lang.common.notSet,""],[d.lang.common.targetNew,"_blank"],[d.lang.common.targetTop,
|
||||
"_top"],[d.lang.common.targetSelf,"_self"],[d.lang.common.targetParent,"_parent"]],setup:function(a,b){2==a&&this.setValue(b.getAttribute("target")||"")},commit:function(a,b){2==a&&(this.getValue()||this.isChanged())&&b.setAttribute("target",this.getValue())}}]},{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:d.lang.image.upload,elements:[{type:"file",id:"upload",label:d.lang.image.btnUpload,style:"height:40px",size:38},{type:"fileButton",id:"uploadButton",filebrowser:"info:txtUrl",label:d.lang.image.btnUpload,
|
||||
@@ -40,5 +40,5 @@ p+'" class\x3d"ImagePreviewLoader" style\x3d"display:none"\x3e\x3cdiv class\x3d"
|
||||
""],[d.lang.common.langDirLtr,"ltr"],[d.lang.common.langDirRtl,"rtl"]],setup:function(a,b){1==a&&this.setValue(b.getAttribute("dir"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("dir",this.getValue())}},{type:"text",id:"txtLangCode",requiredContent:"img[lang]",label:d.lang.common.langCode,"default":"",setup:function(a,b){1==a&&this.setValue(b.getAttribute("lang"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("lang",this.getValue())}}]},
|
||||
{type:"text",id:"txtGenLongDescr",requiredContent:"img[longdesc]",label:d.lang.common.longDescr,setup:function(a,b){1==a&&this.setValue(b.getAttribute("longDesc"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("longDesc",this.getValue())}},{type:"hbox",widths:["50%","50%"],children:[{type:"text",id:"txtGenClass",requiredContent:"img(cke-xyz)",label:d.lang.common.cssClass,"default":"",setup:function(a,b){1==a&&this.setValue(b.getAttribute("class"))},commit:function(a,
|
||||
b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("class",this.getValue())}},{type:"text",id:"txtGenTitle",requiredContent:"img[title]",label:d.lang.common.advisoryTitle,"default":"",onChange:function(){e(this.getDialog())},setup:function(a,b){1==a&&this.setValue(b.getAttribute("title"))},commit:function(a,b){1==a?(this.getValue()||this.isChanged())&&b.setAttribute("title",this.getValue()):4==a?b.setAttribute("title",this.getValue()):8==a&&b.removeAttribute("title")}}]},{type:"text",id:"txtdlgGenStyle",
|
||||
requiredContent:"img{cke-xyz}",label:d.lang.common.cssStyle,validate:CKEDITOR.dialog.validate.inlineStyle(d.lang.common.invalidInlineStyle),"default":"",setup:function(a,b){if(1==a){var c=b.getAttribute("style");!c&&b.$.style.cssText&&(c=b.$.style.cssText);this.setValue(c);var d=b.$.style.height,c=b.$.style.width,d=(d?d:"").match(m),c=(c?c:"").match(m);this.attributesInStyle={height:!!d,width:!!c}}},onChange:function(){k.call(this,"info:cmbFloat info:cmbAlign info:txtVSpace info:txtHSpace info:txtBorder info:txtWidth info:txtHeight".split(" "));
|
||||
e(this)},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("style",this.getValue())}}]}]}};CKEDITOR.dialog.add("image",function(d){return v(d,"image")});CKEDITOR.dialog.add("imagebutton",function(d){return v(d,"imagebutton")})})();
|
||||
requiredContent:"img{cke-xyz}",label:d.lang.common.cssStyle,validate:CKEDITOR.dialog.validate.inlineStyle(d.lang.common.invalidInlineStyle),"default":"",setup:function(a,b){if(1==a){var c=b.getAttribute("style");!c&&b.$.style.cssText&&(c=b.$.style.cssText);this.setValue(c);var d=b.$.style.height,c=b.$.style.width,d=(d?d:"").match(l),c=(c?c:"").match(l);this.attributesInStyle={height:!!d,width:!!c}}},onChange:function(){g.call(this,"info:cmbFloat info:cmbAlign info:txtVSpace info:txtHSpace info:txtBorder info:txtWidth info:txtHeight".split(" "));
|
||||
e(this)},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("style",this.getValue())}}]}]}};CKEDITOR.dialog.add("image",function(d){return u(d,"image")});CKEDITOR.dialog.add("imagebutton",function(d){return u(d,"imagebutton")})})();
|
||||
@@ -2,27 +2,29 @@
|
||||
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
(function(){CKEDITOR.dialog.add("link",function(c){function t(a,b){var c=a.createRange();c.setStartBefore(b);c.setEndAfter(b);return c}var n=CKEDITOR.plugins.link,q,r=function(){var a=this.getDialog(),b=a.getContentElement("target","popupFeatures"),a=a.getContentElement("target","linkTargetName"),p=this.getValue();if(b&&a)switch(b=b.getElement(),b.hide(),a.setValue(""),p){case "frame":a.setLabel(c.lang.link.targetFrameName);a.getElement().show();break;case "popup":b.show();a.setLabel(c.lang.link.targetPopupName);
|
||||
a.getElement().show();break;default:a.setValue(p),a.getElement().hide()}},l=function(a){a.target&&this.setValue(a.target[this.id]||"")},e=function(a){a.advanced&&this.setValue(a.advanced[this.id]||"")},k=function(a){a.target||(a.target={});a.target[this.id]=this.getValue()||""},m=function(a){a.advanced||(a.advanced={});a.advanced[this.id]=this.getValue()||""},g=c.lang.common,b=c.lang.link,d;return{title:b.title,minWidth:"moono-lisa"==(CKEDITOR.skinName||c.config.skin)?450:350,minHeight:240,contents:[{id:"info",
|
||||
label:b.info,title:b.info,elements:[{type:"text",id:"linkDisplayText",label:b.displayText,setup:function(){this.enable();this.setValue(c.getSelection().getSelectedText());q=this.getValue()},commit:function(a){a.linkText=this.isEnabled()?this.getValue():""}},{id:"linkType",type:"select",label:b.type,"default":"url",items:[[b.toUrl,"url"],[b.toAnchor,"anchor"],[b.toEmail,"email"]],onChange:function(){var a=this.getDialog(),b=["urlOptions","anchorOptions","emailOptions"],p=this.getValue(),f=a.definition.getContents("upload"),
|
||||
f=f&&f.hidden;"url"==p?(c.config.linkShowTargetTab&&a.showPage("target"),f||a.showPage("upload")):(a.hidePage("target"),f||a.hidePage("upload"));for(f=0;f<b.length;f++){var h=a.getContentElement("info",b[f]);h&&(h=h.getElement().getParent().getParent(),b[f]==p+"Options"?h.show():h.hide())}a.layout()},setup:function(a){this.setValue(a.type||"url")},commit:function(a){a.type=this.getValue()}},{type:"vbox",id:"urlOptions",children:[{type:"hbox",widths:["25%","75%"],children:[{id:"protocol",type:"select",
|
||||
label:g.protocol,"default":"http://",items:[["http://","http://"],["https://","https://"],["ftp://","ftp://"],["news://","news://"],[b.other,""]],setup:function(a){a.url&&this.setValue(a.url.protocol||"")},commit:function(a){a.url||(a.url={});a.url.protocol=this.getValue()}},{type:"text",id:"url",label:g.url,required:!0,onLoad:function(){this.allowOnChange=!0},onKeyUp:function(){this.allowOnChange=!1;var a=this.getDialog().getContentElement("info","protocol"),b=this.getValue(),c=/^((javascript:)|[#\/\.\?])/i,
|
||||
f=/^(http|https|ftp|news):\/\/(?=.)/i.exec(b);f?(this.setValue(b.substr(f[0].length)),a.setValue(f[0].toLowerCase())):c.test(b)&&a.setValue("");this.allowOnChange=!0},onChange:function(){if(this.allowOnChange)this.onKeyUp()},validate:function(){var a=this.getDialog();return a.getContentElement("info","linkType")&&"url"!=a.getValueOf("info","linkType")?!0:!c.config.linkJavaScriptLinksAllowed&&/javascript\:/.test(this.getValue())?(alert(g.invalidValue),!1):this.getDialog().fakeObj?!0:CKEDITOR.dialog.validate.notEmpty(b.noUrl).apply(this)},
|
||||
setup:function(a){this.allowOnChange=!1;a.url&&this.setValue(a.url.url);this.allowOnChange=!0},commit:function(a){this.onChange();a.url||(a.url={});a.url.url=this.getValue();this.allowOnChange=!1}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().show()}},{type:"button",id:"browse",hidden:"true",filebrowser:"info:url",label:g.browseServer}]},{type:"vbox",id:"anchorOptions",width:260,align:"center",padding:0,children:[{type:"fieldset",id:"selectAnchorText",
|
||||
label:b.selectAnchor,setup:function(){d=n.getEditorAnchors(c);this.getElement()[d&&d.length?"show":"hide"]()},children:[{type:"hbox",id:"selectAnchor",children:[{type:"select",id:"anchorName","default":"",label:b.anchorName,style:"width: 100%;",items:[[""]],setup:function(a){this.clear();this.add("");if(d)for(var b=0;b<d.length;b++)d[b].name&&this.add(d[b].name);a.anchor&&this.setValue(a.anchor.name);(a=this.getDialog().getContentElement("info","linkType"))&&"email"==a.getValue()&&this.focus()},commit:function(a){a.anchor||
|
||||
(a.anchor={});a.anchor.name=this.getValue()}},{type:"select",id:"anchorId","default":"",label:b.anchorId,style:"width: 100%;",items:[[""]],setup:function(a){this.clear();this.add("");if(d)for(var b=0;b<d.length;b++)d[b].id&&this.add(d[b].id);a.anchor&&this.setValue(a.anchor.id)},commit:function(a){a.anchor||(a.anchor={});a.anchor.id=this.getValue()}}],setup:function(){this.getElement()[d&&d.length?"show":"hide"]()}}]},{type:"html",id:"noAnchors",style:"text-align: center;",html:'\x3cdiv role\x3d"note" tabIndex\x3d"-1"\x3e'+
|
||||
CKEDITOR.tools.htmlEncode(b.noAnchors)+"\x3c/div\x3e",focus:!0,setup:function(){this.getElement()[d&&d.length?"hide":"show"]()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}},{type:"vbox",id:"emailOptions",padding:1,children:[{type:"text",id:"emailAddress",label:b.emailAddress,required:!0,validate:function(){var a=this.getDialog();return a.getContentElement("info","linkType")&&"email"==a.getValueOf("info","linkType")?CKEDITOR.dialog.validate.notEmpty(b.noEmail).apply(this):
|
||||
!0},setup:function(a){a.email&&this.setValue(a.email.address);(a=this.getDialog().getContentElement("info","linkType"))&&"email"==a.getValue()&&this.select()},commit:function(a){a.email||(a.email={});a.email.address=this.getValue()}},{type:"text",id:"emailSubject",label:b.emailSubject,setup:function(a){a.email&&this.setValue(a.email.subject)},commit:function(a){a.email||(a.email={});a.email.subject=this.getValue()}},{type:"textarea",id:"emailBody",label:b.emailBody,rows:3,"default":"",setup:function(a){a.email&&
|
||||
this.setValue(a.email.body)},commit:function(a){a.email||(a.email={});a.email.body=this.getValue()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}}]},{id:"target",requiredContent:"a[target]",label:b.target,title:b.target,elements:[{type:"hbox",widths:["50%","50%"],children:[{type:"select",id:"linkTargetType",label:g.target,"default":"notSet",style:"width : 100%;",items:[[g.notSet,"notSet"],[b.targetFrame,"frame"],[b.targetPopup,"popup"],[g.targetNew,
|
||||
"_blank"],[g.targetTop,"_top"],[g.targetSelf,"_self"],[g.targetParent,"_parent"]],onChange:r,setup:function(a){a.target&&this.setValue(a.target.type||"notSet");r.call(this)},commit:function(a){a.target||(a.target={});a.target.type=this.getValue()}},{type:"text",id:"linkTargetName",label:b.targetFrameName,"default":"",setup:function(a){a.target&&this.setValue(a.target.name)},commit:function(a){a.target||(a.target={});a.target.name=this.getValue().replace(/([^\x00-\x7F]|\s)/gi,"")}}]},{type:"vbox",
|
||||
width:"100%",align:"center",padding:2,id:"popupFeatures",children:[{type:"fieldset",label:b.popupFeatures,children:[{type:"hbox",children:[{type:"checkbox",id:"resizable",label:b.popupResizable,setup:l,commit:k},{type:"checkbox",id:"status",label:b.popupStatusBar,setup:l,commit:k}]},{type:"hbox",children:[{type:"checkbox",id:"location",label:b.popupLocationBar,setup:l,commit:k},{type:"checkbox",id:"toolbar",label:b.popupToolbar,setup:l,commit:k}]},{type:"hbox",children:[{type:"checkbox",id:"menubar",
|
||||
label:b.popupMenuBar,setup:l,commit:k},{type:"checkbox",id:"fullscreen",label:b.popupFullScreen,setup:l,commit:k}]},{type:"hbox",children:[{type:"checkbox",id:"scrollbars",label:b.popupScrollBars,setup:l,commit:k},{type:"checkbox",id:"dependent",label:b.popupDependent,setup:l,commit:k}]},{type:"hbox",children:[{type:"text",widths:["50%","50%"],labelLayout:"horizontal",label:g.width,id:"width",setup:l,commit:k},{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:b.popupLeft,id:"left",
|
||||
setup:l,commit:k}]},{type:"hbox",children:[{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:g.height,id:"height",setup:l,commit:k},{type:"text",labelLayout:"horizontal",label:b.popupTop,widths:["50%","50%"],id:"top",setup:l,commit:k}]}]}]}]},{id:"upload",label:b.upload,title:b.upload,hidden:!0,filebrowser:"uploadButton",elements:[{type:"file",id:"upload",label:g.upload,style:"height:40px",size:29},{type:"fileButton",id:"uploadButton",label:g.uploadSubmit,filebrowser:"info:url","for":["upload",
|
||||
"upload"]}]},{id:"advanced",label:b.advanced,title:b.advanced,elements:[{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",id:"advId",requiredContent:"a[id]",label:b.id,setup:e,commit:m},{type:"select",id:"advLangDir",requiredContent:"a[dir]",label:b.langDir,"default":"",style:"width:110px",items:[[g.notSet,""],[b.langDirLTR,"ltr"],[b.langDirRTL,"rtl"]],setup:e,commit:m},{type:"text",id:"advAccessKey",requiredContent:"a[accesskey]",width:"80px",label:b.acccessKey,
|
||||
maxLength:1,setup:e,commit:m}]},{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",label:b.name,id:"advName",requiredContent:"a[name]",setup:e,commit:m},{type:"text",label:b.langCode,id:"advLangCode",requiredContent:"a[lang]",width:"110px","default":"",setup:e,commit:m},{type:"text",label:b.tabIndex,id:"advTabIndex",requiredContent:"a[tabindex]",width:"80px",maxLength:5,setup:e,commit:m}]}]},{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.advisoryTitle,
|
||||
requiredContent:"a[title]","default":"",id:"advTitle",setup:e,commit:m},{type:"text",label:b.advisoryContentType,requiredContent:"a[type]","default":"",id:"advContentType",setup:e,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.cssClasses,requiredContent:"a(cke-xyz)","default":"",id:"advCSSClasses",setup:e,commit:m},{type:"text",label:b.charset,requiredContent:"a[charset]","default":"",id:"advCharset",setup:e,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",
|
||||
label:b.rel,requiredContent:"a[rel]","default":"",id:"advRel",setup:e,commit:m},{type:"text",label:b.styles,requiredContent:"a{cke-xyz}","default":"",id:"advStyles",validate:CKEDITOR.dialog.validate.inlineStyle(c.lang.common.invalidInlineStyle),setup:e,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"checkbox",id:"download",requiredContent:"a[download]",label:b.download,setup:function(a){void 0!==a.download&&this.setValue("checked","checked")},commit:function(a){this.getValue()&&(a.download=
|
||||
this.getValue())}}]}]}]}],onShow:function(){var a=this.getParentEditor(),b=a.getSelection(),c=this.getContentElement("info","linkDisplayText").getElement().getParent().getParent(),f=n.getSelectedLink(a,!0),h=f[0]||null;h&&h.hasAttribute("href")&&(b.getSelectedElement()||b.isInTable()||b.selectElement(h));b=n.parseLinkAttributes(a,h);1>=f.length&&n.showDisplayTextForElement(h,a)?c.show():c.hide();this._.selectedElements=f;this.setupContent(b)},onOk:function(){var a={};this.commitContent(a);if(this._.selectedElements.length){var b=
|
||||
this._.selectedElements,g=n.getLinkAttributes(c,a),f=[],h,d,l,e,k;for(k=0;k<b.length;k++){h=b[k];d=h.data("cke-saved-href");l=h.getHtml();h.setAttributes(g.set);h.removeAttributes(g.removed);if(a.linkText&&q!=a.linkText)e=a.linkText;else if(d==l||"email"==a.type&&-1!=l.indexOf("@"))e="email"==a.type?a.email.address:g.set["data-cke-saved-href"];e&&h.setText(e);f.push(t(c,h))}c.getSelection().selectRanges(f);delete this._.selectedElements}else{b=n.getLinkAttributes(c,a);g=c.getSelection().getRanges();
|
||||
f=new CKEDITOR.style({element:"a",attributes:b.set});h=[];f.type=CKEDITOR.STYLE_INLINE;for(l=0;l<g.length;l++){d=g[l];d.collapsed?(e=new CKEDITOR.dom.text(a.linkText||("email"==a.type?a.email.address:b.set["data-cke-saved-href"]),c.document),d.insertNode(e),d.selectNodeContents(e)):q!==a.linkText&&(e=new CKEDITOR.dom.text(a.linkText,c.document),d.shrink(CKEDITOR.SHRINK_TEXT),c.editable().extractHtmlFromRange(d),d.insertNode(e));e=d._find("a");for(k=0;k<e.length;k++)e[k].remove(!0);f.applyToRange(d,
|
||||
c);h.push(d)}c.getSelection().selectRanges(h)}},onLoad:function(){c.config.linkShowAdvancedTab||this.hidePage("advanced");c.config.linkShowTargetTab||this.hidePage("target")},onFocus:function(){var a=this.getContentElement("info","linkType");a&&"url"==a.getValue()&&(a=this.getContentElement("info","url"),a.select())}}})})();
|
||||
(function(){function u(){var c=this.getDialog(),p=c._.editor,n=p.config.linkPhoneRegExp,q=p.config.linkPhoneMsg,p=CKEDITOR.dialog.validate.notEmpty(p.lang.link.noTel).apply(this);if(!c.getContentElement("info","linkType")||"tel"!=c.getValueOf("info","linkType"))return!0;if(!0!==p)return p;if(n)return CKEDITOR.dialog.validate.regex(n,q).call(this)}CKEDITOR.dialog.add("link",function(c){function p(a,b){var c=a.createRange();c.setStartBefore(b);c.setEndAfter(b);return c}var n=CKEDITOR.plugins.link,q,
|
||||
t=function(){var a=this.getDialog(),b=a.getContentElement("target","popupFeatures"),a=a.getContentElement("target","linkTargetName"),r=this.getValue();if(b&&a)switch(b=b.getElement(),b.hide(),a.setValue(""),r){case "frame":a.setLabel(c.lang.link.targetFrameName);a.getElement().show();break;case "popup":b.show();a.setLabel(c.lang.link.targetPopupName);a.getElement().show();break;default:a.setValue(r),a.getElement().hide()}},l=function(a){a.target&&this.setValue(a.target[this.id]||"")},e=function(a){a.advanced&&
|
||||
this.setValue(a.advanced[this.id]||"")},k=function(a){a.target||(a.target={});a.target[this.id]=this.getValue()||""},m=function(a){a.advanced||(a.advanced={});a.advanced[this.id]=this.getValue()||""},g=c.lang.common,b=c.lang.link,d;return{title:b.title,minWidth:"moono-lisa"==(CKEDITOR.skinName||c.config.skin)?450:350,minHeight:240,contents:[{id:"info",label:b.info,title:b.info,elements:[{type:"text",id:"linkDisplayText",label:b.displayText,setup:function(){this.enable();this.setValue(c.getSelection().getSelectedText());
|
||||
q=this.getValue()},commit:function(a){a.linkText=this.isEnabled()?this.getValue():""}},{id:"linkType",type:"select",label:b.type,"default":"url",items:[[b.toUrl,"url"],[b.toAnchor,"anchor"],[b.toEmail,"email"],[b.toPhone,"tel"]],onChange:function(){var a=this.getDialog(),b=["urlOptions","anchorOptions","emailOptions","telOptions"],r=this.getValue(),f=a.definition.getContents("upload"),f=f&&f.hidden;"url"==r?(c.config.linkShowTargetTab&&a.showPage("target"),f||a.showPage("upload")):(a.hidePage("target"),
|
||||
f||a.hidePage("upload"));for(f=0;f<b.length;f++){var h=a.getContentElement("info",b[f]);h&&(h=h.getElement().getParent().getParent(),b[f]==r+"Options"?h.show():h.hide())}a.layout()},setup:function(a){this.setValue(a.type||"url")},commit:function(a){a.type=this.getValue()}},{type:"vbox",id:"urlOptions",children:[{type:"hbox",widths:["25%","75%"],children:[{id:"protocol",type:"select",label:g.protocol,"default":"http://",items:[["http://","http://"],["https://","https://"],["ftp://","ftp://"],["news://",
|
||||
"news://"],[b.other,""]],setup:function(a){a.url&&this.setValue(a.url.protocol||"")},commit:function(a){a.url||(a.url={});a.url.protocol=this.getValue()}},{type:"text",id:"url",label:g.url,required:!0,onLoad:function(){this.allowOnChange=!0},onKeyUp:function(){this.allowOnChange=!1;var a=this.getDialog().getContentElement("info","protocol"),b=this.getValue(),c=/^((javascript:)|[#\/\.\?])/i,f=/^(http|https|ftp|news):\/\/(?=.)/i.exec(b);f?(this.setValue(b.substr(f[0].length)),a.setValue(f[0].toLowerCase())):
|
||||
c.test(b)&&a.setValue("");this.allowOnChange=!0},onChange:function(){if(this.allowOnChange)this.onKeyUp()},validate:function(){var a=this.getDialog();return a.getContentElement("info","linkType")&&"url"!=a.getValueOf("info","linkType")?!0:!c.config.linkJavaScriptLinksAllowed&&/javascript\:/.test(this.getValue())?(alert(g.invalidValue),!1):this.getDialog().fakeObj?!0:CKEDITOR.dialog.validate.notEmpty(b.noUrl).apply(this)},setup:function(a){this.allowOnChange=!1;a.url&&this.setValue(a.url.url);this.allowOnChange=
|
||||
!0},commit:function(a){this.onChange();a.url||(a.url={});a.url.url=this.getValue();this.allowOnChange=!1}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().show()}},{type:"button",id:"browse",hidden:"true",filebrowser:"info:url",label:g.browseServer}]},{type:"vbox",id:"anchorOptions",width:260,align:"center",padding:0,children:[{type:"fieldset",id:"selectAnchorText",label:b.selectAnchor,setup:function(){d=n.getEditorAnchors(c);this.getElement()[d&&d.length?
|
||||
"show":"hide"]()},children:[{type:"hbox",id:"selectAnchor",children:[{type:"select",id:"anchorName","default":"",label:b.anchorName,style:"width: 100%;",items:[[""]],setup:function(a){this.clear();this.add("");if(d)for(var b=0;b<d.length;b++)d[b].name&&this.add(d[b].name);a.anchor&&this.setValue(a.anchor.name);(a=this.getDialog().getContentElement("info","linkType"))&&"email"==a.getValue()&&this.focus()},commit:function(a){a.anchor||(a.anchor={});a.anchor.name=this.getValue()}},{type:"select",id:"anchorId",
|
||||
"default":"",label:b.anchorId,style:"width: 100%;",items:[[""]],setup:function(a){this.clear();this.add("");if(d)for(var b=0;b<d.length;b++)d[b].id&&this.add(d[b].id);a.anchor&&this.setValue(a.anchor.id)},commit:function(a){a.anchor||(a.anchor={});a.anchor.id=this.getValue()}}],setup:function(){this.getElement()[d&&d.length?"show":"hide"]()}}]},{type:"html",id:"noAnchors",style:"text-align: center;",html:'\x3cdiv role\x3d"note" tabIndex\x3d"-1"\x3e'+CKEDITOR.tools.htmlEncode(b.noAnchors)+"\x3c/div\x3e",
|
||||
focus:!0,setup:function(){this.getElement()[d&&d.length?"hide":"show"]()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}},{type:"vbox",id:"emailOptions",padding:1,children:[{type:"text",id:"emailAddress",label:b.emailAddress,required:!0,validate:function(){var a=this.getDialog();return a.getContentElement("info","linkType")&&"email"==a.getValueOf("info","linkType")?CKEDITOR.dialog.validate.notEmpty(b.noEmail).apply(this):!0},setup:function(a){a.email&&
|
||||
this.setValue(a.email.address);(a=this.getDialog().getContentElement("info","linkType"))&&"email"==a.getValue()&&this.select()},commit:function(a){a.email||(a.email={});a.email.address=this.getValue()}},{type:"text",id:"emailSubject",label:b.emailSubject,setup:function(a){a.email&&this.setValue(a.email.subject)},commit:function(a){a.email||(a.email={});a.email.subject=this.getValue()}},{type:"textarea",id:"emailBody",label:b.emailBody,rows:3,"default":"",setup:function(a){a.email&&this.setValue(a.email.body)},
|
||||
commit:function(a){a.email||(a.email={});a.email.body=this.getValue()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}},{type:"vbox",id:"telOptions",padding:1,children:[{type:"tel",id:"telNumber",label:b.phoneNumber,required:!0,validate:u,setup:function(a){a.tel&&this.setValue(a.tel);(a=this.getDialog().getContentElement("info","linkType"))&&"tel"==a.getValue()&&this.select()},commit:function(a){a.tel=this.getValue()}}],setup:function(){this.getDialog().getContentElement("info",
|
||||
"linkType")||this.getElement().hide()}}]},{id:"target",requiredContent:"a[target]",label:b.target,title:b.target,elements:[{type:"hbox",widths:["50%","50%"],children:[{type:"select",id:"linkTargetType",label:g.target,"default":"notSet",style:"width : 100%;",items:[[g.notSet,"notSet"],[b.targetFrame,"frame"],[b.targetPopup,"popup"],[g.targetNew,"_blank"],[g.targetTop,"_top"],[g.targetSelf,"_self"],[g.targetParent,"_parent"]],onChange:t,setup:function(a){a.target&&this.setValue(a.target.type||"notSet");
|
||||
t.call(this)},commit:function(a){a.target||(a.target={});a.target.type=this.getValue()}},{type:"text",id:"linkTargetName",label:b.targetFrameName,"default":"",setup:function(a){a.target&&this.setValue(a.target.name)},commit:function(a){a.target||(a.target={});a.target.name=this.getValue().replace(/([^\x00-\x7F]|\s)/gi,"")}}]},{type:"vbox",width:"100%",align:"center",padding:2,id:"popupFeatures",children:[{type:"fieldset",label:b.popupFeatures,children:[{type:"hbox",children:[{type:"checkbox",id:"resizable",
|
||||
label:b.popupResizable,setup:l,commit:k},{type:"checkbox",id:"status",label:b.popupStatusBar,setup:l,commit:k}]},{type:"hbox",children:[{type:"checkbox",id:"location",label:b.popupLocationBar,setup:l,commit:k},{type:"checkbox",id:"toolbar",label:b.popupToolbar,setup:l,commit:k}]},{type:"hbox",children:[{type:"checkbox",id:"menubar",label:b.popupMenuBar,setup:l,commit:k},{type:"checkbox",id:"fullscreen",label:b.popupFullScreen,setup:l,commit:k}]},{type:"hbox",children:[{type:"checkbox",id:"scrollbars",
|
||||
label:b.popupScrollBars,setup:l,commit:k},{type:"checkbox",id:"dependent",label:b.popupDependent,setup:l,commit:k}]},{type:"hbox",children:[{type:"text",widths:["50%","50%"],labelLayout:"horizontal",label:g.width,id:"width",setup:l,commit:k},{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:b.popupLeft,id:"left",setup:l,commit:k}]},{type:"hbox",children:[{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:g.height,id:"height",setup:l,commit:k},{type:"text",labelLayout:"horizontal",
|
||||
label:b.popupTop,widths:["50%","50%"],id:"top",setup:l,commit:k}]}]}]}]},{id:"upload",label:b.upload,title:b.upload,hidden:!0,filebrowser:"uploadButton",elements:[{type:"file",id:"upload",label:g.upload,style:"height:40px",size:29},{type:"fileButton",id:"uploadButton",label:g.uploadSubmit,filebrowser:"info:url","for":["upload","upload"]}]},{id:"advanced",label:b.advanced,title:b.advanced,elements:[{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",id:"advId",
|
||||
requiredContent:"a[id]",label:b.id,setup:e,commit:m},{type:"select",id:"advLangDir",requiredContent:"a[dir]",label:b.langDir,"default":"",style:"width:110px",items:[[g.notSet,""],[b.langDirLTR,"ltr"],[b.langDirRTL,"rtl"]],setup:e,commit:m},{type:"text",id:"advAccessKey",requiredContent:"a[accesskey]",width:"80px",label:b.acccessKey,maxLength:1,setup:e,commit:m}]},{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",label:b.name,id:"advName",requiredContent:"a[name]",setup:e,commit:m},{type:"text",
|
||||
label:b.langCode,id:"advLangCode",requiredContent:"a[lang]",width:"110px","default":"",setup:e,commit:m},{type:"text",label:b.tabIndex,id:"advTabIndex",requiredContent:"a[tabindex]",width:"80px",maxLength:5,setup:e,commit:m}]}]},{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.advisoryTitle,requiredContent:"a[title]","default":"",id:"advTitle",setup:e,commit:m},{type:"text",label:b.advisoryContentType,requiredContent:"a[type]","default":"",id:"advContentType",
|
||||
setup:e,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.cssClasses,requiredContent:"a(cke-xyz)","default":"",id:"advCSSClasses",setup:e,commit:m},{type:"text",label:b.charset,requiredContent:"a[charset]","default":"",id:"advCharset",setup:e,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.rel,requiredContent:"a[rel]","default":"",id:"advRel",setup:e,commit:m},{type:"text",label:b.styles,requiredContent:"a{cke-xyz}","default":"",id:"advStyles",
|
||||
validate:CKEDITOR.dialog.validate.inlineStyle(c.lang.common.invalidInlineStyle),setup:e,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"checkbox",id:"download",requiredContent:"a[download]",label:b.download,setup:function(a){void 0!==a.download&&this.setValue("checked","checked")},commit:function(a){this.getValue()&&(a.download=this.getValue())}}]}]}]}],onShow:function(){var a=this.getParentEditor(),b=a.getSelection(),c=this.getContentElement("info","linkDisplayText").getElement().getParent().getParent(),
|
||||
f=n.getSelectedLink(a,!0),h=f[0]||null;h&&h.hasAttribute("href")&&(b.getSelectedElement()||b.isInTable()||b.selectElement(h));b=n.parseLinkAttributes(a,h);1>=f.length&&n.showDisplayTextForElement(h,a)?c.show():c.hide();this._.selectedElements=f;this.setupContent(b)},onOk:function(){var a={};this.commitContent(a);if(this._.selectedElements.length){var b=this._.selectedElements,g=n.getLinkAttributes(c,a),f=[],h,d,l,e,k;for(k=0;k<b.length;k++){h=b[k];d=h.data("cke-saved-href");l=h.getHtml();h.setAttributes(g.set);
|
||||
h.removeAttributes(g.removed);if(a.linkText&&q!=a.linkText)e=a.linkText;else if(d==l||"email"==a.type&&-1!=l.indexOf("@"))e="email"==a.type?a.email.address:g.set["data-cke-saved-href"];e&&h.setText(e);f.push(p(c,h))}c.getSelection().selectRanges(f);delete this._.selectedElements}else{b=n.getLinkAttributes(c,a);g=c.getSelection().getRanges();f=new CKEDITOR.style({element:"a",attributes:b.set});h=[];f.type=CKEDITOR.STYLE_INLINE;for(l=0;l<g.length;l++){d=g[l];d.collapsed?(e=new CKEDITOR.dom.text(a.linkText||
|
||||
("email"==a.type?a.email.address:b.set["data-cke-saved-href"]),c.document),d.insertNode(e),d.selectNodeContents(e)):q!==a.linkText&&(e=new CKEDITOR.dom.text(a.linkText,c.document),d.shrink(CKEDITOR.SHRINK_TEXT),c.editable().extractHtmlFromRange(d),d.insertNode(e));e=d._find("a");for(k=0;k<e.length;k++)e[k].remove(!0);f.applyToRange(d,c);h.push(d)}c.getSelection().selectRanges(h)}},onLoad:function(){c.config.linkShowAdvancedTab||this.hidePage("advanced");c.config.linkShowTargetTab||this.hidePage("target")},
|
||||
onFocus:function(){var a=this.getContentElement("info","linkType");a&&"url"==a.getValue()&&(a=this.getContentElement("info","url"),a.select())}}})})();
|
||||
@@ -3,8 +3,8 @@
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
(function(){function d(c,d){var b;try{b=c.getSelection().getRanges()[0]}catch(f){return null}b.shrink(CKEDITOR.SHRINK_TEXT);return c.elementPath(b.getCommonAncestor()).contains(d,1)}function e(c,e){var b=c.lang.liststyle;if("bulletedListStyle"==e)return{title:b.bulletedTitle,minWidth:300,minHeight:50,contents:[{id:"info",accessKey:"I",elements:[{type:"select",label:b.type,id:"type",align:"center",style:"width:150px",items:[[b.notset,""],[b.circle,"circle"],[b.disc,"disc"],[b.square,"square"]],setup:function(a){a=
|
||||
a.getStyle("list-style-type")||h[a.getAttribute("type")]||a.getAttribute("type")||"";this.setValue(a)},commit:function(a){var b=this.getValue();b?a.setStyle("list-style-type",b):a.removeStyle("list-style-type")}}]}],onShow:function(){var a=this.getParentEditor();(a=d(a,"ul"))&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor();(a=d(a,"ul"))&&this.commitContent(a)}};if("numberedListStyle"==e){var g=[[b.notset,""],[b.lowerRoman,"lower-roman"],[b.upperRoman,"upper-roman"],[b.lowerAlpha,
|
||||
"lower-alpha"],[b.upperAlpha,"upper-alpha"],[b.decimal,"decimal"]];(!CKEDITOR.env.ie||7<CKEDITOR.env.version)&&g.concat([[b.armenian,"armenian"],[b.decimalLeadingZero,"decimal-leading-zero"],[b.georgian,"georgian"],[b.lowerGreek,"lower-greek"]]);return{title:b.numberedTitle,minWidth:300,minHeight:50,contents:[{id:"info",accessKey:"I",elements:[{type:"hbox",widths:["25%","75%"],children:[{label:b.start,type:"text",id:"start",validate:CKEDITOR.dialog.validate.integer(b.validateStartNumber),setup:function(a){a=
|
||||
a.getFirst(f).getAttribute("value")||a.getAttribute("start")||1;this.setValue(a)},commit:function(a){var b=a.getFirst(f),c=b.getAttribute("value")||a.getAttribute("start")||1;a.getFirst(f).removeAttribute("value");var d=parseInt(this.getValue(),10);isNaN(d)?a.removeAttribute("start"):a.setAttribute("start",d);a=b;b=c;for(d=isNaN(d)?1:d;(a=a.getNext(f))&&b++;)a.getAttribute("value")==b&&a.setAttribute("value",d+b-c)}},{type:"select",label:b.type,id:"type",style:"width: 100%;",items:g,setup:function(a){a=
|
||||
a.getStyle("list-style-type")||h[a.getAttribute("type")]||a.getAttribute("type")||"";this.setValue(a)},commit:function(a){var b=this.getValue();b?a.setStyle("list-style-type",b):a.removeStyle("list-style-type")}}]}]}],onShow:function(){var a=this.getParentEditor();(a=d(a,"ol"))&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor();(a=d(a,"ol"))&&this.commitContent(a)}}}}var f=function(c){return c.type==CKEDITOR.NODE_ELEMENT&&c.is("li")},h={a:"lower-alpha",A:"upper-alpha",i:"lower-roman",
|
||||
I:"upper-roman",1:"decimal",disc:"disc",circle:"circle",square:"square"};CKEDITOR.dialog.add("numberedListStyle",function(c){return e(c,"numberedListStyle")});CKEDITOR.dialog.add("bulletedListStyle",function(c){return e(c,"bulletedListStyle")})})();
|
||||
a.getStyle("list-style-type")||g[a.getAttribute("type")]||a.getAttribute("type")||"";this.setValue(a)},commit:function(a){var b=this.getValue();b?a.setStyle("list-style-type",b):a.removeStyle("list-style-type")}}]}],onShow:function(){var a=this.getParentEditor();(a=d(a,"ul"))&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor();(a=d(a,"ul"))&&this.commitContent(a)}};if("numberedListStyle"==e){var h=[[b.notset,""],[b.lowerRoman,"lower-roman"],[b.upperRoman,"upper-roman"],[b.lowerAlpha,
|
||||
"lower-alpha"],[b.upperAlpha,"upper-alpha"],[b.decimal,"decimal"]];return{title:b.numberedTitle,minWidth:300,minHeight:50,contents:[{id:"info",accessKey:"I",elements:[{type:"hbox",widths:["25%","75%"],children:[{label:b.start,type:"text",id:"start",validate:CKEDITOR.dialog.validate.integer(b.validateStartNumber),setup:function(a){a=a.getFirst(f).getAttribute("value")||a.getAttribute("start")||1;this.setValue(a)},commit:function(a){var b=a.getFirst(f),c=b.getAttribute("value")||a.getAttribute("start")||
|
||||
1;a.getFirst(f).removeAttribute("value");var d=parseInt(this.getValue(),10);isNaN(d)?a.removeAttribute("start"):a.setAttribute("start",d);a=b;b=c;for(d=isNaN(d)?1:d;(a=a.getNext(f))&&b++;)a.getAttribute("value")==b&&a.setAttribute("value",d+b-c)}},{type:"select",label:b.type,id:"type",style:"width: 100%;",items:h,setup:function(a){a=a.getStyle("list-style-type")||g[a.getAttribute("type")]||a.getAttribute("type")||"";this.setValue(a)},commit:function(a){var b=this.getValue();b?a.setStyle("list-style-type",
|
||||
b):a.removeStyle("list-style-type")}}]}]}],onShow:function(){var a=this.getParentEditor();(a=d(a,"ol"))&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor();(a=d(a,"ol"))&&this.commitContent(a)}}}}var f=function(c){return c.type==CKEDITOR.NODE_ELEMENT&&c.is("li")},g={a:"lower-alpha",A:"upper-alpha",i:"lower-roman",I:"upper-roman",1:"decimal",disc:"disc",circle:"circle",square:"square"};CKEDITOR.dialog.add("numberedListStyle",function(c){return e(c,"numberedListStyle")});CKEDITOR.dialog.add("bulletedListStyle",
|
||||
function(c){return e(c,"bulletedListStyle")})})();
|
||||
@@ -2,54 +2,54 @@
|
||||
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
(function(){function u(){return!1}function x(a,b){var c,d=[];a.filterChildren(b);for(c=a.children.length-1;0<=c;c--)d.unshift(a.children[c]),a.children[c].remove();c=a.attributes;var e=a,g=!0,h;for(h in c)if(g)g=!1;else{var l=new CKEDITOR.htmlParser.element(a.name);l.attributes[h]=c[h];e.add(l);e=l;delete c[h]}for(c=0;c<d.length;c++)e.add(d[c])}var f,k,t,p,m=CKEDITOR.tools,y=["o:p","xml","script","meta","link"],z="v:arc v:curve v:line v:oval v:polyline v:rect v:roundrect v:group".split(" "),w={},
|
||||
v=0;CKEDITOR.plugins.pastefromword={};CKEDITOR.cleanWord=function(a,b){function c(a){(a.attributes["o:gfxdata"]||"v:group"===a.parent.name)&&e.push(a.attributes.id)}var d=Boolean(a.match(/mso-list:\s*l\d+\s+level\d+\s+lfo\d+/)),e=[];CKEDITOR.plugins.clipboard.isCustomDataTypesSupported&&(a=CKEDITOR.plugins.pastefromword.styles.inliner.inline(a).getBody().getHtml());a=a.replace(/<!\[/g,"\x3c!--[").replace(/\]>/g,"]--\x3e");var g=CKEDITOR.htmlParser.fragment.fromHtml(a),h={root:function(a){a.filterChildren(p);
|
||||
CKEDITOR.plugins.pastefromword.lists.cleanup(f.createLists(a))},elementNames:[[/^\?xml:namespace$/,""],[/^v:shapetype/,""],[new RegExp(y.join("|")),""]],elements:{a:function(a){if(a.attributes.name){if("_GoBack"==a.attributes.name){delete a.name;return}if(a.attributes.name.match(/^OLE_LINK\d+$/)){delete a.name;return}}if(a.attributes.href&&a.attributes.href.match(/#.+$/)){var b=a.attributes.href.match(/#(.+)$/)[1];w[b]=a}a.attributes.name&&w[a.attributes.name]&&(a=w[a.attributes.name],a.attributes.href=
|
||||
a.attributes.href.replace(/.*#(.*)$/,"#$1"))},div:function(a){k.createStyleStack(a,p,b)},img:function(a){if(a.parent&&a.parent.attributes){var b=a.parent.attributes;(b=b.style||b.STYLE)&&b.match(/mso\-list:\s?Ignore/)&&(a.attributes["cke-ignored"]=!0)}k.mapStyles(a,{width:function(b){k.setStyle(a,"width",b+"px")},height:function(b){k.setStyle(a,"height",b+"px")}});a.attributes.src&&a.attributes.src.match(/^file:\/\//)&&a.attributes.alt&&a.attributes.alt.match(/^https?:\/\//)&&(a.attributes.src=a.attributes.alt);
|
||||
var b=a.attributes["v:shapes"]?a.attributes["v:shapes"].split(" "):[],c=CKEDITOR.tools.array.every(b,function(a){return-1<e.indexOf(a)});if(b.length&&c)return!1},p:function(a){a.filterChildren(p);if(a.attributes.style&&a.attributes.style.match(/display:\s*none/i))return!1;if(f.thisIsAListItem(b,a))t.isEdgeListItem(b,a)&&t.cleanupEdgeListItem(a),f.convertToFakeListItem(b,a),m.array.reduce(a.children,function(a,b){"p"===b.name&&(0<a&&(new CKEDITOR.htmlParser.element("br")).insertBefore(b),b.replaceWithChildren(),
|
||||
a+=1);return a},0);else{var c=a.getAscendant(function(a){return"ul"==a.name||"ol"==a.name}),d=m.parseCssText(a.attributes.style);c&&!c.attributes["cke-list-level"]&&d["mso-list"]&&d["mso-list"].match(/level/)&&(c.attributes["cke-list-level"]=d["mso-list"].match(/level(\d+)/)[1]);b.config.enterMode==CKEDITOR.ENTER_BR&&(delete a.name,a.add(new CKEDITOR.htmlParser.element("br")))}k.createStyleStack(a,p,b)},pre:function(a){f.thisIsAListItem(b,a)&&f.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},
|
||||
h1:function(a){f.thisIsAListItem(b,a)&&f.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h2:function(a){f.thisIsAListItem(b,a)&&f.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h3:function(a){f.thisIsAListItem(b,a)&&f.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h4:function(a){f.thisIsAListItem(b,a)&&f.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h5:function(a){f.thisIsAListItem(b,a)&&f.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h6:function(a){f.thisIsAListItem(b,
|
||||
a)&&f.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},font:function(a){if(a.getHtml().match(/^\s*$/))return(new CKEDITOR.htmlParser.text(" ")).insertAfter(a),!1;b&&!0===b.config.pasteFromWordRemoveFontStyles&&a.attributes.size&&delete a.attributes.size;CKEDITOR.dtd.tr[a.parent.name]&&CKEDITOR.tools.arrayCompare(CKEDITOR.tools.objectKeys(a.attributes),["class","style"])?k.createStyleStack(a,p,b):x(a,p)},ul:function(a){if(d)return"li"==a.parent.name&&0===m.indexOf(a.parent.children,a)&&k.setStyle(a.parent,
|
||||
"list-style-type","none"),f.dissolveList(a),!1},li:function(a){t.correctLevelShift(a);d&&(a.attributes.style=k.normalizedStyles(a,b),k.pushStylesLower(a))},ol:function(a){if(d)return"li"==a.parent.name&&0===m.indexOf(a.parent.children,a)&&k.setStyle(a.parent,"list-style-type","none"),f.dissolveList(a),!1},span:function(a){a.filterChildren(p);a.attributes.style=k.normalizedStyles(a,b);if(!a.attributes.style||a.attributes.style.match(/^mso\-bookmark:OLE_LINK\d+$/)||a.getHtml().match(/^(\s| )+$/)){for(var c=
|
||||
a.children.length-1;0<=c;c--)a.children[c].insertAfter(a);return!1}a.attributes.style.match(/FONT-FAMILY:\s*Symbol/i)&&a.forEach(function(a){a.value=a.value.replace(/ /g,"")},CKEDITOR.NODE_TEXT,!0);k.createStyleStack(a,p,b)},table:function(a){a._tdBorders={};a.filterChildren(p);var b,c=0,d;for(d in a._tdBorders)a._tdBorders[d]>c&&(c=a._tdBorders[d],b=d);k.setStyle(a,"border",b);c=(b=a.parent)&&b.parent;if(b.name&&"div"===b.name&&b.attributes.align&&1===m.objectKeys(b.attributes).length&&1===
|
||||
b.children.length){a.attributes.align=b.attributes.align;d=b.children.splice(0);a.remove();for(a=d.length-1;0<=a;a--)c.add(d[a],b.getIndex());b.remove()}},td:function(a){var c=a.getAscendant("table"),d=c._tdBorders,e=["border","border-top","border-right","border-bottom","border-left"],c=m.parseCssText(c.attributes.style),g=c.background||c.BACKGROUND;g&&k.setStyle(a,"background",g,!0);(c=c["background-color"]||c["BACKGROUND-COLOR"])&&k.setStyle(a,"background-color",c,!0);var c=m.parseCssText(a.attributes.style),
|
||||
h;for(h in c)g=c[h],delete c[h],c[h.toLowerCase()]=g;for(h=0;h<e.length;h++)c[e[h]]&&(g=c[e[h]],d[g]=d[g]?d[g]+1:1);k.createStyleStack(a,p,b,/margin|text\-align|padding|list\-style\-type|width|height|border|white\-space|vertical\-align|background/i)},"v:imagedata":u,"v:shape":function(a){var b=!1;if(null===a.getFirst("v:imagedata"))c(a);else{a.parent.find(function(c){"img"==c.name&&c.attributes&&c.attributes["v:shapes"]==a.attributes.id&&(b=!0)},!0);if(b)return!1;var d="";"v:group"===a.parent.name?
|
||||
c(a):(a.forEach(function(a){a.attributes&&a.attributes.src&&(d=a.attributes.src)},CKEDITOR.NODE_ELEMENT,!0),a.filterChildren(p),a.name="img",a.attributes.src=a.attributes.src||d,delete a.attributes.type)}},style:function(){return!1},object:function(a){return!(!a.attributes||!a.attributes.data)}},attributes:{style:function(a,c){return k.normalizedStyles(c,b)||!1},"class":function(a){a=a.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/ig,"");return""===a?!1:a},cellspacing:u,cellpadding:u,border:u,
|
||||
"v:shapes":u,"o:spid":u},comment:function(a){a.match(/\[if.* supportFields.*\]/)&&v++;"[endif]"==a&&(v=0<v?v-1:0);return!1},text:function(a,b){if(v)return"";var c=b.parent&&b.parent.parent;return c&&c.attributes&&c.attributes.style&&c.attributes.style.match(/mso-list:\s*ignore/i)?a.replace(/ /g," "):a}};CKEDITOR.tools.array.forEach(z,function(a){h.elements[a]=c});p=new CKEDITOR.htmlParser.filter(h);var l=new CKEDITOR.htmlParser.basicWriter;p.applyTo(g);g.writeHtml(l);return l.getHtml()};CKEDITOR.plugins.pastefromword.styles=
|
||||
{setStyle:function(a,b,c,d){var e=m.parseCssText(a.attributes.style);d&&e[b]||(""===c?delete e[b]:e[b]=c,a.attributes.style=CKEDITOR.tools.writeCssText(e))},mapStyles:function(a,b){for(var c in b)if(a.attributes[c]){if("function"===typeof b[c])b[c](a.attributes[c]);else k.setStyle(a,b[c],a.attributes[c]);delete a.attributes[c]}},normalizedStyles:function(a,b){var c="background-color:transparent border-image:none color:windowtext direction:ltr mso- text-indent visibility:visible div:border:none".split(" "),
|
||||
d="font-family font font-size color background-color line-height text-decoration".split(" "),e=function(){for(var a=[],b=0;b<arguments.length;b++)arguments[b]&&a.push(arguments[b]);return-1!==m.indexOf(c,a.join(":"))},g=b&&!0===b.config.pasteFromWordRemoveFontStyles,h=m.parseCssText(a.attributes.style);"cke:li"==a.name&&h["TEXT-INDENT"]&&h.MARGIN&&(a.attributes["cke-indentation"]=f.getElementIndentation(a),h.MARGIN=h.MARGIN.replace(/(([\w\.]+ ){3,3})[\d\.]+(\w+$)/,"$10$3"));for(var l=m.objectKeys(h),
|
||||
q=0;q<l.length;q++){var n=l[q].toLowerCase(),r=h[l[q]],k=CKEDITOR.tools.indexOf;(g&&-1!==k(d,n.toLowerCase())||e(null,n,r)||e(null,n.replace(/\-.*$/,"-"))||e(null,n)||e(a.name,n,r)||e(a.name,n.replace(/\-.*$/,"-"))||e(a.name,n)||e(r))&&delete h[l[q]]}return CKEDITOR.tools.writeCssText(h)},createStyleStack:function(a,b,c,d){var e=[];a.filterChildren(b);for(b=a.children.length-1;0<=b;b--)e.unshift(a.children[b]),a.children[b].remove();k.sortStyles(a);b=m.parseCssText(k.normalizedStyles(a,c));c=a;var g=
|
||||
"span"===a.name,h;for(h in b)if(!h.match(d||/margin|text\-align|width|border|padding/i))if(g)g=!1;else{var l=new CKEDITOR.htmlParser.element("span");l.attributes.style=h+":"+b[h];c.add(l);c=l;delete b[h]}CKEDITOR.tools.isEmpty(b)?delete a.attributes.style:a.attributes.style=CKEDITOR.tools.writeCssText(b);for(b=0;b<e.length;b++)c.add(e[b])},sortStyles:function(a){for(var b=["border","border-bottom","font-size","background"],c=m.parseCssText(a.attributes.style),d=m.objectKeys(c),e=[],g=[],h=0;h<d.length;h++)-1!==
|
||||
m.indexOf(b,d[h].toLowerCase())?e.push(d[h]):g.push(d[h]);e.sort(function(a,c){var d=m.indexOf(b,a.toLowerCase()),e=m.indexOf(b,c.toLowerCase());return d-e});d=[].concat(e,g);e={};for(h=0;h<d.length;h++)e[d[h]]=c[d[h]];a.attributes.style=CKEDITOR.tools.writeCssText(e)},pushStylesLower:function(a,b,c){if(!a.attributes.style||0===a.children.length)return!1;b=b||{};var d={"list-style-type":!0,width:!0,height:!0,border:!0,"border-":!0},e=m.parseCssText(a.attributes.style),g;for(g in e)if(!(g.toLowerCase()in
|
||||
d||d[g.toLowerCase().replace(/\-.*$/,"-")]||g.toLowerCase()in b)){for(var h=!1,l=0;l<a.children.length;l++){var f=a.children[l];if(f.type===CKEDITOR.NODE_TEXT&&c){var n=new CKEDITOR.htmlParser.element("span");n.setHtml(f.value);f.replaceWith(n);f=n}f.type===CKEDITOR.NODE_ELEMENT&&(h=!0,k.setStyle(f,g,e[g]))}h&&delete e[g]}a.attributes.style=CKEDITOR.tools.writeCssText(e);return!0},inliner:{filtered:"break-before break-after break-inside page-break page-break-before page-break-after page-break-inside".split(" "),
|
||||
parse:function(a){function b(a){var b=new CKEDITOR.dom.element("style"),c=new CKEDITOR.dom.element("iframe");c.hide();CKEDITOR.document.getBody().append(c);c.$.contentDocument.documentElement.appendChild(b.$);b.$.textContent=a;c.remove();return b.$.sheet}function c(a){var b=a.indexOf("{"),c=a.indexOf("}");return d(a.substring(b+1,c),!0)}var d=CKEDITOR.tools.parseCssText,e=CKEDITOR.plugins.pastefromword.styles.inliner.filter,g=a.is?a.$.sheet:b(a);a=[];var h;if(g)for(g=g.cssRules,h=0;h<g.length;h++)g[h].type===
|
||||
window.CSSRule.STYLE_RULE&&a.push({selector:g[h].selectorText,styles:e(c(g[h].cssText))});return a},filter:function(a){var b=CKEDITOR.plugins.pastefromword.styles.inliner.filtered,c=m.array.indexOf,d={},e;for(e in a)-1===c(b,e)&&(d[e]=a[e]);return d},sort:function(a){return a.sort(function(a){var c=CKEDITOR.tools.array.map(a,function(a){return a.selector});return function(a,b){var g=-1!==(""+a.selector).indexOf(".")?1:0,g=(-1!==(""+b.selector).indexOf(".")?1:0)-g;return 0!==g?g:c.indexOf(b.selector)-
|
||||
c.indexOf(a.selector)}}(a))},inline:function(a){var b=CKEDITOR.plugins.pastefromword.styles.inliner.parse,c=CKEDITOR.plugins.pastefromword.styles.inliner.sort,d=function(a){a=(new DOMParser).parseFromString(a,"text/html");return new CKEDITOR.dom.document(a)}(a);a=d.find("style");c=c(function(a){var c=[],d;for(d=0;d<a.count();d++)c=c.concat(b(a.getItem(d)));return c}(a));CKEDITOR.tools.array.forEach(c,function(a){var b=a.styles;a=d.find(a.selector);var c,f,q;for(q=0;q<a.count();q++)c=a.getItem(q),
|
||||
f=CKEDITOR.tools.parseCssText(c.getAttribute("style")),f=CKEDITOR.tools.extend({},f,b),c.setAttribute("style",CKEDITOR.tools.writeCssText(f))});return d}}};k=CKEDITOR.plugins.pastefromword.styles;CKEDITOR.plugins.pastefromword.lists={thisIsAListItem:function(a,b){return t.isEdgeListItem(a,b)||b.attributes.style&&b.attributes.style.match(/mso\-list:\s?l\d/)&&"li"!==b.parent.name||b.attributes["cke-dissolved"]||b.getHtml().match(/<!\-\-\[if !supportLists]\-\->/)?!0:!1},convertToFakeListItem:function(a,
|
||||
b){t.isDegenerateListItem(a,b)&&t.assignListLevels(a,b);this.getListItemInfo(b);if(!b.attributes["cke-dissolved"]){var c;b.forEach(function(a){!c&&"img"==a.name&&a.attributes["cke-ignored"]&&"*"==a.attributes.alt&&(c="·",a.remove())},CKEDITOR.NODE_ELEMENT);b.forEach(function(a){c||a.value.match(/^ /)||(c=a.value)},CKEDITOR.NODE_TEXT);if("undefined"==typeof c)return;b.attributes["cke-symbol"]=c.replace(/(?: | ).*$/,"");f.removeSymbolText(b)}if(b.attributes.style){var d=m.parseCssText(b.attributes.style);
|
||||
d["margin-left"]&&(delete d["margin-left"],b.attributes.style=CKEDITOR.tools.writeCssText(d))}b.name="cke:li"},convertToRealListItems:function(a){var b=[];a.forEach(function(a){"cke:li"==a.name&&(a.name="li",b.push(a))},CKEDITOR.NODE_ELEMENT,!1);return b},removeSymbolText:function(a){var b,c=a.attributes["cke-symbol"];a.forEach(function(d){!b&&-1<d.value.indexOf(c)&&(d.value=d.value.replace(c,""),d.parent.getHtml().match(/^(\s| )*$/)&&(b=d.parent!==a?d.parent:null))},CKEDITOR.NODE_TEXT);b&&b.remove()},
|
||||
setListSymbol:function(a,b,c){c=c||1;var d=m.parseCssText(a.attributes.style);if("ol"==a.name){if(a.attributes.type||d["list-style-type"])return;var e={"[ivx]":"lower-roman","[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"},g;for(g in e)if(f.getSubsectionSymbol(b).match(new RegExp(g))){d["list-style-type"]=e[g];break}a.attributes["cke-list-style-type"]=d["list-style-type"]}else e={"·":"disc",o:"circle","§":"square"},!d["list-style-type"]&&e[b]&&(d["list-style-type"]=
|
||||
e[b]);f.setListSymbol.removeRedundancies(d,c);(a.attributes.style=CKEDITOR.tools.writeCssText(d))||delete a.attributes.style},setListStart:function(a){for(var b=[],c=0,d=0;d<a.children.length;d++)b.push(a.children[d].attributes["cke-symbol"]||"");b[0]||c++;switch(a.attributes["cke-list-style-type"]){case "lower-roman":case "upper-roman":a.attributes.start=f.toArabic(f.getSubsectionSymbol(b[c]))-c;break;case "lower-alpha":case "upper-alpha":a.attributes.start=f.getSubsectionSymbol(b[c]).replace(/\W/g,
|
||||
"").toLowerCase().charCodeAt(0)-96-c;break;case "decimal":a.attributes.start=parseInt(f.getSubsectionSymbol(b[c]),10)-c||1}"1"==a.attributes.start&&delete a.attributes.start;delete a.attributes["cke-list-style-type"]},numbering:{toNumber:function(a,b){function c(a){a=a.toUpperCase();for(var b=1,c=1;0<a.length;c*=26)b+="ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a.charAt(a.length-1))*c,a=a.substr(0,a.length-1);return b}function d(a){var b=[[1E3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,
|
||||
"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];a=a.toUpperCase();for(var c=b.length,d=0,f=0;f<c;++f)for(var n=b[f],r=n[1].length;a.substr(0,r)==n[1];a=a.substr(r))d+=n[0];return d}return"decimal"==b?Number(a):"upper-roman"==b||"lower-roman"==b?d(a.toUpperCase()):"lower-alpha"==b||"upper-alpha"==b?c(a):1},getStyle:function(a){a=a.slice(0,1);var b={i:"lower-roman",v:"lower-roman",x:"lower-roman",l:"lower-roman",m:"lower-roman",I:"upper-roman",V:"upper-roman",X:"upper-roman",L:"upper-roman",
|
||||
M:"upper-roman"}[a];b||(b="decimal",a.match(/[a-z]/)&&(b="lower-alpha"),a.match(/[A-Z]/)&&(b="upper-alpha"));return b}},getSubsectionSymbol:function(a){return(a.match(/([\da-zA-Z]+).?$/)||["placeholder","1"])[1]},setListDir:function(a){var b=0,c=0;a.forEach(function(a){"li"==a.name&&("rtl"==(a.attributes.dir||a.attributes.DIR||"").toLowerCase()?c++:b++)},CKEDITOR.ELEMENT_NODE);c>b&&(a.attributes.dir="rtl")},createList:function(a){return(a.attributes["cke-symbol"].match(/([\da-np-zA-NP-Z]).?/)||[])[1]?
|
||||
new CKEDITOR.htmlParser.element("ol"):new CKEDITOR.htmlParser.element("ul")},createLists:function(a){var b,c,d,e=f.convertToRealListItems(a);if(0===e.length)return[];var g=f.groupLists(e);for(a=0;a<g.length;a++){var h=g[a],l=h[0];for(d=0;d<h.length;d++)if(1==h[d].attributes["cke-list-level"]){l=h[d];break}var l=[f.createList(l)],k=l[0],n=[l[0]];k.insertBefore(h[0]);for(d=0;d<h.length;d++){b=h[d];for(c=b.attributes["cke-list-level"];c>l.length;){var r=f.createList(b),m=k.children;0<m.length?m[m.length-
|
||||
1].add(r):(m=new CKEDITOR.htmlParser.element("li",{style:"list-style-type:none"}),m.add(r),k.add(m));l.push(r);n.push(r);k=r;c==l.length&&f.setListSymbol(r,b.attributes["cke-symbol"],c)}for(;c<l.length;)l.pop(),k=l[l.length-1],c==l.length&&f.setListSymbol(k,b.attributes["cke-symbol"],c);b.remove();k.add(b)}l[0].children.length&&(d=l[0].children[0].attributes["cke-symbol"],!d&&1<l[0].children.length&&(d=l[0].children[1].attributes["cke-symbol"]),d&&f.setListSymbol(l[0],d));for(d=0;d<n.length;d++)f.setListStart(n[d]);
|
||||
for(d=0;d<h.length;d++)this.determineListItemValue(h[d])}return e},cleanup:function(a){var b=["cke-list-level","cke-symbol","cke-list-id","cke-indentation","cke-dissolved"],c,d;for(c=0;c<a.length;c++)for(d=0;d<b.length;d++)delete a[c].attributes[b[d]]},determineListItemValue:function(a){if("ol"===a.parent.name){var b=this.calculateValue(a),c=a.attributes["cke-symbol"].match(/[a-z0-9]+/gi),d;c&&(c=c[c.length-1],d=a.parent.attributes["cke-list-style-type"]||this.numbering.getStyle(c),c=this.numbering.toNumber(c,
|
||||
d),c!==b&&(a.attributes.value=c))}},calculateValue:function(a){if(!a.parent)return 1;var b=a.parent;a=a.getIndex();var c=null,d,e,g;for(g=a;0<=g&&null===c;g--)e=b.children[g],e.attributes&&void 0!==e.attributes.value&&(d=g,c=parseInt(e.attributes.value,10));null===c&&(c=void 0!==b.attributes.start?parseInt(b.attributes.start,10):1,d=0);return c+(a-d)},dissolveList:function(a){function b(a){return 50<=a?"l"+b(a-50):40<=a?"xl"+b(a-40):10<=a?"x"+b(a-10):9==a?"ix":5<=a?"v"+b(a-5):4==a?"iv":1<=a?"i"+b(a-
|
||||
1):""}function c(a,b){function c(b,d){return b&&b.parent?a(b.parent)?c(b.parent,d+1):c(b.parent,d):d}return c(b,0)}var d=function(a){return function(b){return b.name==a}},e=function(a){return d("ul")(a)||d("ol")(a)},g=CKEDITOR.tools.array,h=[],f,q;a.forEach(function(a){h.push(a)},CKEDITOR.NODE_ELEMENT,!1);f=g.filter(h,d("li"));var n=g.filter(h,e);g.forEach(n,function(a){var h=a.attributes.type,f=parseInt(a.attributes.start,10)||1,l=c(e,a)+1;h||(h=m.parseCssText(a.attributes.style)["list-style-type"]);
|
||||
g.forEach(g.filter(a.children,d("li")),function(c,d){var e;switch(h){case "disc":e="·";break;case "circle":e="o";break;case "square":e="§";break;case "1":case "decimal":e=f+d+".";break;case "a":case "lower-alpha":e=String.fromCharCode(97+f-1+d)+".";break;case "A":case "upper-alpha":e=String.fromCharCode(65+f-1+d)+".";break;case "i":case "lower-roman":e=b(f+d)+".";break;case "I":case "upper-roman":e=b(f+d).toUpperCase()+".";break;default:e="ul"==a.name?"·":f+d+"."}c.attributes["cke-symbol"]=e;c.attributes["cke-list-level"]=
|
||||
l})});f=g.reduce(f,function(a,b){var c=b.children[0];if(c&&c.name&&c.attributes.style&&c.attributes.style.match(/mso-list:/i)){k.pushStylesLower(b,{"list-style-type":!0,display:!0});var d=m.parseCssText(c.attributes.style,!0);k.setStyle(b,"mso-list",d["mso-list"],!0);k.setStyle(c,"mso-list","");delete b["cke-list-level"];(c=d.display?"display":d.DISPLAY?"DISPLAY":"")&&k.setStyle(b,"display",d[c],!0)}if(1===b.children.length&&e(b.children[0]))return a;b.name="p";b.attributes["cke-dissolved"]=!0;a.push(b);
|
||||
return a},[]);for(q=f.length-1;0<=q;q--)f[q].insertAfter(a);for(q=n.length-1;0<=q;q--)delete n[q].name},groupLists:function(a){var b,c,d=[[a[0]]],e=d[0];c=a[0];c.attributes["cke-indentation"]=c.attributes["cke-indentation"]||f.getElementIndentation(c);for(b=1;b<a.length;b++){c=a[b];var g=a[b-1];c.attributes["cke-indentation"]=c.attributes["cke-indentation"]||f.getElementIndentation(c);c.previous!==g&&(f.chopDiscontinuousLists(e,d),d.push(e=[]));e.push(c)}f.chopDiscontinuousLists(e,d);return d},chopDiscontinuousLists:function(a,
|
||||
b){for(var c={},d=[[]],e,g=0;g<a.length;g++){var h=c[a[g].attributes["cke-list-level"]],l=this.getListItemInfo(a[g]),k,n;h?(n=h.type.match(/alpha/)&&7==h.index?"alpha":n,n="o"==a[g].attributes["cke-symbol"]&&14==h.index?"alpha":n,k=f.getSymbolInfo(a[g].attributes["cke-symbol"],n),l=this.getListItemInfo(a[g]),(h.type!=k.type||e&&l.id!=e.id&&!this.isAListContinuation(a[g]))&&d.push([])):k=f.getSymbolInfo(a[g].attributes["cke-symbol"]);for(e=parseInt(a[g].attributes["cke-list-level"],10)+1;20>e;e++)c[e]&&
|
||||
delete c[e];c[a[g].attributes["cke-list-level"]]=k;d[d.length-1].push(a[g]);e=l}[].splice.apply(b,[].concat([m.indexOf(b,a),1],d))},isAListContinuation:function(a){var b=a;do if((b=b.previous)&&b.type===CKEDITOR.NODE_ELEMENT){if(void 0===b.attributes["cke-list-level"])break;if(b.attributes["cke-list-level"]===a.attributes["cke-list-level"])return b.attributes["cke-list-id"]===a.attributes["cke-list-id"]}while(b);return!1},getElementIndentation:function(a){a=m.parseCssText(a.attributes.style);if(a.margin||
|
||||
a.MARGIN){a.margin=a.margin||a.MARGIN;var b={styles:{margin:a.margin}};CKEDITOR.filter.transformationsTools.splitMarginShorthand(b);a["margin-left"]=b.styles["margin-left"]}return parseInt(m.convertToPx(a["margin-left"]||"0px"),10)},toArabic:function(a){return a.match(/[ivxl]/i)?a.match(/^l/i)?50+f.toArabic(a.slice(1)):a.match(/^lx/i)?40+f.toArabic(a.slice(1)):a.match(/^x/i)?10+f.toArabic(a.slice(1)):a.match(/^ix/i)?9+f.toArabic(a.slice(2)):a.match(/^v/i)?5+f.toArabic(a.slice(1)):a.match(/^iv/i)?
|
||||
4+f.toArabic(a.slice(2)):a.match(/^i/i)?1+f.toArabic(a.slice(1)):f.toArabic(a.slice(1)):0},getSymbolInfo:function(a,b){var c=a.toUpperCase()==a?"upper-":"lower-",d={"·":["disc",-1],o:["circle",-2],"§":["square",-3]};if(a in d||b&&b.match(/(disc|circle|square)/))return{index:d[a][1],type:d[a][0]};if(a.match(/\d/))return{index:a?parseInt(f.getSubsectionSymbol(a),10):0,type:"decimal"};a=a.replace(/\W/g,"").toLowerCase();return!b&&a.match(/[ivxl]+/i)||b&&"alpha"!=b||"roman"==b?{index:f.toArabic(a),type:c+
|
||||
"roman"}:a.match(/[a-z]/i)?{index:a.charCodeAt(0)-97,type:c+"alpha"}:{index:-1,type:"disc"}},getListItemInfo:function(a){if(void 0!==a.attributes["cke-list-id"])return{id:a.attributes["cke-list-id"],level:a.attributes["cke-list-level"]};var b=m.parseCssText(a.attributes.style)["mso-list"],c={id:"0",level:"1"};b&&(b+=" ",c.level=b.match(/level(.+?)\s+/)[1],c.id=b.match(/l(\d+?)\s+/)[1]);a.attributes["cke-list-level"]=void 0!==a.attributes["cke-list-level"]?a.attributes["cke-list-level"]:c.level;a.attributes["cke-list-id"]=
|
||||
c.id;return c}};f=CKEDITOR.plugins.pastefromword.lists;CKEDITOR.plugins.pastefromword.images={extractFromRtf:function(a){var b=[],c=/\{\\pict[\s\S]+?\\bliptag\-?\d+(\\blipupi\-?\d+)?(\{\\\*\\blipuid\s?[\da-fA-F]+)?[\s\}]*?/,d;a=a.match(new RegExp("(?:("+c.source+"))([\\da-fA-F\\s]+)\\}","g"));if(!a)return b;for(var e=0;e<a.length;e++)if(c.test(a[e])){if(-1!==a[e].indexOf("\\pngblip"))d="image/png";else if(-1!==a[e].indexOf("\\jpegblip"))d="image/jpeg";else continue;b.push({hex:d?a[e].replace(c,"").replace(/[^\da-fA-F]/g,
|
||||
""):null,type:d})}return b},extractTagsFromHtml:function(a){for(var b=/<img[^>]+src="([^"]+)[^>]+/g,c=[],d;d=b.exec(a);)c.push(d[1]);return c}};CKEDITOR.plugins.pastefromword.heuristics={isEdgeListItem:function(a,b){if(!CKEDITOR.env.edge||!a.config.pasteFromWord_heuristicsEdgeList)return!1;var c="";b.forEach&&b.forEach(function(a){c+=a.value},CKEDITOR.NODE_TEXT);return c.match(/^(?: | )*\(?[a-zA-Z0-9]+?[\.\)](?: | ){2,}/)?!0:t.isDegenerateListItem(a,b)},cleanupEdgeListItem:function(a){var b=
|
||||
!1;a.forEach(function(a){b||(a.value=a.value.replace(/^(?: |[\s])+/,""),a.value.length&&(b=!0))},CKEDITOR.NODE_TEXT)},isDegenerateListItem:function(a,b){return!!b.attributes["cke-list-level"]||b.attributes.style&&!b.attributes.style.match(/mso\-list/)&&!!b.find(function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&b.name.match(/h\d/i)&&a.getHtml().match(/^[a-zA-Z0-9]+?[\.\)]$/))return!0;var d=m.parseCssText(a.attributes&&a.attributes.style,!0);if(!d)return!1;var e=d["font-family"]||"";return(d.font||
|
||||
d["font-size"]||"").match(/7pt/i)&&!!a.previous||e.match(/symbol/i)},!0).length},assignListLevels:function(a,b){if(!b.attributes||void 0===b.attributes["cke-list-level"]){for(var c=[f.getElementIndentation(b)],d=[b],e=[],g=CKEDITOR.tools.array,h=g.map;b.next&&b.next.attributes&&!b.next.attributes["cke-list-level"]&&t.isDegenerateListItem(a,b.next);)b=b.next,c.push(f.getElementIndentation(b)),d.push(b);var k=h(c,function(a,b){return 0===b?0:a-c[b-1]}),m=this.guessIndentationStep(g.filter(c,function(a){return 0!==
|
||||
a})),e=h(c,function(a){return Math.round(a/m)});-1!==g.indexOf(e,0)&&(e=h(e,function(a){return a+1}));g.forEach(d,function(a,b){a.attributes["cke-list-level"]=e[b]});return{indents:c,levels:e,diffs:k}}},guessIndentationStep:function(a){return a.length?Math.min.apply(null,a):null},correctLevelShift:function(a){if(this.isShifted(a)){var b=CKEDITOR.tools.array.filter(a.children,function(a){return"ul"==a.name||"ol"==a.name}),c=CKEDITOR.tools.array.reduce(b,function(a,b){return(b.children&&1==b.children.length&&
|
||||
t.isShifted(b.children[0])?[b]:b.children).concat(a)},[]);CKEDITOR.tools.array.forEach(b,function(a){a.remove()});CKEDITOR.tools.array.forEach(c,function(b){a.add(b)});delete a.name}},isShifted:function(a){return"li"!==a.name?!1:0===CKEDITOR.tools.array.filter(a.children,function(a){return a.name&&("ul"==a.name||"ol"==a.name||"p"==a.name&&0===a.children.length)?!1:!0}).length}};t=CKEDITOR.plugins.pastefromword.heuristics;f.setListSymbol.removeRedundancies=function(a,b){(1===b&&"disc"===a["list-style-type"]||
|
||||
"decimal"===a["list-style-type"])&&delete a["list-style-type"]};CKEDITOR.plugins.pastefromword.createAttributeStack=x;CKEDITOR.config.pasteFromWord_heuristicsEdgeList=!0})();
|
||||
(function(){function u(){return!1}function y(a,b){var c,d=[];a.filterChildren(b);for(c=a.children.length-1;0<=c;c--)d.unshift(a.children[c]),a.children[c].remove();c=a.attributes;var e=a,h=!0,f;for(f in c)if(h)h=!1;else{var l=new CKEDITOR.htmlParser.element(a.name);l.attributes[f]=c[f];e.add(l);e=l;delete c[f]}for(c=0;c<d.length;c++)e.add(d[c])}function w(a){var b=a.margin?"margin":a.MARGIN?"MARGIN":!1,c,d;if(b){d=CKEDITOR.tools.style.parse.margin(a[b]);for(c in d){var e=d[c];parseFloat(e)&&(a["margin-"+
|
||||
c]=e)}delete a[b]}}var g,k,t,p,m=CKEDITOR.tools,z=["o:p","xml","script","meta","link"],A="v:arc v:curve v:line v:oval v:polyline v:rect v:roundrect v:group".split(" "),x={},v=0;CKEDITOR.plugins.pastefromword={};CKEDITOR.cleanWord=function(a,b){function c(a){(a.attributes["o:gfxdata"]||"v:group"===a.parent.name)&&e.push(a.attributes.id)}var d=Boolean(a.match(/mso-list:\s*l\d+\s+level\d+\s+lfo\d+/)),e=[];CKEDITOR.plugins.clipboard.isCustomDataTypesSupported&&(a=CKEDITOR.plugins.pastefromword.styles.inliner.inline(a).getBody().getHtml());
|
||||
a=a.replace(/<!\[/g,"\x3c!--[").replace(/\]>/g,"]--\x3e");var h=CKEDITOR.htmlParser.fragment.fromHtml(a),f={root:function(a){a.filterChildren(p);CKEDITOR.plugins.pastefromword.lists.cleanup(g.createLists(a))},elementNames:[[/^\?xml:namespace$/,""],[/^v:shapetype/,""],[new RegExp(z.join("|")),""]],elements:{a:function(a){if(a.attributes.name){if("_GoBack"==a.attributes.name){delete a.name;return}if(a.attributes.name.match(/^OLE_LINK\d+$/)){delete a.name;return}}if(a.attributes.href&&a.attributes.href.match(/#.+$/)){var b=
|
||||
a.attributes.href.match(/#(.+)$/)[1];x[b]=a}a.attributes.name&&x[a.attributes.name]&&(a=x[a.attributes.name],a.attributes.href=a.attributes.href.replace(/.*#(.*)$/,"#$1"))},div:function(a){k.createStyleStack(a,p,b)},img:function(a){if(a.parent&&a.parent.attributes){var b=a.parent.attributes;(b=b.style||b.STYLE)&&b.match(/mso\-list:\s?Ignore/)&&(a.attributes["cke-ignored"]=!0)}k.mapStyles(a,{width:function(b){k.setStyle(a,"width",b+"px")},height:function(b){k.setStyle(a,"height",b+"px")}});a.attributes.src&&
|
||||
a.attributes.src.match(/^file:\/\//)&&a.attributes.alt&&a.attributes.alt.match(/^https?:\/\//)&&(a.attributes.src=a.attributes.alt);var b=a.attributes["v:shapes"]?a.attributes["v:shapes"].split(" "):[],c=CKEDITOR.tools.array.every(b,function(a){return-1<e.indexOf(a)});if(b.length&&c)return!1},p:function(a){a.filterChildren(p);if(a.attributes.style&&a.attributes.style.match(/display:\s*none/i))return!1;if(g.thisIsAListItem(b,a))t.isEdgeListItem(b,a)&&t.cleanupEdgeListItem(a),g.convertToFakeListItem(b,
|
||||
a),m.array.reduce(a.children,function(a,b){"p"===b.name&&(0<a&&(new CKEDITOR.htmlParser.element("br")).insertBefore(b),b.replaceWithChildren(),a+=1);return a},0);else{var c=a.getAscendant(function(a){return"ul"==a.name||"ol"==a.name}),d=m.parseCssText(a.attributes.style);c&&!c.attributes["cke-list-level"]&&d["mso-list"]&&d["mso-list"].match(/level/)&&(c.attributes["cke-list-level"]=d["mso-list"].match(/level(\d+)/)[1]);b.config.enterMode==CKEDITOR.ENTER_BR&&(delete a.name,a.add(new CKEDITOR.htmlParser.element("br")))}k.createStyleStack(a,
|
||||
p,b)},pre:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h1:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h2:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h3:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h4:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h5:function(a){g.thisIsAListItem(b,
|
||||
a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},h6:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,p,b)},font:function(a){if(a.getHtml().match(/^\s*$/))return(new CKEDITOR.htmlParser.text(" ")).insertAfter(a),!1;b&&!0===b.config.pasteFromWordRemoveFontStyles&&a.attributes.size&&delete a.attributes.size;CKEDITOR.dtd.tr[a.parent.name]&&CKEDITOR.tools.arrayCompare(CKEDITOR.tools.objectKeys(a.attributes),["class","style"])?k.createStyleStack(a,p,b):y(a,
|
||||
p)},ul:function(a){if(d)return"li"==a.parent.name&&0===m.indexOf(a.parent.children,a)&&k.setStyle(a.parent,"list-style-type","none"),g.dissolveList(a),!1},li:function(a){t.correctLevelShift(a);d&&(a.attributes.style=k.normalizedStyles(a,b),k.pushStylesLower(a))},ol:function(a){if(d)return"li"==a.parent.name&&0===m.indexOf(a.parent.children,a)&&k.setStyle(a.parent,"list-style-type","none"),g.dissolveList(a),!1},span:function(a){a.filterChildren(p);a.attributes.style=k.normalizedStyles(a,b);if(!a.attributes.style||
|
||||
a.attributes.style.match(/^mso\-bookmark:OLE_LINK\d+$/)||a.getHtml().match(/^(\s| )+$/)){for(var c=a.children.length-1;0<=c;c--)a.children[c].insertAfter(a);return!1}a.attributes.style.match(/FONT-FAMILY:\s*Symbol/i)&&a.forEach(function(a){a.value=a.value.replace(/ /g,"")},CKEDITOR.NODE_TEXT,!0);k.createStyleStack(a,p,b)},table:function(a){a._tdBorders={};a.filterChildren(p);var b,c=0,d;for(d in a._tdBorders)a._tdBorders[d]>c&&(c=a._tdBorders[d],b=d);k.setStyle(a,"border",b);c=(b=a.parent)&&
|
||||
b.parent;if(b.name&&"div"===b.name&&b.attributes.align&&1===m.objectKeys(b.attributes).length&&1===b.children.length){a.attributes.align=b.attributes.align;d=b.children.splice(0);a.remove();for(a=d.length-1;0<=a;a--)c.add(d[a],b.getIndex());b.remove()}},td:function(a){var c=a.getAscendant("table"),d=c._tdBorders,e=["border","border-top","border-right","border-bottom","border-left"],c=m.parseCssText(c.attributes.style),f=c.background||c.BACKGROUND;f&&k.setStyle(a,"background",f,!0);(c=c["background-color"]||
|
||||
c["BACKGROUND-COLOR"])&&k.setStyle(a,"background-color",c,!0);var c=m.parseCssText(a.attributes.style),h;for(h in c)f=c[h],delete c[h],c[h.toLowerCase()]=f;for(h=0;h<e.length;h++)c[e[h]]&&(f=c[e[h]],d[f]=d[f]?d[f]+1:1);k.createStyleStack(a,p,b,/margin|text\-align|padding|list\-style\-type|width|height|border|white\-space|vertical\-align|background/i)},"v:imagedata":u,"v:shape":function(a){var b=!1;if(null===a.getFirst("v:imagedata"))c(a);else{a.parent.find(function(c){"img"==c.name&&c.attributes&&
|
||||
c.attributes["v:shapes"]==a.attributes.id&&(b=!0)},!0);if(b)return!1;var d="";"v:group"===a.parent.name?c(a):(a.forEach(function(a){a.attributes&&a.attributes.src&&(d=a.attributes.src)},CKEDITOR.NODE_ELEMENT,!0),a.filterChildren(p),a.name="img",a.attributes.src=a.attributes.src||d,delete a.attributes.type)}},style:function(){return!1},object:function(a){return!(!a.attributes||!a.attributes.data)}},attributes:{style:function(a,c){return k.normalizedStyles(c,b)||!1},"class":function(a){a=a.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/ig,
|
||||
"");return""===a?!1:a},cellspacing:u,cellpadding:u,border:u,"v:shapes":u,"o:spid":u},comment:function(a){a.match(/\[if.* supportFields.*\]/)&&v++;"[endif]"==a&&(v=0<v?v-1:0);return!1},text:function(a,b){if(v)return"";var c=b.parent&&b.parent.parent;return c&&c.attributes&&c.attributes.style&&c.attributes.style.match(/mso-list:\s*ignore/i)?a.replace(/ /g," "):a}};CKEDITOR.tools.array.forEach(A,function(a){f.elements[a]=c});p=new CKEDITOR.htmlParser.filter(f);var l=new CKEDITOR.htmlParser.basicWriter;
|
||||
p.applyTo(h);h.writeHtml(l);return l.getHtml()};CKEDITOR.plugins.pastefromword.styles={setStyle:function(a,b,c,d){var e=m.parseCssText(a.attributes.style);d&&e[b]||(""===c?delete e[b]:e[b]=c,a.attributes.style=CKEDITOR.tools.writeCssText(e))},mapStyles:function(a,b){for(var c in b)if(a.attributes[c]){if("function"===typeof b[c])b[c](a.attributes[c]);else k.setStyle(a,b[c],a.attributes[c]);delete a.attributes[c]}},normalizedStyles:function(a,b){var c="background-color:transparent border-image:none color:windowtext direction:ltr mso- visibility:visible div:border:none".split(" "),
|
||||
d="font-family font font-size color background-color line-height text-decoration".split(" "),e=function(){for(var a=[],b=0;b<arguments.length;b++)arguments[b]&&a.push(arguments[b]);return-1!==m.indexOf(c,a.join(":"))},h=b&&!0===b.config.pasteFromWordRemoveFontStyles,f=m.parseCssText(a.attributes.style);"cke:li"==a.name&&(f["TEXT-INDENT"]&&f.MARGIN?(a.attributes["cke-indentation"]=g.getElementIndentation(a),f.MARGIN=f.MARGIN.replace(/(([\w\.]+ ){3,3})[\d\.]+(\w+$)/,"$10$3")):delete f["TEXT-INDENT"],
|
||||
delete f["text-indent"]);for(var l=m.objectKeys(f),q=0;q<l.length;q++){var n=l[q].toLowerCase(),r=f[l[q]],k=CKEDITOR.tools.indexOf;(h&&-1!==k(d,n.toLowerCase())||e(null,n,r)||e(null,n.replace(/\-.*$/,"-"))||e(null,n)||e(a.name,n,r)||e(a.name,n.replace(/\-.*$/,"-"))||e(a.name,n)||e(r))&&delete f[l[q]]}w(f);(function(){CKEDITOR.tools.array.forEach(["top","right","bottom","left"],function(a){a="margin-"+a;parseFloat(f[a])?f[a]=CKEDITOR.tools.convertToPx(f[a])+"px":delete f[a]})})();return CKEDITOR.tools.writeCssText(f)},
|
||||
createStyleStack:function(a,b,c,d){var e=[];a.filterChildren(b);for(b=a.children.length-1;0<=b;b--)e.unshift(a.children[b]),a.children[b].remove();k.sortStyles(a);b=m.parseCssText(k.normalizedStyles(a,c));c=a;var h="span"===a.name,f;for(f in b)if(!f.match(d||/margin((?!-)|-left|-top|-bottom|-right)|text-indent|text-align|width|border|padding/i))if(h)h=!1;else{var l=new CKEDITOR.htmlParser.element("span");l.attributes.style=f+":"+b[f];c.add(l);c=l;delete b[f]}CKEDITOR.tools.isEmpty(b)?delete a.attributes.style:
|
||||
a.attributes.style=CKEDITOR.tools.writeCssText(b);for(b=0;b<e.length;b++)c.add(e[b])},sortStyles:function(a){for(var b=["border","border-bottom","font-size","background"],c=m.parseCssText(a.attributes.style),d=m.objectKeys(c),e=[],h=[],f=0;f<d.length;f++)-1!==m.indexOf(b,d[f].toLowerCase())?e.push(d[f]):h.push(d[f]);e.sort(function(a,c){var d=m.indexOf(b,a.toLowerCase()),e=m.indexOf(b,c.toLowerCase());return d-e});d=[].concat(e,h);e={};for(f=0;f<d.length;f++)e[d[f]]=c[d[f]];a.attributes.style=CKEDITOR.tools.writeCssText(e)},
|
||||
pushStylesLower:function(a,b,c){if(!a.attributes.style||0===a.children.length)return!1;b=b||{};var d={"list-style-type":!0,width:!0,height:!0,border:!0,"border-":!0},e=m.parseCssText(a.attributes.style),h;for(h in e)if(!(h.toLowerCase()in d||d[h.toLowerCase().replace(/\-.*$/,"-")]||h.toLowerCase()in b)){for(var f=!1,l=0;l<a.children.length;l++){var g=a.children[l];if(g.type===CKEDITOR.NODE_TEXT&&c){var n=new CKEDITOR.htmlParser.element("span");n.setHtml(g.value);g.replaceWith(n);g=n}g.type===CKEDITOR.NODE_ELEMENT&&
|
||||
(f=!0,k.setStyle(g,h,e[h]))}f&&delete e[h]}a.attributes.style=CKEDITOR.tools.writeCssText(e);return!0},inliner:{filtered:"break-before break-after break-inside page-break page-break-before page-break-after page-break-inside".split(" "),parse:function(a){function b(a){var b=new CKEDITOR.dom.element("style"),c=new CKEDITOR.dom.element("iframe");c.hide();CKEDITOR.document.getBody().append(c);c.$.contentDocument.documentElement.appendChild(b.$);b.$.textContent=a;c.remove();return b.$.sheet}function c(a){var b=
|
||||
a.indexOf("{"),c=a.indexOf("}");return d(a.substring(b+1,c),!0)}var d=CKEDITOR.tools.parseCssText,e=CKEDITOR.plugins.pastefromword.styles.inliner.filter,h=a.is?a.$.sheet:b(a);a=[];var f;if(h)for(h=h.cssRules,f=0;f<h.length;f++)h[f].type===window.CSSRule.STYLE_RULE&&a.push({selector:h[f].selectorText,styles:e(c(h[f].cssText))});return a},filter:function(a){var b=CKEDITOR.plugins.pastefromword.styles.inliner.filtered,c=m.array.indexOf,d={},e;for(e in a)-1===c(b,e)&&(d[e]=a[e]);return d},sort:function(a){return a.sort(function(a){var c=
|
||||
CKEDITOR.tools.array.map(a,function(a){return a.selector});return function(a,b){var h=-1!==(""+a.selector).indexOf(".")?1:0,h=(-1!==(""+b.selector).indexOf(".")?1:0)-h;return 0!==h?h:c.indexOf(b.selector)-c.indexOf(a.selector)}}(a))},inline:function(a){var b=CKEDITOR.plugins.pastefromword.styles.inliner.parse,c=CKEDITOR.plugins.pastefromword.styles.inliner.sort,d=function(a){a=(new DOMParser).parseFromString(a,"text/html");return new CKEDITOR.dom.document(a)}(a);a=d.find("style");c=c(function(a){var c=
|
||||
[],d;for(d=0;d<a.count();d++)c=c.concat(b(a.getItem(d)));return c}(a));CKEDITOR.tools.array.forEach(c,function(a){var b=a.styles;a=d.find(a.selector);var c,g,q;w(b);for(q=0;q<a.count();q++)c=a.getItem(q),g=CKEDITOR.tools.parseCssText(c.getAttribute("style")),w(g),g=CKEDITOR.tools.extend({},g,b),c.setAttribute("style",CKEDITOR.tools.writeCssText(g))});return d}}};k=CKEDITOR.plugins.pastefromword.styles;CKEDITOR.plugins.pastefromword.lists={thisIsAListItem:function(a,b){return t.isEdgeListItem(a,b)||
|
||||
b.attributes.style&&b.attributes.style.match(/mso\-list:\s?l\d/)&&"li"!==b.parent.name||b.attributes["cke-dissolved"]||b.getHtml().match(/<!\-\-\[if !supportLists]\-\->/)?!0:!1},convertToFakeListItem:function(a,b){t.isDegenerateListItem(a,b)&&t.assignListLevels(a,b);this.getListItemInfo(b);if(!b.attributes["cke-dissolved"]){var c;b.forEach(function(a){!c&&"img"==a.name&&a.attributes["cke-ignored"]&&"*"==a.attributes.alt&&(c="·",a.remove())},CKEDITOR.NODE_ELEMENT);b.forEach(function(a){c||a.value.match(/^ /)||
|
||||
(c=a.value)},CKEDITOR.NODE_TEXT);if("undefined"==typeof c)return;b.attributes["cke-symbol"]=c.replace(/(?: | ).*$/,"");g.removeSymbolText(b)}if(b.attributes.style){var d=m.parseCssText(b.attributes.style);d["margin-left"]&&(delete d["margin-left"],b.attributes.style=CKEDITOR.tools.writeCssText(d))}b.name="cke:li"},convertToRealListItems:function(a){var b=[];a.forEach(function(a){"cke:li"==a.name&&(a.name="li",b.push(a))},CKEDITOR.NODE_ELEMENT,!1);return b},removeSymbolText:function(a){var b,
|
||||
c=a.attributes["cke-symbol"];a.forEach(function(d){!b&&-1<d.value.indexOf(c)&&(d.value=d.value.replace(c,""),d.parent.getHtml().match(/^(\s| )*$/)&&(b=d.parent!==a?d.parent:null))},CKEDITOR.NODE_TEXT);b&&b.remove()},setListSymbol:function(a,b,c){c=c||1;var d=m.parseCssText(a.attributes.style);if("ol"==a.name){if(a.attributes.type||d["list-style-type"])return;var e={"[ivx]":"lower-roman","[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"},h;for(h in e)if(g.getSubsectionSymbol(b).match(new RegExp(h))){d["list-style-type"]=
|
||||
e[h];break}a.attributes["cke-list-style-type"]=d["list-style-type"]}else e={"·":"disc",o:"circle","§":"square"},!d["list-style-type"]&&e[b]&&(d["list-style-type"]=e[b]);g.setListSymbol.removeRedundancies(d,c);(a.attributes.style=CKEDITOR.tools.writeCssText(d))||delete a.attributes.style},setListStart:function(a){for(var b=[],c=0,d=0;d<a.children.length;d++)b.push(a.children[d].attributes["cke-symbol"]||"");b[0]||c++;switch(a.attributes["cke-list-style-type"]){case "lower-roman":case "upper-roman":a.attributes.start=
|
||||
g.toArabic(g.getSubsectionSymbol(b[c]))-c;break;case "lower-alpha":case "upper-alpha":a.attributes.start=g.getSubsectionSymbol(b[c]).replace(/\W/g,"").toLowerCase().charCodeAt(0)-96-c;break;case "decimal":a.attributes.start=parseInt(g.getSubsectionSymbol(b[c]),10)-c||1}"1"==a.attributes.start&&delete a.attributes.start;delete a.attributes["cke-list-style-type"]},numbering:{toNumber:function(a,b){function c(a){a=a.toUpperCase();for(var b=1,c=1;0<a.length;c*=26)b+="ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a.charAt(a.length-
|
||||
1))*c,a=a.substr(0,a.length-1);return b}function d(a){var b=[[1E3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];a=a.toUpperCase();for(var c=b.length,d=0,g=0;g<c;++g)for(var n=b[g],r=n[1].length;a.substr(0,r)==n[1];a=a.substr(r))d+=n[0];return d}return"decimal"==b?Number(a):"upper-roman"==b||"lower-roman"==b?d(a.toUpperCase()):"lower-alpha"==b||"upper-alpha"==b?c(a):1},getStyle:function(a){a=a.slice(0,1);var b={i:"lower-roman",
|
||||
v:"lower-roman",x:"lower-roman",l:"lower-roman",m:"lower-roman",I:"upper-roman",V:"upper-roman",X:"upper-roman",L:"upper-roman",M:"upper-roman"}[a];b||(b="decimal",a.match(/[a-z]/)&&(b="lower-alpha"),a.match(/[A-Z]/)&&(b="upper-alpha"));return b}},getSubsectionSymbol:function(a){return(a.match(/([\da-zA-Z]+).?$/)||["placeholder","1"])[1]},setListDir:function(a){var b=0,c=0;a.forEach(function(a){"li"==a.name&&("rtl"==(a.attributes.dir||a.attributes.DIR||"").toLowerCase()?c++:b++)},CKEDITOR.ELEMENT_NODE);
|
||||
c>b&&(a.attributes.dir="rtl")},createList:function(a){return(a.attributes["cke-symbol"].match(/([\da-np-zA-NP-Z]).?/)||[])[1]?new CKEDITOR.htmlParser.element("ol"):new CKEDITOR.htmlParser.element("ul")},createLists:function(a){var b,c,d,e=g.convertToRealListItems(a);if(0===e.length)return[];var h=g.groupLists(e);for(a=0;a<h.length;a++){var f=h[a],l=f[0];for(d=0;d<f.length;d++)if(1==f[d].attributes["cke-list-level"]){l=f[d];break}var l=[g.createList(l)],k=l[0],n=[l[0]];k.insertBefore(f[0]);for(d=0;d<
|
||||
f.length;d++){b=f[d];for(c=b.attributes["cke-list-level"];c>l.length;){var r=g.createList(b),m=k.children;0<m.length?m[m.length-1].add(r):(m=new CKEDITOR.htmlParser.element("li",{style:"list-style-type:none"}),m.add(r),k.add(m));l.push(r);n.push(r);k=r;c==l.length&&g.setListSymbol(r,b.attributes["cke-symbol"],c)}for(;c<l.length;)l.pop(),k=l[l.length-1],c==l.length&&g.setListSymbol(k,b.attributes["cke-symbol"],c);b.remove();k.add(b)}l[0].children.length&&(d=l[0].children[0].attributes["cke-symbol"],
|
||||
!d&&1<l[0].children.length&&(d=l[0].children[1].attributes["cke-symbol"]),d&&g.setListSymbol(l[0],d));for(d=0;d<n.length;d++)g.setListStart(n[d]);for(d=0;d<f.length;d++)this.determineListItemValue(f[d])}return e},cleanup:function(a){var b=["cke-list-level","cke-symbol","cke-list-id","cke-indentation","cke-dissolved"],c,d;for(c=0;c<a.length;c++)for(d=0;d<b.length;d++)delete a[c].attributes[b[d]]},determineListItemValue:function(a){if("ol"===a.parent.name){var b=this.calculateValue(a),c=a.attributes["cke-symbol"].match(/[a-z0-9]+/gi),
|
||||
d;c&&(c=c[c.length-1],d=a.parent.attributes["cke-list-style-type"]||this.numbering.getStyle(c),c=this.numbering.toNumber(c,d),c!==b&&(a.attributes.value=c))}},calculateValue:function(a){if(!a.parent)return 1;var b=a.parent;a=a.getIndex();var c=null,d,e,h;for(h=a;0<=h&&null===c;h--)e=b.children[h],e.attributes&&void 0!==e.attributes.value&&(d=h,c=parseInt(e.attributes.value,10));null===c&&(c=void 0!==b.attributes.start?parseInt(b.attributes.start,10):1,d=0);return c+(a-d)},dissolveList:function(a){function b(a){return 50<=
|
||||
a?"l"+b(a-50):40<=a?"xl"+b(a-40):10<=a?"x"+b(a-10):9==a?"ix":5<=a?"v"+b(a-5):4==a?"iv":1<=a?"i"+b(a-1):""}function c(a,b){function c(b,d){return b&&b.parent?a(b.parent)?c(b.parent,d+1):c(b.parent,d):d}return c(b,0)}var d=function(a){return function(b){return b.name==a}},e=function(a){return d("ul")(a)||d("ol")(a)},h=CKEDITOR.tools.array,f=[],g,q;a.forEach(function(a){f.push(a)},CKEDITOR.NODE_ELEMENT,!1);g=h.filter(f,d("li"));var n=h.filter(f,e);h.forEach(n,function(a){var f=a.attributes.type,g=parseInt(a.attributes.start,
|
||||
10)||1,l=c(e,a)+1;f||(f=m.parseCssText(a.attributes.style)["list-style-type"]);h.forEach(h.filter(a.children,d("li")),function(c,d){var e;switch(f){case "disc":e="·";break;case "circle":e="o";break;case "square":e="§";break;case "1":case "decimal":e=g+d+".";break;case "a":case "lower-alpha":e=String.fromCharCode(97+g-1+d)+".";break;case "A":case "upper-alpha":e=String.fromCharCode(65+g-1+d)+".";break;case "i":case "lower-roman":e=b(g+d)+".";break;case "I":case "upper-roman":e=b(g+d).toUpperCase()+
|
||||
".";break;default:e="ul"==a.name?"·":g+d+"."}c.attributes["cke-symbol"]=e;c.attributes["cke-list-level"]=l})});g=h.reduce(g,function(a,b){var c=b.children[0];if(c&&c.name&&c.attributes.style&&c.attributes.style.match(/mso-list:/i)){k.pushStylesLower(b,{"list-style-type":!0,display:!0});var d=m.parseCssText(c.attributes.style,!0);k.setStyle(b,"mso-list",d["mso-list"],!0);k.setStyle(c,"mso-list","");delete b["cke-list-level"];(c=d.display?"display":d.DISPLAY?"DISPLAY":"")&&k.setStyle(b,"display",d[c],
|
||||
!0)}if(1===b.children.length&&e(b.children[0]))return a;b.name="p";b.attributes["cke-dissolved"]=!0;a.push(b);return a},[]);for(q=g.length-1;0<=q;q--)g[q].insertAfter(a);for(q=n.length-1;0<=q;q--)delete n[q].name},groupLists:function(a){var b,c,d=[[a[0]]],e=d[0];c=a[0];c.attributes["cke-indentation"]=c.attributes["cke-indentation"]||g.getElementIndentation(c);for(b=1;b<a.length;b++){c=a[b];var h=a[b-1];c.attributes["cke-indentation"]=c.attributes["cke-indentation"]||g.getElementIndentation(c);c.previous!==
|
||||
h&&(g.chopDiscontinuousLists(e,d),d.push(e=[]));e.push(c)}g.chopDiscontinuousLists(e,d);return d},chopDiscontinuousLists:function(a,b){for(var c={},d=[[]],e,h=0;h<a.length;h++){var f=c[a[h].attributes["cke-list-level"]],l=this.getListItemInfo(a[h]),k,n;f?(n=f.type.match(/alpha/)&&7==f.index?"alpha":n,n="o"==a[h].attributes["cke-symbol"]&&14==f.index?"alpha":n,k=g.getSymbolInfo(a[h].attributes["cke-symbol"],n),l=this.getListItemInfo(a[h]),(f.type!=k.type||e&&l.id!=e.id&&!this.isAListContinuation(a[h]))&&
|
||||
d.push([])):k=g.getSymbolInfo(a[h].attributes["cke-symbol"]);for(e=parseInt(a[h].attributes["cke-list-level"],10)+1;20>e;e++)c[e]&&delete c[e];c[a[h].attributes["cke-list-level"]]=k;d[d.length-1].push(a[h]);e=l}[].splice.apply(b,[].concat([m.indexOf(b,a),1],d))},isAListContinuation:function(a){var b=a;do if((b=b.previous)&&b.type===CKEDITOR.NODE_ELEMENT){if(void 0===b.attributes["cke-list-level"])break;if(b.attributes["cke-list-level"]===a.attributes["cke-list-level"])return b.attributes["cke-list-id"]===
|
||||
a.attributes["cke-list-id"]}while(b);return!1},getElementIndentation:function(a){a=m.parseCssText(a.attributes.style);if(a.margin||a.MARGIN){a.margin=a.margin||a.MARGIN;var b={styles:{margin:a.margin}};CKEDITOR.filter.transformationsTools.splitMarginShorthand(b);a["margin-left"]=b.styles["margin-left"]}return parseInt(m.convertToPx(a["margin-left"]||"0px"),10)},toArabic:function(a){return a.match(/[ivxl]/i)?a.match(/^l/i)?50+g.toArabic(a.slice(1)):a.match(/^lx/i)?40+g.toArabic(a.slice(1)):a.match(/^x/i)?
|
||||
10+g.toArabic(a.slice(1)):a.match(/^ix/i)?9+g.toArabic(a.slice(2)):a.match(/^v/i)?5+g.toArabic(a.slice(1)):a.match(/^iv/i)?4+g.toArabic(a.slice(2)):a.match(/^i/i)?1+g.toArabic(a.slice(1)):g.toArabic(a.slice(1)):0},getSymbolInfo:function(a,b){var c=a.toUpperCase()==a?"upper-":"lower-",d={"·":["disc",-1],o:["circle",-2],"§":["square",-3]};if(a in d||b&&b.match(/(disc|circle|square)/))return{index:d[a][1],type:d[a][0]};if(a.match(/\d/))return{index:a?parseInt(g.getSubsectionSymbol(a),10):0,type:"decimal"};
|
||||
a=a.replace(/\W/g,"").toLowerCase();return!b&&a.match(/[ivxl]+/i)||b&&"alpha"!=b||"roman"==b?{index:g.toArabic(a),type:c+"roman"}:a.match(/[a-z]/i)?{index:a.charCodeAt(0)-97,type:c+"alpha"}:{index:-1,type:"disc"}},getListItemInfo:function(a){if(void 0!==a.attributes["cke-list-id"])return{id:a.attributes["cke-list-id"],level:a.attributes["cke-list-level"]};var b=m.parseCssText(a.attributes.style)["mso-list"],c={id:"0",level:"1"};b&&(b+=" ",c.level=b.match(/level(.+?)\s+/)[1],c.id=b.match(/l(\d+?)\s+/)[1]);
|
||||
a.attributes["cke-list-level"]=void 0!==a.attributes["cke-list-level"]?a.attributes["cke-list-level"]:c.level;a.attributes["cke-list-id"]=c.id;return c}};g=CKEDITOR.plugins.pastefromword.lists;CKEDITOR.plugins.pastefromword.images={extractFromRtf:function(a){var b=[],c=/\{\\pict[\s\S]+?\\bliptag\-?\d+(\\blipupi\-?\d+)?(\{\\\*\\blipuid\s?[\da-fA-F]+)?[\s\}]*?/,d;a=a.match(new RegExp("(?:("+c.source+"))([\\da-fA-F\\s]+)\\}","g"));if(!a)return b;for(var e=0;e<a.length;e++)if(c.test(a[e])){if(-1!==a[e].indexOf("\\pngblip"))d=
|
||||
"image/png";else if(-1!==a[e].indexOf("\\jpegblip"))d="image/jpeg";else continue;b.push({hex:d?a[e].replace(c,"").replace(/[^\da-fA-F]/g,""):null,type:d})}return b},extractTagsFromHtml:function(a){for(var b=/<img[^>]+src="([^"]+)[^>]+/g,c=[],d;d=b.exec(a);)c.push(d[1]);return c}};CKEDITOR.plugins.pastefromword.heuristics={isEdgeListItem:function(a,b){if(!CKEDITOR.env.edge||!a.config.pasteFromWord_heuristicsEdgeList)return!1;var c="";b.forEach&&b.forEach(function(a){c+=a.value},CKEDITOR.NODE_TEXT);
|
||||
return c.match(/^(?: | )*\(?[a-zA-Z0-9]+?[\.\)](?: | ){2,}/)?!0:t.isDegenerateListItem(a,b)},cleanupEdgeListItem:function(a){var b=!1;a.forEach(function(a){b||(a.value=a.value.replace(/^(?: |[\s])+/,""),a.value.length&&(b=!0))},CKEDITOR.NODE_TEXT)},isDegenerateListItem:function(a,b){return!!b.attributes["cke-list-level"]||b.attributes.style&&!b.attributes.style.match(/mso\-list/)&&!!b.find(function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&b.name.match(/h\d/i)&&a.getHtml().match(/^[a-zA-Z0-9]+?[\.\)]$/))return!0;
|
||||
var d=m.parseCssText(a.attributes&&a.attributes.style,!0);if(!d)return!1;var e=d["font-family"]||"";return(d.font||d["font-size"]||"").match(/7pt/i)&&!!a.previous||e.match(/symbol/i)},!0).length},assignListLevels:function(a,b){if(!b.attributes||void 0===b.attributes["cke-list-level"]){for(var c=[g.getElementIndentation(b)],d=[b],e=[],h=CKEDITOR.tools.array,f=h.map;b.next&&b.next.attributes&&!b.next.attributes["cke-list-level"]&&t.isDegenerateListItem(a,b.next);)b=b.next,c.push(g.getElementIndentation(b)),
|
||||
d.push(b);var k=f(c,function(a,b){return 0===b?0:a-c[b-1]}),m=this.guessIndentationStep(h.filter(c,function(a){return 0!==a})),e=f(c,function(a){return Math.round(a/m)});-1!==h.indexOf(e,0)&&(e=f(e,function(a){return a+1}));h.forEach(d,function(a,b){a.attributes["cke-list-level"]=e[b]});return{indents:c,levels:e,diffs:k}}},guessIndentationStep:function(a){return a.length?Math.min.apply(null,a):null},correctLevelShift:function(a){if(this.isShifted(a)){var b=CKEDITOR.tools.array.filter(a.children,function(a){return"ul"==
|
||||
a.name||"ol"==a.name}),c=CKEDITOR.tools.array.reduce(b,function(a,b){return(b.children&&1==b.children.length&&t.isShifted(b.children[0])?[b]:b.children).concat(a)},[]);CKEDITOR.tools.array.forEach(b,function(a){a.remove()});CKEDITOR.tools.array.forEach(c,function(b){a.add(b)});delete a.name}},isShifted:function(a){return"li"!==a.name?!1:0===CKEDITOR.tools.array.filter(a.children,function(a){return a.name&&("ul"==a.name||"ol"==a.name||"p"==a.name&&0===a.children.length)?!1:!0}).length}};t=CKEDITOR.plugins.pastefromword.heuristics;
|
||||
g.setListSymbol.removeRedundancies=function(a,b){(1===b&&"disc"===a["list-style-type"]||"decimal"===a["list-style-type"])&&delete a["list-style-type"]};CKEDITOR.plugins.pastefromword.createAttributeStack=y;CKEDITOR.config.pasteFromWord_heuristicsEdgeList=!0})();
|
||||
@@ -24,3 +24,13 @@
|
||||
.cke_table-faked-selection::selection, .cke_table-faked-selection ::selection {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Change the cursor when selecting cells (#706).
|
||||
*
|
||||
* This solution does not work in IE, Edge and Safari due to upstream isues:
|
||||
* https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/3419602/
|
||||
* https://bugs.webkit.org/show_bug.cgi?id=53341
|
||||
*/
|
||||
table[data-cke-table-faked-selection-table] {
|
||||
cursor: cell;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This skin has been made a **default skin** starting from CKEditor 4.6.0 and is maintained by the core developers.
|
||||
|
||||
For more information about skins, please check the [CKEditor Skin SDK](https://docs.ckeditor.com/ckeditor4/docs/#!/guide/skin_sdk_intro)
|
||||
For more information about skins, please check the [CKEditor Skin SDK](https://ckeditor.com/docs/ckeditor4/latest/guide/skin_sdk_intro.html)
|
||||
documentation.
|
||||
|
||||
Features
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// ignore it. Otherwise it is strongly recommended to customize this file to match your
|
||||
// website requirements and design properly.
|
||||
//
|
||||
// For more information refer to: https://docs.ckeditor.com/ckeditor4/docs/#!/guide/dev_styles-section-style-rules
|
||||
// For more information refer to: https://ckeditor.com/docs/ckeditor4/latest/guide/dev_styles.html#style-rules
|
||||
|
||||
CKEDITOR.stylesSet.add( 'default', [
|
||||
/* Block styles */
|
||||
|
||||
|
After Width: | Height: | Size: 174 B |
|
After Width: | Height: | Size: 179 B |
|
After Width: | Height: | Size: 175 B |
|
After Width: | Height: | Size: 174 B |
|
After Width: | Height: | Size: 556 B |
|
After Width: | Height: | Size: 742 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 393 B |
|
After Width: | Height: | Size: 393 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 218 KiB |
|
After Width: | Height: | Size: 295 KiB |
|
After Width: | Height: | Size: 362 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 125 KiB |
|
After Width: | Height: | Size: 282 B |
|
After Width: | Height: | Size: 319 B |
|
After Width: | Height: | Size: 348 B |
|
After Width: | Height: | Size: 334 B |
|
After Width: | Height: | Size: 82 B |
|
After Width: | Height: | Size: 288 B |
|
After Width: | Height: | Size: 242 B |
|
After Width: | Height: | Size: 243 B |
|
After Width: | Height: | Size: 278 B |
|
After Width: | Height: | Size: 266 B |
|
After Width: | Height: | Size: 146 B |
|
After Width: | Height: | Size: 96 B |
|
After Width: | Height: | Size: 393 B |
|
After Width: | Height: | Size: 393 B |