优化后台界面,精简所有不需要用到的js插件
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewLife.Core" Version="10.10.2024.507" />
|
||||
<PackageReference Include="Senparc.Weixin" Version="6.18.1" />
|
||||
<PackageReference Include="Senparc.Weixin.MP" Version="16.21.1" />
|
||||
<PackageReference Include="NewLife.Core" Version="10.10.2024.601" />
|
||||
<PackageReference Include="Senparc.Weixin" Version="6.18.2" />
|
||||
<PackageReference Include="Senparc.Weixin.MP" Version="16.21.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="NewLife.Core" Version="10.10.2024.507" />
|
||||
<PackageReference Include="NewLife.Core" Version="10.10.2024.601" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="PinYinConverterCore" Version="1.0.2" />
|
||||
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewLife.XCode" Version="11.12.2024.515" />
|
||||
<PackageReference Include="NewLife.XCode" Version="11.13.2024.606" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('addarticlekind','添加文章栏目','/AdminCP/Article/AddArticleCategory',0,0);">
|
||||
|
||||
@@ -9,25 +9,17 @@
|
||||
}
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="return doSearch(); return false;">
|
||||
<div>
|
||||
<label class="control-label">文章栏目:</label>
|
||||
|
||||
<select class="form-control" name="kid" id="kid">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
文章栏目:<select name="kid" id="kid">
|
||||
<option value="0">所有栏目</option>
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
if (my.Roles.IsSuperAdmin != 1 && aclist.Count>0)
|
||||
if (my.Roles.IsSuperAdmin != 1 && aclist.Count > 0)
|
||||
{
|
||||
if (aclist.FindIndex(x => x == m.Id) > -1)
|
||||
{
|
||||
@@ -40,16 +32,26 @@
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label class="checkbox-inline i-checks">
|
||||
</li>
|
||||
<li>
|
||||
<label class="checkbox-inline i-checks" for="isshowsub">
|
||||
<input type="checkbox" value="1" name="isshowsub" id="isshowsub" /> 显示下级栏目文章
|
||||
</label>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
@if (AdminUtils.CheckAdminPower("add", "article"))
|
||||
{
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
ViewBag.title = "数据字典管理";
|
||||
}
|
||||
<script src="~/js/vue/vue.min.js"></script>
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="row" id="app">
|
||||
<div class="wrapper wrapper-content " id="app">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('adddepartment','添加部门','/AdminCP/Department/AddDepartment',0,0);">
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showAddRow();">
|
||||
|
||||
@@ -3,36 +3,37 @@
|
||||
ViewBag.title = "留言管理";
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="doSearch(); return false; ">
|
||||
<div>
|
||||
<label class="control-label">留言分类:</label>
|
||||
|
||||
<select class="form-control" name="kid" id="kid">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
留言分类:
|
||||
<select name="kid" id="kid">
|
||||
<option value="0">所有分类</option>
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
</select>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<table id="tb_departments"></table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
|
||||
<div class="ibox-content">
|
||||
<table id="tb_departments"></table>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<link href="~/hplus/css/style.css" rel="stylesheet" />
|
||||
<link href="~/hplus/css/font-awesome.min.css" rel="stylesheet" />
|
||||
<link href="~/hplus/css/animate.css" rel="stylesheet" />
|
||||
<link href="~/hplus/js/plugins/metismenu/metismenu.min.css" rel="stylesheet" />
|
||||
<script>if (window.top !== window.self) { window.top.location = window.location; }</script>
|
||||
</head>
|
||||
|
||||
@@ -77,7 +78,7 @@
|
||||
{
|
||||
var l2 = Model.FindAll(s => s.PId == m1.Id && s.IsHide != 1);
|
||||
<li>
|
||||
<a href="/AdminCP/@(m1.Link)" id="@m1.MenuKey" @(m1.Link != "#" ? "class=J_menuItem" : "")>
|
||||
<a href="/AdminCP/@(m1.Link)" id="@m1.MenuKey" @(m1.Link != "#" ? "class=J_menuItem" : "") >
|
||||
@if (!string.IsNullOrWhiteSpace(m1.ClassName))
|
||||
{
|
||||
<i class="fa @m1.ClassName"></i>
|
||||
|
||||
@@ -3,30 +3,25 @@
|
||||
ViewBag.title = "后台管理日志";
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="doSearch(); return false; ">
|
||||
<div>
|
||||
@*<label class="control-label">留言分类:</label>
|
||||
|
||||
<select class="form-control" name="kid" id="kid">
|
||||
<option value="0">所有分类</option>
|
||||
</select>*@
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<table id="tb_departments"></table>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addadminrole', '添加管理组', '/AdminCP/Member/AddAdminRole', 0, 0)">
|
||||
|
||||
@@ -3,34 +3,36 @@
|
||||
ViewBag.title = "管理员管理";
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline">
|
||||
<div>
|
||||
<label class="control-label">管理组:</label>
|
||||
|
||||
<select class="form-control" name="roleid" id="roleid">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
管理组:
|
||||
<select name="roleid" id="roleid">
|
||||
<option value="0">所有管理组</option>
|
||||
@foreach (var m in ViewBag.RoleList)
|
||||
{
|
||||
<option value="@m.Id">@m.RoleName</option>
|
||||
}
|
||||
</select>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="用户名关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addadmins', '添加管理员', '/AdminCP/Member/AddAdmin', 0, 0)">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addmemberrole', '添加用户组', '/AdminCP/Member/AddMemberRole', 0, 0)">
|
||||
|
||||
@@ -3,34 +3,36 @@
|
||||
ViewBag.title = "用户管理";
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline">
|
||||
<div>
|
||||
<label class="control-label">用户组:</label>
|
||||
|
||||
<select class="form-control" name="roleid" id="roleid">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
用户组:
|
||||
<select name="roleid" id="roleid">
|
||||
<option value="0">所有用户组</option>
|
||||
@foreach (var m in ViewBag.RoleList)
|
||||
{
|
||||
<option value="@m.Id">@m.RoleName</option>
|
||||
}
|
||||
</select>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="用户名关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
|
||||
<div class="ibox-content">
|
||||
@*<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addads', '添加用户', '/AdminCP/Member/AddMember', 0, 0)">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
|
||||
@@ -4,38 +4,43 @@
|
||||
}
|
||||
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="return doSearch();">
|
||||
<div>
|
||||
<label class="control-label">订单状态:</label>
|
||||
<select class="form-control" name="status" id="status">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
订单状态:
|
||||
<select name="status" id="status">
|
||||
<option value="">不限状态</option>
|
||||
<option value="未确认">未确认</option>
|
||||
<option value="已确认">已确认</option>
|
||||
<option value="已完成">已完成</option>
|
||||
</select>
|
||||
<label class="control-label">支付状态:</label>
|
||||
<select class="form-control" name="paystatus" id="paystatus">
|
||||
</li>
|
||||
<li>
|
||||
支付状态:
|
||||
<select name="paystatus" id="paystatus">
|
||||
<option value="">不限状态</option>
|
||||
<option value="未支付">未支付</option>
|
||||
<option value="已支付">已支付</option>
|
||||
</select>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<table id="tb_departments"></table>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -4,33 +4,45 @@
|
||||
}
|
||||
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="return doSearch();">
|
||||
<div>
|
||||
<label class="control-label">支付类型:</label>
|
||||
<select class="form-control" name="mytype" id="mytype">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
支付类型:
|
||||
<select name="mytype" id="mytype">
|
||||
<option value="0">不限状态</option>
|
||||
<option value="1">商品订单</option>
|
||||
<option value="2">快餐订单</option>
|
||||
<option value="3">酒店预定</option>
|
||||
<option value="99" selected>代理商认证费订单</option>
|
||||
</select>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
支付状态:
|
||||
<select name="paystatus" id="paystatus">
|
||||
<option value="">不限状态</option>
|
||||
<option value="未支付">未支付</option>
|
||||
<option value="已支付">已支付</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox float-e-margins">
|
||||
|
||||
<div class="ibox-content">
|
||||
<table id="tb_departments"></table>
|
||||
|
||||
<script>
|
||||
@@ -54,7 +66,8 @@
|
||||
limit: params.limit, //页面大小
|
||||
page: (params.offset / params.limit) + 1, //页码
|
||||
mytype: $("#mytype").val(),
|
||||
keyword: $("#keyword").val()
|
||||
keyword: $("#keyword").val(),
|
||||
paystatus: $("#paystatus").val()
|
||||
};
|
||||
return temp;
|
||||
}
|
||||
@@ -165,7 +178,7 @@
|
||||
limit: params.limit, //页面大小
|
||||
page: (params.offset / params.limit) + 1, //页码
|
||||
mytype: $("#mytype").val(),
|
||||
departmentname: $("#keyword").val()
|
||||
paystatus: $("#paystatus").val()
|
||||
};
|
||||
return temp;
|
||||
};
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showAddRow();">
|
||||
|
||||
@@ -3,34 +3,36 @@
|
||||
ViewBag.title = "广告管理";
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline">
|
||||
<div>
|
||||
<label class="control-label">广告分类:</label>
|
||||
|
||||
<select class="form-control" name="kid" id="kid">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
广告分类:
|
||||
<select name="kid" id="kid">
|
||||
<option value="0">所有栏目</option>
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
</select>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addads','添加广告','/AdminCP/Other/AddAds',0,0)">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showAddRow();">
|
||||
|
||||
@@ -3,34 +3,36 @@
|
||||
ViewBag.title = "友情链接管理";
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline">
|
||||
<div>
|
||||
<label class="control-label">友情链接分类:</label>
|
||||
|
||||
<select class="form-control" name="kid" id="kid">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
友情链接分类:
|
||||
<select name="kid" id="kid">
|
||||
<option value="0">所有分类</option>
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
<option value="@m.Id">@m.KindName</option>
|
||||
}
|
||||
</select>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addads', '添加友情链接', '/AdminCP/Other/AddLink', 0, 0)">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('addadminmenu','添加后台菜单','/AdminCP/Permission/AddAdminMenu',0,0);">
|
||||
|
||||
@@ -1,25 +1,24 @@
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>权限事件管理</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">查询条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal">
|
||||
<div class="form-group" style="margin-top:15px">
|
||||
<label class="control-label col-sm-1" for="txt_search_departmentname">权限名称</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="keyword">
|
||||
</div>
|
||||
<div class="col-sm-4" style="text-align:left;">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary">查询</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addventkey','添加权限','/AdminCP/Permission/AddEventKey',0,0)">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
}
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('addarticlekind','添加商品栏目','/AdminCP/Product/AddCategory',0,0);">
|
||||
|
||||
@@ -9,21 +9,14 @@
|
||||
}
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="return doSearch(); return false;">
|
||||
<div>
|
||||
<label class="control-label">商品分类:</label>
|
||||
|
||||
<select class="form-control" name="kid" id="kid">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
商品分类:
|
||||
<select name="kid" id="kid">
|
||||
<option value="0">所有分类</option>
|
||||
@foreach (var m in ViewBag.ListKinds)
|
||||
{
|
||||
@@ -41,16 +34,26 @@
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label class="checkbox-inline i-checks">
|
||||
<input type="checkbox" value="1" name="isshowsub" id="isshowsub" /> 显示下级栏目商品
|
||||
</li>
|
||||
<li>
|
||||
<label class="checkbox-inline i-checks" for="isshowsub">
|
||||
<input type="checkbox" value="1" name="isshowsub" id="isshowsub" /> 显示下级栏目文章
|
||||
</label>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addarticle','添加商品','/AdminCP/Product/AddProduct',0,0)">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
|
||||
@@ -4,11 +4,6 @@
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editAttachConfigForm", @class = "form-horizontal m-t" }))
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
ViewBag.title = "编辑网站基本设置";
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="row common-panel">
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editBaseConfigForm", @class = "form-horizontal m-t" }))
|
||||
{
|
||||
<div class="tabs-container">
|
||||
|
||||
@@ -4,11 +4,6 @@
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<form asp-area="AdminCP" asp-controller="System" asp-action="Robots" name="editRobotsConfigForm" id="editRobotsConfigForm" class="form-horizontal m-t" method="post">
|
||||
<div class="alert alert-info alert-dismissable">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
}
|
||||
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="row common-panel">
|
||||
<div class="tabs-container">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
|
||||
@@ -3,25 +3,27 @@
|
||||
ViewBag.Title = "微信公众号点击事件回复规则管理";
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="doSearch(); return false; ">
|
||||
<div>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addclickreplyrule','添加点击菜单回复规则','/AdminCP/Weixin/AddClickReplyRule',0,0)">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
@@ -167,4 +169,4 @@
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,11 +5,6 @@
|
||||
<script src="~/js/vue/vue.min.js"></script>
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="ibox float-e-margins" id="app">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editSubscribeReplyForm", @class = "form-horizontal m-t" }))
|
||||
{
|
||||
|
||||
@@ -3,25 +3,26 @@
|
||||
ViewBag.Title = "微信公众号关键字回复规则管理";
|
||||
}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="search-collapse">
|
||||
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
关键字:
|
||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">筛选条件</div>
|
||||
<div class="panel-body">
|
||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="doSearch(); return false; ">
|
||||
<div>
|
||||
<label class="control-label">关键字:</label>
|
||||
<input type="text" placeholder="关键字" name="keyword" id="keyword" class="form-control">
|
||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="toolbar" class="btn-group">
|
||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addtxtreplyrule','添加文本回复规则','/AdminCP/Weixin/AddTextReplyRule',0,0)">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||
|
||||
@@ -5,11 +5,6 @@
|
||||
<script src="~/js/vue/vue.min.js"></script>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox float-e-margins" id="app">
|
||||
<div class="ibox-title">
|
||||
<h5>@ViewBag.Title</h5>
|
||||
<div class="ibox-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editSubscribeReplyForm", @class = "form-horizontal m-t" }))
|
||||
{
|
||||
|
||||
@@ -7,21 +7,21 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MailKit" Version="4.6.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.2" />
|
||||
<PackageReference Include="MimeKit" Version="4.6.0" />
|
||||
<PackageReference Include="MySql.Data" Version="8.4.0" />
|
||||
<PackageReference Include="NewLife.XCode" Version="11.12.2024.515" />
|
||||
<PackageReference Include="NewLife.XCode" Version="11.13.2024.606" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Senparc.NeuChar" Version="2.4.1" />
|
||||
<PackageReference Include="Senparc.Weixin" Version="6.18.1" />
|
||||
<PackageReference Include="Senparc.Weixin.MP" Version="16.21.1" />
|
||||
<PackageReference Include="Senparc.Weixin" Version="6.18.2" />
|
||||
<PackageReference Include="Senparc.Weixin.MP" Version="16.21.2" />
|
||||
<PackageReference Include="Senparc.Weixin.MP.MvcExtension" Version="4.1.1" />
|
||||
<PackageReference Include="Senparc.Weixin.TenPay" Version="1.14.1" />
|
||||
<PackageReference Include="Senparc.Weixin.WxOpen" Version="3.18.1" />
|
||||
<PackageReference Include="Senparc.Weixin.TenPay" Version="1.14.2" />
|
||||
<PackageReference Include="Senparc.Weixin.WxOpen" Version="3.18.2" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -211,13 +211,17 @@ body.body-small .navbar-top-links li:last-child {
|
||||
transition: all 0.5s;
|
||||
}
|
||||
|
||||
.nav > li.active {
|
||||
.nav > li.mm-active {
|
||||
border-left: 4px solid #19aa8d;
|
||||
background: #293846;
|
||||
}
|
||||
.nav-second-level > li.mm-active a{
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.nav.nav-second-level > li.active {
|
||||
.nav.nav-second-level > li.mm-active {
|
||||
border: none;
|
||||
background: #293846;
|
||||
}
|
||||
|
||||
.nav.nav-second-level.collapse[style] {
|
||||
@@ -281,7 +285,7 @@ body.body-small .navbar-top-links li:last-child {
|
||||
content: "\f104";
|
||||
}
|
||||
|
||||
.active > a > .fa.arrow:before {
|
||||
.mm-active > a > .fa.arrow:before {
|
||||
content: "\f107";
|
||||
}
|
||||
|
||||
@@ -3522,7 +3526,7 @@ video {
|
||||
}
|
||||
|
||||
.wrapper-content {
|
||||
padding: 20px;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
#page-wrapper {
|
||||
@@ -4040,7 +4044,7 @@ code {
|
||||
.ibox-content {
|
||||
background-color: #ffffff;
|
||||
color: inherit;
|
||||
padding: 15px 20px 20px 20px;
|
||||
padding: 15px;
|
||||
border-color: #e7eaec;
|
||||
-webkit-border-image: none;
|
||||
-o-border-image: none;
|
||||
@@ -4084,6 +4088,7 @@ table.table-mail tr td {
|
||||
|
||||
.ibox-content {
|
||||
clear: both;
|
||||
box-shadow: 1px 1px 3px rgba(0,0,0,.2);
|
||||
}
|
||||
|
||||
.ibox-heading {
|
||||
@@ -7899,4 +7904,80 @@ body.skin-3 {
|
||||
width: 12.5%;
|
||||
font-size: 12px
|
||||
}
|
||||
}
|
||||
}
|
||||
.search-collapse {
|
||||
position: relative;
|
||||
}
|
||||
.search-collapse, .select-table {
|
||||
background: #fff;
|
||||
margin: 0px 15px 10px 15px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 10px;
|
||||
box-shadow: 1px 1px 3px rgba(0,0,0,.2);
|
||||
}
|
||||
.select-list{overflow:hidden; padding:0 15px}
|
||||
.select-list ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
}
|
||||
|
||||
.select-list li {
|
||||
list-style: none
|
||||
}
|
||||
|
||||
.select-time .time-input {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding-left: 10px
|
||||
}
|
||||
.select-list li {
|
||||
color: #333;
|
||||
margin: 5px 15px 5px 0
|
||||
}
|
||||
|
||||
.select-list li p, .select-list li label:not(.radio-box) {
|
||||
float: left;
|
||||
margin: 5px 0 0 0;
|
||||
text-align: right;
|
||||
font-weight:400
|
||||
}
|
||||
|
||||
.select-list li input {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
outline: 0;
|
||||
height: 30px;
|
||||
width: 200px;
|
||||
padding-left: 5px
|
||||
}
|
||||
.select-list li input[type=checkbox] {
|
||||
outline: 0;
|
||||
height: 30px;
|
||||
width: auto;
|
||||
padding-left: 5px
|
||||
}
|
||||
.select-list li .submit-btn {
|
||||
border: 0;
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
outline: 0;
|
||||
width: 40px;
|
||||
height: 23px
|
||||
}
|
||||
|
||||
.select-list li select {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
outline: 0;
|
||||
height: 30px;
|
||||
width: 200px
|
||||
}
|
||||
@media(min-width : 768px) {
|
||||
.select-list li {
|
||||
float: left
|
||||
}
|
||||
}
|
||||
.common-panel{ margin:0 15px;}
|
||||
@@ -1,617 +0,0 @@
|
||||
/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
|
||||
/*
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2007-2013 Einar Lielmanis and contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
(the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
Style HTML
|
||||
---------------
|
||||
|
||||
Written by Nochum Sossonko, (nsossonko@hotmail.com)
|
||||
|
||||
Based on code initially developed by: Einar Lielmanis, <elfz@laacz.lv>
|
||||
http://jsbeautifier.org/
|
||||
|
||||
Usage:
|
||||
style_html(html_source);
|
||||
|
||||
style_html(html_source, options);
|
||||
|
||||
The options are:
|
||||
indent_size (default 4) — indentation size,
|
||||
indent_char (default space) — character to indent with,
|
||||
max_char (default 250) - maximum amount of characters per line (0 = disable)
|
||||
brace_style (default "collapse") - "collapse" | "expand" | "end-expand"
|
||||
put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line.
|
||||
unformatted (defaults to inline tags) - list of tags, that shouldn't be reformatted
|
||||
indent_scripts (default normal) - "keep"|"separate"|"normal"
|
||||
|
||||
e.g.
|
||||
|
||||
style_html(html_source, {
|
||||
'indent_size': 2,
|
||||
'indent_char': ' ',
|
||||
'max_char': 78,
|
||||
'brace_style': 'expand',
|
||||
'unformatted': ['a', 'sub', 'sup', 'b', 'i', 'u']
|
||||
});
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
function style_html(html_source, options, js_beautify, css_beautify) {
|
||||
//Wrapper function to invoke all the necessary constructors and deal with the output.
|
||||
|
||||
var multi_parser,
|
||||
indent_size,
|
||||
indent_character,
|
||||
max_char,
|
||||
brace_style,
|
||||
unformatted;
|
||||
|
||||
options = options || {};
|
||||
indent_size = options.indent_size || 4;
|
||||
indent_character = options.indent_char || ' ';
|
||||
brace_style = options.brace_style || 'collapse';
|
||||
max_char = options.max_char === 0 ? Infinity : options.max_char || 250;
|
||||
unformatted = options.unformatted || ['a', 'span', 'bdo', 'em', 'strong', 'dfn', 'code', 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'q', 'sub', 'sup', 'tt', 'i', 'b', 'big', 'small', 'u', 's', 'strike', 'font', 'ins', 'del', 'pre', 'address', 'dt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
||||
|
||||
function Parser() {
|
||||
|
||||
this.pos = 0; //Parser position
|
||||
this.token = '';
|
||||
this.current_mode = 'CONTENT'; //reflects the current Parser mode: TAG/CONTENT
|
||||
this.tags = { //An object to hold tags, their position, and their parent-tags, initiated with default values
|
||||
parent: 'parent1',
|
||||
parentcount: 1,
|
||||
parent1: ''
|
||||
};
|
||||
this.tag_type = '';
|
||||
this.token_text = this.last_token = this.last_text = this.token_type = '';
|
||||
|
||||
this.Utils = { //Uilities made available to the various functions
|
||||
whitespace: "\n\r\t ".split(''),
|
||||
single_token: 'br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?='.split(','), //all the single tags for HTML
|
||||
extra_liners: 'head,body,/html'.split(','), //for tags that need a line of whitespace before them
|
||||
in_array: function (what, arr) {
|
||||
for (var i=0; i<arr.length; i++) {
|
||||
if (what === arr[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
this.get_content = function () { //function to capture regular content between tags
|
||||
|
||||
var input_char = '',
|
||||
content = [],
|
||||
space = false; //if a space is needed
|
||||
|
||||
while (this.input.charAt(this.pos) !== '<') {
|
||||
if (this.pos >= this.input.length) {
|
||||
return content.length?content.join(''):['', 'TK_EOF'];
|
||||
}
|
||||
|
||||
input_char = this.input.charAt(this.pos);
|
||||
this.pos++;
|
||||
this.line_char_count++;
|
||||
|
||||
if (this.Utils.in_array(input_char, this.Utils.whitespace)) {
|
||||
if (content.length) {
|
||||
space = true;
|
||||
}
|
||||
this.line_char_count--;
|
||||
continue; //don't want to insert unnecessary space
|
||||
}
|
||||
else if (space) {
|
||||
if (this.line_char_count >= this.max_char) { //insert a line when the max_char is reached
|
||||
content.push('\n');
|
||||
for (var i=0; i<this.indent_level; i++) {
|
||||
content.push(this.indent_string);
|
||||
}
|
||||
this.line_char_count = 0;
|
||||
}
|
||||
else{
|
||||
content.push(' ');
|
||||
this.line_char_count++;
|
||||
}
|
||||
space = false;
|
||||
}
|
||||
content.push(input_char); //letter at-a-time (or string) inserted to an array
|
||||
}
|
||||
return content.length?content.join(''):'';
|
||||
};
|
||||
|
||||
this.get_contents_to = function (name) { //get the full content of a script or style to pass to js_beautify
|
||||
if (this.pos === this.input.length) {
|
||||
return ['', 'TK_EOF'];
|
||||
}
|
||||
var input_char = '';
|
||||
var content = '';
|
||||
var reg_match = new RegExp('</' + name + '\\s*>', 'igm');
|
||||
reg_match.lastIndex = this.pos;
|
||||
var reg_array = reg_match.exec(this.input);
|
||||
var end_script = reg_array?reg_array.index:this.input.length; //absolute end of script
|
||||
if(this.pos < end_script) { //get everything in between the script tags
|
||||
content = this.input.substring(this.pos, end_script);
|
||||
this.pos = end_script;
|
||||
}
|
||||
return content;
|
||||
};
|
||||
|
||||
this.record_tag = function (tag){ //function to record a tag and its parent in this.tags Object
|
||||
if (this.tags[tag + 'count']) { //check for the existence of this tag type
|
||||
this.tags[tag + 'count']++;
|
||||
this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level
|
||||
}
|
||||
else { //otherwise initialize this tag type
|
||||
this.tags[tag + 'count'] = 1;
|
||||
this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level
|
||||
}
|
||||
this.tags[tag + this.tags[tag + 'count'] + 'parent'] = this.tags.parent; //set the parent (i.e. in the case of a div this.tags.div1parent)
|
||||
this.tags.parent = tag + this.tags[tag + 'count']; //and make this the current parent (i.e. in the case of a div 'div1')
|
||||
};
|
||||
|
||||
this.retrieve_tag = function (tag) { //function to retrieve the opening tag to the corresponding closer
|
||||
if (this.tags[tag + 'count']) { //if the openener is not in the Object we ignore it
|
||||
var temp_parent = this.tags.parent; //check to see if it's a closable tag.
|
||||
while (temp_parent) { //till we reach '' (the initial value);
|
||||
if (tag + this.tags[tag + 'count'] === temp_parent) { //if this is it use it
|
||||
break;
|
||||
}
|
||||
temp_parent = this.tags[temp_parent + 'parent']; //otherwise keep on climbing up the DOM Tree
|
||||
}
|
||||
if (temp_parent) { //if we caught something
|
||||
this.indent_level = this.tags[tag + this.tags[tag + 'count']]; //set the indent_level accordingly
|
||||
this.tags.parent = this.tags[temp_parent + 'parent']; //and set the current parent
|
||||
}
|
||||
delete this.tags[tag + this.tags[tag + 'count'] + 'parent']; //delete the closed tags parent reference...
|
||||
delete this.tags[tag + this.tags[tag + 'count']]; //...and the tag itself
|
||||
if (this.tags[tag + 'count'] === 1) {
|
||||
delete this.tags[tag + 'count'];
|
||||
}
|
||||
else {
|
||||
this.tags[tag + 'count']--;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.get_tag = function (peek) { //function to get a full tag and parse its type
|
||||
var input_char = '',
|
||||
content = [],
|
||||
comment = '',
|
||||
space = false,
|
||||
tag_start, tag_end,
|
||||
orig_pos = this.pos,
|
||||
orig_line_char_count = this.line_char_count;
|
||||
|
||||
peek = peek !== undefined ? peek : false;
|
||||
|
||||
do {
|
||||
if (this.pos >= this.input.length) {
|
||||
if (peek) {
|
||||
this.pos = orig_pos;
|
||||
this.line_char_count = orig_line_char_count;
|
||||
}
|
||||
return content.length?content.join(''):['', 'TK_EOF'];
|
||||
}
|
||||
|
||||
input_char = this.input.charAt(this.pos);
|
||||
this.pos++;
|
||||
this.line_char_count++;
|
||||
|
||||
if (this.Utils.in_array(input_char, this.Utils.whitespace)) { //don't want to insert unnecessary space
|
||||
space = true;
|
||||
this.line_char_count--;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (input_char === "'" || input_char === '"') {
|
||||
if (!content[1] || content[1] !== '!') { //if we're in a comment strings don't get treated specially
|
||||
input_char += this.get_unformatted(input_char);
|
||||
space = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (input_char === '=') { //no space before =
|
||||
space = false;
|
||||
}
|
||||
|
||||
if (content.length && content[content.length-1] !== '=' && input_char !== '>' && space) {
|
||||
//no space after = or before >
|
||||
if (this.line_char_count >= this.max_char) {
|
||||
this.print_newline(false, content);
|
||||
this.line_char_count = 0;
|
||||
}
|
||||
else {
|
||||
content.push(' ');
|
||||
this.line_char_count++;
|
||||
}
|
||||
space = false;
|
||||
}
|
||||
if (input_char === '<') {
|
||||
tag_start = this.pos - 1;
|
||||
}
|
||||
content.push(input_char); //inserts character at-a-time (or string)
|
||||
} while (input_char !== '>');
|
||||
|
||||
var tag_complete = content.join('');
|
||||
var tag_index;
|
||||
if (tag_complete.indexOf(' ') !== -1) { //if there's whitespace, thats where the tag name ends
|
||||
tag_index = tag_complete.indexOf(' ');
|
||||
}
|
||||
else { //otherwise go with the tag ending
|
||||
tag_index = tag_complete.indexOf('>');
|
||||
}
|
||||
var tag_check = tag_complete.substring(1, tag_index).toLowerCase();
|
||||
if (tag_complete.charAt(tag_complete.length-2) === '/' ||
|
||||
this.Utils.in_array(tag_check, this.Utils.single_token)) { //if this tag name is a single tag type (either in the list or has a closing /)
|
||||
if ( ! peek) {
|
||||
this.tag_type = 'SINGLE';
|
||||
}
|
||||
}
|
||||
else if (tag_check === 'script') { //for later script handling
|
||||
if ( ! peek) {
|
||||
this.record_tag(tag_check);
|
||||
this.tag_type = 'SCRIPT';
|
||||
}
|
||||
}
|
||||
else if (tag_check === 'style') { //for future style handling (for now it justs uses get_content)
|
||||
if ( ! peek) {
|
||||
this.record_tag(tag_check);
|
||||
this.tag_type = 'STYLE';
|
||||
}
|
||||
}
|
||||
else if (this.is_unformatted(tag_check, unformatted)) { // do not reformat the "unformatted" tags
|
||||
comment = this.get_unformatted('</'+tag_check+'>', tag_complete); //...delegate to get_unformatted function
|
||||
content.push(comment);
|
||||
// Preserve collapsed whitespace either before or after this tag.
|
||||
if (tag_start > 0 && this.Utils.in_array(this.input.charAt(tag_start - 1), this.Utils.whitespace)){
|
||||
content.splice(0, 0, this.input.charAt(tag_start - 1));
|
||||
}
|
||||
tag_end = this.pos - 1;
|
||||
if (this.Utils.in_array(this.input.charAt(tag_end + 1), this.Utils.whitespace)){
|
||||
content.push(this.input.charAt(tag_end + 1));
|
||||
}
|
||||
this.tag_type = 'SINGLE';
|
||||
}
|
||||
else if (tag_check.charAt(0) === '!') { //peek for <!-- comment
|
||||
if (tag_check.indexOf('[if') !== -1) { //peek for <!--[if conditional comment
|
||||
if (tag_complete.indexOf('!IE') !== -1) { //this type needs a closing --> so...
|
||||
comment = this.get_unformatted('-->', tag_complete); //...delegate to get_unformatted
|
||||
content.push(comment);
|
||||
}
|
||||
if ( ! peek) {
|
||||
this.tag_type = 'START';
|
||||
}
|
||||
}
|
||||
else if (tag_check.indexOf('[endif') !== -1) {//peek for <!--[endif end conditional comment
|
||||
this.tag_type = 'END';
|
||||
this.unindent();
|
||||
}
|
||||
else if (tag_check.indexOf('[cdata[') !== -1) { //if it's a <[cdata[ comment...
|
||||
comment = this.get_unformatted(']]>', tag_complete); //...delegate to get_unformatted function
|
||||
content.push(comment);
|
||||
if ( ! peek) {
|
||||
this.tag_type = 'SINGLE'; //<![CDATA[ comments are treated like single tags
|
||||
}
|
||||
}
|
||||
else {
|
||||
comment = this.get_unformatted('-->', tag_complete);
|
||||
content.push(comment);
|
||||
this.tag_type = 'SINGLE';
|
||||
}
|
||||
}
|
||||
else if ( ! peek) {
|
||||
if (tag_check.charAt(0) === '/') { //this tag is a double tag so check for tag-ending
|
||||
this.retrieve_tag(tag_check.substring(1)); //remove it and all ancestors
|
||||
this.tag_type = 'END';
|
||||
}
|
||||
else { //otherwise it's a start-tag
|
||||
this.record_tag(tag_check); //push it on the tag stack
|
||||
this.tag_type = 'START';
|
||||
}
|
||||
if (this.Utils.in_array(tag_check, this.Utils.extra_liners)) { //check if this double needs an extra line
|
||||
this.print_newline(true, this.output);
|
||||
}
|
||||
}
|
||||
|
||||
if (peek) {
|
||||
this.pos = orig_pos;
|
||||
this.line_char_count = orig_line_char_count;
|
||||
}
|
||||
|
||||
return content.join(''); //returns fully formatted tag
|
||||
};
|
||||
|
||||
this.get_unformatted = function (delimiter, orig_tag) { //function to return unformatted content in its entirety
|
||||
|
||||
if (orig_tag && orig_tag.toLowerCase().indexOf(delimiter) !== -1) {
|
||||
return '';
|
||||
}
|
||||
var input_char = '';
|
||||
var content = '';
|
||||
var space = true;
|
||||
do {
|
||||
|
||||
if (this.pos >= this.input.length) {
|
||||
return content;
|
||||
}
|
||||
|
||||
input_char = this.input.charAt(this.pos);
|
||||
this.pos++;
|
||||
|
||||
if (this.Utils.in_array(input_char, this.Utils.whitespace)) {
|
||||
if (!space) {
|
||||
this.line_char_count--;
|
||||
continue;
|
||||
}
|
||||
if (input_char === '\n' || input_char === '\r') {
|
||||
content += '\n';
|
||||
/* Don't change tab indention for unformatted blocks. If using code for html editing, this will greatly affect <pre> tags if they are specified in the 'unformatted array'
|
||||
for (var i=0; i<this.indent_level; i++) {
|
||||
content += this.indent_string;
|
||||
}
|
||||
space = false; //...and make sure other indentation is erased
|
||||
*/
|
||||
this.line_char_count = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
content += input_char;
|
||||
this.line_char_count++;
|
||||
space = true;
|
||||
|
||||
|
||||
} while (content.toLowerCase().indexOf(delimiter) === -1);
|
||||
return content;
|
||||
};
|
||||
|
||||
this.get_token = function () { //initial handler for token-retrieval
|
||||
var token;
|
||||
|
||||
if (this.last_token === 'TK_TAG_SCRIPT' || this.last_token === 'TK_TAG_STYLE') { //check if we need to format javascript
|
||||
var type = this.last_token.substr(7);
|
||||
token = this.get_contents_to(type);
|
||||
if (typeof token !== 'string') {
|
||||
return token;
|
||||
}
|
||||
return [token, 'TK_' + type];
|
||||
}
|
||||
if (this.current_mode === 'CONTENT') {
|
||||
token = this.get_content();
|
||||
if (typeof token !== 'string') {
|
||||
return token;
|
||||
}
|
||||
else {
|
||||
return [token, 'TK_CONTENT'];
|
||||
}
|
||||
}
|
||||
|
||||
if (this.current_mode === 'TAG') {
|
||||
token = this.get_tag();
|
||||
if (typeof token !== 'string') {
|
||||
return token;
|
||||
}
|
||||
else {
|
||||
var tag_name_type = 'TK_TAG_' + this.tag_type;
|
||||
return [token, tag_name_type];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.get_full_indent = function (level) {
|
||||
level = this.indent_level + level || 0;
|
||||
if (level < 1) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return Array(level + 1).join(this.indent_string);
|
||||
};
|
||||
|
||||
this.is_unformatted = function(tag_check, unformatted) {
|
||||
//is this an HTML5 block-level link?
|
||||
if (!this.Utils.in_array(tag_check, unformatted)){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tag_check.toLowerCase() !== 'a' || !this.Utils.in_array('a', unformatted)){
|
||||
return true;
|
||||
}
|
||||
|
||||
//at this point we have an tag; is its first child something we want to remain
|
||||
//unformatted?
|
||||
var next_tag = this.get_tag(true /* peek. */);
|
||||
|
||||
// tets next_tag to see if it is just html tag (no external content)
|
||||
var tag = (next_tag || "").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);
|
||||
|
||||
// if next_tag comes back but is not an isolated tag, then
|
||||
// let's treat the 'a' tag as having content
|
||||
// and respect the unformatted option
|
||||
if (!tag || this.Utils.in_array(tag, unformatted)){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
this.printer = function (js_source, indent_character, indent_size, max_char, brace_style) { //handles input/output and some other printing functions
|
||||
|
||||
this.input = js_source || ''; //gets the input for the Parser
|
||||
this.output = [];
|
||||
this.indent_character = indent_character;
|
||||
this.indent_string = '';
|
||||
this.indent_size = indent_size;
|
||||
this.brace_style = brace_style;
|
||||
this.indent_level = 0;
|
||||
this.max_char = max_char;
|
||||
this.line_char_count = 0; //count to see if max_char was exceeded
|
||||
|
||||
for (var i=0; i<this.indent_size; i++) {
|
||||
this.indent_string += this.indent_character;
|
||||
}
|
||||
|
||||
this.print_newline = function (ignore, arr) {
|
||||
this.line_char_count = 0;
|
||||
if (!arr || !arr.length) {
|
||||
return;
|
||||
}
|
||||
if (!ignore) { //we might want the extra line
|
||||
while (this.Utils.in_array(arr[arr.length-1], this.Utils.whitespace)) {
|
||||
arr.pop();
|
||||
}
|
||||
}
|
||||
arr.push('\n');
|
||||
for (var i=0; i<this.indent_level; i++) {
|
||||
arr.push(this.indent_string);
|
||||
}
|
||||
};
|
||||
|
||||
this.print_token = function (text) {
|
||||
this.output.push(text);
|
||||
};
|
||||
|
||||
this.indent = function () {
|
||||
this.indent_level++;
|
||||
};
|
||||
|
||||
this.unindent = function () {
|
||||
if (this.indent_level > 0) {
|
||||
this.indent_level--;
|
||||
}
|
||||
};
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
/*_____________________--------------------_____________________*/
|
||||
|
||||
multi_parser = new Parser(); //wrapping functions Parser
|
||||
multi_parser.printer(html_source, indent_character, indent_size, max_char, brace_style); //initialize starting values
|
||||
|
||||
while (true) {
|
||||
var t = multi_parser.get_token();
|
||||
multi_parser.token_text = t[0];
|
||||
multi_parser.token_type = t[1];
|
||||
|
||||
if (multi_parser.token_type === 'TK_EOF') {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (multi_parser.token_type) {
|
||||
case 'TK_TAG_START':
|
||||
multi_parser.print_newline(false, multi_parser.output);
|
||||
multi_parser.print_token(multi_parser.token_text);
|
||||
multi_parser.indent();
|
||||
multi_parser.current_mode = 'CONTENT';
|
||||
break;
|
||||
case 'TK_TAG_STYLE':
|
||||
case 'TK_TAG_SCRIPT':
|
||||
multi_parser.print_newline(false, multi_parser.output);
|
||||
multi_parser.print_token(multi_parser.token_text);
|
||||
multi_parser.current_mode = 'CONTENT';
|
||||
break;
|
||||
case 'TK_TAG_END':
|
||||
//Print new line only if the tag has no content and has child
|
||||
if (multi_parser.last_token === 'TK_CONTENT' && multi_parser.last_text === '') {
|
||||
var tag_name = multi_parser.token_text.match(/\w+/)[0];
|
||||
var tag_extracted_from_last_output = multi_parser.output[multi_parser.output.length -1].match(/<\s*(\w+)/);
|
||||
if (tag_extracted_from_last_output === null || tag_extracted_from_last_output[1] !== tag_name) {
|
||||
multi_parser.print_newline(true, multi_parser.output);
|
||||
}
|
||||
}
|
||||
multi_parser.print_token(multi_parser.token_text);
|
||||
multi_parser.current_mode = 'CONTENT';
|
||||
break;
|
||||
case 'TK_TAG_SINGLE':
|
||||
// Don't add a newline before elements that should remain unformatted.
|
||||
var tag_check = multi_parser.token_text.match(/^\s*<([a-z]+)/i);
|
||||
if (!tag_check || !multi_parser.Utils.in_array(tag_check[1], unformatted)){
|
||||
multi_parser.print_newline(false, multi_parser.output);
|
||||
}
|
||||
multi_parser.print_token(multi_parser.token_text);
|
||||
multi_parser.current_mode = 'CONTENT';
|
||||
break;
|
||||
case 'TK_CONTENT':
|
||||
if (multi_parser.token_text !== '') {
|
||||
multi_parser.print_token(multi_parser.token_text);
|
||||
}
|
||||
multi_parser.current_mode = 'TAG';
|
||||
break;
|
||||
case 'TK_STYLE':
|
||||
case 'TK_SCRIPT':
|
||||
if (multi_parser.token_text !== '') {
|
||||
multi_parser.output.push('\n');
|
||||
var text = multi_parser.token_text,
|
||||
_beautifier,
|
||||
script_indent_level = 1;
|
||||
if (multi_parser.token_type === 'TK_SCRIPT') {
|
||||
_beautifier = typeof js_beautify === 'function' && js_beautify;
|
||||
} else if (multi_parser.token_type === 'TK_STYLE') {
|
||||
_beautifier = typeof css_beautify === 'function' && css_beautify;
|
||||
}
|
||||
|
||||
if (options.indent_scripts === "keep") {
|
||||
script_indent_level = 0;
|
||||
} else if (options.indent_scripts === "separate") {
|
||||
script_indent_level = -multi_parser.indent_level;
|
||||
}
|
||||
|
||||
var indentation = multi_parser.get_full_indent(script_indent_level);
|
||||
if (_beautifier) {
|
||||
// call the Beautifier if avaliable
|
||||
text = _beautifier(text.replace(/^\s*/, indentation), options);
|
||||
} else {
|
||||
// simply indent the string otherwise
|
||||
var white = text.match(/^\s*/)[0];
|
||||
var _level = white.match(/[^\n\r]*$/)[0].split(multi_parser.indent_string).length - 1;
|
||||
var reindent = multi_parser.get_full_indent(script_indent_level -_level);
|
||||
text = text.replace(/^\s*/, indentation)
|
||||
.replace(/\r\n|\r|\n/g, '\n' + reindent)
|
||||
.replace(/\s*$/, '');
|
||||
}
|
||||
if (text) {
|
||||
multi_parser.print_token(text);
|
||||
multi_parser.print_newline(true, multi_parser.output);
|
||||
}
|
||||
}
|
||||
multi_parser.current_mode = 'TAG';
|
||||
break;
|
||||
}
|
||||
multi_parser.last_token = multi_parser.token_type;
|
||||
multi_parser.last_text = multi_parser.token_text;
|
||||
}
|
||||
return multi_parser.output.join('');
|
||||
}
|
||||
|
||||
// If we're running a web page and don't have either of the above, add our one global
|
||||
window.html_beautify = function(html_source, options) {
|
||||
return style_html(html_source, options, window.js_beautify, window.css_beautify);
|
||||
};
|
||||
|
||||
}());
|
||||
File diff suppressed because one or more lines are too long
+1747
-1536
File diff suppressed because it is too large
Load Diff
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.22.1
|
||||
* @version v1.22.6
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
|
||||
*
|
||||
* @version v1.22.1
|
||||
* @version v1.22.6
|
||||
* @homepage https://bootstrap-table.com
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
* version: 1.22.1
|
||||
* version: 1.22.6
|
||||
* https://github.com/wenzhixin/bootstrap-table/
|
||||
*/
|
||||
/* stylelint-disable annotation-no-unknown, max-line-length */
|
||||
@@ -83,21 +83,25 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .table thead th {
|
||||
.bootstrap-table .fixed-table-container .table thead th,
|
||||
.bootstrap-table .fixed-table-container .table tfoot th {
|
||||
vertical-align: bottom;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .table thead th:focus {
|
||||
.bootstrap-table .fixed-table-container .table thead th:focus,
|
||||
.bootstrap-table .fixed-table-container .table tfoot th:focus {
|
||||
outline: 0 solid transparent;
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .table thead th.detail {
|
||||
.bootstrap-table .fixed-table-container .table thead th.detail,
|
||||
.bootstrap-table .fixed-table-container .table tfoot th.detail {
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .table thead th .th-inner {
|
||||
.bootstrap-table .fixed-table-container .table thead th .th-inner,
|
||||
.bootstrap-table .fixed-table-container .table tfoot th .th-inner {
|
||||
padding: 0.75rem;
|
||||
vertical-align: bottom;
|
||||
overflow: hidden;
|
||||
@@ -105,27 +109,32 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .table thead th .sortable {
|
||||
.bootstrap-table .fixed-table-container .table thead th .sortable,
|
||||
.bootstrap-table .fixed-table-container .table tfoot th .sortable {
|
||||
cursor: pointer;
|
||||
background-position: right;
|
||||
background-repeat: no-repeat;
|
||||
padding-right: 30px !important;
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .table thead th .sortable.sortable-center {
|
||||
.bootstrap-table .fixed-table-container .table thead th .sortable.sortable-center,
|
||||
.bootstrap-table .fixed-table-container .table tfoot th .sortable.sortable-center {
|
||||
padding-left: 20px !important;
|
||||
padding-right: 20px !important;
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .table thead th .both {
|
||||
.bootstrap-table .fixed-table-container .table thead th .both,
|
||||
.bootstrap-table .fixed-table-container .table tfoot th .both {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC");
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .table thead th .asc {
|
||||
.bootstrap-table .fixed-table-container .table thead th .asc,
|
||||
.bootstrap-table .fixed-table-container .table tfoot th .asc {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==");
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .table thead th .desc {
|
||||
.bootstrap-table .fixed-table-container .table thead th .desc,
|
||||
.bootstrap-table .fixed-table-container .table tfoot th .desc {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII= ");
|
||||
}
|
||||
|
||||
@@ -168,7 +177,7 @@
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .table.table-sm .th-inner {
|
||||
padding: 0.3rem;
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container.fixed-height:not(.has-footer) {
|
||||
@@ -198,8 +207,7 @@
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-container .fixed-table-body {
|
||||
overflow-x: auto;
|
||||
overflow-y: auto;
|
||||
overflow: auto auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
+2991
-3007
File diff suppressed because it is too large
Load Diff
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+96
-112
@@ -7,7 +7,7 @@
|
||||
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
||||
|
||||
var check = function (it) {
|
||||
return it && it.Math == Math && it;
|
||||
return it && it.Math === Math && it;
|
||||
};
|
||||
|
||||
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
||||
@@ -18,6 +18,7 @@
|
||||
// eslint-disable-next-line no-restricted-globals -- safe
|
||||
check(typeof self == 'object' && self) ||
|
||||
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
||||
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
||||
// eslint-disable-next-line no-new-func -- fallback
|
||||
(function () { return this; })() || Function('return this')();
|
||||
|
||||
@@ -36,7 +37,7 @@
|
||||
// Detect IE8's incomplete defineProperty implementation
|
||||
var descriptors = !fails$b(function () {
|
||||
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
||||
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
||||
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
||||
});
|
||||
|
||||
var fails$a = fails$c;
|
||||
@@ -115,7 +116,7 @@
|
||||
// eslint-disable-next-line no-prototype-builtins -- safe
|
||||
return !$Object$3('z').propertyIsEnumerable(0);
|
||||
}) ? function (it) {
|
||||
return classof$3(it) == 'String' ? split(it, '') : $Object$3(it);
|
||||
return classof$3(it) === 'String' ? split(it, '') : $Object$3(it);
|
||||
} : $Object$3;
|
||||
|
||||
// we can't use just `it == null` since of `document.all` special case
|
||||
@@ -131,7 +132,7 @@
|
||||
// `RequireObjectCoercible` abstract operation
|
||||
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
||||
var requireObjectCoercible$2 = function (it) {
|
||||
if (isNullOrUndefined$1(it)) throw $TypeError$6("Can't call method on " + it);
|
||||
if (isNullOrUndefined$1(it)) throw new $TypeError$6("Can't call method on " + it);
|
||||
return it;
|
||||
};
|
||||
|
||||
@@ -143,37 +144,21 @@
|
||||
return IndexedObject$1(requireObjectCoercible$1(it));
|
||||
};
|
||||
|
||||
var documentAll$2 = typeof document == 'object' && document.all;
|
||||
|
||||
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
||||
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
||||
var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
||||
|
||||
var documentAll_1 = {
|
||||
all: documentAll$2,
|
||||
IS_HTMLDDA: IS_HTMLDDA
|
||||
};
|
||||
|
||||
var $documentAll$1 = documentAll_1;
|
||||
|
||||
var documentAll$1 = $documentAll$1.all;
|
||||
var documentAll = typeof document == 'object' && document.all;
|
||||
|
||||
// `IsCallable` abstract operation
|
||||
// https://tc39.es/ecma262/#sec-iscallable
|
||||
var isCallable$c = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
||||
return typeof argument == 'function' || argument === documentAll$1;
|
||||
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
||||
var isCallable$c = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
||||
return typeof argument == 'function' || argument === documentAll;
|
||||
} : function (argument) {
|
||||
return typeof argument == 'function';
|
||||
};
|
||||
|
||||
var isCallable$b = isCallable$c;
|
||||
var $documentAll = documentAll_1;
|
||||
|
||||
var documentAll = $documentAll.all;
|
||||
|
||||
var isObject$7 = $documentAll.IS_HTMLDDA ? function (it) {
|
||||
return typeof it == 'object' ? it !== null : isCallable$b(it) || it === documentAll;
|
||||
} : function (it) {
|
||||
var isObject$7 = function (it) {
|
||||
return typeof it == 'object' ? it !== null : isCallable$b(it);
|
||||
};
|
||||
|
||||
@@ -223,22 +208,25 @@
|
||||
var engineV8Version = version;
|
||||
|
||||
/* eslint-disable es/no-symbol -- required for testing */
|
||||
|
||||
var V8_VERSION$2 = engineV8Version;
|
||||
var fails$8 = fails$c;
|
||||
var global$7 = global$a;
|
||||
|
||||
var $String$3 = global$7.String;
|
||||
|
||||
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
||||
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$8(function () {
|
||||
var symbol = Symbol();
|
||||
var symbol = Symbol('symbol detection');
|
||||
// Chrome 38 Symbol has incorrect toString conversion
|
||||
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
||||
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
||||
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
||||
// of course, fail.
|
||||
return !$String$3(symbol) || !(Object(symbol) instanceof Symbol) ||
|
||||
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
||||
!Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
|
||||
});
|
||||
|
||||
/* eslint-disable es/no-symbol -- required for testing */
|
||||
|
||||
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
||||
|
||||
var useSymbolAsUid = NATIVE_SYMBOL$1
|
||||
@@ -277,7 +265,7 @@
|
||||
// `Assert: IsCallable(argument) is true`
|
||||
var aCallable$1 = function (argument) {
|
||||
if (isCallable$8(argument)) return argument;
|
||||
throw $TypeError$5(tryToString(argument) + ' is not a function');
|
||||
throw new $TypeError$5(tryToString(argument) + ' is not a function');
|
||||
};
|
||||
|
||||
var aCallable = aCallable$1;
|
||||
@@ -303,48 +291,46 @@
|
||||
if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$6(val = call$3(fn, input))) return val;
|
||||
if (isCallable$7(fn = input.valueOf) && !isObject$6(val = call$3(fn, input))) return val;
|
||||
if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$6(val = call$3(fn, input))) return val;
|
||||
throw $TypeError$4("Can't convert object to primitive value");
|
||||
throw new $TypeError$4("Can't convert object to primitive value");
|
||||
};
|
||||
|
||||
var sharedExports = {};
|
||||
var shared$3 = {
|
||||
get exports(){ return sharedExports; },
|
||||
set exports(v){ sharedExports = v; },
|
||||
};
|
||||
var sharedStore = {exports: {}};
|
||||
|
||||
var global$7 = global$a;
|
||||
var global$6 = global$a;
|
||||
|
||||
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
||||
var defineProperty$2 = Object.defineProperty;
|
||||
|
||||
var defineGlobalProperty$3 = function (key, value) {
|
||||
try {
|
||||
defineProperty$2(global$7, key, { value: value, configurable: true, writable: true });
|
||||
defineProperty$2(global$6, key, { value: value, configurable: true, writable: true });
|
||||
} catch (error) {
|
||||
global$7[key] = value;
|
||||
global$6[key] = value;
|
||||
} return value;
|
||||
};
|
||||
|
||||
var global$6 = global$a;
|
||||
var globalThis$1 = global$a;
|
||||
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
||||
|
||||
var SHARED = '__core-js_shared__';
|
||||
var store$3 = global$6[SHARED] || defineGlobalProperty$2(SHARED, {});
|
||||
var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
|
||||
|
||||
var sharedStore = store$3;
|
||||
|
||||
var store$2 = sharedStore;
|
||||
|
||||
(shared$3.exports = function (key, value) {
|
||||
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
||||
})('versions', []).push({
|
||||
version: '3.29.0',
|
||||
(store$3.versions || (store$3.versions = [])).push({
|
||||
version: '3.36.1',
|
||||
mode: 'global',
|
||||
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
||||
license: 'https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE',
|
||||
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
||||
license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
|
||||
source: 'https://github.com/zloirock/core-js'
|
||||
});
|
||||
|
||||
var sharedStoreExports = sharedStore.exports;
|
||||
|
||||
var store$2 = sharedStoreExports;
|
||||
|
||||
var shared$3 = function (key, value) {
|
||||
return store$2[key] || (store$2[key] = value || {});
|
||||
};
|
||||
|
||||
var requireObjectCoercible = requireObjectCoercible$2;
|
||||
|
||||
var $Object$1 = Object;
|
||||
@@ -378,7 +364,7 @@
|
||||
};
|
||||
|
||||
var global$5 = global$a;
|
||||
var shared$2 = sharedExports;
|
||||
var shared$2 = shared$3;
|
||||
var hasOwn$6 = hasOwnProperty_1;
|
||||
var uid$1 = uid$2;
|
||||
var NATIVE_SYMBOL = symbolConstructorDetection;
|
||||
@@ -416,7 +402,7 @@
|
||||
if (pref === undefined) pref = 'default';
|
||||
result = call$2(exoticToPrim, input, pref);
|
||||
if (!isObject$5(result) || isSymbol$1(result)) return result;
|
||||
throw $TypeError$3("Can't convert object to primitive value");
|
||||
throw new $TypeError$3("Can't convert object to primitive value");
|
||||
}
|
||||
if (pref === undefined) pref = 'number';
|
||||
return ordinaryToPrimitive(input, pref);
|
||||
@@ -427,7 +413,7 @@
|
||||
|
||||
// `ToPropertyKey` abstract operation
|
||||
// https://tc39.es/ecma262/#sec-topropertykey
|
||||
var toPropertyKey$3 = function (argument) {
|
||||
var toPropertyKey$2 = function (argument) {
|
||||
var key = toPrimitive(argument, 'string');
|
||||
return isSymbol(key) ? key : key + '';
|
||||
};
|
||||
@@ -443,24 +429,24 @@
|
||||
return EXISTS$1 ? document$1.createElement(it) : {};
|
||||
};
|
||||
|
||||
var DESCRIPTORS$7 = descriptors;
|
||||
var DESCRIPTORS$8 = descriptors;
|
||||
var fails$7 = fails$c;
|
||||
var createElement = documentCreateElement;
|
||||
|
||||
// Thanks to IE8 for its funny defineProperty
|
||||
var ie8DomDefine = !DESCRIPTORS$7 && !fails$7(function () {
|
||||
var ie8DomDefine = !DESCRIPTORS$8 && !fails$7(function () {
|
||||
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
||||
return Object.defineProperty(createElement('div'), 'a', {
|
||||
get: function () { return 7; }
|
||||
}).a != 7;
|
||||
}).a !== 7;
|
||||
});
|
||||
|
||||
var DESCRIPTORS$6 = descriptors;
|
||||
var DESCRIPTORS$7 = descriptors;
|
||||
var call$1 = functionCall;
|
||||
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
||||
var createPropertyDescriptor$2 = createPropertyDescriptor$3;
|
||||
var toIndexedObject$2 = toIndexedObject$3;
|
||||
var toPropertyKey$2 = toPropertyKey$3;
|
||||
var toPropertyKey$1 = toPropertyKey$2;
|
||||
var hasOwn$5 = hasOwnProperty_1;
|
||||
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
||||
|
||||
@@ -469,9 +455,9 @@
|
||||
|
||||
// `Object.getOwnPropertyDescriptor` method
|
||||
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
||||
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
||||
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$7 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
||||
O = toIndexedObject$2(O);
|
||||
P = toPropertyKey$2(P);
|
||||
P = toPropertyKey$1(P);
|
||||
if (IE8_DOM_DEFINE$1) try {
|
||||
return $getOwnPropertyDescriptor$1(O, P);
|
||||
} catch (error) { /* empty */ }
|
||||
@@ -480,17 +466,17 @@
|
||||
|
||||
var objectDefineProperty = {};
|
||||
|
||||
var DESCRIPTORS$5 = descriptors;
|
||||
var DESCRIPTORS$6 = descriptors;
|
||||
var fails$6 = fails$c;
|
||||
|
||||
// V8 ~ Chrome 36-
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
||||
var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$6(function () {
|
||||
var v8PrototypeDefineBug = DESCRIPTORS$6 && fails$6(function () {
|
||||
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
||||
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
||||
value: 42,
|
||||
writable: false
|
||||
}).prototype != 42;
|
||||
}).prototype !== 42;
|
||||
});
|
||||
|
||||
var isObject$3 = isObject$7;
|
||||
@@ -501,14 +487,14 @@
|
||||
// `Assert: Type(argument) is Object`
|
||||
var anObject$2 = function (argument) {
|
||||
if (isObject$3(argument)) return argument;
|
||||
throw $TypeError$2($String$1(argument) + ' is not an object');
|
||||
throw new $TypeError$2($String$1(argument) + ' is not an object');
|
||||
};
|
||||
|
||||
var DESCRIPTORS$4 = descriptors;
|
||||
var DESCRIPTORS$5 = descriptors;
|
||||
var IE8_DOM_DEFINE = ie8DomDefine;
|
||||
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
||||
var anObject$1 = anObject$2;
|
||||
var toPropertyKey$1 = toPropertyKey$3;
|
||||
var toPropertyKey = toPropertyKey$2;
|
||||
|
||||
var $TypeError$1 = TypeError;
|
||||
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
||||
@@ -521,9 +507,9 @@
|
||||
|
||||
// `Object.defineProperty` method
|
||||
// https://tc39.es/ecma262/#sec-object.defineproperty
|
||||
objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
|
||||
objectDefineProperty.f = DESCRIPTORS$5 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
|
||||
anObject$1(O);
|
||||
P = toPropertyKey$1(P);
|
||||
P = toPropertyKey(P);
|
||||
anObject$1(Attributes);
|
||||
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
||||
var current = $getOwnPropertyDescriptor(O, P);
|
||||
@@ -538,44 +524,40 @@
|
||||
} return $defineProperty(O, P, Attributes);
|
||||
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
||||
anObject$1(O);
|
||||
P = toPropertyKey$1(P);
|
||||
P = toPropertyKey(P);
|
||||
anObject$1(Attributes);
|
||||
if (IE8_DOM_DEFINE) try {
|
||||
return $defineProperty(O, P, Attributes);
|
||||
} catch (error) { /* empty */ }
|
||||
if ('get' in Attributes || 'set' in Attributes) throw $TypeError$1('Accessors not supported');
|
||||
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$1('Accessors not supported');
|
||||
if ('value' in Attributes) O[P] = Attributes.value;
|
||||
return O;
|
||||
};
|
||||
|
||||
var DESCRIPTORS$3 = descriptors;
|
||||
var DESCRIPTORS$4 = descriptors;
|
||||
var definePropertyModule$3 = objectDefineProperty;
|
||||
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
||||
|
||||
var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value) {
|
||||
var createNonEnumerableProperty$2 = DESCRIPTORS$4 ? function (object, key, value) {
|
||||
return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
|
||||
} : function (object, key, value) {
|
||||
object[key] = value;
|
||||
return object;
|
||||
};
|
||||
|
||||
var makeBuiltInExports = {};
|
||||
var makeBuiltIn$2 = {
|
||||
get exports(){ return makeBuiltInExports; },
|
||||
set exports(v){ makeBuiltInExports = v; },
|
||||
};
|
||||
var makeBuiltIn$2 = {exports: {}};
|
||||
|
||||
var DESCRIPTORS$2 = descriptors;
|
||||
var DESCRIPTORS$3 = descriptors;
|
||||
var hasOwn$4 = hasOwnProperty_1;
|
||||
|
||||
var FunctionPrototype = Function.prototype;
|
||||
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
||||
var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
|
||||
var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
|
||||
|
||||
var EXISTS = hasOwn$4(FunctionPrototype, 'name');
|
||||
// additional protection from minified / mangled / dropped function names
|
||||
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
||||
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
|
||||
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype, 'name').configurable));
|
||||
|
||||
var functionName = {
|
||||
EXISTS: EXISTS,
|
||||
@@ -585,7 +567,7 @@
|
||||
|
||||
var uncurryThis$5 = functionUncurryThis;
|
||||
var isCallable$6 = isCallable$c;
|
||||
var store$1 = sharedStore;
|
||||
var store$1 = sharedStoreExports;
|
||||
|
||||
var functionToString = uncurryThis$5(Function.toString);
|
||||
|
||||
@@ -605,7 +587,7 @@
|
||||
|
||||
var weakMapBasicDetection = isCallable$5(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
||||
|
||||
var shared$1 = sharedExports;
|
||||
var shared$1 = shared$3;
|
||||
var uid = uid$2;
|
||||
|
||||
var keys = shared$1('keys');
|
||||
@@ -621,7 +603,7 @@
|
||||
var isObject$2 = isObject$7;
|
||||
var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
|
||||
var hasOwn$3 = hasOwnProperty_1;
|
||||
var shared = sharedStore;
|
||||
var shared = sharedStoreExports;
|
||||
var sharedKey = sharedKey$1;
|
||||
var hiddenKeys$2 = hiddenKeys$3;
|
||||
|
||||
@@ -638,7 +620,7 @@
|
||||
return function (it) {
|
||||
var state;
|
||||
if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
|
||||
throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
||||
throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
||||
} return state;
|
||||
};
|
||||
};
|
||||
@@ -651,7 +633,7 @@
|
||||
store.set = store.set;
|
||||
/* eslint-enable no-self-assign -- prototype methods protection */
|
||||
set = function (it, metadata) {
|
||||
if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
||||
if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
||||
metadata.facade = it;
|
||||
store.set(it, metadata);
|
||||
return metadata;
|
||||
@@ -666,7 +648,7 @@
|
||||
var STATE = sharedKey('state');
|
||||
hiddenKeys$2[STATE] = true;
|
||||
set = function (it, metadata) {
|
||||
if (hasOwn$3(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
||||
if (hasOwn$3(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
||||
metadata.facade = it;
|
||||
createNonEnumerableProperty$1(it, STATE, metadata);
|
||||
return metadata;
|
||||
@@ -691,7 +673,7 @@
|
||||
var fails$5 = fails$c;
|
||||
var isCallable$4 = isCallable$c;
|
||||
var hasOwn$2 = hasOwnProperty_1;
|
||||
var DESCRIPTORS$1 = descriptors;
|
||||
var DESCRIPTORS$2 = descriptors;
|
||||
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
||||
var inspectSource$1 = inspectSource$2;
|
||||
var InternalStateModule = internalState;
|
||||
@@ -705,7 +687,7 @@
|
||||
var replace = uncurryThis$4(''.replace);
|
||||
var join = uncurryThis$4([].join);
|
||||
|
||||
var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$5(function () {
|
||||
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$5(function () {
|
||||
return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
||||
});
|
||||
|
||||
@@ -713,12 +695,12 @@
|
||||
|
||||
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
||||
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
||||
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
|
||||
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
||||
}
|
||||
if (options && options.getter) name = 'get ' + name;
|
||||
if (options && options.setter) name = 'set ' + name;
|
||||
if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
||||
if (DESCRIPTORS$1) defineProperty$1(value, 'name', { value: name, configurable: true });
|
||||
if (DESCRIPTORS$2) defineProperty$1(value, 'name', { value: name, configurable: true });
|
||||
else value.name = name;
|
||||
}
|
||||
if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
|
||||
@@ -726,7 +708,7 @@
|
||||
}
|
||||
try {
|
||||
if (options && hasOwn$2(options, 'constructor') && options.constructor) {
|
||||
if (DESCRIPTORS$1) defineProperty$1(value, 'prototype', { writable: false });
|
||||
if (DESCRIPTORS$2) defineProperty$1(value, 'prototype', { writable: false });
|
||||
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
||||
} else if (value.prototype) value.prototype = undefined;
|
||||
} catch (error) { /* empty */ }
|
||||
@@ -742,6 +724,8 @@
|
||||
return isCallable$4(this) && getInternalState(this).source || inspectSource$1(this);
|
||||
}, 'toString');
|
||||
|
||||
var makeBuiltInExports = makeBuiltIn$2.exports;
|
||||
|
||||
var isCallable$3 = isCallable$c;
|
||||
var definePropertyModule$2 = objectDefineProperty;
|
||||
var makeBuiltIn = makeBuiltInExports;
|
||||
@@ -813,7 +797,8 @@
|
||||
// `ToLength` abstract operation
|
||||
// https://tc39.es/ecma262/#sec-tolength
|
||||
var toLength$1 = function (argument) {
|
||||
return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
||||
var len = toIntegerOrInfinity(argument);
|
||||
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
||||
};
|
||||
|
||||
var toLength = toLength$1;
|
||||
@@ -833,14 +818,15 @@
|
||||
return function ($this, el, fromIndex) {
|
||||
var O = toIndexedObject$1($this);
|
||||
var length = lengthOfArrayLike$1(O);
|
||||
if (length === 0) return !IS_INCLUDES && -1;
|
||||
var index = toAbsoluteIndex(fromIndex, length);
|
||||
var value;
|
||||
// Array#includes uses SameValueZero equality algorithm
|
||||
// eslint-disable-next-line no-self-compare -- NaN check
|
||||
if (IS_INCLUDES && el != el) while (length > index) {
|
||||
if (IS_INCLUDES && el !== el) while (length > index) {
|
||||
value = O[index++];
|
||||
// eslint-disable-next-line no-self-compare -- NaN check
|
||||
if (value != value) return true;
|
||||
if (value !== value) return true;
|
||||
// Array#indexOf ignores holes, Array#includes - not
|
||||
} else for (;length > index; index++) {
|
||||
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
||||
@@ -945,8 +931,8 @@
|
||||
|
||||
var isForced$1 = function (feature, detection) {
|
||||
var value = data[normalize(feature)];
|
||||
return value == POLYFILL ? true
|
||||
: value == NATIVE ? false
|
||||
return value === POLYFILL ? true
|
||||
: value === NATIVE ? false
|
||||
: isCallable$2(detection) ? fails$4(detection)
|
||||
: !!detection;
|
||||
};
|
||||
@@ -994,7 +980,7 @@
|
||||
} else if (STATIC) {
|
||||
target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
|
||||
} else {
|
||||
target = (global$1[TARGET] || {}).prototype;
|
||||
target = global$1[TARGET] && global$1[TARGET].prototype;
|
||||
}
|
||||
if (target) for (key in source) {
|
||||
sourceProperty = source[key];
|
||||
@@ -1022,7 +1008,7 @@
|
||||
// https://tc39.es/ecma262/#sec-isarray
|
||||
// eslint-disable-next-line es/no-array-isarray -- safe
|
||||
var isArray$2 = Array.isArray || function isArray(argument) {
|
||||
return classof$2(argument) == 'Array';
|
||||
return classof$2(argument) === 'Array';
|
||||
};
|
||||
|
||||
var $TypeError = TypeError;
|
||||
@@ -1033,14 +1019,13 @@
|
||||
return it;
|
||||
};
|
||||
|
||||
var toPropertyKey = toPropertyKey$3;
|
||||
var DESCRIPTORS$1 = descriptors;
|
||||
var definePropertyModule = objectDefineProperty;
|
||||
var createPropertyDescriptor = createPropertyDescriptor$3;
|
||||
|
||||
var createProperty$1 = function (object, key, value) {
|
||||
var propertyKey = toPropertyKey(key);
|
||||
if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
|
||||
else object[propertyKey] = value;
|
||||
if (DESCRIPTORS$1) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
|
||||
else object[key] = value;
|
||||
};
|
||||
|
||||
var wellKnownSymbol$4 = wellKnownSymbol$6;
|
||||
@@ -1061,7 +1046,7 @@
|
||||
var $Object = Object;
|
||||
|
||||
// ES3 wrong here
|
||||
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
||||
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
||||
|
||||
// fallback for IE11 Script Access Denied error
|
||||
var tryGet = function (it, key) {
|
||||
@@ -1079,7 +1064,7 @@
|
||||
// builtinTag case
|
||||
: CORRECT_ARGUMENTS ? classofRaw(O)
|
||||
// ES3 arguments fallback
|
||||
: (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
|
||||
: (result = classofRaw(O)) === 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
|
||||
};
|
||||
|
||||
var uncurryThis$1 = functionUncurryThis;
|
||||
@@ -1090,16 +1075,15 @@
|
||||
var inspectSource = inspectSource$2;
|
||||
|
||||
var noop = function () { /* empty */ };
|
||||
var empty = [];
|
||||
var construct = getBuiltIn('Reflect', 'construct');
|
||||
var constructorRegExp = /^\s*(?:class|function)\b/;
|
||||
var exec = uncurryThis$1(constructorRegExp.exec);
|
||||
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
||||
var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
|
||||
|
||||
var isConstructorModern = function isConstructor(argument) {
|
||||
if (!isCallable(argument)) return false;
|
||||
try {
|
||||
construct(noop, empty, argument);
|
||||
construct(noop, [], argument);
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
@@ -1287,11 +1271,11 @@
|
||||
var A = {};
|
||||
var B = {};
|
||||
// eslint-disable-next-line es/no-symbol -- safe
|
||||
var symbol = Symbol();
|
||||
var symbol = Symbol('assign detection');
|
||||
var alphabet = 'abcdefghijklmnopqrst';
|
||||
A[symbol] = 7;
|
||||
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
||||
return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
|
||||
return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
|
||||
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
||||
var T = toObject(target);
|
||||
var argumentsLength = arguments.length;
|
||||
@@ -1328,10 +1312,10 @@
|
||||
|
||||
$$2.fn.bootstrapTable.locales['zh-CN'] = $$2.fn.bootstrapTable.locales['zh'] = {
|
||||
formatCopyRows: function formatCopyRows() {
|
||||
return 'Copy Rows';
|
||||
return '复制行';
|
||||
},
|
||||
formatPrint: function formatPrint() {
|
||||
return 'Print';
|
||||
return '打印';
|
||||
},
|
||||
formatLoadingMessage: function formatLoadingMessage() {
|
||||
return '正在努力地加载数据中,请稍候';
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+96
-112
@@ -7,7 +7,7 @@
|
||||
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
||||
|
||||
var check = function (it) {
|
||||
return it && it.Math == Math && it;
|
||||
return it && it.Math === Math && it;
|
||||
};
|
||||
|
||||
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
||||
@@ -18,6 +18,7 @@
|
||||
// eslint-disable-next-line no-restricted-globals -- safe
|
||||
check(typeof self == 'object' && self) ||
|
||||
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
||||
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
||||
// eslint-disable-next-line no-new-func -- fallback
|
||||
(function () { return this; })() || Function('return this')();
|
||||
|
||||
@@ -36,7 +37,7 @@
|
||||
// Detect IE8's incomplete defineProperty implementation
|
||||
var descriptors = !fails$b(function () {
|
||||
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
||||
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
||||
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
||||
});
|
||||
|
||||
var fails$a = fails$c;
|
||||
@@ -115,7 +116,7 @@
|
||||
// eslint-disable-next-line no-prototype-builtins -- safe
|
||||
return !$Object$3('z').propertyIsEnumerable(0);
|
||||
}) ? function (it) {
|
||||
return classof$3(it) == 'String' ? split(it, '') : $Object$3(it);
|
||||
return classof$3(it) === 'String' ? split(it, '') : $Object$3(it);
|
||||
} : $Object$3;
|
||||
|
||||
// we can't use just `it == null` since of `document.all` special case
|
||||
@@ -131,7 +132,7 @@
|
||||
// `RequireObjectCoercible` abstract operation
|
||||
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
||||
var requireObjectCoercible$2 = function (it) {
|
||||
if (isNullOrUndefined$1(it)) throw $TypeError$6("Can't call method on " + it);
|
||||
if (isNullOrUndefined$1(it)) throw new $TypeError$6("Can't call method on " + it);
|
||||
return it;
|
||||
};
|
||||
|
||||
@@ -143,37 +144,21 @@
|
||||
return IndexedObject$1(requireObjectCoercible$1(it));
|
||||
};
|
||||
|
||||
var documentAll$2 = typeof document == 'object' && document.all;
|
||||
|
||||
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
||||
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
||||
var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
||||
|
||||
var documentAll_1 = {
|
||||
all: documentAll$2,
|
||||
IS_HTMLDDA: IS_HTMLDDA
|
||||
};
|
||||
|
||||
var $documentAll$1 = documentAll_1;
|
||||
|
||||
var documentAll$1 = $documentAll$1.all;
|
||||
var documentAll = typeof document == 'object' && document.all;
|
||||
|
||||
// `IsCallable` abstract operation
|
||||
// https://tc39.es/ecma262/#sec-iscallable
|
||||
var isCallable$c = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
||||
return typeof argument == 'function' || argument === documentAll$1;
|
||||
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
||||
var isCallable$c = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
||||
return typeof argument == 'function' || argument === documentAll;
|
||||
} : function (argument) {
|
||||
return typeof argument == 'function';
|
||||
};
|
||||
|
||||
var isCallable$b = isCallable$c;
|
||||
var $documentAll = documentAll_1;
|
||||
|
||||
var documentAll = $documentAll.all;
|
||||
|
||||
var isObject$7 = $documentAll.IS_HTMLDDA ? function (it) {
|
||||
return typeof it == 'object' ? it !== null : isCallable$b(it) || it === documentAll;
|
||||
} : function (it) {
|
||||
var isObject$7 = function (it) {
|
||||
return typeof it == 'object' ? it !== null : isCallable$b(it);
|
||||
};
|
||||
|
||||
@@ -223,22 +208,25 @@
|
||||
var engineV8Version = version;
|
||||
|
||||
/* eslint-disable es/no-symbol -- required for testing */
|
||||
|
||||
var V8_VERSION$2 = engineV8Version;
|
||||
var fails$8 = fails$c;
|
||||
var global$7 = global$a;
|
||||
|
||||
var $String$3 = global$7.String;
|
||||
|
||||
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
||||
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$8(function () {
|
||||
var symbol = Symbol();
|
||||
var symbol = Symbol('symbol detection');
|
||||
// Chrome 38 Symbol has incorrect toString conversion
|
||||
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
||||
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
||||
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
||||
// of course, fail.
|
||||
return !$String$3(symbol) || !(Object(symbol) instanceof Symbol) ||
|
||||
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
||||
!Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
|
||||
});
|
||||
|
||||
/* eslint-disable es/no-symbol -- required for testing */
|
||||
|
||||
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
||||
|
||||
var useSymbolAsUid = NATIVE_SYMBOL$1
|
||||
@@ -277,7 +265,7 @@
|
||||
// `Assert: IsCallable(argument) is true`
|
||||
var aCallable$1 = function (argument) {
|
||||
if (isCallable$8(argument)) return argument;
|
||||
throw $TypeError$5(tryToString(argument) + ' is not a function');
|
||||
throw new $TypeError$5(tryToString(argument) + ' is not a function');
|
||||
};
|
||||
|
||||
var aCallable = aCallable$1;
|
||||
@@ -303,48 +291,46 @@
|
||||
if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$6(val = call$3(fn, input))) return val;
|
||||
if (isCallable$7(fn = input.valueOf) && !isObject$6(val = call$3(fn, input))) return val;
|
||||
if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$6(val = call$3(fn, input))) return val;
|
||||
throw $TypeError$4("Can't convert object to primitive value");
|
||||
throw new $TypeError$4("Can't convert object to primitive value");
|
||||
};
|
||||
|
||||
var sharedExports = {};
|
||||
var shared$3 = {
|
||||
get exports(){ return sharedExports; },
|
||||
set exports(v){ sharedExports = v; },
|
||||
};
|
||||
var sharedStore = {exports: {}};
|
||||
|
||||
var global$7 = global$a;
|
||||
var global$6 = global$a;
|
||||
|
||||
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
||||
var defineProperty$2 = Object.defineProperty;
|
||||
|
||||
var defineGlobalProperty$3 = function (key, value) {
|
||||
try {
|
||||
defineProperty$2(global$7, key, { value: value, configurable: true, writable: true });
|
||||
defineProperty$2(global$6, key, { value: value, configurable: true, writable: true });
|
||||
} catch (error) {
|
||||
global$7[key] = value;
|
||||
global$6[key] = value;
|
||||
} return value;
|
||||
};
|
||||
|
||||
var global$6 = global$a;
|
||||
var globalThis$1 = global$a;
|
||||
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
||||
|
||||
var SHARED = '__core-js_shared__';
|
||||
var store$3 = global$6[SHARED] || defineGlobalProperty$2(SHARED, {});
|
||||
var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
|
||||
|
||||
var sharedStore = store$3;
|
||||
|
||||
var store$2 = sharedStore;
|
||||
|
||||
(shared$3.exports = function (key, value) {
|
||||
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
||||
})('versions', []).push({
|
||||
version: '3.29.0',
|
||||
(store$3.versions || (store$3.versions = [])).push({
|
||||
version: '3.36.1',
|
||||
mode: 'global',
|
||||
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
||||
license: 'https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE',
|
||||
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
||||
license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
|
||||
source: 'https://github.com/zloirock/core-js'
|
||||
});
|
||||
|
||||
var sharedStoreExports = sharedStore.exports;
|
||||
|
||||
var store$2 = sharedStoreExports;
|
||||
|
||||
var shared$3 = function (key, value) {
|
||||
return store$2[key] || (store$2[key] = value || {});
|
||||
};
|
||||
|
||||
var requireObjectCoercible = requireObjectCoercible$2;
|
||||
|
||||
var $Object$1 = Object;
|
||||
@@ -378,7 +364,7 @@
|
||||
};
|
||||
|
||||
var global$5 = global$a;
|
||||
var shared$2 = sharedExports;
|
||||
var shared$2 = shared$3;
|
||||
var hasOwn$6 = hasOwnProperty_1;
|
||||
var uid$1 = uid$2;
|
||||
var NATIVE_SYMBOL = symbolConstructorDetection;
|
||||
@@ -416,7 +402,7 @@
|
||||
if (pref === undefined) pref = 'default';
|
||||
result = call$2(exoticToPrim, input, pref);
|
||||
if (!isObject$5(result) || isSymbol$1(result)) return result;
|
||||
throw $TypeError$3("Can't convert object to primitive value");
|
||||
throw new $TypeError$3("Can't convert object to primitive value");
|
||||
}
|
||||
if (pref === undefined) pref = 'number';
|
||||
return ordinaryToPrimitive(input, pref);
|
||||
@@ -427,7 +413,7 @@
|
||||
|
||||
// `ToPropertyKey` abstract operation
|
||||
// https://tc39.es/ecma262/#sec-topropertykey
|
||||
var toPropertyKey$3 = function (argument) {
|
||||
var toPropertyKey$2 = function (argument) {
|
||||
var key = toPrimitive(argument, 'string');
|
||||
return isSymbol(key) ? key : key + '';
|
||||
};
|
||||
@@ -443,24 +429,24 @@
|
||||
return EXISTS$1 ? document$1.createElement(it) : {};
|
||||
};
|
||||
|
||||
var DESCRIPTORS$7 = descriptors;
|
||||
var DESCRIPTORS$8 = descriptors;
|
||||
var fails$7 = fails$c;
|
||||
var createElement = documentCreateElement;
|
||||
|
||||
// Thanks to IE8 for its funny defineProperty
|
||||
var ie8DomDefine = !DESCRIPTORS$7 && !fails$7(function () {
|
||||
var ie8DomDefine = !DESCRIPTORS$8 && !fails$7(function () {
|
||||
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
||||
return Object.defineProperty(createElement('div'), 'a', {
|
||||
get: function () { return 7; }
|
||||
}).a != 7;
|
||||
}).a !== 7;
|
||||
});
|
||||
|
||||
var DESCRIPTORS$6 = descriptors;
|
||||
var DESCRIPTORS$7 = descriptors;
|
||||
var call$1 = functionCall;
|
||||
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
||||
var createPropertyDescriptor$2 = createPropertyDescriptor$3;
|
||||
var toIndexedObject$2 = toIndexedObject$3;
|
||||
var toPropertyKey$2 = toPropertyKey$3;
|
||||
var toPropertyKey$1 = toPropertyKey$2;
|
||||
var hasOwn$5 = hasOwnProperty_1;
|
||||
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
||||
|
||||
@@ -469,9 +455,9 @@
|
||||
|
||||
// `Object.getOwnPropertyDescriptor` method
|
||||
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
||||
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
||||
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$7 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
||||
O = toIndexedObject$2(O);
|
||||
P = toPropertyKey$2(P);
|
||||
P = toPropertyKey$1(P);
|
||||
if (IE8_DOM_DEFINE$1) try {
|
||||
return $getOwnPropertyDescriptor$1(O, P);
|
||||
} catch (error) { /* empty */ }
|
||||
@@ -480,17 +466,17 @@
|
||||
|
||||
var objectDefineProperty = {};
|
||||
|
||||
var DESCRIPTORS$5 = descriptors;
|
||||
var DESCRIPTORS$6 = descriptors;
|
||||
var fails$6 = fails$c;
|
||||
|
||||
// V8 ~ Chrome 36-
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
||||
var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$6(function () {
|
||||
var v8PrototypeDefineBug = DESCRIPTORS$6 && fails$6(function () {
|
||||
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
||||
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
||||
value: 42,
|
||||
writable: false
|
||||
}).prototype != 42;
|
||||
}).prototype !== 42;
|
||||
});
|
||||
|
||||
var isObject$3 = isObject$7;
|
||||
@@ -501,14 +487,14 @@
|
||||
// `Assert: Type(argument) is Object`
|
||||
var anObject$2 = function (argument) {
|
||||
if (isObject$3(argument)) return argument;
|
||||
throw $TypeError$2($String$1(argument) + ' is not an object');
|
||||
throw new $TypeError$2($String$1(argument) + ' is not an object');
|
||||
};
|
||||
|
||||
var DESCRIPTORS$4 = descriptors;
|
||||
var DESCRIPTORS$5 = descriptors;
|
||||
var IE8_DOM_DEFINE = ie8DomDefine;
|
||||
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
||||
var anObject$1 = anObject$2;
|
||||
var toPropertyKey$1 = toPropertyKey$3;
|
||||
var toPropertyKey = toPropertyKey$2;
|
||||
|
||||
var $TypeError$1 = TypeError;
|
||||
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
||||
@@ -521,9 +507,9 @@
|
||||
|
||||
// `Object.defineProperty` method
|
||||
// https://tc39.es/ecma262/#sec-object.defineproperty
|
||||
objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
|
||||
objectDefineProperty.f = DESCRIPTORS$5 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
|
||||
anObject$1(O);
|
||||
P = toPropertyKey$1(P);
|
||||
P = toPropertyKey(P);
|
||||
anObject$1(Attributes);
|
||||
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
||||
var current = $getOwnPropertyDescriptor(O, P);
|
||||
@@ -538,44 +524,40 @@
|
||||
} return $defineProperty(O, P, Attributes);
|
||||
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
||||
anObject$1(O);
|
||||
P = toPropertyKey$1(P);
|
||||
P = toPropertyKey(P);
|
||||
anObject$1(Attributes);
|
||||
if (IE8_DOM_DEFINE) try {
|
||||
return $defineProperty(O, P, Attributes);
|
||||
} catch (error) { /* empty */ }
|
||||
if ('get' in Attributes || 'set' in Attributes) throw $TypeError$1('Accessors not supported');
|
||||
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$1('Accessors not supported');
|
||||
if ('value' in Attributes) O[P] = Attributes.value;
|
||||
return O;
|
||||
};
|
||||
|
||||
var DESCRIPTORS$3 = descriptors;
|
||||
var DESCRIPTORS$4 = descriptors;
|
||||
var definePropertyModule$3 = objectDefineProperty;
|
||||
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
||||
|
||||
var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value) {
|
||||
var createNonEnumerableProperty$2 = DESCRIPTORS$4 ? function (object, key, value) {
|
||||
return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
|
||||
} : function (object, key, value) {
|
||||
object[key] = value;
|
||||
return object;
|
||||
};
|
||||
|
||||
var makeBuiltInExports = {};
|
||||
var makeBuiltIn$2 = {
|
||||
get exports(){ return makeBuiltInExports; },
|
||||
set exports(v){ makeBuiltInExports = v; },
|
||||
};
|
||||
var makeBuiltIn$2 = {exports: {}};
|
||||
|
||||
var DESCRIPTORS$2 = descriptors;
|
||||
var DESCRIPTORS$3 = descriptors;
|
||||
var hasOwn$4 = hasOwnProperty_1;
|
||||
|
||||
var FunctionPrototype = Function.prototype;
|
||||
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
||||
var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
|
||||
var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
|
||||
|
||||
var EXISTS = hasOwn$4(FunctionPrototype, 'name');
|
||||
// additional protection from minified / mangled / dropped function names
|
||||
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
||||
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
|
||||
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype, 'name').configurable));
|
||||
|
||||
var functionName = {
|
||||
EXISTS: EXISTS,
|
||||
@@ -585,7 +567,7 @@
|
||||
|
||||
var uncurryThis$5 = functionUncurryThis;
|
||||
var isCallable$6 = isCallable$c;
|
||||
var store$1 = sharedStore;
|
||||
var store$1 = sharedStoreExports;
|
||||
|
||||
var functionToString = uncurryThis$5(Function.toString);
|
||||
|
||||
@@ -605,7 +587,7 @@
|
||||
|
||||
var weakMapBasicDetection = isCallable$5(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
||||
|
||||
var shared$1 = sharedExports;
|
||||
var shared$1 = shared$3;
|
||||
var uid = uid$2;
|
||||
|
||||
var keys = shared$1('keys');
|
||||
@@ -621,7 +603,7 @@
|
||||
var isObject$2 = isObject$7;
|
||||
var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
|
||||
var hasOwn$3 = hasOwnProperty_1;
|
||||
var shared = sharedStore;
|
||||
var shared = sharedStoreExports;
|
||||
var sharedKey = sharedKey$1;
|
||||
var hiddenKeys$2 = hiddenKeys$3;
|
||||
|
||||
@@ -638,7 +620,7 @@
|
||||
return function (it) {
|
||||
var state;
|
||||
if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
|
||||
throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
||||
throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
||||
} return state;
|
||||
};
|
||||
};
|
||||
@@ -651,7 +633,7 @@
|
||||
store.set = store.set;
|
||||
/* eslint-enable no-self-assign -- prototype methods protection */
|
||||
set = function (it, metadata) {
|
||||
if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
||||
if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
||||
metadata.facade = it;
|
||||
store.set(it, metadata);
|
||||
return metadata;
|
||||
@@ -666,7 +648,7 @@
|
||||
var STATE = sharedKey('state');
|
||||
hiddenKeys$2[STATE] = true;
|
||||
set = function (it, metadata) {
|
||||
if (hasOwn$3(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
||||
if (hasOwn$3(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
||||
metadata.facade = it;
|
||||
createNonEnumerableProperty$1(it, STATE, metadata);
|
||||
return metadata;
|
||||
@@ -691,7 +673,7 @@
|
||||
var fails$5 = fails$c;
|
||||
var isCallable$4 = isCallable$c;
|
||||
var hasOwn$2 = hasOwnProperty_1;
|
||||
var DESCRIPTORS$1 = descriptors;
|
||||
var DESCRIPTORS$2 = descriptors;
|
||||
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
||||
var inspectSource$1 = inspectSource$2;
|
||||
var InternalStateModule = internalState;
|
||||
@@ -705,7 +687,7 @@
|
||||
var replace = uncurryThis$4(''.replace);
|
||||
var join = uncurryThis$4([].join);
|
||||
|
||||
var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$5(function () {
|
||||
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$5(function () {
|
||||
return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
||||
});
|
||||
|
||||
@@ -713,12 +695,12 @@
|
||||
|
||||
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
||||
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
||||
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
|
||||
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
||||
}
|
||||
if (options && options.getter) name = 'get ' + name;
|
||||
if (options && options.setter) name = 'set ' + name;
|
||||
if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
||||
if (DESCRIPTORS$1) defineProperty$1(value, 'name', { value: name, configurable: true });
|
||||
if (DESCRIPTORS$2) defineProperty$1(value, 'name', { value: name, configurable: true });
|
||||
else value.name = name;
|
||||
}
|
||||
if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
|
||||
@@ -726,7 +708,7 @@
|
||||
}
|
||||
try {
|
||||
if (options && hasOwn$2(options, 'constructor') && options.constructor) {
|
||||
if (DESCRIPTORS$1) defineProperty$1(value, 'prototype', { writable: false });
|
||||
if (DESCRIPTORS$2) defineProperty$1(value, 'prototype', { writable: false });
|
||||
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
||||
} else if (value.prototype) value.prototype = undefined;
|
||||
} catch (error) { /* empty */ }
|
||||
@@ -742,6 +724,8 @@
|
||||
return isCallable$4(this) && getInternalState(this).source || inspectSource$1(this);
|
||||
}, 'toString');
|
||||
|
||||
var makeBuiltInExports = makeBuiltIn$2.exports;
|
||||
|
||||
var isCallable$3 = isCallable$c;
|
||||
var definePropertyModule$2 = objectDefineProperty;
|
||||
var makeBuiltIn = makeBuiltInExports;
|
||||
@@ -813,7 +797,8 @@
|
||||
// `ToLength` abstract operation
|
||||
// https://tc39.es/ecma262/#sec-tolength
|
||||
var toLength$1 = function (argument) {
|
||||
return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
||||
var len = toIntegerOrInfinity(argument);
|
||||
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
||||
};
|
||||
|
||||
var toLength = toLength$1;
|
||||
@@ -833,14 +818,15 @@
|
||||
return function ($this, el, fromIndex) {
|
||||
var O = toIndexedObject$1($this);
|
||||
var length = lengthOfArrayLike$1(O);
|
||||
if (length === 0) return !IS_INCLUDES && -1;
|
||||
var index = toAbsoluteIndex(fromIndex, length);
|
||||
var value;
|
||||
// Array#includes uses SameValueZero equality algorithm
|
||||
// eslint-disable-next-line no-self-compare -- NaN check
|
||||
if (IS_INCLUDES && el != el) while (length > index) {
|
||||
if (IS_INCLUDES && el !== el) while (length > index) {
|
||||
value = O[index++];
|
||||
// eslint-disable-next-line no-self-compare -- NaN check
|
||||
if (value != value) return true;
|
||||
if (value !== value) return true;
|
||||
// Array#indexOf ignores holes, Array#includes - not
|
||||
} else for (;length > index; index++) {
|
||||
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
||||
@@ -945,8 +931,8 @@
|
||||
|
||||
var isForced$1 = function (feature, detection) {
|
||||
var value = data[normalize(feature)];
|
||||
return value == POLYFILL ? true
|
||||
: value == NATIVE ? false
|
||||
return value === POLYFILL ? true
|
||||
: value === NATIVE ? false
|
||||
: isCallable$2(detection) ? fails$4(detection)
|
||||
: !!detection;
|
||||
};
|
||||
@@ -994,7 +980,7 @@
|
||||
} else if (STATIC) {
|
||||
target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
|
||||
} else {
|
||||
target = (global$1[TARGET] || {}).prototype;
|
||||
target = global$1[TARGET] && global$1[TARGET].prototype;
|
||||
}
|
||||
if (target) for (key in source) {
|
||||
sourceProperty = source[key];
|
||||
@@ -1022,7 +1008,7 @@
|
||||
// https://tc39.es/ecma262/#sec-isarray
|
||||
// eslint-disable-next-line es/no-array-isarray -- safe
|
||||
var isArray$2 = Array.isArray || function isArray(argument) {
|
||||
return classof$2(argument) == 'Array';
|
||||
return classof$2(argument) === 'Array';
|
||||
};
|
||||
|
||||
var $TypeError = TypeError;
|
||||
@@ -1033,14 +1019,13 @@
|
||||
return it;
|
||||
};
|
||||
|
||||
var toPropertyKey = toPropertyKey$3;
|
||||
var DESCRIPTORS$1 = descriptors;
|
||||
var definePropertyModule = objectDefineProperty;
|
||||
var createPropertyDescriptor = createPropertyDescriptor$3;
|
||||
|
||||
var createProperty$1 = function (object, key, value) {
|
||||
var propertyKey = toPropertyKey(key);
|
||||
if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
|
||||
else object[propertyKey] = value;
|
||||
if (DESCRIPTORS$1) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
|
||||
else object[key] = value;
|
||||
};
|
||||
|
||||
var wellKnownSymbol$4 = wellKnownSymbol$6;
|
||||
@@ -1061,7 +1046,7 @@
|
||||
var $Object = Object;
|
||||
|
||||
// ES3 wrong here
|
||||
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
||||
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
||||
|
||||
// fallback for IE11 Script Access Denied error
|
||||
var tryGet = function (it, key) {
|
||||
@@ -1079,7 +1064,7 @@
|
||||
// builtinTag case
|
||||
: CORRECT_ARGUMENTS ? classofRaw(O)
|
||||
// ES3 arguments fallback
|
||||
: (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
|
||||
: (result = classofRaw(O)) === 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
|
||||
};
|
||||
|
||||
var uncurryThis$1 = functionUncurryThis;
|
||||
@@ -1090,16 +1075,15 @@
|
||||
var inspectSource = inspectSource$2;
|
||||
|
||||
var noop = function () { /* empty */ };
|
||||
var empty = [];
|
||||
var construct = getBuiltIn('Reflect', 'construct');
|
||||
var constructorRegExp = /^\s*(?:class|function)\b/;
|
||||
var exec = uncurryThis$1(constructorRegExp.exec);
|
||||
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
||||
var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
|
||||
|
||||
var isConstructorModern = function isConstructor(argument) {
|
||||
if (!isCallable(argument)) return false;
|
||||
try {
|
||||
construct(noop, empty, argument);
|
||||
construct(noop, [], argument);
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
@@ -1287,11 +1271,11 @@
|
||||
var A = {};
|
||||
var B = {};
|
||||
// eslint-disable-next-line es/no-symbol -- safe
|
||||
var symbol = Symbol();
|
||||
var symbol = Symbol('assign detection');
|
||||
var alphabet = 'abcdefghijklmnopqrst';
|
||||
A[symbol] = 7;
|
||||
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
||||
return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
|
||||
return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
|
||||
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
||||
var T = toObject(target);
|
||||
var argumentsLength = arguments.length;
|
||||
@@ -1328,10 +1312,10 @@
|
||||
|
||||
$$2.fn.bootstrapTable.locales['zh-TW'] = {
|
||||
formatCopyRows: function formatCopyRows() {
|
||||
return 'Copy Rows';
|
||||
return '複製行';
|
||||
},
|
||||
formatPrint: function formatPrint() {
|
||||
return 'Print';
|
||||
return '列印';
|
||||
},
|
||||
formatLoadingMessage: function formatLoadingMessage() {
|
||||
return '正在努力地載入資料,請稍候';
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,729 +0,0 @@
|
||||
/*!
|
||||
* ClockPicker v{package.version} (http://weareoutman.github.io/clockpicker/)
|
||||
* Copyright 2014 Wang Shenwei.
|
||||
* Licensed under MIT (https://github.com/weareoutman/clockpicker/blob/gh-pages/LICENSE)
|
||||
*/
|
||||
|
||||
;(function(){
|
||||
var $ = window.jQuery,
|
||||
$win = $(window),
|
||||
$doc = $(document),
|
||||
$body;
|
||||
|
||||
// Can I use inline svg ?
|
||||
var svgNS = 'http://www.w3.org/2000/svg',
|
||||
svgSupported = 'SVGAngle' in window && (function(){
|
||||
var supported,
|
||||
el = document.createElement('div');
|
||||
el.innerHTML = '<svg/>';
|
||||
supported = (el.firstChild && el.firstChild.namespaceURI) == svgNS;
|
||||
el.innerHTML = '';
|
||||
return supported;
|
||||
})();
|
||||
|
||||
// Can I use transition ?
|
||||
var transitionSupported = (function(){
|
||||
var style = document.createElement('div').style;
|
||||
return 'transition' in style ||
|
||||
'WebkitTransition' in style ||
|
||||
'MozTransition' in style ||
|
||||
'msTransition' in style ||
|
||||
'OTransition' in style;
|
||||
})();
|
||||
|
||||
// Listen touch events in touch screen device, instead of mouse events in desktop.
|
||||
var touchSupported = 'ontouchstart' in window,
|
||||
mousedownEvent = 'mousedown' + ( touchSupported ? ' touchstart' : ''),
|
||||
mousemoveEvent = 'mousemove.clockpicker' + ( touchSupported ? ' touchmove.clockpicker' : ''),
|
||||
mouseupEvent = 'mouseup.clockpicker' + ( touchSupported ? ' touchend.clockpicker' : '');
|
||||
|
||||
// Vibrate the device if supported
|
||||
var vibrate = navigator.vibrate ? 'vibrate' : navigator.webkitVibrate ? 'webkitVibrate' : null;
|
||||
|
||||
function createSvgElement(name) {
|
||||
return document.createElementNS(svgNS, name);
|
||||
}
|
||||
|
||||
function leadingZero(num) {
|
||||
return (num < 10 ? '0' : '') + num;
|
||||
}
|
||||
|
||||
// Get a unique id
|
||||
var idCounter = 0;
|
||||
function uniqueId(prefix) {
|
||||
var id = ++idCounter + '';
|
||||
return prefix ? prefix + id : id;
|
||||
}
|
||||
|
||||
// Clock size
|
||||
var dialRadius = 100,
|
||||
outerRadius = 80,
|
||||
// innerRadius = 80 on 12 hour clock
|
||||
innerRadius = 54,
|
||||
tickRadius = 13,
|
||||
diameter = dialRadius * 2,
|
||||
duration = transitionSupported ? 350 : 1;
|
||||
|
||||
// Popover template
|
||||
var tpl = [
|
||||
'<div class="popover clockpicker-popover">',
|
||||
'<div class="arrow"></div>',
|
||||
'<div class="popover-title">',
|
||||
'<span class="clockpicker-span-hours text-primary"></span>',
|
||||
' : ',
|
||||
'<span class="clockpicker-span-minutes"></span>',
|
||||
'<span class="clockpicker-span-am-pm"></span>',
|
||||
'</div>',
|
||||
'<div class="popover-content">',
|
||||
'<div class="clockpicker-plate">',
|
||||
'<div class="clockpicker-canvas"></div>',
|
||||
'<div class="clockpicker-dial clockpicker-hours"></div>',
|
||||
'<div class="clockpicker-dial clockpicker-minutes clockpicker-dial-out"></div>',
|
||||
'</div>',
|
||||
'<span class="clockpicker-am-pm-block">',
|
||||
'</span>',
|
||||
'</div>',
|
||||
'</div>'
|
||||
].join('');
|
||||
|
||||
// ClockPicker
|
||||
function ClockPicker(element, options) {
|
||||
var popover = $(tpl),
|
||||
plate = popover.find('.clockpicker-plate'),
|
||||
hoursView = popover.find('.clockpicker-hours'),
|
||||
minutesView = popover.find('.clockpicker-minutes'),
|
||||
amPmBlock = popover.find('.clockpicker-am-pm-block'),
|
||||
isInput = element.prop('tagName') === 'INPUT',
|
||||
input = isInput ? element : element.find('input'),
|
||||
addon = element.find('.input-group-addon'),
|
||||
self = this,
|
||||
timer;
|
||||
|
||||
this.id = uniqueId('cp');
|
||||
this.element = element;
|
||||
this.options = options;
|
||||
this.isAppended = false;
|
||||
this.isShown = false;
|
||||
this.currentView = 'hours';
|
||||
this.isInput = isInput;
|
||||
this.input = input;
|
||||
this.addon = addon;
|
||||
this.popover = popover;
|
||||
this.plate = plate;
|
||||
this.hoursView = hoursView;
|
||||
this.minutesView = minutesView;
|
||||
this.amPmBlock = amPmBlock;
|
||||
this.spanHours = popover.find('.clockpicker-span-hours');
|
||||
this.spanMinutes = popover.find('.clockpicker-span-minutes');
|
||||
this.spanAmPm = popover.find('.clockpicker-span-am-pm');
|
||||
this.amOrPm = "PM";
|
||||
|
||||
// Setup for for 12 hour clock if option is selected
|
||||
if (options.twelvehour) {
|
||||
|
||||
var amPmButtonsTemplate = ['<div class="clockpicker-am-pm-block">',
|
||||
'<button type="button" class="btn btn-sm btn-default clockpicker-button clockpicker-am-button">',
|
||||
'AM</button>',
|
||||
'<button type="button" class="btn btn-sm btn-default clockpicker-button clockpicker-pm-button">',
|
||||
'PM</button>',
|
||||
'</div>'].join('');
|
||||
|
||||
var amPmButtons = $(amPmButtonsTemplate);
|
||||
//amPmButtons.appendTo(plate);
|
||||
|
||||
////Not working b/c they are not shown when this runs
|
||||
//$('clockpicker-am-button')
|
||||
// .on("click", function() {
|
||||
// self.amOrPm = "AM";
|
||||
// $('.clockpicker-span-am-pm').empty().append('AM');
|
||||
// });
|
||||
//
|
||||
//$('clockpicker-pm-button')
|
||||
// .on("click", function() {
|
||||
// self.amOrPm = "PM";
|
||||
// $('.clockpicker-span-am-pm').empty().append('PM');
|
||||
// });
|
||||
|
||||
$('<button type="button" class="btn btn-sm btn-default clockpicker-button am-button">' + "AM" + '</button>')
|
||||
.on("click", function() {
|
||||
self.amOrPm = "AM";
|
||||
$('.clockpicker-span-am-pm').empty().append('AM');
|
||||
}).appendTo(this.amPmBlock);
|
||||
|
||||
|
||||
$('<button type="button" class="btn btn-sm btn-default clockpicker-button pm-button">' + "PM" + '</button>')
|
||||
.on("click", function() {
|
||||
self.amOrPm = 'PM';
|
||||
$('.clockpicker-span-am-pm').empty().append('PM');
|
||||
}).appendTo(this.amPmBlock);
|
||||
|
||||
}
|
||||
|
||||
if (! options.autoclose) {
|
||||
// If autoclose is not setted, append a button
|
||||
$('<button type="button" class="btn btn-sm btn-default btn-block clockpicker-button">' + options.donetext + '</button>')
|
||||
.click($.proxy(this.done, this))
|
||||
.appendTo(popover);
|
||||
}
|
||||
|
||||
// Placement and arrow align - make sure they make sense.
|
||||
if ((options.placement === 'top' || options.placement === 'bottom') && (options.align === 'top' || options.align === 'bottom')) options.align = 'left';
|
||||
if ((options.placement === 'left' || options.placement === 'right') && (options.align === 'left' || options.align === 'right')) options.align = 'top';
|
||||
|
||||
popover.addClass(options.placement);
|
||||
popover.addClass('clockpicker-align-' + options.align);
|
||||
|
||||
this.spanHours.click($.proxy(this.toggleView, this, 'hours'));
|
||||
this.spanMinutes.click($.proxy(this.toggleView, this, 'minutes'));
|
||||
|
||||
// Show or toggle
|
||||
input.on('focus.clockpicker click.clockpicker', $.proxy(this.show, this));
|
||||
addon.on('click.clockpicker', $.proxy(this.toggle, this));
|
||||
|
||||
// Build ticks
|
||||
var tickTpl = $('<div class="clockpicker-tick"></div>'),
|
||||
i, tick, radian, radius;
|
||||
|
||||
// Hours view
|
||||
if (options.twelvehour) {
|
||||
for (i = 1; i < 13; i += 1) {
|
||||
tick = tickTpl.clone();
|
||||
radian = i / 6 * Math.PI;
|
||||
radius = outerRadius;
|
||||
tick.css('font-size', '120%');
|
||||
tick.css({
|
||||
left: dialRadius + Math.sin(radian) * radius - tickRadius,
|
||||
top: dialRadius - Math.cos(radian) * radius - tickRadius
|
||||
});
|
||||
tick.html(i === 0 ? '00' : i);
|
||||
hoursView.append(tick);
|
||||
tick.on(mousedownEvent, mousedown);
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 24; i += 1) {
|
||||
tick = tickTpl.clone();
|
||||
radian = i / 6 * Math.PI;
|
||||
var inner = i > 0 && i < 13;
|
||||
radius = inner ? innerRadius : outerRadius;
|
||||
tick.css({
|
||||
left: dialRadius + Math.sin(radian) * radius - tickRadius,
|
||||
top: dialRadius - Math.cos(radian) * radius - tickRadius
|
||||
});
|
||||
if (inner) {
|
||||
tick.css('font-size', '120%');
|
||||
}
|
||||
tick.html(i === 0 ? '00' : i);
|
||||
hoursView.append(tick);
|
||||
tick.on(mousedownEvent, mousedown);
|
||||
}
|
||||
}
|
||||
|
||||
// Minutes view
|
||||
for (i = 0; i < 60; i += 5) {
|
||||
tick = tickTpl.clone();
|
||||
radian = i / 30 * Math.PI;
|
||||
tick.css({
|
||||
left: dialRadius + Math.sin(radian) * outerRadius - tickRadius,
|
||||
top: dialRadius - Math.cos(radian) * outerRadius - tickRadius
|
||||
});
|
||||
tick.css('font-size', '120%');
|
||||
tick.html(leadingZero(i));
|
||||
minutesView.append(tick);
|
||||
tick.on(mousedownEvent, mousedown);
|
||||
}
|
||||
|
||||
// Clicking on minutes view space
|
||||
plate.on(mousedownEvent, function(e){
|
||||
if ($(e.target).closest('.clockpicker-tick').length === 0) {
|
||||
mousedown(e, true);
|
||||
}
|
||||
});
|
||||
|
||||
// Mousedown or touchstart
|
||||
function mousedown(e, space) {
|
||||
var offset = plate.offset(),
|
||||
isTouch = /^touch/.test(e.type),
|
||||
x0 = offset.left + dialRadius,
|
||||
y0 = offset.top + dialRadius,
|
||||
dx = (isTouch ? e.originalEvent.touches[0] : e).pageX - x0,
|
||||
dy = (isTouch ? e.originalEvent.touches[0] : e).pageY - y0,
|
||||
z = Math.sqrt(dx * dx + dy * dy),
|
||||
moved = false;
|
||||
|
||||
// When clicking on minutes view space, check the mouse position
|
||||
if (space && (z < outerRadius - tickRadius || z > outerRadius + tickRadius)) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
// Set cursor style of body after 200ms
|
||||
var movingTimer = setTimeout(function(){
|
||||
$body.addClass('clockpicker-moving');
|
||||
}, 200);
|
||||
|
||||
// Place the canvas to top
|
||||
if (svgSupported) {
|
||||
plate.append(self.canvas);
|
||||
}
|
||||
|
||||
// Clock
|
||||
self.setHand(dx, dy, ! space, true);
|
||||
|
||||
// Mousemove on document
|
||||
$doc.off(mousemoveEvent).on(mousemoveEvent, function(e){
|
||||
e.preventDefault();
|
||||
var isTouch = /^touch/.test(e.type),
|
||||
x = (isTouch ? e.originalEvent.touches[0] : e).pageX - x0,
|
||||
y = (isTouch ? e.originalEvent.touches[0] : e).pageY - y0;
|
||||
if (! moved && x === dx && y === dy) {
|
||||
// Clicking in chrome on windows will trigger a mousemove event
|
||||
return;
|
||||
}
|
||||
moved = true;
|
||||
self.setHand(x, y, false, true);
|
||||
});
|
||||
|
||||
// Mouseup on document
|
||||
$doc.off(mouseupEvent).on(mouseupEvent, function(e){
|
||||
$doc.off(mouseupEvent);
|
||||
e.preventDefault();
|
||||
var isTouch = /^touch/.test(e.type),
|
||||
x = (isTouch ? e.originalEvent.changedTouches[0] : e).pageX - x0,
|
||||
y = (isTouch ? e.originalEvent.changedTouches[0] : e).pageY - y0;
|
||||
if ((space || moved) && x === dx && y === dy) {
|
||||
self.setHand(x, y);
|
||||
}
|
||||
if (self.currentView === 'hours') {
|
||||
self.toggleView('minutes', duration / 2);
|
||||
} else {
|
||||
if (options.autoclose) {
|
||||
self.minutesView.addClass('clockpicker-dial-out');
|
||||
setTimeout(function(){
|
||||
self.done();
|
||||
}, duration / 2);
|
||||
}
|
||||
}
|
||||
plate.prepend(canvas);
|
||||
|
||||
// Reset cursor style of body
|
||||
clearTimeout(movingTimer);
|
||||
$body.removeClass('clockpicker-moving');
|
||||
|
||||
// Unbind mousemove event
|
||||
$doc.off(mousemoveEvent);
|
||||
});
|
||||
}
|
||||
|
||||
if (svgSupported) {
|
||||
// Draw clock hands and others
|
||||
var canvas = popover.find('.clockpicker-canvas'),
|
||||
svg = createSvgElement('svg');
|
||||
svg.setAttribute('class', 'clockpicker-svg');
|
||||
svg.setAttribute('width', diameter);
|
||||
svg.setAttribute('height', diameter);
|
||||
var g = createSvgElement('g');
|
||||
g.setAttribute('transform', 'translate(' + dialRadius + ',' + dialRadius + ')');
|
||||
var bearing = createSvgElement('circle');
|
||||
bearing.setAttribute('class', 'clockpicker-canvas-bearing');
|
||||
bearing.setAttribute('cx', 0);
|
||||
bearing.setAttribute('cy', 0);
|
||||
bearing.setAttribute('r', 2);
|
||||
var hand = createSvgElement('line');
|
||||
hand.setAttribute('x1', 0);
|
||||
hand.setAttribute('y1', 0);
|
||||
var bg = createSvgElement('circle');
|
||||
bg.setAttribute('class', 'clockpicker-canvas-bg');
|
||||
bg.setAttribute('r', tickRadius);
|
||||
var fg = createSvgElement('circle');
|
||||
fg.setAttribute('class', 'clockpicker-canvas-fg');
|
||||
fg.setAttribute('r', 3.5);
|
||||
g.appendChild(hand);
|
||||
g.appendChild(bg);
|
||||
g.appendChild(fg);
|
||||
g.appendChild(bearing);
|
||||
svg.appendChild(g);
|
||||
canvas.append(svg);
|
||||
|
||||
this.hand = hand;
|
||||
this.bg = bg;
|
||||
this.fg = fg;
|
||||
this.bearing = bearing;
|
||||
this.g = g;
|
||||
this.canvas = canvas;
|
||||
}
|
||||
|
||||
raiseCallback(this.options.init);
|
||||
}
|
||||
|
||||
function raiseCallback(callbackFunction) {
|
||||
if (callbackFunction && typeof callbackFunction === "function") {
|
||||
callbackFunction();
|
||||
}
|
||||
}
|
||||
|
||||
// Default options
|
||||
ClockPicker.DEFAULTS = {
|
||||
'default': '', // default time, 'now' or '13:14' e.g.
|
||||
fromnow: 0, // set default time to * milliseconds from now (using with default = 'now')
|
||||
placement: 'bottom', // clock popover placement
|
||||
align: 'left', // popover arrow align
|
||||
donetext: '完成', // done button text
|
||||
autoclose: false, // auto close when minute is selected
|
||||
twelvehour: false, // change to 12 hour AM/PM clock from 24 hour
|
||||
vibrate: true // vibrate the device when dragging clock hand
|
||||
};
|
||||
|
||||
// Show or hide popover
|
||||
ClockPicker.prototype.toggle = function(){
|
||||
this[this.isShown ? 'hide' : 'show']();
|
||||
};
|
||||
|
||||
// Set popover position
|
||||
ClockPicker.prototype.locate = function(){
|
||||
var element = this.element,
|
||||
popover = this.popover,
|
||||
offset = element.offset(),
|
||||
width = element.outerWidth(),
|
||||
height = element.outerHeight(),
|
||||
placement = this.options.placement,
|
||||
align = this.options.align,
|
||||
styles = {},
|
||||
self = this;
|
||||
|
||||
popover.show();
|
||||
|
||||
// Place the popover
|
||||
switch (placement) {
|
||||
case 'bottom':
|
||||
styles.top = offset.top + height;
|
||||
break;
|
||||
case 'right':
|
||||
styles.left = offset.left + width;
|
||||
break;
|
||||
case 'top':
|
||||
styles.top = offset.top - popover.outerHeight();
|
||||
break;
|
||||
case 'left':
|
||||
styles.left = offset.left - popover.outerWidth();
|
||||
break;
|
||||
}
|
||||
|
||||
// Align the popover arrow
|
||||
switch (align) {
|
||||
case 'left':
|
||||
styles.left = offset.left;
|
||||
break;
|
||||
case 'right':
|
||||
styles.left = offset.left + width - popover.outerWidth();
|
||||
break;
|
||||
case 'top':
|
||||
styles.top = offset.top;
|
||||
break;
|
||||
case 'bottom':
|
||||
styles.top = offset.top + height - popover.outerHeight();
|
||||
break;
|
||||
}
|
||||
|
||||
popover.css(styles);
|
||||
};
|
||||
|
||||
// Show popover
|
||||
ClockPicker.prototype.show = function(e){
|
||||
// Not show again
|
||||
if (this.isShown) {
|
||||
return;
|
||||
}
|
||||
|
||||
raiseCallback(this.options.beforeShow);
|
||||
|
||||
var self = this;
|
||||
|
||||
// Initialize
|
||||
if (! this.isAppended) {
|
||||
// Append popover to body
|
||||
$body = $(document.body).append(this.popover);
|
||||
|
||||
// Reset position when resize
|
||||
$win.on('resize.clockpicker' + this.id, function(){
|
||||
if (self.isShown) {
|
||||
self.locate();
|
||||
}
|
||||
});
|
||||
|
||||
this.isAppended = true;
|
||||
}
|
||||
|
||||
// Get the time
|
||||
var value = ((this.input.prop('value') || this.options['default'] || '') + '').split(':');
|
||||
if (value[0] === 'now') {
|
||||
var now = new Date(+ new Date() + this.options.fromnow);
|
||||
value = [
|
||||
now.getHours(),
|
||||
now.getMinutes()
|
||||
];
|
||||
}
|
||||
this.hours = + value[0] || 0;
|
||||
this.minutes = + value[1] || 0;
|
||||
this.spanHours.html(leadingZero(this.hours));
|
||||
this.spanMinutes.html(leadingZero(this.minutes));
|
||||
|
||||
// Toggle to hours view
|
||||
this.toggleView('hours');
|
||||
|
||||
// Set position
|
||||
this.locate();
|
||||
|
||||
this.isShown = true;
|
||||
|
||||
// Hide when clicking or tabbing on any element except the clock, input and addon
|
||||
$doc.on('click.clockpicker.' + this.id + ' focusin.clockpicker.' + this.id, function(e){
|
||||
var target = $(e.target);
|
||||
if (target.closest(self.popover).length === 0 &&
|
||||
target.closest(self.addon).length === 0 &&
|
||||
target.closest(self.input).length === 0) {
|
||||
self.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Hide when ESC is pressed
|
||||
$doc.on('keyup.clockpicker.' + this.id, function(e){
|
||||
if (e.keyCode === 27) {
|
||||
self.hide();
|
||||
}
|
||||
});
|
||||
|
||||
raiseCallback(this.options.afterShow);
|
||||
};
|
||||
|
||||
// Hide popover
|
||||
ClockPicker.prototype.hide = function(){
|
||||
raiseCallback(this.options.beforeHide);
|
||||
|
||||
this.isShown = false;
|
||||
|
||||
// Unbinding events on document
|
||||
$doc.off('click.clockpicker.' + this.id + ' focusin.clockpicker.' + this.id);
|
||||
$doc.off('keyup.clockpicker.' + this.id);
|
||||
|
||||
this.popover.hide();
|
||||
|
||||
raiseCallback(this.options.afterHide);
|
||||
};
|
||||
|
||||
// Toggle to hours or minutes view
|
||||
ClockPicker.prototype.toggleView = function(view, delay){
|
||||
var raiseAfterHourSelect = false;
|
||||
if (view === 'minutes' && $(this.hoursView).css("visibility") === "visible") {
|
||||
raiseCallback(this.options.beforeHourSelect);
|
||||
raiseAfterHourSelect = true;
|
||||
}
|
||||
var isHours = view === 'hours',
|
||||
nextView = isHours ? this.hoursView : this.minutesView,
|
||||
hideView = isHours ? this.minutesView : this.hoursView;
|
||||
|
||||
this.currentView = view;
|
||||
|
||||
this.spanHours.toggleClass('text-primary', isHours);
|
||||
this.spanMinutes.toggleClass('text-primary', ! isHours);
|
||||
|
||||
// Let's make transitions
|
||||
hideView.addClass('clockpicker-dial-out');
|
||||
nextView.css('visibility', 'visible').removeClass('clockpicker-dial-out');
|
||||
|
||||
// Reset clock hand
|
||||
this.resetClock(delay);
|
||||
|
||||
// After transitions ended
|
||||
clearTimeout(this.toggleViewTimer);
|
||||
this.toggleViewTimer = setTimeout(function(){
|
||||
hideView.css('visibility', 'hidden');
|
||||
}, duration);
|
||||
|
||||
if (raiseAfterHourSelect) {
|
||||
raiseCallback(this.options.afterHourSelect);
|
||||
}
|
||||
};
|
||||
|
||||
// Reset clock hand
|
||||
ClockPicker.prototype.resetClock = function(delay){
|
||||
var view = this.currentView,
|
||||
value = this[view],
|
||||
isHours = view === 'hours',
|
||||
unit = Math.PI / (isHours ? 6 : 30),
|
||||
radian = value * unit,
|
||||
radius = isHours && value > 0 && value < 13 ? innerRadius : outerRadius,
|
||||
x = Math.sin(radian) * radius,
|
||||
y = - Math.cos(radian) * radius,
|
||||
self = this;
|
||||
if (svgSupported && delay) {
|
||||
self.canvas.addClass('clockpicker-canvas-out');
|
||||
setTimeout(function(){
|
||||
self.canvas.removeClass('clockpicker-canvas-out');
|
||||
self.setHand(x, y);
|
||||
}, delay);
|
||||
} else {
|
||||
this.setHand(x, y);
|
||||
}
|
||||
};
|
||||
|
||||
// Set clock hand to (x, y)
|
||||
ClockPicker.prototype.setHand = function(x, y, roundBy5, dragging){
|
||||
var radian = Math.atan2(x, - y),
|
||||
isHours = this.currentView === 'hours',
|
||||
unit = Math.PI / (isHours || roundBy5 ? 6 : 30),
|
||||
z = Math.sqrt(x * x + y * y),
|
||||
options = this.options,
|
||||
inner = isHours && z < (outerRadius + innerRadius) / 2,
|
||||
radius = inner ? innerRadius : outerRadius,
|
||||
value;
|
||||
|
||||
if (options.twelvehour) {
|
||||
radius = outerRadius;
|
||||
}
|
||||
|
||||
// Radian should in range [0, 2PI]
|
||||
if (radian < 0) {
|
||||
radian = Math.PI * 2 + radian;
|
||||
}
|
||||
|
||||
// Get the round value
|
||||
value = Math.round(radian / unit);
|
||||
|
||||
// Get the round radian
|
||||
radian = value * unit;
|
||||
|
||||
// Correct the hours or minutes
|
||||
if (options.twelvehour) {
|
||||
if (isHours) {
|
||||
if (value === 0) {
|
||||
value = 12;
|
||||
}
|
||||
} else {
|
||||
if (roundBy5) {
|
||||
value *= 5;
|
||||
}
|
||||
if (value === 60) {
|
||||
value = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isHours) {
|
||||
if (value === 12) {
|
||||
value = 0;
|
||||
}
|
||||
value = inner ? (value === 0 ? 12 : value) : value === 0 ? 0 : value + 12;
|
||||
} else {
|
||||
if (roundBy5) {
|
||||
value *= 5;
|
||||
}
|
||||
if (value === 60) {
|
||||
value = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Once hours or minutes changed, vibrate the device
|
||||
if (this[this.currentView] !== value) {
|
||||
if (vibrate && this.options.vibrate) {
|
||||
// Do not vibrate too frequently
|
||||
if (! this.vibrateTimer) {
|
||||
navigator[vibrate](10);
|
||||
this.vibrateTimer = setTimeout($.proxy(function(){
|
||||
this.vibrateTimer = null;
|
||||
}, this), 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this[this.currentView] = value;
|
||||
this[isHours ? 'spanHours' : 'spanMinutes'].html(leadingZero(value));
|
||||
|
||||
// If svg is not supported, just add an active class to the tick
|
||||
if (! svgSupported) {
|
||||
this[isHours ? 'hoursView' : 'minutesView'].find('.clockpicker-tick').each(function(){
|
||||
var tick = $(this);
|
||||
tick.toggleClass('active', value === + tick.html());
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Place clock hand at the top when dragging
|
||||
if (dragging || (! isHours && value % 5)) {
|
||||
this.g.insertBefore(this.hand, this.bearing);
|
||||
this.g.insertBefore(this.bg, this.fg);
|
||||
this.bg.setAttribute('class', 'clockpicker-canvas-bg clockpicker-canvas-bg-trans');
|
||||
} else {
|
||||
// Or place it at the bottom
|
||||
this.g.insertBefore(this.hand, this.bg);
|
||||
this.g.insertBefore(this.fg, this.bg);
|
||||
this.bg.setAttribute('class', 'clockpicker-canvas-bg');
|
||||
}
|
||||
|
||||
// Set clock hand and others' position
|
||||
var cx = Math.sin(radian) * radius,
|
||||
cy = - Math.cos(radian) * radius;
|
||||
this.hand.setAttribute('x2', cx);
|
||||
this.hand.setAttribute('y2', cy);
|
||||
this.bg.setAttribute('cx', cx);
|
||||
this.bg.setAttribute('cy', cy);
|
||||
this.fg.setAttribute('cx', cx);
|
||||
this.fg.setAttribute('cy', cy);
|
||||
};
|
||||
|
||||
// Hours and minutes are selected
|
||||
ClockPicker.prototype.done = function() {
|
||||
raiseCallback(this.options.beforeDone);
|
||||
this.hide();
|
||||
var last = this.input.prop('value'),
|
||||
value = leadingZero(this.hours) + ':' + leadingZero(this.minutes);
|
||||
if (this.options.twelvehour) {
|
||||
value = value + this.amOrPm;
|
||||
}
|
||||
|
||||
this.input.prop('value', value);
|
||||
if (value !== last) {
|
||||
this.input.triggerHandler('change');
|
||||
if (! this.isInput) {
|
||||
this.element.trigger('change');
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.autoclose) {
|
||||
this.input.trigger('blur');
|
||||
}
|
||||
|
||||
raiseCallback(this.options.afterDone);
|
||||
};
|
||||
|
||||
// Remove clockpicker from input
|
||||
ClockPicker.prototype.remove = function() {
|
||||
this.element.removeData('clockpicker');
|
||||
this.input.off('focus.clockpicker click.clockpicker');
|
||||
this.addon.off('click.clockpicker');
|
||||
if (this.isShown) {
|
||||
this.hide();
|
||||
}
|
||||
if (this.isAppended) {
|
||||
$win.off('resize.clockpicker' + this.id);
|
||||
this.popover.remove();
|
||||
}
|
||||
};
|
||||
|
||||
// Extends $.fn.clockpicker
|
||||
$.fn.clockpicker = function(option){
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
return this.each(function(){
|
||||
var $this = $(this),
|
||||
data = $this.data('clockpicker');
|
||||
if (! data) {
|
||||
var options = $.extend({}, ClockPicker.DEFAULTS, $this.data(), typeof option == 'object' && option);
|
||||
$this.data('clockpicker', new ClockPicker($this, options));
|
||||
} else {
|
||||
// Manual operatsions. show, hide, remove, e.g.
|
||||
if (typeof data[option] === 'function') {
|
||||
data[option].apply(data, args);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}());
|
||||
File diff suppressed because one or more lines are too long
@@ -1,245 +0,0 @@
|
||||
/* Set the defaults for DataTables initialisation */
|
||||
$.extend(true, $.fn.dataTable.defaults, {
|
||||
"sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>" + "t" + "<'row'<'col-sm-6'i><'col-sm-6'p>>",
|
||||
"oLanguage": {
|
||||
"sLengthMenu": "每页 _MENU_ 条记录"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/* Default class modification */
|
||||
$.extend($.fn.dataTableExt.oStdClasses, {
|
||||
"sWrapper": "dataTables_wrapper form-inline",
|
||||
"sFilterInput": "form-control input-sm",
|
||||
"sLengthSelect": "form-control input-sm"
|
||||
});
|
||||
|
||||
// In 1.10 we use the pagination renderers to draw the Bootstrap paging,
|
||||
// rather than custom plug-in
|
||||
if ($.fn.dataTable.Api) {
|
||||
$.fn.dataTable.defaults.renderer = 'bootstrap';
|
||||
$.fn.dataTable.ext.renderer.pageButton.bootstrap = function(settings, host, idx, buttons, page, pages) {
|
||||
var api = new $.fn.dataTable.Api(settings);
|
||||
var classes = settings.oClasses;
|
||||
var lang = settings.oLanguage.oPaginate;
|
||||
var btnDisplay, btnClass;
|
||||
|
||||
var attach = function(container, buttons) {
|
||||
var i, ien, node, button;
|
||||
var clickHandler = function(e) {
|
||||
e.preventDefault();
|
||||
if (e.data.action !== 'ellipsis') {
|
||||
api.page(e.data.action).draw(false);
|
||||
}
|
||||
};
|
||||
|
||||
for (i = 0, ien = buttons.length; i < ien; i++) {
|
||||
button = buttons[i];
|
||||
|
||||
if ($.isArray(button)) {
|
||||
attach(container, button);
|
||||
} else {
|
||||
btnDisplay = '';
|
||||
btnClass = '';
|
||||
|
||||
switch (button) {
|
||||
case 'ellipsis':
|
||||
btnDisplay = '…';
|
||||
btnClass = 'disabled';
|
||||
break;
|
||||
|
||||
case 'first':
|
||||
btnDisplay = lang.sFirst;
|
||||
btnClass = button + (page > 0 ?
|
||||
'' : ' disabled');
|
||||
break;
|
||||
|
||||
case 'previous':
|
||||
btnDisplay = lang.sPrevious;
|
||||
btnClass = button + (page > 0 ?
|
||||
'' : ' disabled');
|
||||
break;
|
||||
|
||||
case 'next':
|
||||
btnDisplay = lang.sNext;
|
||||
btnClass = button + (page < pages - 1 ?
|
||||
'' : ' disabled');
|
||||
break;
|
||||
|
||||
case 'last':
|
||||
btnDisplay = lang.sLast;
|
||||
btnClass = button + (page < pages - 1 ?
|
||||
'' : ' disabled');
|
||||
break;
|
||||
|
||||
default:
|
||||
btnDisplay = button + 1;
|
||||
btnClass = page === button ?
|
||||
'active' : '';
|
||||
break;
|
||||
}
|
||||
|
||||
if (btnDisplay) {
|
||||
node = $('<li>', {
|
||||
'class': classes.sPageButton + ' ' + btnClass,
|
||||
'aria-controls': settings.sTableId,
|
||||
'tabindex': settings.iTabIndex,
|
||||
'id': idx === 0 && typeof button === 'string' ? settings.sTableId + '_' + button : null
|
||||
})
|
||||
.append($('<a>', {
|
||||
'href': '#'
|
||||
})
|
||||
.html(btnDisplay)
|
||||
)
|
||||
.appendTo(container);
|
||||
|
||||
settings.oApi._fnBindAction(
|
||||
node, {
|
||||
action: button
|
||||
}, clickHandler
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
attach(
|
||||
$(host).empty().html('<ul class="pagination"/>').children('ul'),
|
||||
buttons
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Integration for 1.9-
|
||||
$.fn.dataTable.defaults.sPaginationType = 'bootstrap';
|
||||
|
||||
/* API method to get paging information */
|
||||
$.fn.dataTableExt.oApi.fnPagingInfo = function(oSettings) {
|
||||
return {
|
||||
"iStart": oSettings._iDisplayStart,
|
||||
"iEnd": oSettings.fnDisplayEnd(),
|
||||
"iLength": oSettings._iDisplayLength,
|
||||
"iTotal": oSettings.fnRecordsTotal(),
|
||||
"iFilteredTotal": oSettings.fnRecordsDisplay(),
|
||||
"iPage": oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength),
|
||||
"iTotalPages": oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength)
|
||||
};
|
||||
};
|
||||
|
||||
/* Bootstrap style pagination control */
|
||||
$.extend($.fn.dataTableExt.oPagination, {
|
||||
"bootstrap": {
|
||||
"fnInit": function(oSettings, nPaging, fnDraw) {
|
||||
var oLang = oSettings.oLanguage.oPaginate;
|
||||
var fnClickHandler = function(e) {
|
||||
e.preventDefault();
|
||||
if (oSettings.oApi._fnPageChange(oSettings, e.data.action)) {
|
||||
fnDraw(oSettings);
|
||||
}
|
||||
};
|
||||
|
||||
$(nPaging).append(
|
||||
'<ul class="pagination">' +
|
||||
'<li class="prev disabled"><a href="#">← ' + oLang.sPrevious + '</a></li>' +
|
||||
'<li class="next disabled"><a href="#">' + oLang.sNext + ' → </a></li>' +
|
||||
'</ul>'
|
||||
);
|
||||
var els = $('a', nPaging);
|
||||
$(els[0]).bind('click.DT', {
|
||||
action: "previous"
|
||||
}, fnClickHandler);
|
||||
$(els[1]).bind('click.DT', {
|
||||
action: "next"
|
||||
}, fnClickHandler);
|
||||
},
|
||||
|
||||
"fnUpdate": function(oSettings, fnDraw) {
|
||||
var iListLength = 5;
|
||||
var oPaging = oSettings.oInstance.fnPagingInfo();
|
||||
var an = oSettings.aanFeatures.p;
|
||||
var i, ien, j, sClass, iStart, iEnd, iHalf = Math.floor(iListLength / 2);
|
||||
|
||||
if (oPaging.iTotalPages < iListLength) {
|
||||
iStart = 1;
|
||||
iEnd = oPaging.iTotalPages;
|
||||
} else if (oPaging.iPage <= iHalf) {
|
||||
iStart = 1;
|
||||
iEnd = iListLength;
|
||||
} else if (oPaging.iPage >= (oPaging.iTotalPages - iHalf)) {
|
||||
iStart = oPaging.iTotalPages - iListLength + 1;
|
||||
iEnd = oPaging.iTotalPages;
|
||||
} else {
|
||||
iStart = oPaging.iPage - iHalf + 1;
|
||||
iEnd = iStart + iListLength - 1;
|
||||
}
|
||||
|
||||
for (i = 0, ien = an.length; i < ien; i++) {
|
||||
// Remove the middle elements
|
||||
$('li:gt(0)', an[i]).filter(':not(:last)').remove();
|
||||
|
||||
// Add the new list items and their event handlers
|
||||
for (j = iStart; j <= iEnd; j++) {
|
||||
sClass = (j == oPaging.iPage + 1) ? 'class="active"' : '';
|
||||
$('<li ' + sClass + '><a href="#">' + j + '</a></li>')
|
||||
.insertBefore($('li:last', an[i])[0])
|
||||
.bind('click', function(e) {
|
||||
e.preventDefault();
|
||||
oSettings._iDisplayStart = (parseInt($('a', this).text(), 10) - 1) * oPaging.iLength;
|
||||
fnDraw(oSettings);
|
||||
});
|
||||
}
|
||||
|
||||
// Add / remove disabled classes from the static elements
|
||||
if (oPaging.iPage === 0) {
|
||||
$('li:first', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:first', an[i]).removeClass('disabled');
|
||||
}
|
||||
|
||||
if (oPaging.iPage === oPaging.iTotalPages - 1 || oPaging.iTotalPages === 0) {
|
||||
$('li:last', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:last', an[i]).removeClass('disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* TableTools Bootstrap compatibility
|
||||
* Required TableTools 2.1+
|
||||
*/
|
||||
if ($.fn.DataTable.TableTools) {
|
||||
// Set the classes that TableTools uses to something suitable for Bootstrap
|
||||
$.extend(true, $.fn.DataTable.TableTools.classes, {
|
||||
"container": "DTTT btn-group",
|
||||
"buttons": {
|
||||
"normal": "btn btn-default",
|
||||
"disabled": "disabled"
|
||||
},
|
||||
"collection": {
|
||||
"container": "DTTT_dropdown dropdown-menu",
|
||||
"buttons": {
|
||||
"normal": "",
|
||||
"disabled": "disabled"
|
||||
}
|
||||
},
|
||||
"print": {
|
||||
"info": "DTTT_print_info modal"
|
||||
},
|
||||
"select": {
|
||||
"row": "active"
|
||||
}
|
||||
});
|
||||
|
||||
// Have the collection use a bootstrap compatible dropdown
|
||||
$.extend(true, $.fn.DataTable.TableTools.DEFAULTS.oTags, {
|
||||
"collection": {
|
||||
"container": "ul",
|
||||
"button": "li",
|
||||
"liner": "a"
|
||||
}
|
||||
});
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,49 +0,0 @@
|
||||
(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32}
|
||||
diff_match_patch.prototype.diff_main=function(a,b,c,d){"undefined"==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a,
|
||||
b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a};
|
||||
diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100<a.length&&100<b.length?this.diff_lineMode_(a,b,
|
||||
d):this.diff_bisect_(a,b,d)};
|
||||
diff_match_patch.prototype.diff_lineMode_=function(a,b,c){var d=this.diff_linesToChars_(a,b);a=d.chars1;b=d.chars2;d=d.lineArray;a=this.diff_main(a,b,!1,c);this.diff_charsToLines_(a,d);this.diff_cleanupSemantic(a);a.push([0,""]);for(var e=d=b=0,f="",g="";b<a.length;){switch(a[b][0]){case 1:e++;g+=a[b][1];break;case -1:d++;f+=a[b][1];break;case 0:if(1<=d&&1<=e){a.splice(b-d-e,d+e);b=b-d-e;d=this.diff_main(f,g,!1,c);for(e=d.length-1;0<=e;e--)a.splice(b,0,d[e]);b+=d.length}d=e=0;g=f=""}b++}a.pop();return a};
|
||||
diff_match_patch.prototype.diff_bisect_=function(a,b,c){for(var d=a.length,e=b.length,f=Math.ceil((d+e)/2),g=f,h=2*f,j=Array(h),i=Array(h),k=0;k<h;k++)j[k]=-1,i[k]=-1;j[g+1]=0;i[g+1]=0;for(var k=d-e,q=0!=k%2,r=0,t=0,p=0,w=0,v=0;v<f&&!((new Date).getTime()>c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]<j[l+1]?j[l+1]:j[l-1]+1;for(var s=m-n;m<d&&s<e&&a.charAt(m)==b.charAt(s);)m++,s++;j[l]=m;if(m>d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l<h&&-1!=i[l])){var u=d-i[l];if(m>=
|
||||
u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]<i[l+1]?i[l+1]:i[l-1]+1;for(m=u-n;u<d&&m<e&&a.charAt(d-u-1)==b.charAt(e-m-1);)u++,m++;i[l]=u;if(u>d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l<h&&-1!=j[l])&&(m=j[l],s=g+m-l,u=d-u,m>=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]};
|
||||
diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)};
|
||||
diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;f<a.length-1;){f=a.indexOf("\n",c);-1==f&&(f=a.length-1);var r=a.substring(c,f+1),c=f+1;(e.hasOwnProperty?e.hasOwnProperty(r):void 0!==e[r])?b+=String.fromCharCode(e[r]):(b+=String.fromCharCode(g),e[r]=g,d[g++]=r)}return b}var d=[],e={};d[0]="";var f=c(a),g=c(b);return{chars1:f,chars2:g,lineArray:d}};
|
||||
diff_match_patch.prototype.diff_charsToLines_=function(a,b){for(var c=0;c<a.length;c++){for(var d=a[c][1],e=[],f=0;f<d.length;f++)e[f]=b[d.charCodeAt(f)];a[c][1]=e.join("")}};diff_match_patch.prototype.diff_commonPrefix=function(a,b){if(!a||!b||a.charAt(0)!=b.charAt(0))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(f,e)==b.substring(f,e)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
|
||||
diff_match_patch.prototype.diff_commonSuffix=function(a,b){if(!a||!b||a.charAt(a.length-1)!=b.charAt(b.length-1))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(a.length-e,a.length-f)==b.substring(b.length-e,b.length-f)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
|
||||
diff_match_patch.prototype.diff_commonOverlap_=function(a,b){var c=a.length,d=b.length;if(0==c||0==d)return 0;c>d?a=a.substring(c-d):c<d&&(b=b.substring(0,c));c=Math.min(c,d);if(a==b)return c;for(var d=0,e=1;;){var f=a.substring(c-e),f=b.indexOf(f);if(-1==f)return d;e+=f;if(0==f||a.substring(c-e)==b.substring(0,e))d=e,e++}};
|
||||
diff_match_patch.prototype.diff_halfMatch_=function(a,b){function c(a,b,c){for(var d=a.substring(c,c+Math.floor(a.length/4)),e=-1,g="",h,j,n,l;-1!=(e=b.indexOf(d,e+1));){var m=f.diff_commonPrefix(a.substring(c),b.substring(e)),s=f.diff_commonSuffix(a.substring(0,c),b.substring(0,e));g.length<s+m&&(g=b.substring(e-s,e)+b.substring(e,e+m),h=a.substring(0,c-s),j=a.substring(c+m),n=b.substring(0,e-s),l=b.substring(e+m))}return 2*g.length>=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null;
|
||||
var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.length<d.length)return null;var f=this,g=c(d,e,Math.ceil(d.length/4)),d=c(d,e,Math.ceil(d.length/2)),h;if(!g&&!d)return null;h=d?g?g[4].length>d[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]};
|
||||
diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f<a.length;)0==a[f][0]?(c[d++]=f,g=j,h=i,i=j=0,e=a[f][1]):(1==a[f][0]?j+=a[f][1].length:i+=a[f][1].length,e&&(e.length<=Math.max(g,h)&&e.length<=Math.max(j,i))&&(a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,d--,f=0<d?c[d-1]:-1,i=j=h=g=0,e=null,b=!0)),f++;b&&this.diff_cleanupMerge(a);this.diff_cleanupSemanticLossless(a);for(f=1;f<a.length;){if(-1==a[f-1][0]&&1==a[f][0]){b=a[f-1][1];c=a[f][1];
|
||||
d=this.diff_commonOverlap_(b,c);e=this.diff_commonOverlap_(c,b);if(d>=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}};
|
||||
diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_);
|
||||
return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c<a.length-1;){if(0==a[c-1][0]&&0==a[c+1][0]){var d=a[c-1][1],e=a[c][1],f=a[c+1][1],g=this.diff_commonSuffix(d,e);if(g)var h=e.substring(e.length-g),d=d.substring(0,d.length-g),e=h+e.substring(0,e.length-g),f=h+f;for(var g=d,h=e,j=f,i=b(d,e)+b(e,f);e.charAt(0)===f.charAt(0);){var d=d+e.charAt(0),e=e.substring(1)+f.charAt(0),f=f.substring(1),k=b(d,e)+b(e,f);k>=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]=
|
||||
h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/;
|
||||
diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;f<a.length;){if(0==a[f][0])a[f][1].length<this.Diff_EditCost&&(j||i)?(c[d++]=f,g=j,h=i,e=a[f][1]):(d=0,e=null),j=i=!1;else if(-1==a[f][0]?i=!0:j=!0,e&&(g&&h&&j&&i||e.length<this.Diff_EditCost/2&&3==g+h+j+i))a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,e=null,g&&h?(j=i=!0,d=0):(d--,f=0<d?c[d-1]:-1,j=i=!1),b=!0;f++}b&&this.diff_cleanupMerge(a)};
|
||||
diff_match_patch.prototype.diff_cleanupMerge=function(a){a.push([0,""]);for(var b=0,c=0,d=0,e="",f="",g;b<a.length;)switch(a[b][0]){case 1:d++;f+=a[b][1];b++;break;case -1:c++;e+=a[b][1];b++;break;case 0:1<c+d?(0!==c&&0!==d&&(g=this.diff_commonPrefix(f,e),0!==g&&(0<b-c-d&&0==a[b-c-d-1][0]?a[b-c-d-1][1]+=f.substring(0,g):(a.splice(0,0,[0,f.substring(0,g)]),b++),f=f.substring(g),e=e.substring(g)),g=this.diff_commonSuffix(f,e),0!==g&&(a[b][1]=f.substring(f.length-g)+a[b][1],f=f.substring(0,f.length-
|
||||
g),e=e.substring(0,e.length-g))),0===c?a.splice(b-d,c+d,[1,f]):0===d?a.splice(b-c,c+d,[-1,e]):a.splice(b-c-d,c+d,[-1,e],[1,f]),b=b-c-d+(c?1:0)+(d?1:0)+1):0!==b&&0==a[b-1][0]?(a[b-1][1]+=a[b][1],a.splice(b,1)):b++,c=d=0,f=e=""}""===a[a.length-1][1]&&a.pop();c=!1;for(b=1;b<a.length-1;)0==a[b-1][0]&&0==a[b+1][0]&&(a[b][1].substring(a[b][1].length-a[b-1][1].length)==a[b-1][1]?(a[b][1]=a[b-1][1]+a[b][1].substring(0,a[b][1].length-a[b-1][1].length),a[b+1][1]=a[b-1][1]+a[b+1][1],a.splice(b-1,1),c=!0):a[b][1].substring(0,
|
||||
a[b+1][1].length)==a[b+1][1]&&(a[b-1][1]+=a[b+1][1],a[b][1]=a[b][1].substring(a[b+1][1].length)+a[b+1][1],a.splice(b+1,1),c=!0)),b++;c&&this.diff_cleanupMerge(a)};diff_match_patch.prototype.diff_xIndex=function(a,b){var c=0,d=0,e=0,f=0,g;for(g=0;g<a.length;g++){1!==a[g][0]&&(c+=a[g][1].length);-1!==a[g][0]&&(d+=a[g][1].length);if(c>b)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)};
|
||||
diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=/</g,e=/>/g,f=/\n/g,g=0;g<a.length;g++){var h=a[g][0],j=a[g][1],j=j.replace(c,"&").replace(d,"<").replace(e,">").replace(f,"¶<br>");switch(h){case 1:b[g]='<ins style="background:#e6ffe6;">'+j+"</ins>";break;case -1:b[g]='<del style="background:#ffe6e6;">'+j+"</del>";break;case 0:b[g]="<span>"+j+"</span>"}}return b.join("")};
|
||||
diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;c<a.length;c++)1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_text2=function(a){for(var b=[],c=0;c<a.length;c++)-1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_levenshtein=function(a){for(var b=0,c=0,d=0,e=0;e<a.length;e++){var f=a[e][0],g=a[e][1];switch(f){case 1:c+=g.length;break;case -1:d+=g.length;break;case 0:b+=Math.max(c,d),d=c=0}}return b+=Math.max(c,d)};
|
||||
diff_match_patch.prototype.diff_toDelta=function(a){for(var b=[],c=0;c<a.length;c++)switch(a[c][0]){case 1:b[c]="+"+encodeURI(a[c][1]);break;case -1:b[c]="-"+a[c][1].length;break;case 0:b[c]="="+a[c][1].length}return b.join("\t").replace(/%20/g," ")};
|
||||
diff_match_patch.prototype.diff_fromDelta=function(a,b){for(var c=[],d=0,e=0,f=b.split(/\t/g),g=0;g<f.length;g++){var h=f[g].substring(1);switch(f[g].charAt(0)){case "+":try{c[d++]=[1,decodeURI(h)]}catch(j){throw Error("Illegal escape in diff_fromDelta: "+h);}break;case "-":case "=":var i=parseInt(h,10);if(isNaN(i)||0>i)throw Error("Invalid number in diff_fromDelta: "+h);h=a.substring(e,e+=i);"="==f[g].charAt(0)?c[d++]=[0,h]:c[d++]=[-1,h];break;default:if(f[g])throw Error("Invalid diff operation in diff_fromDelta: "+
|
||||
f[g]);}}if(e!=a.length)throw Error("Delta length ("+e+") does not equal source text length ("+a.length+").");return c};diff_match_patch.prototype.match_main=function(a,b,c){if(null==a||null==b||null==c)throw Error("Null input. (match_main)");c=Math.max(0,Math.min(c,a.length));return a==b?0:a.length?a.substring(c,c+b.length)==b?c:this.match_bitap_(a,b,c):-1};
|
||||
diff_match_patch.prototype.match_bitap_=function(a,b,c){function d(a,d){var e=a/b.length,g=Math.abs(c-d);return!f.Match_Distance?g?1:e:e+g/f.Match_Distance}if(b.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<<b.length-1,h=-1,i,k,q=b.length+a.length,r,t=0;t<b.length;t++){i=0;for(k=q;i<k;)d(t,c+
|
||||
k)<=g?i=k:q=k,k=Math.floor((q-i)/2+i);q=k;i=Math.max(1,c-k+1);var p=Math.min(c+k,a.length)+b.length;k=Array(p+2);for(k[p+1]=(1<<t)-1;p>=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h};
|
||||
diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=0;for(c=0;c<a.length;c++)b[a.charAt(c)]|=1<<a.length-c-1;return b};
|
||||
diff_match_patch.prototype.patch_addContext_=function(a,b){if(0!=b.length){for(var c=b.substring(a.start2,a.start2+a.length1),d=0;b.indexOf(c)!=b.lastIndexOf(c)&&c.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)d+=this.Patch_Margin,c=b.substring(a.start2-d,a.start2+a.length1+d);d+=this.Patch_Margin;(c=b.substring(a.start2-d,a.start2))&&a.diffs.unshift([0,c]);(d=b.substring(a.start2+a.length1,a.start2+a.length1+d))&&a.diffs.push([0,d]);a.start1-=c.length;a.start2-=c.length;a.length1+=
|
||||
c.length+d.length;a.length2+=c.length+d.length}};
|
||||
diff_match_patch.prototype.patch_make=function(a,b,c){var d;if("string"==typeof a&&"string"==typeof b&&"undefined"==typeof c)d=a,b=this.diff_main(d,b,!0),2<b.length&&(this.diff_cleanupSemantic(b),this.diff_cleanupEfficiency(b));else if(a&&"object"==typeof a&&"undefined"==typeof b&&"undefined"==typeof c)b=a,d=this.diff_text1(b);else if("string"==typeof a&&b&&"object"==typeof b&&"undefined"==typeof c)d=a;else if("string"==typeof a&&"string"==typeof b&&c&&"object"==typeof c)d=a,b=c;else throw Error("Unknown call format to patch_make.");
|
||||
if(0===b.length)return[];c=[];a=new diff_match_patch.patch_obj;for(var e=0,f=0,g=0,h=d,j=0;j<b.length;j++){var i=b[j][0],k=b[j][1];!e&&0!==i&&(a.start1=f,a.start2=g);switch(i){case 1:a.diffs[e++]=b[j];a.length2+=k.length;d=d.substring(0,g)+k+d.substring(g);break;case -1:a.length1+=k.length;a.diffs[e++]=b[j];d=d.substring(0,g)+d.substring(g+k.length);break;case 0:k.length<=2*this.Patch_Margin&&e&&b.length!=j+1?(a.diffs[e++]=b[j],a.length1+=k.length,a.length2+=k.length):k.length>=2*this.Patch_Margin&&
|
||||
e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=new diff_match_patch.patch_obj;e.diffs=[];for(var f=0;f<d.diffs.length;f++)e.diffs[f]=d.diffs[f].slice();e.start1=d.start1;e.start2=d.start2;e.length1=d.length1;e.length2=d.length2;b[c]=e}return b};
|
||||
diff_match_patch.prototype.patch_apply=function(a,b){if(0==a.length)return[b,[]];a=this.patch_deepCopy(a);var c=this.patch_addPadding(a);b=c+b+c;this.patch_splitMax(a);for(var d=0,e=[],f=0;f<a.length;f++){var g=a[f].start2+d,h=this.diff_text1(a[f].diffs),j,i=-1;if(h.length>this.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g);
|
||||
if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;i<a[f].diffs.length;i++){var q=a[f].diffs[i];0!==q[0]&&(k=this.diff_xIndex(g,h));1===q[0]?b=b.substring(0,
|
||||
j+k)+q[1]+b.substring(j+k):-1===q[0]&&(b=b.substring(0,j+k)+b.substring(j+this.diff_xIndex(g,h+q[1].length)));-1!==q[0]&&(h+=q[1].length)}}}b=b.substring(c.length,b.length-c.length);return[b,e]};
|
||||
diff_match_patch.prototype.patch_addPadding=function(a){for(var b=this.Patch_Margin,c="",d=1;d<=b;d++)c+=String.fromCharCode(d);for(d=0;d<a.length;d++)a[d].start1+=b,a[d].start2+=b;var d=a[0],e=d.diffs;if(0==e.length||0!=e[0][0])e.unshift([0,c]),d.start1-=b,d.start2-=b,d.length1+=b,d.length2+=b;else if(b>e[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0,
|
||||
c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c};
|
||||
diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c<a.length;c++)if(!(a[c].length1<=b)){var d=a[c];a.splice(c--,1);for(var e=d.start1,f=d.start2,g="";0!==d.diffs.length;){var h=new diff_match_patch.patch_obj,j=!0;h.start1=e-g.length;h.start2=f-g.length;""!==g&&(h.length1=h.length2=g.length,h.diffs.push([0,g]));for(;0!==d.diffs.length&&h.length1<b-this.Patch_Margin;){var g=d.diffs[0][0],i=d.diffs[0][1];1===g?(h.length2+=i.length,f+=i.length,h.diffs.push(d.diffs.shift()),
|
||||
j=!1):-1===g&&1==h.diffs.length&&0==h.diffs[0][0]&&i.length>2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&&
|
||||
(h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=a[c];return b.join("")};
|
||||
diff_match_patch.prototype.patch_fromText=function(a){var b=[];if(!a)return b;a=a.split("\n");for(var c=0,d=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;c<a.length;){var e=a[c].match(d);if(!e)throw Error("Invalid patch string: "+a[c]);var f=new diff_match_patch.patch_obj;b.push(f);f.start1=parseInt(e[1],10);""===e[2]?(f.start1--,f.length1=1):"0"==e[2]?f.length1=0:(f.start1--,f.length1=parseInt(e[2],10));f.start2=parseInt(e[3],10);""===e[4]?(f.start2--,f.length2=1):"0"==e[4]?f.length2=0:(f.start2--,f.length2=
|
||||
parseInt(e[4],10));for(c++;c<a.length;){e=a[c].charAt(0);try{var g=decodeURI(a[c].substring(1))}catch(h){throw Error("Illegal escape in patch_fromText: "+g);}if("-"==e)f.diffs.push([-1,g]);else if("+"==e)f.diffs.push([1,g]);else if(" "==e)f.diffs.push([0,g]);else if("@"==e)break;else if(""!==e)throw Error('Invalid patch mode "'+e+'" in: '+g);c++}}return b};diff_match_patch.patch_obj=function(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0};
|
||||
diff_match_patch.patch_obj.prototype.toString=function(){var a,b;a=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;b=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;a=["@@ -"+a+" +"+b+" @@\n"];var c;for(b=0;b<this.diffs.length;b++){switch(this.diffs[b][0]){case 1:c="+";break;case -1:c="-";break;case 0:c=" "}a[b+1]=c+encodeURI(this.diffs[b][1])+"\n"}return a.join("").replace(/%20/g," ")};
|
||||
this.diff_match_patch=diff_match_patch;this.DIFF_DELETE=-1;this.DIFF_INSERT=1;this.DIFF_EQUAL=0;})()
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,709 +0,0 @@
|
||||
;(function ($, window, document, undefined) {
|
||||
// Create the defaults once
|
||||
var pluginName = 'bootstrapDualListbox',
|
||||
defaults = {
|
||||
bootstrap2Compatible: false,
|
||||
filterTextClear: '显示全部',
|
||||
filterPlaceHolder: '查找',
|
||||
moveSelectedLabel: '移动选择',
|
||||
moveAllLabel: '移动全部',
|
||||
removeSelectedLabel: '移除选择',
|
||||
removeAllLabel: '移除全部',
|
||||
moveOnSelect: true, // true/false (forced true on androids, see the comment later)
|
||||
preserveSelectionOnMove: false, // 'all' / 'moved' / false
|
||||
selectedListLabel: false, // 'string', false
|
||||
nonSelectedListLabel: false, // 'string', false
|
||||
helperSelectNamePostfix: '_helper', // 'string_of_postfix' / false
|
||||
selectorMinimalHeight: 100,
|
||||
showFilterInputs: true, // whether to show filter inputs
|
||||
nonSelectedFilter: '', // string, filter the non selected options
|
||||
selectedFilter: '', // string, filter the selected options
|
||||
infoText: '全部:{0}', // text when all options are visible / false for no info text
|
||||
infoTextFiltered: '<span class="label label-warning">查找</span> {0}/{1}', // when not all of the options are visible due to the filter
|
||||
infoTextEmpty: '空', // when there are no options present in the list
|
||||
filterOnValues: false // filter by selector's values, boolean
|
||||
},
|
||||
// Selections are invisible on android if the containing select is styled with CSS
|
||||
// http://code.google.com/p/android/issues/detail?id=16922
|
||||
isBuggyAndroid = /android/i.test(navigator.userAgent.toLowerCase());
|
||||
|
||||
// The actual plugin constructor
|
||||
function BootstrapDualListbox(element, options) {
|
||||
this.element = $(element);
|
||||
// jQuery has an extend method which merges the contents of two or
|
||||
// more objects, storing the result in the first object. The first object
|
||||
// is generally empty as we don't want to alter the default options for
|
||||
// future instances of the plugin
|
||||
this.settings = $.extend({}, defaults, options);
|
||||
this._defaults = defaults;
|
||||
this._name = pluginName;
|
||||
this.init();
|
||||
}
|
||||
|
||||
function triggerChangeEvent(dualListbox) {
|
||||
dualListbox.element.trigger('change');
|
||||
}
|
||||
|
||||
function updateSelectionStates(dualListbox) {
|
||||
dualListbox.element.find('option').each(function(index, item) {
|
||||
var $item = $(item);
|
||||
if (typeof($item.data('original-index')) === 'undefined') {
|
||||
$item.data('original-index', dualListbox.elementCount++);
|
||||
}
|
||||
if (typeof($item.data('_selected')) === 'undefined') {
|
||||
$item.data('_selected', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function changeSelectionState(dualListbox, original_index, selected) {
|
||||
dualListbox.element.find('option').each(function(index, item) {
|
||||
var $item = $(item);
|
||||
if ($item.data('original-index') === original_index) {
|
||||
$item.prop('selected', selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function formatString(s, args) {
|
||||
return s.replace(/\{(\d+)\}/g, function(match, number) {
|
||||
return typeof args[number] !== 'undefined' ? args[number] : match;
|
||||
});
|
||||
}
|
||||
|
||||
function refreshInfo(dualListbox) {
|
||||
if (!dualListbox.settings.infoText) {
|
||||
return;
|
||||
}
|
||||
|
||||
var visible1 = dualListbox.elements.select1.find('option').length,
|
||||
visible2 = dualListbox.elements.select2.find('option').length,
|
||||
all1 = dualListbox.element.find('option').length - dualListbox.selectedElements,
|
||||
all2 = dualListbox.selectedElements,
|
||||
content = '';
|
||||
|
||||
if (all1 === 0) {
|
||||
content = dualListbox.settings.infoTextEmpty;
|
||||
} else if (visible1 === all1) {
|
||||
content = formatString(dualListbox.settings.infoText, [visible1, all1]);
|
||||
} else {
|
||||
content = formatString(dualListbox.settings.infoTextFiltered, [visible1, all1]);
|
||||
}
|
||||
|
||||
dualListbox.elements.info1.html(content);
|
||||
dualListbox.elements.box1.toggleClass('filtered', !(visible1 === all1 || all1 === 0));
|
||||
|
||||
if (all2 === 0) {
|
||||
content = dualListbox.settings.infoTextEmpty;
|
||||
} else if (visible2 === all2) {
|
||||
content = formatString(dualListbox.settings.infoText, [visible2, all2]);
|
||||
} else {
|
||||
content = formatString(dualListbox.settings.infoTextFiltered, [visible2, all2]);
|
||||
}
|
||||
|
||||
dualListbox.elements.info2.html(content);
|
||||
dualListbox.elements.box2.toggleClass('filtered', !(visible2 === all2 || all2 === 0));
|
||||
}
|
||||
|
||||
function refreshSelects(dualListbox) {
|
||||
dualListbox.selectedElements = 0;
|
||||
|
||||
dualListbox.elements.select1.empty();
|
||||
dualListbox.elements.select2.empty();
|
||||
|
||||
dualListbox.element.find('option').each(function(index, item) {
|
||||
var $item = $(item);
|
||||
if ($item.prop('selected')) {
|
||||
dualListbox.selectedElements++;
|
||||
dualListbox.elements.select2.append($item.clone(true).prop('selected', $item.data('_selected')));
|
||||
} else {
|
||||
dualListbox.elements.select1.append($item.clone(true).prop('selected', $item.data('_selected')));
|
||||
}
|
||||
});
|
||||
|
||||
if (dualListbox.settings.showFilterInputs) {
|
||||
filter(dualListbox, 1);
|
||||
filter(dualListbox, 2);
|
||||
}
|
||||
refreshInfo(dualListbox);
|
||||
}
|
||||
|
||||
function filter(dualListbox, selectIndex) {
|
||||
if (!dualListbox.settings.showFilterInputs) {
|
||||
return;
|
||||
}
|
||||
|
||||
saveSelections(dualListbox, selectIndex);
|
||||
|
||||
dualListbox.elements['select'+selectIndex].empty().scrollTop(0);
|
||||
var regex = new RegExp($.trim(dualListbox.elements['filterInput'+selectIndex].val()), 'gi'),
|
||||
options = dualListbox.element;
|
||||
|
||||
if (selectIndex === 1) {
|
||||
options = options.find('option').not(':selected');
|
||||
} else {
|
||||
options = options.find('option:selected');
|
||||
}
|
||||
|
||||
options.each(function(index, item) {
|
||||
var $item = $(item),
|
||||
isFiltered = true;
|
||||
if (item.text.match(regex) || (dualListbox.settings.filterOnValues && $item.attr('value').match(regex) ) ) {
|
||||
isFiltered = false;
|
||||
dualListbox.elements['select'+selectIndex].append($item.clone(true).prop('selected', $item.data('_selected')));
|
||||
}
|
||||
dualListbox.element.find('option').eq($item.data('original-index')).data('filtered'+selectIndex, isFiltered);
|
||||
});
|
||||
|
||||
refreshInfo(dualListbox);
|
||||
}
|
||||
|
||||
function saveSelections(dualListbox, selectIndex) {
|
||||
dualListbox.elements['select'+selectIndex].find('option').each(function(index, item) {
|
||||
var $item = $(item);
|
||||
dualListbox.element.find('option').eq($item.data('original-index')).data('_selected', $item.prop('selected'));
|
||||
});
|
||||
}
|
||||
|
||||
function sortOptions(select) {
|
||||
select.find('option').sort(function(a, b) {
|
||||
return ($(a).data('original-index') > $(b).data('original-index')) ? 1 : -1;
|
||||
}).appendTo(select);
|
||||
}
|
||||
|
||||
function clearSelections(dualListbox) {
|
||||
dualListbox.elements.select1.find('option').each(function() {
|
||||
dualListbox.element.find('option').data('_selected', false);
|
||||
});
|
||||
}
|
||||
|
||||
function move(dualListbox) {
|
||||
if (dualListbox.settings.preserveSelectionOnMove === 'all' && !dualListbox.settings.moveOnSelect) {
|
||||
saveSelections(dualListbox, 1);
|
||||
saveSelections(dualListbox, 2);
|
||||
} else if (dualListbox.settings.preserveSelectionOnMove === 'moved' && !dualListbox.settings.moveOnSelect) {
|
||||
saveSelections(dualListbox, 1);
|
||||
}
|
||||
|
||||
dualListbox.elements.select1.find('option:selected').each(function(index, item) {
|
||||
var $item = $(item);
|
||||
if (!$item.data('filtered1')) {
|
||||
changeSelectionState(dualListbox, $item.data('original-index'), true);
|
||||
}
|
||||
});
|
||||
|
||||
refreshSelects(dualListbox);
|
||||
triggerChangeEvent(dualListbox);
|
||||
sortOptions(dualListbox.elements.select2);
|
||||
}
|
||||
|
||||
function remove(dualListbox) {
|
||||
if (dualListbox.settings.preserveSelectionOnMove === 'all' && !dualListbox.settings.moveOnSelect) {
|
||||
saveSelections(dualListbox, 1);
|
||||
saveSelections(dualListbox, 2);
|
||||
} else if (dualListbox.settings.preserveSelectionOnMove === 'moved' && !dualListbox.settings.moveOnSelect) {
|
||||
saveSelections(dualListbox, 2);
|
||||
}
|
||||
|
||||
dualListbox.elements.select2.find('option:selected').each(function(index, item) {
|
||||
var $item = $(item);
|
||||
if (!$item.data('filtered2')) {
|
||||
changeSelectionState(dualListbox, $item.data('original-index'), false);
|
||||
}
|
||||
});
|
||||
|
||||
refreshSelects(dualListbox);
|
||||
triggerChangeEvent(dualListbox);
|
||||
sortOptions(dualListbox.elements.select1);
|
||||
}
|
||||
|
||||
function moveAll(dualListbox) {
|
||||
if (dualListbox.settings.preserveSelectionOnMove === 'all' && !dualListbox.settings.moveOnSelect) {
|
||||
saveSelections(dualListbox, 1);
|
||||
saveSelections(dualListbox, 2);
|
||||
} else if (dualListbox.settings.preserveSelectionOnMove === 'moved' && !dualListbox.settings.moveOnSelect) {
|
||||
saveSelections(dualListbox, 1);
|
||||
}
|
||||
|
||||
dualListbox.element.find('option').each(function(index, item) {
|
||||
var $item = $(item);
|
||||
if (!$item.data('filtered1')) {
|
||||
$item.prop('selected', true);
|
||||
}
|
||||
});
|
||||
|
||||
refreshSelects(dualListbox);
|
||||
triggerChangeEvent(dualListbox);
|
||||
}
|
||||
|
||||
function removeAll(dualListbox) {
|
||||
if (dualListbox.settings.preserveSelectionOnMove === 'all' && !dualListbox.settings.moveOnSelect) {
|
||||
saveSelections(dualListbox, 1);
|
||||
saveSelections(dualListbox, 2);
|
||||
} else if (dualListbox.settings.preserveSelectionOnMove === 'moved' && !dualListbox.settings.moveOnSelect) {
|
||||
saveSelections(dualListbox, 2);
|
||||
}
|
||||
|
||||
dualListbox.element.find('option').each(function(index, item) {
|
||||
var $item = $(item);
|
||||
if (!$item.data('filtered2')) {
|
||||
$item.prop('selected', false);
|
||||
}
|
||||
});
|
||||
|
||||
refreshSelects(dualListbox);
|
||||
triggerChangeEvent(dualListbox);
|
||||
}
|
||||
|
||||
function bindEvents(dualListbox) {
|
||||
dualListbox.elements.form.submit(function(e) {
|
||||
if (dualListbox.elements.filterInput1.is(':focus')) {
|
||||
e.preventDefault();
|
||||
dualListbox.elements.filterInput1.focusout();
|
||||
} else if (dualListbox.elements.filterInput2.is(':focus')) {
|
||||
e.preventDefault();
|
||||
dualListbox.elements.filterInput2.focusout();
|
||||
}
|
||||
});
|
||||
|
||||
dualListbox.element.on('bootstrapDualListbox.refresh', function(e, mustClearSelections){
|
||||
dualListbox.refresh(mustClearSelections);
|
||||
});
|
||||
|
||||
dualListbox.elements.filterClear1.on('click', function() {
|
||||
dualListbox.setNonSelectedFilter('', true);
|
||||
});
|
||||
|
||||
dualListbox.elements.filterClear2.on('click', function() {
|
||||
dualListbox.setSelectedFilter('', true);
|
||||
});
|
||||
|
||||
dualListbox.elements.moveButton.on('click', function() {
|
||||
move(dualListbox);
|
||||
});
|
||||
|
||||
dualListbox.elements.moveAllButton.on('click', function() {
|
||||
moveAll(dualListbox);
|
||||
});
|
||||
|
||||
dualListbox.elements.removeButton.on('click', function() {
|
||||
remove(dualListbox);
|
||||
});
|
||||
|
||||
dualListbox.elements.removeAllButton.on('click', function() {
|
||||
removeAll(dualListbox);
|
||||
});
|
||||
|
||||
dualListbox.elements.filterInput1.on('change keyup', function() {
|
||||
filter(dualListbox, 1);
|
||||
});
|
||||
|
||||
dualListbox.elements.filterInput2.on('change keyup', function() {
|
||||
filter(dualListbox, 2);
|
||||
});
|
||||
}
|
||||
|
||||
BootstrapDualListbox.prototype = {
|
||||
init: function () {
|
||||
// Add the custom HTML template
|
||||
this.container = $('' +
|
||||
'<div class="bootstrap-duallistbox-container">' +
|
||||
' <div class="box1">' +
|
||||
' <label></label>' +
|
||||
' <span class="info-container">' +
|
||||
' <span class="info"></span>' +
|
||||
' <button type="button" class="btn clear1 pull-right"></button>' +
|
||||
' </span>' +
|
||||
' <div class="btn-group buttons">' +
|
||||
' <button type="button" class="btn moveall">' +
|
||||
' <i></i>' +
|
||||
' <i></i>' +
|
||||
' </button>' +
|
||||
' <button type="button" class="btn move">' +
|
||||
' <i></i>' +
|
||||
' </button>' +
|
||||
' </div>' +
|
||||
' <input class="filter" type="text">' +
|
||||
' <select multiple="multiple"></select>' +
|
||||
' </div>' +
|
||||
' <div class="box2">' +
|
||||
' <label></label>' +
|
||||
' <span class="info-container">' +
|
||||
' <span class="info"></span>' +
|
||||
' <button type="button" class="btn clear2 pull-right"></button>' +
|
||||
' </span>' +
|
||||
' <div class="btn-group buttons">' +
|
||||
' <button type="button" class="btn remove">' +
|
||||
' <i></i>' +
|
||||
' </button>' +
|
||||
' <button type="button" class="btn removeall">' +
|
||||
' <i></i>' +
|
||||
' <i></i>' +
|
||||
' </button>' +
|
||||
' </div>' +
|
||||
' <input class="filter" type="text">' +
|
||||
' <select multiple="multiple"></select>' +
|
||||
' </div>' +
|
||||
'</div>')
|
||||
.insertBefore(this.element);
|
||||
|
||||
// Cache the inner elements
|
||||
this.elements = {
|
||||
originalSelect: this.element,
|
||||
box1: $('.box1', this.container),
|
||||
box2: $('.box2', this.container),
|
||||
filterInput1: $('.box1 .filter', this.container),
|
||||
filterInput2: $('.box2 .filter', this.container),
|
||||
filterClear1: $('.box1 .clear1', this.container),
|
||||
filterClear2: $('.box2 .clear2', this.container),
|
||||
label1: $('.box1 > label', this.container),
|
||||
label2: $('.box2 > label', this.container),
|
||||
info1: $('.box1 .info', this.container),
|
||||
info2: $('.box2 .info', this.container),
|
||||
select1: $('.box1 select', this.container),
|
||||
select2: $('.box2 select', this.container),
|
||||
moveButton: $('.box1 .move', this.container),
|
||||
removeButton: $('.box2 .remove', this.container),
|
||||
moveAllButton: $('.box1 .moveall', this.container),
|
||||
removeAllButton: $('.box2 .removeall', this.container),
|
||||
form: $($('.box1 .filter', this.container)[0].form)
|
||||
};
|
||||
|
||||
// Set select IDs
|
||||
this.originalSelectName = this.element.attr('name') || '';
|
||||
var select1Id = 'bootstrap-duallistbox-nonselected-list_' + this.originalSelectName,
|
||||
select2Id = 'bootstrap-duallistbox-selected-list_' + this.originalSelectName;
|
||||
this.elements.select1.attr('id', select1Id);
|
||||
this.elements.select2.attr('id', select2Id);
|
||||
this.elements.label1.attr('for', select1Id);
|
||||
this.elements.label2.attr('for', select2Id);
|
||||
|
||||
// Apply all settings
|
||||
this.selectedElements = 0;
|
||||
this.elementCount = 0;
|
||||
this.setBootstrap2Compatible(this.settings.bootstrap2Compatible);
|
||||
this.setFilterTextClear(this.settings.filterTextClear);
|
||||
this.setFilterPlaceHolder(this.settings.filterPlaceHolder);
|
||||
this.setMoveSelectedLabel(this.settings.moveSelectedLabel);
|
||||
this.setMoveAllLabel(this.settings.moveAllLabel);
|
||||
this.setRemoveSelectedLabel(this.settings.removeSelectedLabel);
|
||||
this.setRemoveAllLabel(this.settings.removeAllLabel);
|
||||
this.setMoveOnSelect(this.settings.moveOnSelect);
|
||||
this.setPreserveSelectionOnMove(this.settings.preserveSelectionOnMove);
|
||||
this.setSelectedListLabel(this.settings.selectedListLabel);
|
||||
this.setNonSelectedListLabel(this.settings.nonSelectedListLabel);
|
||||
this.setHelperSelectNamePostfix(this.settings.helperSelectNamePostfix);
|
||||
this.setSelectOrMinimalHeight(this.settings.selectorMinimalHeight);
|
||||
|
||||
updateSelectionStates(this);
|
||||
|
||||
this.setShowFilterInputs(this.settings.showFilterInputs);
|
||||
this.setNonSelectedFilter(this.settings.nonSelectedFilter);
|
||||
this.setSelectedFilter(this.settings.selectedFilter);
|
||||
this.setInfoText(this.settings.infoText);
|
||||
this.setInfoTextFiltered(this.settings.infoTextFiltered);
|
||||
this.setInfoTextEmpty(this.settings.infoTextEmpty);
|
||||
this.setFilterOnValues(this.settings.filterOnValues);
|
||||
|
||||
// Hide the original select
|
||||
this.element.hide();
|
||||
|
||||
bindEvents(this);
|
||||
refreshSelects(this);
|
||||
|
||||
return this.element;
|
||||
},
|
||||
setBootstrap2Compatible: function(value, refresh) {
|
||||
this.settings.bootstrap2Compatible = value;
|
||||
if (value) {
|
||||
this.container.removeClass('row').addClass('row-fluid bs2compatible');
|
||||
this.container.find('.box1, .box2').removeClass('col-xs-6').addClass('span6');
|
||||
this.container.find('.clear1, .clear2').removeClass('btn-white btn-xs').addClass('btn-mini');
|
||||
this.container.find('input, select').removeClass('form-control');
|
||||
this.container.find('.btn').removeClass('btn-white');
|
||||
this.container.find('.moveall > i, .move > i').removeClass('glyphicon glyphicon-arrow-right').addClass('icon-arrow-right');
|
||||
this.container.find('.removeall > i, .remove > i').removeClass('glyphicon glyphicon-arrow-left').addClass('icon-arrow-left');
|
||||
} else {
|
||||
this.container.removeClass('row-fluid bs2compatible').addClass('row');
|
||||
this.container.find('.box1, .box2').removeClass('span6').addClass('col-xs-6');
|
||||
this.container.find('.clear1, .clear2').removeClass('btn-mini').addClass('btn-white btn-xs');
|
||||
this.container.find('input, select').addClass('form-control');
|
||||
this.container.find('.btn').addClass('btn-white');
|
||||
this.container.find('.moveall > i, .move > i').removeClass('icon-arrow-right').addClass('glyphicon glyphicon-arrow-right');
|
||||
this.container.find('.removeall > i, .remove > i').removeClass('icon-arrow-left').addClass('glyphicon glyphicon-arrow-left');
|
||||
}
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setFilterTextClear: function(value, refresh) {
|
||||
this.settings.filterTextClear = value;
|
||||
this.elements.filterClear1.html(value);
|
||||
this.elements.filterClear2.html(value);
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setFilterPlaceHolder: function(value, refresh) {
|
||||
this.settings.filterPlaceHolder = value;
|
||||
this.elements.filterInput1.attr('placeholder', value);
|
||||
this.elements.filterInput2.attr('placeholder', value);
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setMoveSelectedLabel: function(value, refresh) {
|
||||
this.settings.moveSelectedLabel = value;
|
||||
this.elements.moveButton.attr('title', value);
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setMoveAllLabel: function(value, refresh) {
|
||||
this.settings.moveAllLabel = value;
|
||||
this.elements.moveAllButton.attr('title', value);
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setRemoveSelectedLabel: function(value, refresh) {
|
||||
this.settings.removeSelectedLabel = value;
|
||||
this.elements.removeButton.attr('title', value);
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setRemoveAllLabel: function(value, refresh) {
|
||||
this.settings.removeAllLabel = value;
|
||||
this.elements.removeAllButton.attr('title', value);
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setMoveOnSelect: function(value, refresh) {
|
||||
if (isBuggyAndroid) {
|
||||
value = true;
|
||||
}
|
||||
this.settings.moveOnSelect = value;
|
||||
if (this.settings.moveOnSelect) {
|
||||
this.container.addClass('moveonselect');
|
||||
var self = this;
|
||||
this.elements.select1.on('change', function() {
|
||||
move(self);
|
||||
});
|
||||
this.elements.select2.on('change', function() {
|
||||
remove(self);
|
||||
});
|
||||
} else {
|
||||
this.container.removeClass('moveonselect');
|
||||
this.elements.select1.off('change');
|
||||
this.elements.select2.off('change');
|
||||
}
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setPreserveSelectionOnMove: function(value, refresh) {
|
||||
// We are forcing to move on select and disabling preserveSelectionOnMove on Android
|
||||
if (isBuggyAndroid) {
|
||||
value = false;
|
||||
}
|
||||
this.settings.preserveSelectionOnMove = value;
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setSelectedListLabel: function(value, refresh) {
|
||||
this.settings.selectedListLabel = value;
|
||||
if (value) {
|
||||
this.elements.label2.show().html(value);
|
||||
} else {
|
||||
this.elements.label2.hide().html(value);
|
||||
}
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setNonSelectedListLabel: function(value, refresh) {
|
||||
this.settings.nonSelectedListLabel = value;
|
||||
if (value) {
|
||||
this.elements.label1.show().html(value);
|
||||
} else {
|
||||
this.elements.label1.hide().html(value);
|
||||
}
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setHelperSelectNamePostfix: function(value, refresh) {
|
||||
this.settings.helperSelectNamePostfix = value;
|
||||
if (value) {
|
||||
this.elements.select1.attr('name', this.originalSelectName + value + '1');
|
||||
this.elements.select2.attr('name', this.originalSelectName + value + '2');
|
||||
} else {
|
||||
this.elements.select1.removeAttr('name');
|
||||
this.elements.select2.removeAttr('name');
|
||||
}
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setSelectOrMinimalHeight: function(value, refresh) {
|
||||
this.settings.selectorMinimalHeight = value;
|
||||
var height = this.element.height();
|
||||
if (this.element.height() < value) {
|
||||
height = value;
|
||||
}
|
||||
this.elements.select1.height(height);
|
||||
this.elements.select2.height(height);
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setShowFilterInputs: function(value, refresh) {
|
||||
if (!value) {
|
||||
this.setNonSelectedFilter('');
|
||||
this.setSelectedFilter('');
|
||||
refreshSelects(this);
|
||||
this.elements.filterInput1.hide();
|
||||
this.elements.filterInput2.hide();
|
||||
} else {
|
||||
this.elements.filterInput1.show();
|
||||
this.elements.filterInput2.show();
|
||||
}
|
||||
this.settings.showFilterInputs = value;
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setNonSelectedFilter: function(value, refresh) {
|
||||
if (this.settings.showFilterInputs) {
|
||||
this.settings.nonSelectedFilter = value;
|
||||
this.elements.filterInput1.val(value);
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
}
|
||||
},
|
||||
setSelectedFilter: function(value, refresh) {
|
||||
if (this.settings.showFilterInputs) {
|
||||
this.settings.selectedFilter = value;
|
||||
this.elements.filterInput2.val(value);
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
}
|
||||
},
|
||||
setInfoText: function(value, refresh) {
|
||||
this.settings.infoText = value;
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setInfoTextFiltered: function(value, refresh) {
|
||||
this.settings.infoTextFiltered = value;
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setInfoTextEmpty: function(value, refresh) {
|
||||
this.settings.infoTextEmpty = value;
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
setFilterOnValues: function(value, refresh) {
|
||||
this.settings.filterOnValues = value;
|
||||
if (refresh) {
|
||||
refreshSelects(this);
|
||||
}
|
||||
return this.element;
|
||||
},
|
||||
getContainer: function() {
|
||||
return this.container;
|
||||
},
|
||||
refresh: function(mustClearSelections) {
|
||||
updateSelectionStates(this);
|
||||
|
||||
if (!mustClearSelections) {
|
||||
saveSelections(this, 1);
|
||||
saveSelections(this, 2);
|
||||
} else {
|
||||
clearSelections(this);
|
||||
}
|
||||
|
||||
refreshSelects(this);
|
||||
},
|
||||
destroy: function() {
|
||||
this.container.remove();
|
||||
this.element.show();
|
||||
$.data(this, 'plugin_' + pluginName, null);
|
||||
return this.element;
|
||||
}
|
||||
};
|
||||
|
||||
// A really lightweight plugin wrapper around the constructor,
|
||||
// preventing against multiple instantiations
|
||||
$.fn[ pluginName ] = function (options) {
|
||||
var args = arguments;
|
||||
|
||||
// Is the first parameter an object (options), or was omitted, instantiate a new instance of the plugin.
|
||||
if (options === undefined || typeof options === 'object') {
|
||||
return this.each(function () {
|
||||
// If this is not a select
|
||||
if (!$(this).is('select')) {
|
||||
$(this).find('select').each(function(index, item) {
|
||||
// For each nested select, instantiate the Dual List Box
|
||||
$(item).bootstrapDualListbox(options);
|
||||
});
|
||||
} else if (!$.data(this, 'plugin_' + pluginName)) {
|
||||
// Only allow the plugin to be instantiated once so we check that the element has no plugin instantiation yet
|
||||
|
||||
// if it has no instance, create a new one, pass options to our plugin constructor,
|
||||
// and store the plugin instance in the elements jQuery data object.
|
||||
$.data(this, 'plugin_' + pluginName, new BootstrapDualListbox(this, options));
|
||||
}
|
||||
});
|
||||
// If the first parameter is a string and it doesn't start with an underscore or "contains" the `init`-function,
|
||||
// treat this as a call to a public method.
|
||||
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
|
||||
|
||||
// Cache the method call to make it possible to return a value
|
||||
var returns;
|
||||
|
||||
this.each(function () {
|
||||
var instance = $.data(this, 'plugin_' + pluginName);
|
||||
// Tests that there's already a plugin-instance and checks that the requested public method exists
|
||||
if (instance instanceof BootstrapDualListbox && typeof instance[options] === 'function') {
|
||||
// Call the method of our plugin instance, and pass it the supplied arguments.
|
||||
returns = instance[options].apply(instance, Array.prototype.slice.call(args, 1));
|
||||
}
|
||||
});
|
||||
|
||||
// If the earlier cached method gives a value back return the value,
|
||||
// otherwise return this to preserve chainability.
|
||||
return returns !== undefined ? returns : this;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})(jQuery, window, document);
|
||||
@@ -1,359 +0,0 @@
|
||||
/**!
|
||||
* easyPieChart
|
||||
* Lightweight plugin to render simple, animated and retina optimized pie charts
|
||||
*
|
||||
* @license
|
||||
* @author Robert Fleischmann <rendro87@gmail.com> (http://robert-fleischmann.de)
|
||||
* @version 2.1.5
|
||||
**/
|
||||
|
||||
(function(root, factory) {
|
||||
if(typeof exports === 'object') {
|
||||
module.exports = factory(require('jquery'));
|
||||
}
|
||||
else if(typeof define === 'function' && define.amd) {
|
||||
define(['jquery'], factory);
|
||||
}
|
||||
else {
|
||||
factory(root.jQuery);
|
||||
}
|
||||
}(this, function($) {
|
||||
|
||||
/**
|
||||
* Renderer to render the chart on a canvas object
|
||||
* @param {DOMElement} el DOM element to host the canvas (root of the plugin)
|
||||
* @param {object} options options object of the plugin
|
||||
*/
|
||||
var CanvasRenderer = function(el, options) {
|
||||
var cachedBackground;
|
||||
var canvas = document.createElement('canvas');
|
||||
|
||||
el.appendChild(canvas);
|
||||
|
||||
if (typeof(G_vmlCanvasManager) !== 'undefined') {
|
||||
G_vmlCanvasManager.initElement(canvas);
|
||||
}
|
||||
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
canvas.width = canvas.height = options.size;
|
||||
|
||||
// canvas on retina devices
|
||||
var scaleBy = 1;
|
||||
if (window.devicePixelRatio > 1) {
|
||||
scaleBy = window.devicePixelRatio;
|
||||
canvas.style.width = canvas.style.height = [options.size, 'px'].join('');
|
||||
canvas.width = canvas.height = options.size * scaleBy;
|
||||
ctx.scale(scaleBy, scaleBy);
|
||||
}
|
||||
|
||||
// move 0,0 coordinates to the center
|
||||
ctx.translate(options.size / 2, options.size / 2);
|
||||
|
||||
// rotate canvas -90deg
|
||||
ctx.rotate((-1 / 2 + options.rotate / 180) * Math.PI);
|
||||
|
||||
var radius = (options.size - options.lineWidth) / 2;
|
||||
if (options.scaleColor && options.scaleLength) {
|
||||
radius -= options.scaleLength + 2; // 2 is the distance between scale and bar
|
||||
}
|
||||
|
||||
// IE polyfill for Date
|
||||
Date.now = Date.now || function() {
|
||||
return +(new Date());
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw a circle around the center of the canvas
|
||||
* @param {strong} color Valid CSS color string
|
||||
* @param {number} lineWidth Width of the line in px
|
||||
* @param {number} percent Percentage to draw (float between -1 and 1)
|
||||
*/
|
||||
var drawCircle = function(color, lineWidth, percent) {
|
||||
percent = Math.min(Math.max(-1, percent || 0), 1);
|
||||
var isNegative = percent <= 0 ? true : false;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, radius, 0, Math.PI * 2 * percent, isNegative);
|
||||
|
||||
ctx.strokeStyle = color;
|
||||
ctx.lineWidth = lineWidth;
|
||||
|
||||
ctx.stroke();
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the scale of the chart
|
||||
*/
|
||||
var drawScale = function() {
|
||||
var offset;
|
||||
var length;
|
||||
|
||||
ctx.lineWidth = 1;
|
||||
ctx.fillStyle = options.scaleColor;
|
||||
|
||||
ctx.save();
|
||||
for (var i = 24; i > 0; --i) {
|
||||
if (i % 6 === 0) {
|
||||
length = options.scaleLength;
|
||||
offset = 0;
|
||||
} else {
|
||||
length = options.scaleLength * 0.6;
|
||||
offset = options.scaleLength - length;
|
||||
}
|
||||
ctx.fillRect(-options.size/2 + offset, 0, length, 1);
|
||||
ctx.rotate(Math.PI / 12);
|
||||
}
|
||||
ctx.restore();
|
||||
};
|
||||
|
||||
/**
|
||||
* Request animation frame wrapper with polyfill
|
||||
* @return {function} Request animation frame method or timeout fallback
|
||||
*/
|
||||
var reqAnimationFrame = (function() {
|
||||
return window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
window.setTimeout(callback, 1000 / 60);
|
||||
};
|
||||
}());
|
||||
|
||||
/**
|
||||
* Draw the background of the plugin including the scale and the track
|
||||
*/
|
||||
var drawBackground = function() {
|
||||
if(options.scaleColor) drawScale();
|
||||
if(options.trackColor) drawCircle(options.trackColor, options.lineWidth, 1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Canvas accessor
|
||||
*/
|
||||
this.getCanvas = function() {
|
||||
return canvas;
|
||||
};
|
||||
|
||||
/**
|
||||
* Canvas 2D context 'ctx' accessor
|
||||
*/
|
||||
this.getCtx = function() {
|
||||
return ctx;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear the complete canvas
|
||||
*/
|
||||
this.clear = function() {
|
||||
ctx.clearRect(options.size / -2, options.size / -2, options.size, options.size);
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the complete chart
|
||||
* @param {number} percent Percent shown by the chart between -100 and 100
|
||||
*/
|
||||
this.draw = function(percent) {
|
||||
// do we need to render a background
|
||||
if (!!options.scaleColor || !!options.trackColor) {
|
||||
// getImageData and putImageData are supported
|
||||
if (ctx.getImageData && ctx.putImageData) {
|
||||
if (!cachedBackground) {
|
||||
drawBackground();
|
||||
cachedBackground = ctx.getImageData(0, 0, options.size * scaleBy, options.size * scaleBy);
|
||||
} else {
|
||||
ctx.putImageData(cachedBackground, 0, 0);
|
||||
}
|
||||
} else {
|
||||
this.clear();
|
||||
drawBackground();
|
||||
}
|
||||
} else {
|
||||
this.clear();
|
||||
}
|
||||
|
||||
ctx.lineCap = options.lineCap;
|
||||
|
||||
// if barcolor is a function execute it and pass the percent as a value
|
||||
var color;
|
||||
if (typeof(options.barColor) === 'function') {
|
||||
color = options.barColor(percent);
|
||||
} else {
|
||||
color = options.barColor;
|
||||
}
|
||||
|
||||
// draw bar
|
||||
drawCircle(color, options.lineWidth, percent / 100);
|
||||
}.bind(this);
|
||||
|
||||
/**
|
||||
* Animate from some percent to some other percentage
|
||||
* @param {number} from Starting percentage
|
||||
* @param {number} to Final percentage
|
||||
*/
|
||||
this.animate = function(from, to) {
|
||||
var startTime = Date.now();
|
||||
options.onStart(from, to);
|
||||
var animation = function() {
|
||||
var process = Math.min(Date.now() - startTime, options.animate.duration);
|
||||
var currentValue = options.easing(this, process, from, to - from, options.animate.duration);
|
||||
this.draw(currentValue);
|
||||
options.onStep(from, to, currentValue);
|
||||
if (process >= options.animate.duration) {
|
||||
options.onStop(from, to);
|
||||
} else {
|
||||
reqAnimationFrame(animation);
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
reqAnimationFrame(animation);
|
||||
}.bind(this);
|
||||
};
|
||||
|
||||
var EasyPieChart = function(el, opts) {
|
||||
var defaultOptions = {
|
||||
barColor: '#ef1e25',
|
||||
trackColor: '#f9f9f9',
|
||||
scaleColor: '#dfe0e0',
|
||||
scaleLength: 5,
|
||||
lineCap: 'round',
|
||||
lineWidth: 3,
|
||||
size: 110,
|
||||
rotate: 0,
|
||||
animate: {
|
||||
duration: 1000,
|
||||
enabled: true
|
||||
},
|
||||
easing: function (x, t, b, c, d) { // more can be found here: http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
t = t / (d/2);
|
||||
if (t < 1) {
|
||||
return c / 2 * t * t + b;
|
||||
}
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
onStart: function(from, to) {
|
||||
return;
|
||||
},
|
||||
onStep: function(from, to, currentValue) {
|
||||
return;
|
||||
},
|
||||
onStop: function(from, to) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
// detect present renderer
|
||||
if (typeof(CanvasRenderer) !== 'undefined') {
|
||||
defaultOptions.renderer = CanvasRenderer;
|
||||
} else if (typeof(SVGRenderer) !== 'undefined') {
|
||||
defaultOptions.renderer = SVGRenderer;
|
||||
} else {
|
||||
throw new Error('Please load either the SVG- or the CanvasRenderer');
|
||||
}
|
||||
|
||||
var options = {};
|
||||
var currentValue = 0;
|
||||
|
||||
/**
|
||||
* Initialize the plugin by creating the options object and initialize rendering
|
||||
*/
|
||||
var init = function() {
|
||||
this.el = el;
|
||||
this.options = options;
|
||||
|
||||
// merge user options into default options
|
||||
for (var i in defaultOptions) {
|
||||
if (defaultOptions.hasOwnProperty(i)) {
|
||||
options[i] = opts && typeof(opts[i]) !== 'undefined' ? opts[i] : defaultOptions[i];
|
||||
if (typeof(options[i]) === 'function') {
|
||||
options[i] = options[i].bind(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check for jQuery easing
|
||||
if (typeof(options.easing) === 'string' && typeof(jQuery) !== 'undefined' && jQuery.isFunction(jQuery.easing[options.easing])) {
|
||||
options.easing = jQuery.easing[options.easing];
|
||||
} else {
|
||||
options.easing = defaultOptions.easing;
|
||||
}
|
||||
|
||||
// process earlier animate option to avoid bc breaks
|
||||
if (typeof(options.animate) === 'number') {
|
||||
options.animate = {
|
||||
duration: options.animate,
|
||||
enabled: true
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof(options.animate) === 'boolean' && !options.animate) {
|
||||
options.animate = {
|
||||
duration: 1000,
|
||||
enabled: options.animate
|
||||
};
|
||||
}
|
||||
|
||||
// create renderer
|
||||
this.renderer = new options.renderer(el, options);
|
||||
|
||||
// initial draw
|
||||
this.renderer.draw(currentValue);
|
||||
|
||||
// initial update
|
||||
if (el.dataset && el.dataset.percent) {
|
||||
this.update(parseFloat(el.dataset.percent));
|
||||
} else if (el.getAttribute && el.getAttribute('data-percent')) {
|
||||
this.update(parseFloat(el.getAttribute('data-percent')));
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
/**
|
||||
* Update the value of the chart
|
||||
* @param {number} newValue Number between 0 and 100
|
||||
* @return {object} Instance of the plugin for method chaining
|
||||
*/
|
||||
this.update = function(newValue) {
|
||||
newValue = parseFloat(newValue);
|
||||
if (options.animate.enabled) {
|
||||
this.renderer.animate(currentValue, newValue);
|
||||
} else {
|
||||
this.renderer.draw(newValue);
|
||||
}
|
||||
currentValue = newValue;
|
||||
return this;
|
||||
}.bind(this);
|
||||
|
||||
/**
|
||||
* Disable animation
|
||||
* @return {object} Instance of the plugin for method chaining
|
||||
*/
|
||||
this.disableAnimation = function() {
|
||||
options.animate.enabled = false;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Enable animation
|
||||
* @return {object} Instance of the plugin for method chaining
|
||||
*/
|
||||
this.enableAnimation = function() {
|
||||
options.animate.enabled = true;
|
||||
return this;
|
||||
};
|
||||
|
||||
init();
|
||||
};
|
||||
|
||||
$.fn.easyPieChart = function(options) {
|
||||
return this.each(function() {
|
||||
var instanceOptions;
|
||||
|
||||
if (!$.data(this, 'easyPieChart')) {
|
||||
instanceOptions = $.extend({}, options, $(this).data());
|
||||
$.data(this, 'easyPieChart', new EasyPieChart(this, instanceOptions));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
}));
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,26 +0,0 @@
|
||||
// Ion.RangeSlider | version 1.9.1 | https://github.com/IonDen/ion.rangeSlider
|
||||
(function(c,ea,$,M){var aa=0,s,S=function(){var c=M.userAgent,a=/msie\s\d+/i;return 0<c.search(a)&&(c=a.exec(c).toString(),c=c.split(" ")[1],9>c)?!0:!1}(),X="ontouchstart"in $||0<M.msMaxTouchPoints,N=function(c){"Number"!==typeof c&&(c=parseFloat(c));return isNaN(c)?null:c},H={init:function(fa){return this.each(function(){var a=c.extend({min:null,max:null,from:null,to:null,type:"single",step:null,prefix:"",postfix:"",maxPostfix:"",hasGrid:!1,hideMinMax:!1,hideFromTo:!1,prettify:!0,disable:!1,values:null,
|
||||
onChange:null,onLoad:null,onFinish:null},fa),e=c(this),n=this,I=!1,g=null;if(!e.data("isActive")){e.data("isActive",!0);this.pluginCount=aa+=1;e.prop("value")&&(g=e.prop("value").split(";"));"single"===a.type?g&&1<g.length?("number"!==typeof a.min?a.min=parseFloat(g[0]):"number"!==typeof a.from&&(a.from=parseFloat(g[0])),"number"!==typeof a.max&&(a.max=parseFloat(g[1]))):g&&1===g.length&&"number"!==typeof a.from&&(a.from=parseFloat(g[0])):"double"===a.type&&(g&&1<g.length?("number"!==typeof a.min?
|
||||
a.min=parseFloat(g[0]):"number"!==typeof a.from&&(a.from=parseFloat(g[0])),"number"!==typeof a.max?a.max=parseFloat(g[1]):"number"!==typeof a.to&&(a.to=parseFloat(g[1]))):g&&1===g.length&&("number"!==typeof a.min?a.min=parseFloat(g[0]):"number"!==typeof a.from&&(a.from=parseFloat(g[0]))));"number"===typeof e.data("min")&&(a.min=parseFloat(e.data("min")));"number"===typeof e.data("max")&&(a.max=parseFloat(e.data("max")));"number"===typeof e.data("from")&&(a.from=parseFloat(e.data("from")));"number"===
|
||||
typeof e.data("to")&&(a.to=parseFloat(e.data("to")));e.data("step")&&(a.step=parseFloat(e.data("step")));e.data("type")&&(a.type=e.data("type"));e.data("prefix")&&(a.prefix=e.data("prefix"));e.data("postfix")&&(a.postfix=e.data("postfix"));e.data("maxpostfix")&&(a.maxPostfix=e.data("maxpostfix"));e.data("hasgrid")&&(a.hasGrid=e.data("hasgrid"));e.data("hideminmax")&&(a.hideMinMax=e.data("hideminmax"));e.data("hidefromto")&&(a.hideFromTo=e.data("hidefromto"));e.data("prettify")&&(a.prettify=e.data("prettify"));
|
||||
e.data("disable")&&(a.disable=e.data("disable"));e.data("values")&&(a.values=e.data("values").split(","));a.min=N(a.min);a.min||0===a.min||(a.min=10);a.max=N(a.max);a.max||0===a.max||(a.max=100);"[object Array]"!==Object.prototype.toString.call(a.values)&&(a.values=null);a.values&&0<a.values.length&&(a.min=0,a.max=a.values.length-1,a.step=1,I=!0);a.from=N(a.from);a.from||0===a.from||(a.from=a.min);a.to=N(a.to);a.to||0===a.to||(a.to=a.max);a.step=N(a.step);a.step||(a.step=1);a.from<a.min&&(a.from=
|
||||
a.min);a.from>a.max&&(a.from=a.min);a.to<a.min&&(a.to=a.max);a.to>a.max&&(a.to=a.max);"double"===a.type&&(a.from>a.to&&(a.from=a.to),a.to<a.from&&(a.to=a.from));var z=function(b){b=b.toString();a.prettify&&(b=b.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1 "));return b},g='<span class="irs" id="irs-'+this.pluginCount+'"></span>';e[0].style.display="none";e.before(g);var p=e.prev(),J=c(ea.body),T=c($),q,C,D,A,B,w,x,m,t,r,H,M,v=!1,y=!1,E=!0,f={},U=0,O=0,P=0,l=0,F=0,G=0,V=0,Q=0,R=0,Y=0,u=0;parseInt(a.step,
|
||||
10)!==parseFloat(a.step)&&(u=a.step.toString().split(".")[1],u=Math.pow(10,u.length));this.updateData=function(b){E=!0;a=c.extend(a,b);p.find("*").off();T.off("mouseup.irs"+n.pluginCount);J.off("mouseup.irs"+n.pluginCount);J.off("mousemove.irs"+n.pluginCount);p.html("");ba()};this.removeSlider=function(){p.find("*").off();T.off("mouseup.irs"+n.pluginCount);J.off("mouseup.irs"+n.pluginCount);J.off("mousemove.irs"+n.pluginCount);p.html("").remove();e.data("isActive",!1);e.show()};var ba=function(){p.html('<span class="irs"><span class="irs-line"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min">0</span><span class="irs-max">1</span><span class="irs-from">0</span><span class="irs-to">0</span><span class="irs-single">0</span></span><span class="irs-grid"></span>');
|
||||
q=p.find(".irs");C=q.find(".irs-min");D=q.find(".irs-max");A=q.find(".irs-from");B=q.find(".irs-to");w=q.find(".irs-single");M=p.find(".irs-grid");a.hideFromTo&&(A[0].style.visibility="hidden",B[0].style.visibility="hidden",w[0].style.visibility="hidden");a.hideFromTo||(A[0].style.visibility="visible",B[0].style.visibility="visible",w[0].style.visibility="visible");a.hideMinMax&&(C[0].style.visibility="hidden",D[0].style.visibility="hidden",P=O=0);a.hideMinMax||(C[0].style.visibility="visible",D[0].style.visibility=
|
||||
"visible",a.values?(C.html(a.prefix+a.values[0]+a.postfix),D.html(a.prefix+a.values[a.values.length-1]+a.maxPostfix+a.postfix)):(C.html(a.prefix+z(a.min)+a.postfix),D.html(a.prefix+z(a.max)+a.maxPostfix+a.postfix)),O=C.outerWidth(),P=D.outerWidth());ga()},ga=function(){if("single"===a.type){if(q.append('<span class="irs-slider single"></span>'),x=q.find(".single"),x.on("mousedown",function(a){a.preventDefault();a.stopPropagation();K(a,c(this),null);y=v=!0;s=n.pluginCount;S&&c("*").prop("unselectable",
|
||||
!0)}),X)x.on("touchstart",function(a){a.preventDefault();a.stopPropagation();K(a.originalEvent.touches[0],c(this),null);y=v=!0;s=n.pluginCount})}else"double"===a.type&&(q.append('<span class="irs-diapason"></span><span class="irs-slider from"></span><span class="irs-slider to"></span>'),m=q.find(".from"),t=q.find(".to"),H=q.find(".irs-diapason"),L(),m.on("mousedown",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");t.removeClass("last");K(a,c(this),"from");y=v=!0;s=n.pluginCount;
|
||||
S&&c("*").prop("unselectable",!0)}),t.on("mousedown",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");m.removeClass("last");K(a,c(this),"to");y=v=!0;s=n.pluginCount;S&&c("*").prop("unselectable",!0)}),X&&(m.on("touchstart",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");t.removeClass("last");K(a.originalEvent.touches[0],c(this),"from");y=v=!0;s=n.pluginCount}),t.on("touchstart",function(a){a.preventDefault();a.stopPropagation();c(this).addClass("last");
|
||||
m.removeClass("last");K(a.originalEvent.touches[0],c(this),"to");y=v=!0;s=n.pluginCount})),a.to===a.max&&m.addClass("last"));J.on("mouseup.irs"+n.pluginCount,function(){s===n.pluginCount&&v&&(v=y=!1,r.removeAttr("id"),r=null,"double"===a.type&&L(),Z(),S&&c("*").prop("unselectable",!1))});J.on("mousemove.irs"+n.pluginCount,function(a){v&&(U=a.pageX,W())});p.on("mousedown",function(){s=n.pluginCount});p.on("mouseup",function(b){if(s===n.pluginCount&&!v&&!a.disable){b=b.pageX;E=!1;b-=p.offset().left;
|
||||
var d=f.fromX+(f.toX-f.fromX)/2;Q=0;V=q.width()-G;R=q.width()-G;"single"===a.type?(r=x,r.attr("id","irs-active-slider"),W(b)):"double"===a.type&&(r=b<=d?m:t,r.attr("id","irs-active-slider"),W(b),L());r.removeAttr("id");r=null}});X&&(T.on("touchend",function(){v&&(v=y=!1,r.removeAttr("id"),r=null,"double"===a.type&&L(),Z())}),T.on("touchmove",function(a){v&&(U=a.originalEvent.touches[0].pageX,W())}));ca();ha();a.hasGrid&&ia();a.disable?(p.addClass("irs-disabled"),p.append('<span class="irs-disable-mask"></span>')):
|
||||
(p.removeClass("irs-disabled"),p.find(".irs-disable-mask").remove())},ca=function(){l=q.width();G=x?x.width():m.width();F=l-G},K=function(b,d,h){ca();E=!1;r=d;r.attr("id","irs-active-slider");d=r.offset().left;Y=d+(b.pageX-d)-r.position().left;"single"===a.type?V=q.width()-G:"double"===a.type&&("from"===h?(Q=0,R=parseInt(t.css("left"),10)):(Q=parseInt(m.css("left"),10),R=q.width()-G))},L=function(){var a=m.width(),d=c.data(m[0],"x")||parseInt(m[0].style.left,10)||m.position().left,h=(c.data(t[0],
|
||||
"x")||parseInt(t[0].style.left,10)||t.position().left)-d;H[0].style.left=d+a/2+"px";H[0].style.width=h+"px"},W=function(b){var d=U-Y,d=b?b:U-Y;"single"===a.type?(0>d&&(d=0),d>V&&(d=V)):"double"===a.type&&(d<Q&&(d=Q),d>R&&(d=R),L());c.data(r[0],"x",d);Z();b=Math.round(d);r[0].style.left=b+"px"},Z=function(){var b={input:e,slider:p,min:a.min,max:a.max,fromNumber:0,toNumber:0,fromPers:0,toPers:0,fromX:0,fromX_pure:0,toX:0,toX_pure:0},d=a.max-a.min,h;"single"===a.type?(b.fromX=c.data(x[0],"x")||parseInt(x[0].style.left,
|
||||
10)||x.position().left,b.fromPers=b.fromX/F*100,h=d/100*b.fromPers+a.min,b.fromNumber=Math.round(h/a.step)*a.step,b.fromNumber<a.min&&(b.fromNumber=a.min),b.fromNumber>a.max&&(b.fromNumber=a.max),u&&(b.fromNumber=parseInt(b.fromNumber*u,10)/u),I&&(b.fromValue=a.values[b.fromNumber])):"double"===a.type&&(b.fromX=c.data(m[0],"x")||parseInt(m[0].style.left,10)||m.position().left,b.fromPers=b.fromX/F*100,h=d/100*b.fromPers+a.min,b.fromNumber=Math.round(h/a.step)*a.step,b.fromNumber<a.min&&(b.fromNumber=
|
||||
a.min),b.toX=c.data(t[0],"x")||parseInt(t[0].style.left,10)||t.position().left,b.toPers=b.toX/F*100,d=d/100*b.toPers+a.min,b.toNumber=Math.round(d/a.step)*a.step,b.toNumber>a.max&&(b.toNumber=a.max),u&&(b.fromNumber=parseInt(b.fromNumber*u,10)/u,b.toNumber=parseInt(b.toNumber*u,10)/u),I&&(b.fromValue=a.values[b.fromNumber],b.toValue=a.values[b.toNumber]));f=b;da()},ha=function(){var b={input:e,slider:p,min:a.min,max:a.max,fromNumber:a.from,toNumber:a.to,fromPers:0,toPers:0,fromX:0,fromX_pure:0,toX:0,
|
||||
toX_pure:0},d=a.max-a.min;"single"===a.type?(b.fromPers=0!==d?(b.fromNumber-a.min)/d*100:0,b.fromX_pure=F/100*b.fromPers,b.fromX=Math.round(b.fromX_pure),x[0].style.left=b.fromX+"px",c.data(x[0],"x",b.fromX_pure)):"double"===a.type&&(b.fromPers=0!==d?(b.fromNumber-a.min)/d*100:0,b.fromX_pure=F/100*b.fromPers,b.fromX=Math.round(b.fromX_pure),m[0].style.left=b.fromX+"px",c.data(m[0],"x",b.fromX_pure),b.toPers=0!==d?(b.toNumber-a.min)/d*100:1,b.toX_pure=F/100*b.toPers,b.toX=Math.round(b.toX_pure),t[0].style.left=
|
||||
b.toX+"px",c.data(t[0],"x",b.toX_pure),L());f=b;da()},da=function(){var b,d,h,c,g,k;k=G/2;h="";"single"===a.type?(h=f.fromNumber===a.max?a.maxPostfix:"",A[0].style.display="none",B[0].style.display="none",h=I?a.prefix+a.values[f.fromNumber]+h+a.postfix:a.prefix+z(f.fromNumber)+h+a.postfix,w.html(h),g=w.outerWidth(),k=f.fromX-g/2+k,0>k&&(k=0),k>l-g&&(k=l-g),w[0].style.left=k+"px",a.hideMinMax||a.hideFromTo||(C[0].style.display=k<O?"none":"block",D[0].style.display=k+g>l-P?"none":"block"),e.attr("value",
|
||||
parseFloat(f.fromNumber))):"double"===a.type&&(h=f.toNumber===a.max?a.maxPostfix:"",I?(b=a.prefix+a.values[f.fromNumber]+a.postfix,d=a.prefix+a.values[f.toNumber]+h+a.postfix,h=f.fromNumber!==f.toNumber?a.prefix+a.values[f.fromNumber]+" \u2014 "+a.prefix+a.values[f.toNumber]+h+a.postfix:a.prefix+a.values[f.fromNumber]+h+a.postfix):(b=a.prefix+z(f.fromNumber)+a.postfix,d=a.prefix+z(f.toNumber)+h+a.postfix,h=f.fromNumber!==f.toNumber?a.prefix+z(f.fromNumber)+" \u2014 "+a.prefix+z(f.toNumber)+h+a.postfix:
|
||||
a.prefix+z(f.fromNumber)+h+a.postfix),A.html(b),B.html(d),w.html(h),b=A.outerWidth(),d=f.fromX-b/2+k,0>d&&(d=0),d>l-b&&(d=l-b),A[0].style.left=d+"px",h=B.outerWidth(),c=f.toX-h/2+k,0>c&&(c=0),c>l-h&&(c=l-h),B[0].style.left=c+"px",g=w.outerWidth(),k=f.fromX+(f.toX-f.fromX)/2-g/2+k,0>k&&(k=0),k>l-g&&(k=l-g),w[0].style.left=k+"px",d+b<c?(w[0].style.display="none",A[0].style.display="block",B[0].style.display="block"):(w[0].style.display="block",A[0].style.display="none",B[0].style.display="none"),a.hideMinMax||
|
||||
a.hideFromTo||(C[0].style.display=k<O||d<O?"none":"block",D[0].style.display=k+g>l-P||c+h>l-P?"none":"block"),e.attr("value",parseFloat(f.fromNumber)+";"+parseFloat(f.toNumber)));ja()},ja=function(){"function"!==typeof a.onFinish||y||E||a.onFinish.call(this,f);"function"!==typeof a.onChange||E||a.onChange.call(this,f);"function"===typeof a.onLoad&&!y&&E&&(a.onLoad.call(this,f),E=!1)},ia=function(){p.addClass("irs-with-grid");var b,d="",c=0,c=0,e="";for(b=0;20>=b;b+=1)c=Math.floor(l/20*b),c>=l&&(c=
|
||||
l-1),e+='<span class="irs-grid-pol small" style="left: '+c+'px;"></span>';for(b=0;4>=b;b+=1)c=Math.floor(l/4*b),c>=l&&(c=l-1),e+='<span class="irs-grid-pol" style="left: '+c+'px;"></span>',u?(d=a.min+(a.max-a.min)/4*b,d=d/a.step*a.step,d=parseInt(d*u,10)/u):(d=Math.round(a.min+(a.max-a.min)/4*b),d=Math.round(d/a.step)*a.step,d=z(d)),I&&(a.hideMinMax?(d=Math.round(a.min+(a.max-a.min)/4*b),d=Math.round(d/a.step)*a.step,d=0===b||4===b?a.values[d]:""):d=""),0===b?e+='<span class="irs-grid-text" style="left: '+
|
||||
c+'px; text-align: left;">'+d+"</span>":4===b?(c-=100,e+='<span class="irs-grid-text" style="left: '+c+'px; text-align: right;">'+d+"</span>"):(c-=50,e+='<span class="irs-grid-text" style="left: '+c+'px;">'+d+"</span>");M.html(e)};ba()}})},update:function(c){return this.each(function(){this.updateData(c)})},remove:function(){return this.each(function(){this.removeSlider()})}};c.fn.ionRangeSlider=function(s){if(H[s])return H[s].apply(this,Array.prototype.slice.call(arguments,1));if("object"!==typeof s&&
|
||||
s)c.error("Method "+s+" does not exist for jQuery.ionRangeSlider");else return H.init.apply(this,arguments)}})(jQuery,document,window,navigator);
|
||||
-6
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,543 +0,0 @@
|
||||
/*
|
||||
* Jeditable - jQuery in place edit plugin
|
||||
*
|
||||
* Copyright (c) 2006-2009 Mika Tuupola, Dylan Verheul
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Project home:
|
||||
* http://www.appelsiini.net/projects/jeditable
|
||||
*
|
||||
* Based on editable by Dylan Verheul <dylan_at_dyve.net>:
|
||||
* http://www.dyve.net/jquery/?editable
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Version 1.7.1
|
||||
*
|
||||
* ** means there is basic unit tests for this parameter.
|
||||
*
|
||||
* @name Jeditable
|
||||
* @type jQuery
|
||||
* @param String target (POST) URL or function to send edited content to **
|
||||
* @param Hash options additional options
|
||||
* @param String options[method] method to use to send edited content (POST or PUT) **
|
||||
* @param Function options[callback] Function to run after submitting edited content **
|
||||
* @param String options[name] POST parameter name of edited content
|
||||
* @param String options[id] POST parameter name of edited div id
|
||||
* @param Hash options[submitdata] Extra parameters to send when submitting edited content.
|
||||
* @param String options[type] text, textarea or select (or any 3rd party input type) **
|
||||
* @param Integer options[rows] number of rows if using textarea **
|
||||
* @param Integer options[cols] number of columns if using textarea **
|
||||
* @param Mixed options[height] 'auto', 'none' or height in pixels **
|
||||
* @param Mixed options[width] 'auto', 'none' or width in pixels **
|
||||
* @param String options[loadurl] URL to fetch input content before editing **
|
||||
* @param String options[loadtype] Request type for load url. Should be GET or POST.
|
||||
* @param String options[loadtext] Text to display while loading external content.
|
||||
* @param Mixed options[loaddata] Extra parameters to pass when fetching content before editing.
|
||||
* @param Mixed options[data] Or content given as paramameter. String or function.**
|
||||
* @param String options[indicator] indicator html to show when saving
|
||||
* @param String options[tooltip] optional tooltip text via title attribute **
|
||||
* @param String options[event] jQuery event such as 'click' of 'dblclick' **
|
||||
* @param String options[submit] submit button value, empty means no button **
|
||||
* @param String options[cancel] cancel button value, empty means no button **
|
||||
* @param String options[cssclass] CSS class to apply to input form. 'inherit' to copy from parent. **
|
||||
* @param String options[style] Style to apply to input form 'inherit' to copy from parent. **
|
||||
* @param String options[select] true or false, when true text is highlighted ??
|
||||
* @param String options[placeholder] Placeholder text or html to insert when element is empty. **
|
||||
* @param String options[onblur] 'cancel', 'submit', 'ignore' or function ??
|
||||
*
|
||||
* @param Function options[onsubmit] function(settings, original) { ... } called before submit
|
||||
* @param Function options[onreset] function(settings, original) { ... } called before reset
|
||||
* @param Function options[onerror] function(settings, original, xhr) { ... } called on error
|
||||
*
|
||||
* @param Hash options[ajaxoptions] jQuery Ajax options. See docs.jquery.com.
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.fn.editable = function(target, options) {
|
||||
|
||||
if ('disable' == target) {
|
||||
$(this).data('disabled.editable', true);
|
||||
return;
|
||||
}
|
||||
if ('enable' == target) {
|
||||
$(this).data('disabled.editable', false);
|
||||
return;
|
||||
}
|
||||
if ('destroy' == target) {
|
||||
$(this)
|
||||
.unbind($(this).data('event.editable'))
|
||||
.removeData('disabled.editable')
|
||||
.removeData('event.editable');
|
||||
return;
|
||||
}
|
||||
|
||||
var settings = $.extend({}, $.fn.editable.defaults, {target:target}, options);
|
||||
|
||||
/* setup some functions */
|
||||
var plugin = $.editable.types[settings.type].plugin || function() { };
|
||||
var submit = $.editable.types[settings.type].submit || function() { };
|
||||
var buttons = $.editable.types[settings.type].buttons
|
||||
|| $.editable.types['defaults'].buttons;
|
||||
var content = $.editable.types[settings.type].content
|
||||
|| $.editable.types['defaults'].content;
|
||||
var element = $.editable.types[settings.type].element
|
||||
|| $.editable.types['defaults'].element;
|
||||
var reset = $.editable.types[settings.type].reset
|
||||
|| $.editable.types['defaults'].reset;
|
||||
var callback = settings.callback || function() { };
|
||||
var onedit = settings.onedit || function() { };
|
||||
var onsubmit = settings.onsubmit || function() { };
|
||||
var onreset = settings.onreset || function() { };
|
||||
var onerror = settings.onerror || reset;
|
||||
|
||||
/* show tooltip */
|
||||
if (settings.tooltip) {
|
||||
$(this).attr('title', settings.tooltip);
|
||||
}
|
||||
|
||||
settings.autowidth = 'auto' == settings.width;
|
||||
settings.autoheight = 'auto' == settings.height;
|
||||
|
||||
return this.each(function() {
|
||||
|
||||
/* save this to self because this changes when scope changes */
|
||||
var self = this;
|
||||
|
||||
/* inlined block elements lose their width and height after first edit */
|
||||
/* save them for later use as workaround */
|
||||
var savedwidth = $(self).width();
|
||||
var savedheight = $(self).height();
|
||||
|
||||
/* save so it can be later used by $.editable('destroy') */
|
||||
$(this).data('event.editable', settings.event);
|
||||
|
||||
/* if element is empty add something clickable (if requested) */
|
||||
if (!$.trim($(this).html())) {
|
||||
$(this).html(settings.placeholder);
|
||||
}
|
||||
|
||||
$(this).bind(settings.event, function(e) {
|
||||
|
||||
/* abort if disabled for this element */
|
||||
if (true === $(this).data('disabled.editable')) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* prevent throwing an exeption if edit field is clicked again */
|
||||
if (self.editing) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* abort if onedit hook returns false */
|
||||
if (false === onedit.apply(this, [settings, self])) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* prevent default action and bubbling */
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
/* remove tooltip */
|
||||
if (settings.tooltip) {
|
||||
$(self).removeAttr('title');
|
||||
}
|
||||
|
||||
/* figure out how wide and tall we are, saved width and height */
|
||||
/* are workaround for http://dev.jquery.com/ticket/2190 */
|
||||
if (0 == $(self).width()) {
|
||||
//$(self).css('visibility', 'hidden');
|
||||
settings.width = savedwidth;
|
||||
settings.height = savedheight;
|
||||
} else {
|
||||
if (settings.width != 'none') {
|
||||
settings.width =
|
||||
settings.autowidth ? $(self).width() : settings.width;
|
||||
}
|
||||
if (settings.height != 'none') {
|
||||
settings.height =
|
||||
settings.autoheight ? $(self).height() : settings.height;
|
||||
}
|
||||
}
|
||||
//$(this).css('visibility', '');
|
||||
|
||||
/* remove placeholder text, replace is here because of IE */
|
||||
if ($(this).html().toLowerCase().replace(/(;|")/g, '') ==
|
||||
settings.placeholder.toLowerCase().replace(/(;|")/g, '')) {
|
||||
$(this).html('');
|
||||
}
|
||||
|
||||
self.editing = true;
|
||||
self.revert = $(self).html();
|
||||
$(self).html('');
|
||||
|
||||
/* create the form object */
|
||||
var form = $('<form />');
|
||||
|
||||
/* apply css or style or both */
|
||||
if (settings.cssclass) {
|
||||
if ('inherit' == settings.cssclass) {
|
||||
form.attr('class', $(self).attr('class'));
|
||||
} else {
|
||||
form.attr('class', settings.cssclass);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.style) {
|
||||
if ('inherit' == settings.style) {
|
||||
form.attr('style', $(self).attr('style'));
|
||||
/* IE needs the second line or display wont be inherited */
|
||||
form.css('display', $(self).css('display'));
|
||||
} else {
|
||||
form.attr('style', settings.style);
|
||||
}
|
||||
}
|
||||
|
||||
/* add main input element to form and store it in input */
|
||||
var input = element.apply(form, [settings, self]);
|
||||
|
||||
/* set input content via POST, GET, given data or existing value */
|
||||
var input_content;
|
||||
|
||||
if (settings.loadurl) {
|
||||
var t = setTimeout(function() {
|
||||
input.disabled = true;
|
||||
content.apply(form, [settings.loadtext, settings, self]);
|
||||
}, 100);
|
||||
|
||||
var loaddata = {};
|
||||
loaddata[settings.id] = self.id;
|
||||
if ($.isFunction(settings.loaddata)) {
|
||||
$.extend(loaddata, settings.loaddata.apply(self, [self.revert, settings]));
|
||||
} else {
|
||||
$.extend(loaddata, settings.loaddata);
|
||||
}
|
||||
$.ajax({
|
||||
type : settings.loadtype,
|
||||
url : settings.loadurl,
|
||||
data : loaddata,
|
||||
async : false,
|
||||
success: function(result) {
|
||||
window.clearTimeout(t);
|
||||
input_content = result;
|
||||
input.disabled = false;
|
||||
}
|
||||
});
|
||||
} else if (settings.data) {
|
||||
input_content = settings.data;
|
||||
if ($.isFunction(settings.data)) {
|
||||
input_content = settings.data.apply(self, [self.revert, settings]);
|
||||
}
|
||||
} else {
|
||||
input_content = self.revert;
|
||||
}
|
||||
content.apply(form, [input_content, settings, self]);
|
||||
|
||||
input.attr('name', settings.name);
|
||||
|
||||
/* add buttons to the form */
|
||||
buttons.apply(form, [settings, self]);
|
||||
|
||||
/* add created form to self */
|
||||
$(self).append(form);
|
||||
|
||||
/* attach 3rd party plugin if requested */
|
||||
plugin.apply(form, [settings, self]);
|
||||
|
||||
/* focus to first visible form element */
|
||||
$(':input:visible:enabled:first', form).focus();
|
||||
|
||||
/* highlight input contents when requested */
|
||||
if (settings.select) {
|
||||
input.select();
|
||||
}
|
||||
|
||||
/* discard changes if pressing esc */
|
||||
input.keydown(function(e) {
|
||||
if (e.keyCode == 27) {
|
||||
e.preventDefault();
|
||||
//self.reset();
|
||||
reset.apply(form, [settings, self]);
|
||||
}
|
||||
});
|
||||
|
||||
/* discard, submit or nothing with changes when clicking outside */
|
||||
/* do nothing is usable when navigating with tab */
|
||||
var t;
|
||||
if ('cancel' == settings.onblur) {
|
||||
input.blur(function(e) {
|
||||
/* prevent canceling if submit was clicked */
|
||||
t = setTimeout(function() {
|
||||
reset.apply(form, [settings, self]);
|
||||
}, 500);
|
||||
});
|
||||
} else if ('submit' == settings.onblur) {
|
||||
input.blur(function(e) {
|
||||
/* prevent double submit if submit was clicked */
|
||||
t = setTimeout(function() {
|
||||
form.submit();
|
||||
}, 200);
|
||||
});
|
||||
} else if ($.isFunction(settings.onblur)) {
|
||||
input.blur(function(e) {
|
||||
settings.onblur.apply(self, [input.val(), settings]);
|
||||
});
|
||||
} else {
|
||||
input.blur(function(e) {
|
||||
/* TODO: maybe something here */
|
||||
});
|
||||
}
|
||||
|
||||
form.submit(function(e) {
|
||||
|
||||
if (t) {
|
||||
clearTimeout(t);
|
||||
}
|
||||
|
||||
/* do no submit */
|
||||
e.preventDefault();
|
||||
|
||||
/* call before submit hook. */
|
||||
/* if it returns false abort submitting */
|
||||
if (false !== onsubmit.apply(form, [settings, self])) {
|
||||
/* custom inputs call before submit hook. */
|
||||
/* if it returns false abort submitting */
|
||||
if (false !== submit.apply(form, [settings, self])) {
|
||||
|
||||
/* check if given target is function */
|
||||
if ($.isFunction(settings.target)) {
|
||||
var str = settings.target.apply(self, [input.val(), settings]);
|
||||
$(self).html(str);
|
||||
self.editing = false;
|
||||
callback.apply(self, [self.innerHTML, settings]);
|
||||
/* TODO: this is not dry */
|
||||
if (!$.trim($(self).html())) {
|
||||
$(self).html(settings.placeholder);
|
||||
}
|
||||
} else {
|
||||
/* add edited content and id of edited element to POST */
|
||||
var submitdata = {};
|
||||
submitdata[settings.name] = input.val();
|
||||
submitdata[settings.id] = self.id;
|
||||
/* add extra data to be POST:ed */
|
||||
if ($.isFunction(settings.submitdata)) {
|
||||
$.extend(submitdata, settings.submitdata.apply(self, [self.revert, settings]));
|
||||
} else {
|
||||
$.extend(submitdata, settings.submitdata);
|
||||
}
|
||||
|
||||
/* quick and dirty PUT support */
|
||||
if ('PUT' == settings.method) {
|
||||
submitdata['_method'] = 'put';
|
||||
}
|
||||
|
||||
/* show the saving indicator */
|
||||
$(self).html(settings.indicator);
|
||||
|
||||
/* defaults for ajaxoptions */
|
||||
var ajaxoptions = {
|
||||
type : 'POST',
|
||||
data : submitdata,
|
||||
dataType: 'html',
|
||||
url : settings.target,
|
||||
success : function(result, status) {
|
||||
if (ajaxoptions.dataType == 'html') {
|
||||
$(self).html(result);
|
||||
}
|
||||
self.editing = false;
|
||||
callback.apply(self, [result, settings]);
|
||||
if (!$.trim($(self).html())) {
|
||||
$(self).html(settings.placeholder);
|
||||
}
|
||||
},
|
||||
error : function(xhr, status, error) {
|
||||
onerror.apply(form, [settings, self, xhr]);
|
||||
}
|
||||
};
|
||||
|
||||
/* override with what is given in settings.ajaxoptions */
|
||||
$.extend(ajaxoptions, settings.ajaxoptions);
|
||||
$.ajax(ajaxoptions);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* show tooltip again */
|
||||
$(self).attr('title', settings.tooltip);
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
/* privileged methods */
|
||||
this.reset = function(form) {
|
||||
/* prevent calling reset twice when blurring */
|
||||
if (this.editing) {
|
||||
/* before reset hook, if it returns false abort reseting */
|
||||
if (false !== onreset.apply(form, [settings, self])) {
|
||||
$(self).html(self.revert);
|
||||
self.editing = false;
|
||||
if (!$.trim($(self).html())) {
|
||||
$(self).html(settings.placeholder);
|
||||
}
|
||||
/* show tooltip again */
|
||||
if (settings.tooltip) {
|
||||
$(self).attr('title', settings.tooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
$.editable = {
|
||||
types: {
|
||||
defaults: {
|
||||
element : function(settings, original) {
|
||||
var input = $('<input type="hidden"></input>');
|
||||
$(this).append(input);
|
||||
return(input);
|
||||
},
|
||||
content : function(string, settings, original) {
|
||||
$(':input:first', this).val(string);
|
||||
},
|
||||
reset : function(settings, original) {
|
||||
original.reset(this);
|
||||
},
|
||||
buttons : function(settings, original) {
|
||||
var form = this;
|
||||
if (settings.submit) {
|
||||
/* if given html string use that */
|
||||
if (settings.submit.match(/>$/)) {
|
||||
var submit = $(settings.submit).click(function() {
|
||||
if (submit.attr("type") != "submit") {
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
/* otherwise use button with given string as text */
|
||||
} else {
|
||||
var submit = $('<button type="submit" />');
|
||||
submit.html(settings.submit);
|
||||
}
|
||||
$(this).append(submit);
|
||||
}
|
||||
if (settings.cancel) {
|
||||
/* if given html string use that */
|
||||
if (settings.cancel.match(/>$/)) {
|
||||
var cancel = $(settings.cancel);
|
||||
/* otherwise use button with given string as text */
|
||||
} else {
|
||||
var cancel = $('<button type="cancel" />');
|
||||
cancel.html(settings.cancel);
|
||||
}
|
||||
$(this).append(cancel);
|
||||
|
||||
$(cancel).click(function(event) {
|
||||
//original.reset();
|
||||
if ($.isFunction($.editable.types[settings.type].reset)) {
|
||||
var reset = $.editable.types[settings.type].reset;
|
||||
} else {
|
||||
var reset = $.editable.types['defaults'].reset;
|
||||
}
|
||||
reset.apply(form, [settings, original]);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
text: {
|
||||
element : function(settings, original) {
|
||||
var input = $('<input />');
|
||||
if (settings.width != 'none') { input.width(settings.width); }
|
||||
if (settings.height != 'none') { input.height(settings.height); }
|
||||
/* https://bugzilla.mozilla.org/show_bug.cgi?id=236791 */
|
||||
//input[0].setAttribute('autocomplete','off');
|
||||
input.attr('autocomplete','off');
|
||||
$(this).append(input);
|
||||
return(input);
|
||||
}
|
||||
},
|
||||
textarea: {
|
||||
element : function(settings, original) {
|
||||
var textarea = $('<textarea />');
|
||||
if (settings.rows) {
|
||||
textarea.attr('rows', settings.rows);
|
||||
} else if (settings.height != "none") {
|
||||
textarea.height(settings.height);
|
||||
}
|
||||
if (settings.cols) {
|
||||
textarea.attr('cols', settings.cols);
|
||||
} else if (settings.width != "none") {
|
||||
textarea.width(settings.width);
|
||||
}
|
||||
$(this).append(textarea);
|
||||
return(textarea);
|
||||
}
|
||||
},
|
||||
select: {
|
||||
element : function(settings, original) {
|
||||
var select = $('<select />');
|
||||
$(this).append(select);
|
||||
return(select);
|
||||
},
|
||||
content : function(data, settings, original) {
|
||||
/* If it is string assume it is json. */
|
||||
if (String == data.constructor) {
|
||||
eval ('var json = ' + data);
|
||||
} else {
|
||||
/* Otherwise assume it is a hash already. */
|
||||
var json = data;
|
||||
}
|
||||
for (var key in json) {
|
||||
if (!json.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
if ('selected' == key) {
|
||||
continue;
|
||||
}
|
||||
var option = $('<option />').val(key).append(json[key]);
|
||||
$('select', this).append(option);
|
||||
}
|
||||
/* Loop option again to set selected. IE needed this... */
|
||||
$('select', this).children().each(function() {
|
||||
if ($(this).val() == json['selected'] ||
|
||||
$(this).text() == $.trim(original.revert)) {
|
||||
$(this).attr('selected', 'selected');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/* Add new input type */
|
||||
addInputType: function(name, input) {
|
||||
$.editable.types[name] = input;
|
||||
}
|
||||
};
|
||||
|
||||
// publicly accessible defaults
|
||||
$.fn.editable.defaults = {
|
||||
name : 'value',
|
||||
id : 'id',
|
||||
type : 'text',
|
||||
width : 'auto',
|
||||
height : 'auto',
|
||||
event : 'click.editable',
|
||||
onblur : 'cancel',
|
||||
loadtype : 'GET',
|
||||
loadtext : 'Loading...',
|
||||
placeholder: 'Click to edit',
|
||||
loaddata : {},
|
||||
submitdata : {},
|
||||
ajaxoptions: {}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,207 +0,0 @@
|
||||
/**
|
||||
* jqGrid Chinese Translation
|
||||
* 咖啡兔 yanhonglei@gmail.com
|
||||
* http://www.kafeitu.me
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
**/
|
||||
/*global jQuery, define */
|
||||
(function( factory ) {
|
||||
"use strict";
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define([
|
||||
"jquery",
|
||||
"../grid.base"
|
||||
], factory );
|
||||
} else {
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
}(function( $ ) {
|
||||
|
||||
$.jgrid = $.jgrid || {};
|
||||
if(!$.jgrid.hasOwnProperty("regional")) {
|
||||
$.jgrid.regional = [];
|
||||
}
|
||||
$.jgrid.regional["cn"] = {
|
||||
defaults : {
|
||||
recordtext: "{0} - {1}\u3000共 {2} 条", // 共字前是全角空格
|
||||
emptyrecords: "无数据显示",
|
||||
loadtext: "读取中...",
|
||||
savetext: "Saving...",
|
||||
pgtext : " {0} 共 {1} 页",
|
||||
pgfirst : "First Page",
|
||||
pglast : "Last Page",
|
||||
pgnext : "Next Page",
|
||||
pgprev : "Previous Page",
|
||||
pgrecs : "Records per Page",
|
||||
showhide: "Toggle Expand Collapse Grid",
|
||||
// mobile
|
||||
pagerCaption : "Grid::Page Settings",
|
||||
pageText : "Page:",
|
||||
recordPage : "Records per Page",
|
||||
nomorerecs : "No more records...",
|
||||
scrollPullup: "Pull up to load more...",
|
||||
scrollPulldown : "Pull down to refresh...",
|
||||
scrollRefresh : "Release to refresh..."
|
||||
},
|
||||
search : {
|
||||
caption: "搜索...",
|
||||
Find: "查找",
|
||||
Reset: "重置",
|
||||
odata: [{ oper:'eq', text:'等于\u3000\u3000'},{ oper:'ne', text:'不等\u3000\u3000'},{ oper:'lt', text:'小于\u3000\u3000'},{ oper:'le', text:'小于等于'},{ oper:'gt', text:'大于\u3000\u3000'},{ oper:'ge', text:'大于等于'},{ oper:'bw', text:'开始于'},{ oper:'bn', text:'不开始于'},{ oper:'in', text:'属于\u3000\u3000'},{ oper:'ni', text:'不属于'},{ oper:'ew', text:'结束于'},{ oper:'en', text:'不结束于'},{ oper:'cn', text:'包含\u3000\u3000'},{ oper:'nc', text:'不包含'},{ oper:'nu', text:'不存在'},{ oper:'nn', text:'存在'}],
|
||||
groupOps: [ { op: "AND", text: "所有" }, { op: "OR", text: "任一" } ],
|
||||
operandTitle : "Click to select search operation.",
|
||||
resetTitle : "Reset Search Value"
|
||||
},
|
||||
edit : {
|
||||
addCaption: "添加记录",
|
||||
editCaption: "编辑记录",
|
||||
bSubmit: "提交",
|
||||
bCancel: "取消",
|
||||
bClose: "关闭",
|
||||
saveData: "数据已改变,是否保存?",
|
||||
bYes : "是",
|
||||
bNo : "否",
|
||||
bExit : "取消",
|
||||
msg: {
|
||||
required:"此字段必需",
|
||||
number:"请输入有效数字",
|
||||
minValue:"输值必须大于等于 ",
|
||||
maxValue:"输值必须小于等于 ",
|
||||
email: "这不是有效的e-mail地址",
|
||||
integer: "请输入有效整数",
|
||||
date: "请输入有效时间",
|
||||
url: "无效网址。前缀必须为 ('http://' 或 'https://')",
|
||||
nodefined : " 未定义!",
|
||||
novalue : " 需要返回值!",
|
||||
customarray : "自定义函数需要返回数组!",
|
||||
customfcheck : "必须有自定义函数!"
|
||||
}
|
||||
},
|
||||
view : {
|
||||
caption: "查看记录",
|
||||
bClose: "关闭"
|
||||
},
|
||||
del : {
|
||||
caption: "删除",
|
||||
msg: "删除所选记录?",
|
||||
bSubmit: "删除",
|
||||
bCancel: "取消"
|
||||
},
|
||||
nav : {
|
||||
edittext: "",
|
||||
edittitle: "编辑所选记录",
|
||||
addtext:"",
|
||||
addtitle: "添加新记录",
|
||||
deltext: "",
|
||||
deltitle: "删除所选记录",
|
||||
searchtext: "",
|
||||
searchtitle: "查找",
|
||||
refreshtext: "",
|
||||
refreshtitle: "刷新表格",
|
||||
alertcap: "注意",
|
||||
alerttext: "请选择记录",
|
||||
viewtext: "",
|
||||
viewtitle: "查看所选记录",
|
||||
savetext: "",
|
||||
savetitle: "Save row",
|
||||
canceltext: "",
|
||||
canceltitle : "Cancel row editing",
|
||||
selectcaption : "Actions..."
|
||||
},
|
||||
col : {
|
||||
caption: "选择列",
|
||||
bSubmit: "确定",
|
||||
bCancel: "取消"
|
||||
},
|
||||
errors : {
|
||||
errcap : "错误",
|
||||
nourl : "没有设置url",
|
||||
norecords: "没有要处理的记录",
|
||||
model : "colNames 和 colModel 长度不等!"
|
||||
},
|
||||
formatter : {
|
||||
integer : {thousandsSeparator: ",", defaultValue: '0'},
|
||||
number : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, defaultValue: '0.00'},
|
||||
currency : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
|
||||
date : {
|
||||
dayNames: [
|
||||
"日", "一", "二", "三", "四", "五", "六",
|
||||
"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六",
|
||||
],
|
||||
monthNames: [
|
||||
"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",
|
||||
"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
|
||||
],
|
||||
AmPm : ["am","pm","上午","下午"],
|
||||
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th';},
|
||||
srcformat: 'Y-m-d',
|
||||
newformat: 'Y-m-d',
|
||||
parseRe : /[#%\\\/:_;.,\t\s-]/,
|
||||
masks : {
|
||||
// see http://php.net/manual/en/function.date.php for PHP format used in jqGrid
|
||||
// and see http://docs.jquery.com/UI/Datepicker/formatDate
|
||||
// and https://github.com/jquery/globalize#dates for alternative formats used frequently
|
||||
// one can find on https://github.com/jquery/globalize/tree/master/lib/cultures many
|
||||
// information about date, time, numbers and currency formats used in different countries
|
||||
// one should just convert the information in PHP format
|
||||
ISO8601Long:"Y-m-d H:i:s",
|
||||
ISO8601Short:"Y-m-d",
|
||||
// short date:
|
||||
// n - Numeric representation of a month, without leading zeros
|
||||
// j - Day of the month without leading zeros
|
||||
// Y - A full numeric representation of a year, 4 digits
|
||||
// example: 3/1/2012 which means 1 March 2012
|
||||
ShortDate: "n/j/Y", // in jQuery UI Datepicker: "M/d/yyyy"
|
||||
// long date:
|
||||
// l - A full textual representation of the day of the week
|
||||
// F - A full textual representation of a month
|
||||
// d - Day of the month, 2 digits with leading zeros
|
||||
// Y - A full numeric representation of a year, 4 digits
|
||||
LongDate: "l, F d, Y", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy"
|
||||
// long date with long time:
|
||||
// l - A full textual representation of the day of the week
|
||||
// F - A full textual representation of a month
|
||||
// d - Day of the month, 2 digits with leading zeros
|
||||
// Y - A full numeric representation of a year, 4 digits
|
||||
// g - 12-hour format of an hour without leading zeros
|
||||
// i - Minutes with leading zeros
|
||||
// s - Seconds, with leading zeros
|
||||
// A - Uppercase Ante meridiem and Post meridiem (AM or PM)
|
||||
FullDateTime: "l, F d, Y g:i:s A", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy h:mm:ss tt"
|
||||
// month day:
|
||||
// F - A full textual representation of a month
|
||||
// d - Day of the month, 2 digits with leading zeros
|
||||
MonthDay: "F d", // in jQuery UI Datepicker: "MMMM dd"
|
||||
// short time (without seconds)
|
||||
// g - 12-hour format of an hour without leading zeros
|
||||
// i - Minutes with leading zeros
|
||||
// A - Uppercase Ante meridiem and Post meridiem (AM or PM)
|
||||
ShortTime: "g:i A", // in jQuery UI Datepicker: "h:mm tt"
|
||||
// long time (with seconds)
|
||||
// g - 12-hour format of an hour without leading zeros
|
||||
// i - Minutes with leading zeros
|
||||
// s - Seconds, with leading zeros
|
||||
// A - Uppercase Ante meridiem and Post meridiem (AM or PM)
|
||||
LongTime: "g:i:s A", // in jQuery UI Datepicker: "h:mm:ss tt"
|
||||
SortableDateTime: "Y-m-d\\TH:i:s",
|
||||
UniversalSortableDateTime: "Y-m-d H:i:sO",
|
||||
// month with year
|
||||
// Y - A full numeric representation of a year, 4 digits
|
||||
// F - A full textual representation of a month
|
||||
YearMonth: "F, Y" // in jQuery UI Datepicker: "MMMM, yyyy"
|
||||
},
|
||||
reformatAfterEdit : false,
|
||||
userLocalTime : false
|
||||
},
|
||||
baseLinkUrl: '',
|
||||
showAction: '',
|
||||
target: '',
|
||||
checkbox : {disabled:true},
|
||||
idName : 'id'
|
||||
}
|
||||
};
|
||||
}));
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,791 +0,0 @@
|
||||
/*!jQuery Knob*/
|
||||
/**
|
||||
* Downward compatible, touchable dial
|
||||
*
|
||||
* Version: 1.2.8
|
||||
* Requires: jQuery v1.7+
|
||||
*
|
||||
* Copyright (c) 2012 Anthony Terrien
|
||||
* Under MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*
|
||||
* Thanks to vor, eskimoblood, spiffistan, FabrizioC
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
/**
|
||||
* Kontrol library
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Definition of globals and core
|
||||
*/
|
||||
var k = {}, // kontrol
|
||||
max = Math.max,
|
||||
min = Math.min;
|
||||
|
||||
k.c = {};
|
||||
k.c.d = $(document);
|
||||
k.c.t = function (e) {
|
||||
return e.originalEvent.touches.length - 1;
|
||||
};
|
||||
|
||||
/**
|
||||
* Kontrol Object
|
||||
*
|
||||
* Definition of an abstract UI control
|
||||
*
|
||||
* Each concrete component must call this one.
|
||||
* <code>
|
||||
* k.o.call(this);
|
||||
* </code>
|
||||
*/
|
||||
k.o = function () {
|
||||
var s = this;
|
||||
|
||||
this.o = null; // array of options
|
||||
this.$ = null; // jQuery wrapped element
|
||||
this.i = null; // mixed HTMLInputElement or array of HTMLInputElement
|
||||
this.g = null; // deprecated 2D graphics context for 'pre-rendering'
|
||||
this.v = null; // value ; mixed array or integer
|
||||
this.cv = null; // change value ; not commited value
|
||||
this.x = 0; // canvas x position
|
||||
this.y = 0; // canvas y position
|
||||
this.w = 0; // canvas width
|
||||
this.h = 0; // canvas height
|
||||
this.$c = null; // jQuery canvas element
|
||||
this.c = null; // rendered canvas context
|
||||
this.t = 0; // touches index
|
||||
this.isInit = false;
|
||||
this.fgColor = null; // main color
|
||||
this.pColor = null; // previous color
|
||||
this.dH = null; // draw hook
|
||||
this.cH = null; // change hook
|
||||
this.eH = null; // cancel hook
|
||||
this.rH = null; // release hook
|
||||
this.scale = 1; // scale factor
|
||||
this.relative = false;
|
||||
this.relativeWidth = false;
|
||||
this.relativeHeight = false;
|
||||
this.$div = null; // component div
|
||||
|
||||
this.run = function () {
|
||||
var cf = function (e, conf) {
|
||||
var k;
|
||||
for (k in conf) {
|
||||
s.o[k] = conf[k];
|
||||
}
|
||||
s._carve().init();
|
||||
s._configure()
|
||||
._draw();
|
||||
};
|
||||
|
||||
if(this.$.data('kontroled')) return;
|
||||
this.$.data('kontroled', true);
|
||||
|
||||
this.extend();
|
||||
this.o = $.extend(
|
||||
{
|
||||
// Config
|
||||
min : this.$.data('min') !== undefined ? this.$.data('min') : 0,
|
||||
max : this.$.data('max') !== undefined ? this.$.data('max') : 100,
|
||||
stopper : true,
|
||||
readOnly : this.$.data('readonly') || (this.$.attr('readonly') === 'readonly'),
|
||||
|
||||
// UI
|
||||
cursor : (this.$.data('cursor') === true && 30) ||
|
||||
this.$.data('cursor') || 0,
|
||||
thickness : (
|
||||
this.$.data('thickness') &&
|
||||
Math.max(Math.min(this.$.data('thickness'), 1), 0.01)
|
||||
) || 0.35,
|
||||
lineCap : this.$.data('linecap') || 'butt',
|
||||
width : this.$.data('width') || 200,
|
||||
height : this.$.data('height') || 200,
|
||||
displayInput : this.$.data('displayinput') == null || this.$.data('displayinput'),
|
||||
displayPrevious : this.$.data('displayprevious'),
|
||||
fgColor : this.$.data('fgcolor') || '#87CEEB',
|
||||
inputColor: this.$.data('inputcolor'),
|
||||
font: this.$.data('font') || 'Arial',
|
||||
fontWeight: this.$.data('font-weight') || 'bold',
|
||||
inline : false,
|
||||
step : this.$.data('step') || 1,
|
||||
rotation: this.$.data('rotation'),
|
||||
|
||||
// Hooks
|
||||
draw : null, // function () {}
|
||||
change : null, // function (value) {}
|
||||
cancel : null, // function () {}
|
||||
release : null, // function (value) {}
|
||||
|
||||
// Output formatting, allows to add unit: %, ms ...
|
||||
format: function(v) {
|
||||
return v;
|
||||
},
|
||||
parse: function (v) {
|
||||
return parseFloat(v);
|
||||
}
|
||||
}, this.o
|
||||
);
|
||||
|
||||
// finalize options
|
||||
this.o.flip = this.o.rotation === 'anticlockwise' || this.o.rotation === 'acw';
|
||||
if(!this.o.inputColor) {
|
||||
this.o.inputColor = this.o.fgColor;
|
||||
}
|
||||
|
||||
// routing value
|
||||
if(this.$.is('fieldset')) {
|
||||
|
||||
// fieldset = array of integer
|
||||
this.v = {};
|
||||
this.i = this.$.find('input');
|
||||
this.i.each(function(k) {
|
||||
var $this = $(this);
|
||||
s.i[k] = $this;
|
||||
s.v[k] = s.o.parse($this.val());
|
||||
|
||||
$this.bind(
|
||||
'change blur'
|
||||
, function () {
|
||||
var val = {};
|
||||
val[k] = $this.val();
|
||||
s.val(val);
|
||||
}
|
||||
);
|
||||
});
|
||||
this.$.find('legend').remove();
|
||||
|
||||
} else {
|
||||
|
||||
// input = integer
|
||||
this.i = this.$;
|
||||
this.v = this.o.parse(this.$.val());
|
||||
(this.v === '') && (this.v = this.o.min);
|
||||
|
||||
this.$.bind(
|
||||
'change blur'
|
||||
, function () {
|
||||
s.val(s._validate(s.o.parse(s.$.val())));
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
(!this.o.displayInput) && this.$.hide();
|
||||
|
||||
// adds needed DOM elements (canvas, div)
|
||||
this.$c = $(document.createElement('canvas')).attr({
|
||||
width: this.o.width,
|
||||
height: this.o.height
|
||||
});
|
||||
|
||||
// wraps all elements in a div
|
||||
// add to DOM before Canvas init is triggered
|
||||
this.$div = $('<div style="'
|
||||
+ (this.o.inline ? 'display:inline;' : '')
|
||||
+ 'width:' + this.o.width + 'px;height:' + this.o.height + 'px;'
|
||||
+ '"></div>');
|
||||
|
||||
this.$.wrap(this.$div).before(this.$c);
|
||||
this.$div = this.$.parent();
|
||||
|
||||
if (typeof G_vmlCanvasManager !== 'undefined') {
|
||||
G_vmlCanvasManager.initElement(this.$c[0]);
|
||||
}
|
||||
|
||||
this.c = this.$c[0].getContext ? this.$c[0].getContext('2d') : null;
|
||||
|
||||
if (!this.c) {
|
||||
throw {
|
||||
name: "CanvasNotSupportedException",
|
||||
message: "Canvas not supported. Please use excanvas on IE8.0.",
|
||||
toString: function(){return this.name + ": " + this.message}
|
||||
}
|
||||
}
|
||||
|
||||
// hdpi support
|
||||
this.scale = (window.devicePixelRatio || 1) /
|
||||
(
|
||||
this.c.webkitBackingStorePixelRatio ||
|
||||
this.c.mozBackingStorePixelRatio ||
|
||||
this.c.msBackingStorePixelRatio ||
|
||||
this.c.oBackingStorePixelRatio ||
|
||||
this.c.backingStorePixelRatio || 1
|
||||
);
|
||||
|
||||
// detects relative width / height
|
||||
this.relativeWidth = ((this.o.width % 1 !== 0) &&
|
||||
this.o.width.indexOf('%'));
|
||||
this.relativeHeight = ((this.o.height % 1 !== 0) &&
|
||||
this.o.height.indexOf('%'));
|
||||
this.relative = (this.relativeWidth || this.relativeHeight);
|
||||
|
||||
// computes size and carves the component
|
||||
this._carve();
|
||||
|
||||
// prepares props for transaction
|
||||
if (this.v instanceof Object) {
|
||||
this.cv = {};
|
||||
this.copy(this.v, this.cv);
|
||||
} else {
|
||||
this.cv = this.v;
|
||||
}
|
||||
|
||||
// binds configure event
|
||||
this.$
|
||||
.bind("configure", cf)
|
||||
.parent()
|
||||
.bind("configure", cf);
|
||||
|
||||
// finalize init
|
||||
this._listen()
|
||||
._configure()
|
||||
._xy()
|
||||
.init();
|
||||
|
||||
this.isInit = true;
|
||||
|
||||
this.$.val(this.o.format(this.v));
|
||||
this._draw();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
this._carve = function() {
|
||||
if(this.relative) {
|
||||
var w = this.relativeWidth ?
|
||||
this.$div.parent().width() *
|
||||
parseInt(this.o.width) / 100 :
|
||||
this.$div.parent().width(),
|
||||
h = this.relativeHeight ?
|
||||
this.$div.parent().height() *
|
||||
parseInt(this.o.height) / 100 :
|
||||
this.$div.parent().height();
|
||||
|
||||
// apply relative
|
||||
this.w = this.h = Math.min(w, h);
|
||||
} else {
|
||||
this.w = this.o.width;
|
||||
this.h = this.o.height;
|
||||
}
|
||||
|
||||
// finalize div
|
||||
this.$div.css({
|
||||
'width': this.w + 'px',
|
||||
'height': this.h + 'px'
|
||||
});
|
||||
|
||||
// finalize canvas with computed width
|
||||
this.$c.attr({
|
||||
width: this.w,
|
||||
height: this.h
|
||||
});
|
||||
|
||||
// scaling
|
||||
if (this.scale !== 1) {
|
||||
this.$c[0].width = this.$c[0].width * this.scale;
|
||||
this.$c[0].height = this.$c[0].height * this.scale;
|
||||
this.$c.width(this.w);
|
||||
this.$c.height(this.h);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
this._draw = function () {
|
||||
|
||||
// canvas pre-rendering
|
||||
var d = true;
|
||||
|
||||
s.g = s.c;
|
||||
|
||||
s.clear();
|
||||
|
||||
s.dH
|
||||
&& (d = s.dH());
|
||||
|
||||
(d !== false) && s.draw();
|
||||
|
||||
};
|
||||
|
||||
this._touch = function (e) {
|
||||
|
||||
var touchMove = function (e) {
|
||||
|
||||
var v = s.xy2val(
|
||||
e.originalEvent.touches[s.t].pageX,
|
||||
e.originalEvent.touches[s.t].pageY
|
||||
);
|
||||
|
||||
if (v == s.cv) return;
|
||||
|
||||
if (s.cH && (s.cH(v) === false)) return;
|
||||
|
||||
s.change(s._validate(v));
|
||||
s._draw();
|
||||
};
|
||||
|
||||
// get touches index
|
||||
this.t = k.c.t(e);
|
||||
|
||||
// First touch
|
||||
touchMove(e);
|
||||
|
||||
// Touch events listeners
|
||||
k.c.d
|
||||
.bind("touchmove.k", touchMove)
|
||||
.bind(
|
||||
"touchend.k"
|
||||
, function () {
|
||||
k.c.d.unbind('touchmove.k touchend.k');
|
||||
s.val(s.cv);
|
||||
}
|
||||
);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
this._mouse = function (e) {
|
||||
|
||||
var mouseMove = function (e) {
|
||||
var v = s.xy2val(e.pageX, e.pageY);
|
||||
|
||||
if (v == s.cv) return;
|
||||
|
||||
if (s.cH && (s.cH(v) === false)) return;
|
||||
|
||||
s.change(s._validate(v));
|
||||
s._draw();
|
||||
};
|
||||
|
||||
// First click
|
||||
mouseMove(e);
|
||||
|
||||
// Mouse events listeners
|
||||
k.c.d
|
||||
.bind("mousemove.k", mouseMove)
|
||||
.bind(
|
||||
// Escape key cancel current change
|
||||
"keyup.k"
|
||||
, function (e) {
|
||||
if (e.keyCode === 27) {
|
||||
k.c.d.unbind("mouseup.k mousemove.k keyup.k");
|
||||
|
||||
if (
|
||||
s.eH
|
||||
&& (s.eH() === false)
|
||||
) return;
|
||||
|
||||
s.cancel();
|
||||
}
|
||||
}
|
||||
)
|
||||
.bind(
|
||||
"mouseup.k"
|
||||
, function (e) {
|
||||
k.c.d.unbind('mousemove.k mouseup.k keyup.k');
|
||||
s.val(s.cv);
|
||||
}
|
||||
);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
this._xy = function () {
|
||||
var o = this.$c.offset();
|
||||
this.x = o.left;
|
||||
this.y = o.top;
|
||||
return this;
|
||||
};
|
||||
|
||||
this._listen = function () {
|
||||
|
||||
if (!this.o.readOnly) {
|
||||
this.$c
|
||||
.bind(
|
||||
"mousedown"
|
||||
, function (e) {
|
||||
e.preventDefault();
|
||||
s._xy()._mouse(e);
|
||||
}
|
||||
)
|
||||
.bind(
|
||||
"touchstart"
|
||||
, function (e) {
|
||||
e.preventDefault();
|
||||
s._xy()._touch(e);
|
||||
}
|
||||
);
|
||||
|
||||
this.listen();
|
||||
} else {
|
||||
this.$.attr('readonly', 'readonly');
|
||||
}
|
||||
|
||||
if(this.relative) {
|
||||
$(window).resize(function() {
|
||||
s._carve()
|
||||
.init();
|
||||
s._draw();
|
||||
});
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
this._configure = function () {
|
||||
|
||||
// Hooks
|
||||
if (this.o.draw) this.dH = this.o.draw;
|
||||
if (this.o.change) this.cH = this.o.change;
|
||||
if (this.o.cancel) this.eH = this.o.cancel;
|
||||
if (this.o.release) this.rH = this.o.release;
|
||||
|
||||
if (this.o.displayPrevious) {
|
||||
this.pColor = this.h2rgba(this.o.fgColor, "0.4");
|
||||
this.fgColor = this.h2rgba(this.o.fgColor, "0.6");
|
||||
} else {
|
||||
this.fgColor = this.o.fgColor;
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
this._clear = function () {
|
||||
this.$c[0].width = this.$c[0].width;
|
||||
};
|
||||
|
||||
this._validate = function(v) {
|
||||
return (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step;
|
||||
};
|
||||
|
||||
// Abstract methods
|
||||
this.listen = function () {}; // on start, one time
|
||||
this.extend = function () {}; // each time configure triggered
|
||||
this.init = function () {}; // each time configure triggered
|
||||
this.change = function (v) {}; // on change
|
||||
this.val = function (v) {}; // on release
|
||||
this.xy2val = function (x, y) {}; //
|
||||
this.draw = function () {}; // on change / on release
|
||||
this.clear = function () { this._clear(); };
|
||||
|
||||
// Utils
|
||||
this.h2rgba = function (h, a) {
|
||||
var rgb;
|
||||
h = h.substring(1,7)
|
||||
rgb = [parseInt(h.substring(0,2),16)
|
||||
,parseInt(h.substring(2,4),16)
|
||||
,parseInt(h.substring(4,6),16)];
|
||||
return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + a + ")";
|
||||
};
|
||||
|
||||
this.copy = function (f, t) {
|
||||
for (var i in f) { t[i] = f[i]; }
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* k.Dial
|
||||
*/
|
||||
k.Dial = function () {
|
||||
k.o.call(this);
|
||||
|
||||
this.startAngle = null;
|
||||
this.xy = null;
|
||||
this.radius = null;
|
||||
this.lineWidth = null;
|
||||
this.cursorExt = null;
|
||||
this.w2 = null;
|
||||
this.PI2 = 2*Math.PI;
|
||||
|
||||
this.extend = function () {
|
||||
this.o = $.extend(
|
||||
{
|
||||
bgColor : this.$.data('bgcolor') || '#EEEEEE',
|
||||
angleOffset : this.$.data('angleoffset') || 0,
|
||||
angleArc : this.$.data('anglearc') || 360,
|
||||
inline : true
|
||||
}, this.o
|
||||
);
|
||||
};
|
||||
|
||||
this.val = function (v, triggerRelease) {
|
||||
if (null != v) {
|
||||
|
||||
// reverse format
|
||||
v = this.o.parse(v);
|
||||
|
||||
if (
|
||||
triggerRelease !== false && (v != this.v) && this.rH &&
|
||||
(this.rH(v) === false)
|
||||
) return;
|
||||
|
||||
this.cv = this.o.stopper ? max(min(v, this.o.max), this.o.min) : v;
|
||||
this.v = this.cv;
|
||||
this.$.val(this.o.format(this.v));
|
||||
this._draw();
|
||||
} else {
|
||||
return this.v;
|
||||
}
|
||||
};
|
||||
|
||||
this.xy2val = function (x, y) {
|
||||
var a, ret;
|
||||
|
||||
a = Math.atan2(
|
||||
x - (this.x + this.w2)
|
||||
, - (y - this.y - this.w2)
|
||||
) - this.angleOffset;
|
||||
|
||||
if (this.o.flip) {
|
||||
a = this.angleArc - a - this.PI2;
|
||||
}
|
||||
|
||||
if(this.angleArc != this.PI2 && (a < 0) && (a > -0.5)) {
|
||||
// if isset angleArc option, set to min if .5 under min
|
||||
a = 0;
|
||||
} else if (a < 0) {
|
||||
a += this.PI2;
|
||||
}
|
||||
|
||||
ret = ~~ (0.5 + (a * (this.o.max - this.o.min) / this.angleArc))
|
||||
+ this.o.min;
|
||||
|
||||
this.o.stopper && (ret = max(min(ret, this.o.max), this.o.min));
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
this.listen = function () {
|
||||
// bind MouseWheel
|
||||
var s = this, mwTimerStop, mwTimerRelease,
|
||||
mw = function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var ori = e.originalEvent
|
||||
,deltaX = ori.detail || ori.wheelDeltaX
|
||||
,deltaY = ori.detail || ori.wheelDeltaY
|
||||
,v = s._validate(s.o.parse(s.$.val()))
|
||||
+ (deltaX>0 || deltaY>0 ? s.o.step : deltaX<0 || deltaY<0 ? -s.o.step : 0);
|
||||
|
||||
v = max(min(v, s.o.max), s.o.min);
|
||||
|
||||
s.val(v, false);
|
||||
|
||||
if(s.rH) {
|
||||
// Handle mousewheel stop
|
||||
clearTimeout(mwTimerStop);
|
||||
mwTimerStop = setTimeout(function() {
|
||||
s.rH(v);
|
||||
mwTimerStop = null;
|
||||
}, 100);
|
||||
|
||||
// Handle mousewheel releases
|
||||
if(!mwTimerRelease) {
|
||||
mwTimerRelease = setTimeout(function() {
|
||||
if(mwTimerStop) s.rH(v);
|
||||
mwTimerRelease = null;
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
, kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step};
|
||||
|
||||
this.$
|
||||
.bind(
|
||||
"keydown"
|
||||
,function (e) {
|
||||
var kc = e.keyCode;
|
||||
|
||||
// numpad support
|
||||
if(kc >= 96 && kc <= 105) {
|
||||
kc = e.keyCode = kc - 48;
|
||||
}
|
||||
|
||||
kval = parseInt(String.fromCharCode(kc));
|
||||
|
||||
if (isNaN(kval)) {
|
||||
|
||||
(kc !== 13) // enter
|
||||
&& (kc !== 8) // bs
|
||||
&& (kc !== 9) // tab
|
||||
&& (kc !== 189) // -
|
||||
&& (kc !== 190 || s.$.val().match(/\./)) // . only allowed once
|
||||
&& e.preventDefault();
|
||||
|
||||
// arrows
|
||||
if ($.inArray(kc,[37,38,39,40]) > -1) {
|
||||
e.preventDefault();
|
||||
|
||||
var v = s.o.parse(s.$.val()) + kv[kc] * m;
|
||||
s.o.stopper && (v = max(min(v, s.o.max), s.o.min));
|
||||
|
||||
s.change(v);
|
||||
s._draw();
|
||||
|
||||
// long time keydown speed-up
|
||||
to = window.setTimeout(
|
||||
function () { m *= 2; }, 30
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
.bind(
|
||||
"keyup"
|
||||
,function (e) {
|
||||
if (isNaN(kval)) {
|
||||
if (to) {
|
||||
window.clearTimeout(to);
|
||||
to = null;
|
||||
m = 1;
|
||||
s.val(s.$.val());
|
||||
}
|
||||
} else {
|
||||
// kval postcond
|
||||
(s.$.val() > s.o.max && s.$.val(s.o.max))
|
||||
|| (s.$.val() < s.o.min && s.$.val(s.o.min));
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
this.$c.bind("mousewheel DOMMouseScroll", mw);
|
||||
this.$.bind("mousewheel DOMMouseScroll", mw)
|
||||
};
|
||||
|
||||
this.init = function () {
|
||||
|
||||
if (
|
||||
this.v < this.o.min
|
||||
|| this.v > this.o.max
|
||||
) this.v = this.o.min;
|
||||
|
||||
this.$.val(this.v);
|
||||
this.w2 = this.w / 2;
|
||||
this.cursorExt = this.o.cursor / 100;
|
||||
this.xy = this.w2 * this.scale;
|
||||
this.lineWidth = this.xy * this.o.thickness;
|
||||
this.lineCap = this.o.lineCap;
|
||||
this.radius = this.xy - this.lineWidth / 2;
|
||||
|
||||
this.o.angleOffset
|
||||
&& (this.o.angleOffset = isNaN(this.o.angleOffset) ? 0 : this.o.angleOffset);
|
||||
|
||||
this.o.angleArc
|
||||
&& (this.o.angleArc = isNaN(this.o.angleArc) ? this.PI2 : this.o.angleArc);
|
||||
|
||||
// deg to rad
|
||||
this.angleOffset = this.o.angleOffset * Math.PI / 180;
|
||||
this.angleArc = this.o.angleArc * Math.PI / 180;
|
||||
|
||||
// compute start and end angles
|
||||
this.startAngle = 1.5 * Math.PI + this.angleOffset;
|
||||
this.endAngle = 1.5 * Math.PI + this.angleOffset + this.angleArc;
|
||||
|
||||
var s = max(
|
||||
String(Math.abs(this.o.max)).length
|
||||
, String(Math.abs(this.o.min)).length
|
||||
, 2
|
||||
) + 2;
|
||||
|
||||
this.o.displayInput
|
||||
&& this.i.css({
|
||||
'width' : ((this.w / 2 + 4) >> 0) + 'px'
|
||||
,'height' : ((this.w / 3) >> 0) + 'px'
|
||||
,'position' : 'absolute'
|
||||
,'vertical-align' : 'middle'
|
||||
,'margin-top' : ((this.w / 3) >> 0) + 'px'
|
||||
,'margin-left' : '-' + ((this.w * 3 / 4 + 2) >> 0) + 'px'
|
||||
,'border' : 0
|
||||
,'background' : 'none'
|
||||
,'font' : this.o.fontWeight + ' ' + ((this.w / s) >> 0) + 'px ' + this.o.font
|
||||
,'text-align' : 'center'
|
||||
,'color' : this.o.inputColor || this.o.fgColor
|
||||
,'padding' : '0px'
|
||||
,'-webkit-appearance': 'none'
|
||||
})
|
||||
|| this.i.css({
|
||||
'width' : '0px'
|
||||
,'visibility' : 'hidden'
|
||||
});
|
||||
};
|
||||
|
||||
this.change = function (v) {
|
||||
this.cv = v;
|
||||
this.$.val(this.o.format(v));
|
||||
};
|
||||
|
||||
this.angle = function (v) {
|
||||
return (v - this.o.min) * this.angleArc / (this.o.max - this.o.min);
|
||||
};
|
||||
|
||||
this.arc = function (v) {
|
||||
var sa, ea;
|
||||
v = this.angle(v);
|
||||
if (this.o.flip) {
|
||||
sa = this.endAngle + 0.00001;
|
||||
ea = sa - v - 0.00001;
|
||||
} else {
|
||||
sa = this.startAngle - 0.00001;
|
||||
ea = sa + v + 0.00001;
|
||||
}
|
||||
this.o.cursor
|
||||
&& (sa = ea - this.cursorExt)
|
||||
&& (ea = ea + this.cursorExt);
|
||||
return {
|
||||
s: sa,
|
||||
e: ea,
|
||||
d: this.o.flip && !this.o.cursor
|
||||
};
|
||||
};
|
||||
|
||||
this.draw = function () {
|
||||
|
||||
var c = this.g, // context
|
||||
a = this.arc(this.cv) // Arc
|
||||
, pa // Previous arc
|
||||
, r = 1;
|
||||
|
||||
c.lineWidth = this.lineWidth;
|
||||
c.lineCap = this.lineCap;
|
||||
|
||||
c.beginPath();
|
||||
c.strokeStyle = this.o.bgColor;
|
||||
c.arc(this.xy, this.xy, this.radius, this.endAngle - 0.00001, this.startAngle + 0.00001, true);
|
||||
c.stroke();
|
||||
|
||||
if (this.o.displayPrevious) {
|
||||
pa = this.arc(this.v);
|
||||
c.beginPath();
|
||||
c.strokeStyle = this.pColor;
|
||||
c.arc(this.xy, this.xy, this.radius, pa.s, pa.e, pa.d);
|
||||
c.stroke();
|
||||
r = (this.cv == this.v);
|
||||
}
|
||||
|
||||
c.beginPath();
|
||||
c.strokeStyle = r ? this.o.fgColor : this.fgColor ;
|
||||
c.arc(this.xy, this.xy, this.radius, a.s, a.e, a.d);
|
||||
c.stroke();
|
||||
};
|
||||
|
||||
this.cancel = function () {
|
||||
this.val(this.v);
|
||||
};
|
||||
};
|
||||
|
||||
$.fn.dial = $.fn.knob = function (o) {
|
||||
return this.each(
|
||||
function () {
|
||||
var d = new k.Dial();
|
||||
d.o = o;
|
||||
d.$ = $(this);
|
||||
d.run();
|
||||
}
|
||||
).parent();
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Chinese translation for bootstrap-markdown
|
||||
* benhaile <denghaier@163.com>
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.markdown.messages.zh = {
|
||||
'Bold': "粗体",
|
||||
'Italic': "斜体",
|
||||
'Heading': "标题",
|
||||
'URL/Link': "链接",
|
||||
'Image': "图片",
|
||||
'List': "列表",
|
||||
'Unordered List': "无序列表",
|
||||
'Ordered List': "有序列表",
|
||||
'Code': "代码",
|
||||
'Quote': "引用",
|
||||
'Preview': "预览",
|
||||
'strong text': "粗体",
|
||||
'emphasized text': "强调",
|
||||
'heading text': "标题",
|
||||
'enter link description here': "输入链接说明",
|
||||
'Insert Hyperlink': "URL地址",
|
||||
'enter image description here': "输入图片说明",
|
||||
'Insert Image Hyperlink': "图片URL地址",
|
||||
'enter image title here': "在这里输入图片标题",
|
||||
'list text here': "这里是列表文本",
|
||||
'code text here': "这里输入代码",
|
||||
'quote here': "这里输入引用文本"
|
||||
|
||||
|
||||
};
|
||||
}(jQuery));
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,184 +0,0 @@
|
||||
/*
|
||||
* to-markdown - an HTML to Markdown converter
|
||||
*
|
||||
* Copyright 2011, Dom Christie
|
||||
* Licenced under the MIT licence
|
||||
*
|
||||
*/
|
||||
|
||||
var toMarkdown = function(string) {
|
||||
|
||||
var ELEMENTS = [
|
||||
{
|
||||
patterns: 'p',
|
||||
replacement: function(str, attrs, innerHTML) {
|
||||
return innerHTML ? '\n\n' + innerHTML + '\n' : '';
|
||||
}
|
||||
},
|
||||
{
|
||||
patterns: 'br',
|
||||
type: 'void',
|
||||
replacement: '\n'
|
||||
},
|
||||
{
|
||||
patterns: 'h([1-6])',
|
||||
replacement: function(str, hLevel, attrs, innerHTML) {
|
||||
var hPrefix = '';
|
||||
for(var i = 0; i < hLevel; i++) {
|
||||
hPrefix += '#';
|
||||
}
|
||||
return '\n\n' + hPrefix + ' ' + innerHTML + '\n';
|
||||
}
|
||||
},
|
||||
{
|
||||
patterns: 'hr',
|
||||
type: 'void',
|
||||
replacement: '\n\n* * *\n'
|
||||
},
|
||||
{
|
||||
patterns: 'a',
|
||||
replacement: function(str, attrs, innerHTML) {
|
||||
var href = attrs.match(attrRegExp('href')),
|
||||
title = attrs.match(attrRegExp('title'));
|
||||
return href ? '[' + innerHTML + ']' + '(' + href[1] + (title && title[1] ? ' "' + title[1] + '"' : '') + ')' : str;
|
||||
}
|
||||
},
|
||||
{
|
||||
patterns: ['b', 'strong'],
|
||||
replacement: function(str, attrs, innerHTML) {
|
||||
return innerHTML ? '**' + innerHTML + '**' : '';
|
||||
}
|
||||
},
|
||||
{
|
||||
patterns: ['i', 'em'],
|
||||
replacement: function(str, attrs, innerHTML) {
|
||||
return innerHTML ? '_' + innerHTML + '_' : '';
|
||||
}
|
||||
},
|
||||
{
|
||||
patterns: 'code',
|
||||
replacement: function(str, attrs, innerHTML) {
|
||||
return innerHTML ? '`' + innerHTML + '`' : '';
|
||||
}
|
||||
},
|
||||
{
|
||||
patterns: 'img',
|
||||
type: 'void',
|
||||
replacement: function(str, attrs, innerHTML) {
|
||||
var src = attrs.match(attrRegExp('src')),
|
||||
alt = attrs.match(attrRegExp('alt')),
|
||||
title = attrs.match(attrRegExp('title'));
|
||||
return '![' + (alt && alt[1] ? alt[1] : '') + ']' + '(' + src[1] + (title && title[1] ? ' "' + title[1] + '"' : '') + ')';
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
for(var i = 0, len = ELEMENTS.length; i < len; i++) {
|
||||
if(typeof ELEMENTS[i].patterns === 'string') {
|
||||
string = replaceEls(string, { tag: ELEMENTS[i].patterns, replacement: ELEMENTS[i].replacement, type: ELEMENTS[i].type });
|
||||
}
|
||||
else {
|
||||
for(var j = 0, pLen = ELEMENTS[i].patterns.length; j < pLen; j++) {
|
||||
string = replaceEls(string, { tag: ELEMENTS[i].patterns[j], replacement: ELEMENTS[i].replacement, type: ELEMENTS[i].type });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function replaceEls(html, elProperties) {
|
||||
var pattern = elProperties.type === 'void' ? '<' + elProperties.tag + '\\b([^>]*)\\/?>' : '<' + elProperties.tag + '\\b([^>]*)>([\\s\\S]*?)<\\/' + elProperties.tag + '>',
|
||||
regex = new RegExp(pattern, 'gi'),
|
||||
markdown = '';
|
||||
if(typeof elProperties.replacement === 'string') {
|
||||
markdown = html.replace(regex, elProperties.replacement);
|
||||
}
|
||||
else {
|
||||
markdown = html.replace(regex, function(str, p1, p2, p3) {
|
||||
return elProperties.replacement.call(this, str, p1, p2, p3);
|
||||
});
|
||||
}
|
||||
return markdown;
|
||||
}
|
||||
|
||||
function attrRegExp(attr) {
|
||||
return new RegExp(attr + '\\s*=\\s*["\']?([^"\']*)["\']?', 'i');
|
||||
}
|
||||
|
||||
// Pre code blocks
|
||||
|
||||
string = string.replace(/<pre\b[^>]*>`([\s\S]*)`<\/pre>/gi, function(str, innerHTML) {
|
||||
innerHTML = innerHTML.replace(/^\t+/g, ' '); // convert tabs to spaces (you know it makes sense)
|
||||
innerHTML = innerHTML.replace(/\n/g, '\n ');
|
||||
return '\n\n ' + innerHTML + '\n';
|
||||
});
|
||||
|
||||
// Lists
|
||||
|
||||
// Escape numbers that could trigger an ol
|
||||
// If there are more than three spaces before the code, it would be in a pre tag
|
||||
// Make sure we are escaping the period not matching any character
|
||||
string = string.replace(/^(\s{0,3}\d+)\. /g, '$1\\. ');
|
||||
|
||||
// Converts lists that have no child lists (of same type) first, then works it's way up
|
||||
var noChildrenRegex = /<(ul|ol)\b[^>]*>(?:(?!<ul|<ol)[\s\S])*?<\/\1>/gi;
|
||||
while(string.match(noChildrenRegex)) {
|
||||
string = string.replace(noChildrenRegex, function(str) {
|
||||
return replaceLists(str);
|
||||
});
|
||||
}
|
||||
|
||||
function replaceLists(html) {
|
||||
|
||||
html = html.replace(/<(ul|ol)\b[^>]*>([\s\S]*?)<\/\1>/gi, function(str, listType, innerHTML) {
|
||||
var lis = innerHTML.split('</li>');
|
||||
lis.splice(lis.length - 1, 1);
|
||||
|
||||
for(i = 0, len = lis.length; i < len; i++) {
|
||||
if(lis[i]) {
|
||||
var prefix = (listType === 'ol') ? (i + 1) + ". " : "* ";
|
||||
lis[i] = lis[i].replace(/\s*<li[^>]*>([\s\S]*)/i, function(str, innerHTML) {
|
||||
|
||||
innerHTML = innerHTML.replace(/^\s+/, '');
|
||||
innerHTML = innerHTML.replace(/\n\n/g, '\n\n ');
|
||||
// indent nested lists
|
||||
innerHTML = innerHTML.replace(/\n([ ]*)+(\*|\d+\.) /g, '\n$1 $2 ');
|
||||
return prefix + innerHTML;
|
||||
});
|
||||
}
|
||||
}
|
||||
return lis.join('\n');
|
||||
});
|
||||
return '\n\n' + html.replace(/[ \t]+\n|\s+$/g, '');
|
||||
}
|
||||
|
||||
// Blockquotes
|
||||
var deepest = /<blockquote\b[^>]*>((?:(?!<blockquote)[\s\S])*?)<\/blockquote>/gi;
|
||||
while(string.match(deepest)) {
|
||||
string = string.replace(deepest, function(str) {
|
||||
return replaceBlockquotes(str);
|
||||
});
|
||||
}
|
||||
|
||||
function replaceBlockquotes(html) {
|
||||
html = html.replace(/<blockquote\b[^>]*>([\s\S]*?)<\/blockquote>/gi, function(str, inner) {
|
||||
inner = inner.replace(/^\s+|\s+$/g, '');
|
||||
inner = cleanUp(inner);
|
||||
inner = inner.replace(/^/gm, '> ');
|
||||
inner = inner.replace(/^(>([ \t]{2,}>)+)/gm, '> >');
|
||||
return inner;
|
||||
});
|
||||
return html;
|
||||
}
|
||||
|
||||
function cleanUp(string) {
|
||||
string = string.replace(/^[\t\r\n]+|[\t\r\n]+$/g, ''); // trim leading/trailing whitespace
|
||||
string = string.replace(/\n\s+\n/g, '\n\n');
|
||||
string = string.replace(/\n{3,}/g, '\n\n'); // limit consecutive linebreaks to 2
|
||||
return string;
|
||||
}
|
||||
|
||||
return cleanUp(string);
|
||||
};
|
||||
|
||||
if (typeof exports === 'object') {
|
||||
exports.toMarkdown = toMarkdown;
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
/*
|
||||
* metismenu - v1.1.3
|
||||
* Easy menu jQuery plugin for Twitter Bootstrap 3
|
||||
* https://github.com/onokumus/metisMenu
|
||||
*
|
||||
* Made by Osman Nuri Okumus
|
||||
* Under MIT License
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
|
||||
var pluginName = "metisMenu",
|
||||
defaults = {
|
||||
toggle: true,
|
||||
doubleTapToGo: false
|
||||
};
|
||||
|
||||
function Plugin(element, options) {
|
||||
this.element = $(element);
|
||||
this.settings = $.extend({}, defaults, options);
|
||||
this._defaults = defaults;
|
||||
this._name = pluginName;
|
||||
this.init();
|
||||
}
|
||||
|
||||
Plugin.prototype = {
|
||||
init: function() {
|
||||
|
||||
var $this = this.element,
|
||||
$toggle = this.settings.toggle,
|
||||
obj = this;
|
||||
|
||||
if (this.isIE() <= 9) {
|
||||
$this.find("li.active").has("ul").children("ul").collapse("show");
|
||||
$this.find("li").not(".active").has("ul").children("ul").collapse("hide");
|
||||
} else {
|
||||
$this.find("li.active").has("ul").children("ul").addClass("collapse in");
|
||||
$this.find("li").not(".active").has("ul").children("ul").addClass("collapse");
|
||||
}
|
||||
|
||||
//add the "doubleTapToGo" class to active items if needed
|
||||
if (obj.settings.doubleTapToGo) {
|
||||
$this.find("li.active").has("ul").children("a").addClass("doubleTapToGo");
|
||||
}
|
||||
|
||||
$this.find("li").has("ul").children("a").on("click" + "." + pluginName, function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
//Do we need to enable the double tap
|
||||
if (obj.settings.doubleTapToGo) {
|
||||
|
||||
//if we hit a second time on the link and the href is valid, navigate to that url
|
||||
if (obj.doubleTapToGo($(this)) && $(this).attr("href") !== "#" && $(this).attr("href") !== "") {
|
||||
e.stopPropagation();
|
||||
document.location = $(this).attr("href");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$(this).parent("li").toggleClass("active").children("ul").collapse("toggle");
|
||||
|
||||
if ($toggle) {
|
||||
$(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide");
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
isIE: function() { //https://gist.github.com/padolsey/527683
|
||||
var undef,
|
||||
v = 3,
|
||||
div = document.createElement("div"),
|
||||
all = div.getElementsByTagName("i");
|
||||
|
||||
while (
|
||||
div.innerHTML = "<!--[if gt IE " + (++v) + "]><i></i><![endif]-->",
|
||||
all[0]
|
||||
) {
|
||||
return v > 4 ? v : undef;
|
||||
}
|
||||
},
|
||||
|
||||
//Enable the link on the second click.
|
||||
doubleTapToGo: function(elem) {
|
||||
var $this = this.element;
|
||||
|
||||
//if the class "doubleTapToGo" exists, remove it and return
|
||||
if (elem.hasClass("doubleTapToGo")) {
|
||||
elem.removeClass("doubleTapToGo");
|
||||
return true;
|
||||
}
|
||||
|
||||
//does not exists, add a new class and return false
|
||||
if (elem.parent().children("ul").length) {
|
||||
//first remove all other class
|
||||
$this.find(".doubleTapToGo").removeClass("doubleTapToGo");
|
||||
//add the class on the current element
|
||||
elem.addClass("doubleTapToGo");
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
remove: function() {
|
||||
this.element.off("." + pluginName);
|
||||
this.element.removeData(pluginName);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.fn[pluginName] = function(options) {
|
||||
this.each(function () {
|
||||
var el = $(this);
|
||||
if (el.data(pluginName)) {
|
||||
el.data(pluginName).remove();
|
||||
}
|
||||
el.data(pluginName, new Plugin(this, options));
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
})(jQuery, window, document);
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* metismenu - v2.7.4
|
||||
* A jQuery menu plugin
|
||||
* https://github.com/onokumus/metismenu#readme
|
||||
*
|
||||
* Made by Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
|
||||
* Under MIT License
|
||||
*/
|
||||
|
||||
@charset "UTF-8";
|
||||
/*!
|
||||
* metismenu https://github.com/onokumus/metismenu#readme
|
||||
* A collapsible jQuery menu plugin
|
||||
* @version 3.0.7
|
||||
* @author Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
|
||||
* @license: MIT
|
||||
*/
|
||||
.metismenu .arrow {
|
||||
float: right;
|
||||
line-height: 1.42857;
|
||||
}
|
||||
*[dir="rtl"] .metismenu .arrow {
|
||||
|
||||
*[dir=rtl] .metismenu .arrow {
|
||||
float: left;
|
||||
}
|
||||
|
||||
@@ -19,82 +19,80 @@
|
||||
* Require Bootstrap 3.x
|
||||
* https://github.com/twbs/bootstrap
|
||||
*/
|
||||
|
||||
.metismenu .glyphicon.arrow:before {
|
||||
content: "\e079";
|
||||
content: "";
|
||||
}
|
||||
.metismenu .active > a > .glyphicon.arrow:before {
|
||||
content: "\e114";
|
||||
|
||||
.metismenu .mm-active > a > .glyphicon.arrow:before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
/*
|
||||
* Require Font-Awesome
|
||||
* http://fortawesome.github.io/Font-Awesome/
|
||||
*/
|
||||
|
||||
.metismenu .fa.arrow:before {
|
||||
content: "\f104";
|
||||
content: "";
|
||||
}
|
||||
.metismenu .active > a > .fa.arrow:before {
|
||||
content: "\f107";
|
||||
|
||||
.metismenu .mm-active > a > .fa.arrow:before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
/*
|
||||
* Require Ionicons
|
||||
* http://ionicons.com/
|
||||
*/
|
||||
|
||||
.metismenu .ion.arrow:before {
|
||||
content: "\f3d2"
|
||||
content: "";
|
||||
}
|
||||
.metismenu .active > a > .ion.arrow:before {
|
||||
content: "\f3d0";
|
||||
|
||||
.metismenu .mm-active > a > .ion.arrow:before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.metismenu .plus-times {
|
||||
float: right;
|
||||
}
|
||||
*[dir="rtl"] .metismenu .plus-times {
|
||||
|
||||
*[dir=rtl] .metismenu .plus-times {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.metismenu .fa.plus-times:before {
|
||||
content: "\f067";
|
||||
content: "";
|
||||
}
|
||||
.metismenu .active > a > .fa.plus-times {
|
||||
-webkit-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
|
||||
.metismenu .mm-active > a > .fa.plus-times {
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.metismenu .plus-minus {
|
||||
float: right;
|
||||
}
|
||||
*[dir="rtl"] .metismenu .plus-minus {
|
||||
|
||||
*[dir=rtl] .metismenu .plus-minus {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.metismenu .fa.plus-minus:before {
|
||||
content: "\f067";
|
||||
content: "";
|
||||
}
|
||||
.metismenu .active > a > .fa.plus-minus:before {
|
||||
content: "\f068";
|
||||
|
||||
.metismenu .mm-active > a > .fa.plus-minus:before {
|
||||
content: "";
|
||||
}
|
||||
.metismenu .collapse {
|
||||
|
||||
.metismenu .mm-collapse:not(.mm-show) {
|
||||
display: none;
|
||||
}
|
||||
.metismenu .collapse.in {
|
||||
display: block;
|
||||
}
|
||||
.metismenu .collapsing {
|
||||
|
||||
.metismenu .mm-collapsing {
|
||||
position: relative;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
-webkit-transition-timing-function: ease;
|
||||
-o-transition-timing-function: ease;
|
||||
transition-timing-function: ease;
|
||||
-webkit-transition-duration: .35s;
|
||||
-o-transition-duration: .35s;
|
||||
transition-duration: .35s;
|
||||
-webkit-transition-property: height, visibility;
|
||||
-o-transition-property: height, visibility;
|
||||
transition-timing-function: ease;
|
||||
transition-duration: 0.35s;
|
||||
transition-property: height, visibility;
|
||||
}
|
||||
|
||||
@@ -104,40 +102,33 @@
|
||||
|
||||
.metismenu .has-arrow::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
width: .5em;
|
||||
height: .5em;
|
||||
content: "";
|
||||
width: 0.5em;
|
||||
height: 0.5em;
|
||||
border-width: 1px 0 0 1px;
|
||||
border-style: solid;
|
||||
border-color: initial;
|
||||
right: 1em;
|
||||
-webkit-transform: rotate(-45deg) translate(0, -50%);
|
||||
-ms-transform: rotate(-45deg) translate(0, -50%);
|
||||
-o-transform: rotate(-45deg) translate(0, -50%);
|
||||
transform: rotate(-45deg) translate(0, -50%);
|
||||
-webkit-transform-origin: top;
|
||||
-ms-transform-origin: top;
|
||||
-o-transform-origin: top;
|
||||
transform-origin: top;
|
||||
transform: rotate(-45deg) translate(0, -50%);
|
||||
transform-origin: top;
|
||||
top: 50%;
|
||||
-webkit-transition: all .3s ease-out;
|
||||
-o-transition: all .3s ease-out;
|
||||
transition: all .3s ease-out;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
|
||||
*[dir="rtl"] .metismenu .has-arrow::after {
|
||||
*[dir=rtl] .metismenu .has-arrow::after {
|
||||
right: auto;
|
||||
left: 1em;
|
||||
-webkit-transform: rotate(135deg) translate(0, -50%);
|
||||
-ms-transform: rotate(135deg) translate(0, -50%);
|
||||
-o-transform: rotate(135deg) translate(0, -50%);
|
||||
transform: rotate(135deg) translate(0, -50%);
|
||||
transform: rotate(135deg) translate(0, -50%);
|
||||
}
|
||||
|
||||
.metismenu .active > .has-arrow::after,
|
||||
.metismenu .has-arrow[aria-expanded="true"]::after {
|
||||
-webkit-transform: rotate(-135deg) translate(0, -50%);
|
||||
-ms-transform: rotate(-135deg) translate(0, -50%);
|
||||
-o-transform: rotate(-135deg) translate(0, -50%);
|
||||
transform: rotate(-135deg) translate(0, -50%);
|
||||
.metismenu .mm-active > .has-arrow::after,
|
||||
.metismenu .has-arrow[aria-expanded=true]::after {
|
||||
transform: rotate(-135deg) translate(0, -50%);
|
||||
}
|
||||
|
||||
*[dir=rtl] .metismenu .mm-active > .has-arrow::after,
|
||||
*[dir=rtl] .metismenu .has-arrow[aria-expanded=true]::after {
|
||||
transform: rotate(225deg) translate(0, -50%);
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=metisMenu.css.map */
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sourceRoot":"","sources":["../src/metisMenu.scss"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;EACE;EACA;;;AAEF;EACE;;;AAGF;AAAA;AAAA;AAAA;AAKA;EACE;;;AAEF;EACE;;;AAGF;AAAA;AAAA;AAAA;AAKA;EACE;;;AAEF;EACE;;;AAGF;AAAA;AAAA;AAAA;AAKA;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;AAAA;EAEE;;;AAGF;AAAA;EAEE","file":"metisMenu.css"}
|
||||
@@ -0,0 +1,358 @@
|
||||
/*!
|
||||
* metismenu https://github.com/onokumus/metismenu#readme
|
||||
* A collapsible jQuery menu plugin
|
||||
* @version 3.0.7
|
||||
* @author Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
|
||||
* @license: MIT
|
||||
*/
|
||||
import $ from 'jquery';
|
||||
|
||||
const Util = (($) => { // eslint-disable-line no-shadow
|
||||
const TRANSITION_END = 'transitionend';
|
||||
|
||||
const Util = { // eslint-disable-line no-shadow
|
||||
TRANSITION_END: 'mmTransitionEnd',
|
||||
|
||||
triggerTransitionEnd(element) {
|
||||
$(element).trigger(TRANSITION_END);
|
||||
},
|
||||
|
||||
supportsTransitionEnd() {
|
||||
return Boolean(TRANSITION_END);
|
||||
},
|
||||
};
|
||||
|
||||
function getSpecialTransitionEndEvent() {
|
||||
return {
|
||||
bindType: TRANSITION_END,
|
||||
delegateType: TRANSITION_END,
|
||||
handle(event) {
|
||||
if ($(event.target).is(this)) {
|
||||
return event
|
||||
.handleObj
|
||||
.handler
|
||||
.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function transitionEndEmulator(duration) {
|
||||
let called = false;
|
||||
|
||||
$(this).one(Util.TRANSITION_END, () => {
|
||||
called = true;
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
if (!called) {
|
||||
Util.triggerTransitionEnd(this);
|
||||
}
|
||||
}, duration);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
function setTransitionEndSupport() {
|
||||
$.fn.mmEmulateTransitionEnd = transitionEndEmulator; // eslint-disable-line no-param-reassign
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
||||
}
|
||||
|
||||
setTransitionEndSupport();
|
||||
|
||||
return Util;
|
||||
})($);
|
||||
|
||||
const NAME = 'metisMenu';
|
||||
const DATA_KEY = 'metisMenu';
|
||||
const EVENT_KEY = `.${DATA_KEY}`;
|
||||
const DATA_API_KEY = '.data-api';
|
||||
const JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
const TRANSITION_DURATION = 350;
|
||||
|
||||
const Default = {
|
||||
toggle: true,
|
||||
preventDefault: true,
|
||||
triggerElement: 'a',
|
||||
parentTrigger: 'li',
|
||||
subMenu: 'ul',
|
||||
};
|
||||
|
||||
const Event = {
|
||||
SHOW: `show${EVENT_KEY}`,
|
||||
SHOWN: `shown${EVENT_KEY}`,
|
||||
HIDE: `hide${EVENT_KEY}`,
|
||||
HIDDEN: `hidden${EVENT_KEY}`,
|
||||
CLICK_DATA_API: `click${EVENT_KEY}${DATA_API_KEY}`,
|
||||
};
|
||||
|
||||
const ClassName = {
|
||||
METIS: 'metismenu',
|
||||
ACTIVE: 'mm-active',
|
||||
SHOW: 'mm-show',
|
||||
COLLAPSE: 'mm-collapse',
|
||||
COLLAPSING: 'mm-collapsing',
|
||||
COLLAPSED: 'mm-collapsed',
|
||||
};
|
||||
|
||||
class MetisMenu {
|
||||
// eslint-disable-line no-shadow
|
||||
constructor(element, config) {
|
||||
this.element = element;
|
||||
this.config = {
|
||||
...Default,
|
||||
...config,
|
||||
};
|
||||
this.transitioning = null;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
init() {
|
||||
const self = this;
|
||||
const conf = this.config;
|
||||
const el = $(this.element);
|
||||
|
||||
el.addClass(ClassName.METIS); // add metismenu class to element
|
||||
|
||||
el.find(`${conf.parentTrigger}.${ClassName.ACTIVE}`)
|
||||
.children(conf.triggerElement)
|
||||
.attr('aria-expanded', 'true'); // add attribute aria-expanded=true the trigger element
|
||||
|
||||
el.find(`${conf.parentTrigger}.${ClassName.ACTIVE}`)
|
||||
.parents(conf.parentTrigger)
|
||||
.addClass(ClassName.ACTIVE);
|
||||
|
||||
el.find(`${conf.parentTrigger}.${ClassName.ACTIVE}`)
|
||||
.parents(conf.parentTrigger)
|
||||
.children(conf.triggerElement)
|
||||
.attr('aria-expanded', 'true'); // add attribute aria-expanded=true the triggers of all parents
|
||||
|
||||
el.find(`${conf.parentTrigger}.${ClassName.ACTIVE}`)
|
||||
.has(conf.subMenu)
|
||||
.children(conf.subMenu)
|
||||
.addClass(`${ClassName.COLLAPSE} ${ClassName.SHOW}`);
|
||||
|
||||
el
|
||||
.find(conf.parentTrigger)
|
||||
.not(`.${ClassName.ACTIVE}`)
|
||||
.has(conf.subMenu)
|
||||
.children(conf.subMenu)
|
||||
.addClass(ClassName.COLLAPSE);
|
||||
|
||||
el
|
||||
.find(conf.parentTrigger)
|
||||
// .has(conf.subMenu)
|
||||
.children(conf.triggerElement)
|
||||
.on(Event.CLICK_DATA_API, function (e) { // eslint-disable-line func-names
|
||||
const eTar = $(this);
|
||||
|
||||
if (eTar.attr('aria-disabled') === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (conf.preventDefault && eTar.attr('href') === '#') {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
const paRent = eTar.parent(conf.parentTrigger);
|
||||
const sibLi = paRent.siblings(conf.parentTrigger);
|
||||
const sibTrigger = sibLi.children(conf.triggerElement);
|
||||
|
||||
if (paRent.hasClass(ClassName.ACTIVE)) {
|
||||
eTar.attr('aria-expanded', 'false');
|
||||
self.removeActive(paRent);
|
||||
} else {
|
||||
eTar.attr('aria-expanded', 'true');
|
||||
self.setActive(paRent);
|
||||
if (conf.toggle) {
|
||||
self.removeActive(sibLi);
|
||||
sibTrigger.attr('aria-expanded', 'false');
|
||||
}
|
||||
}
|
||||
|
||||
if (conf.onTransitionStart) {
|
||||
conf.onTransitionStart(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setActive(li) {
|
||||
$(li).addClass(ClassName.ACTIVE);
|
||||
const ul = $(li).children(this.config.subMenu);
|
||||
if (ul.length > 0 && !ul.hasClass(ClassName.SHOW)) {
|
||||
this.show(ul);
|
||||
}
|
||||
}
|
||||
|
||||
removeActive(li) {
|
||||
$(li).removeClass(ClassName.ACTIVE);
|
||||
const ul = $(li).children(`${this.config.subMenu}.${ClassName.SHOW}`);
|
||||
if (ul.length > 0) {
|
||||
this.hide(ul);
|
||||
}
|
||||
}
|
||||
|
||||
show(element) {
|
||||
if (this.transitioning || $(element).hasClass(ClassName.COLLAPSING)) {
|
||||
return;
|
||||
}
|
||||
const elem = $(element);
|
||||
|
||||
const startEvent = $.Event(Event.SHOW);
|
||||
elem.trigger(startEvent);
|
||||
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
elem.parent(this.config.parentTrigger).addClass(ClassName.ACTIVE);
|
||||
|
||||
if (this.config.toggle) {
|
||||
const toggleElem = elem.parent(this.config.parentTrigger).siblings().children(`${this.config.subMenu}.${ClassName.SHOW}`);
|
||||
this.hide(toggleElem);
|
||||
}
|
||||
|
||||
elem
|
||||
.removeClass(ClassName.COLLAPSE)
|
||||
.addClass(ClassName.COLLAPSING)
|
||||
.height(0);
|
||||
|
||||
this.setTransitioning(true);
|
||||
|
||||
const complete = () => {
|
||||
// check if disposed
|
||||
if (!this.config || !this.element) {
|
||||
return;
|
||||
}
|
||||
elem
|
||||
.removeClass(ClassName.COLLAPSING)
|
||||
.addClass(`${ClassName.COLLAPSE} ${ClassName.SHOW}`)
|
||||
.height('');
|
||||
|
||||
this.setTransitioning(false);
|
||||
|
||||
elem.trigger(Event.SHOWN);
|
||||
};
|
||||
|
||||
elem
|
||||
.height(element[0].scrollHeight)
|
||||
.one(Util.TRANSITION_END, complete)
|
||||
.mmEmulateTransitionEnd(TRANSITION_DURATION);
|
||||
}
|
||||
|
||||
hide(element) {
|
||||
if (
|
||||
this.transitioning || !$(element).hasClass(ClassName.SHOW)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const elem = $(element);
|
||||
|
||||
const startEvent = $.Event(Event.HIDE);
|
||||
elem.trigger(startEvent);
|
||||
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
elem.parent(this.config.parentTrigger).removeClass(ClassName.ACTIVE);
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
elem.height(elem.height())[0].offsetHeight;
|
||||
|
||||
elem
|
||||
.addClass(ClassName.COLLAPSING)
|
||||
.removeClass(ClassName.COLLAPSE)
|
||||
.removeClass(ClassName.SHOW);
|
||||
|
||||
this.setTransitioning(true);
|
||||
|
||||
const complete = () => {
|
||||
// check if disposed
|
||||
if (!this.config || !this.element) {
|
||||
return;
|
||||
}
|
||||
if (this.transitioning && this.config.onTransitionEnd) {
|
||||
this.config.onTransitionEnd();
|
||||
}
|
||||
|
||||
this.setTransitioning(false);
|
||||
elem.trigger(Event.HIDDEN);
|
||||
|
||||
elem
|
||||
.removeClass(ClassName.COLLAPSING)
|
||||
.addClass(ClassName.COLLAPSE);
|
||||
};
|
||||
|
||||
if (elem.height() === 0 || elem.css('display') === 'none') {
|
||||
complete();
|
||||
} else {
|
||||
elem
|
||||
.height(0)
|
||||
.one(Util.TRANSITION_END, complete)
|
||||
.mmEmulateTransitionEnd(TRANSITION_DURATION);
|
||||
}
|
||||
}
|
||||
|
||||
setTransitioning(isTransitioning) {
|
||||
this.transitioning = isTransitioning;
|
||||
}
|
||||
|
||||
dispose() {
|
||||
$.removeData(this.element, DATA_KEY);
|
||||
|
||||
$(this.element)
|
||||
.find(this.config.parentTrigger)
|
||||
// .has(this.config.subMenu)
|
||||
.children(this.config.triggerElement)
|
||||
.off(Event.CLICK_DATA_API);
|
||||
|
||||
this.transitioning = null;
|
||||
this.config = null;
|
||||
this.element = null;
|
||||
}
|
||||
|
||||
static jQueryInterface(config) {
|
||||
// eslint-disable-next-line func-names
|
||||
return this.each(function () {
|
||||
const $this = $(this);
|
||||
let data = $this.data(DATA_KEY);
|
||||
const conf = {
|
||||
...Default,
|
||||
...$this.data(),
|
||||
...(typeof config === 'object' && config ? config : {}),
|
||||
};
|
||||
|
||||
if (!data) {
|
||||
data = new MetisMenu(this, conf);
|
||||
$this.data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
if (data[config] === undefined) {
|
||||
throw new Error(`No method named "${config}"`);
|
||||
}
|
||||
data[config]();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = MetisMenu.jQueryInterface; // eslint-disable-line no-param-reassign
|
||||
$.fn[NAME].Constructor = MetisMenu; // eslint-disable-line no-param-reassign
|
||||
$.fn[NAME].noConflict = () => {
|
||||
// eslint-disable-line no-param-reassign
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT; // eslint-disable-line no-param-reassign
|
||||
return MetisMenu.jQueryInterface;
|
||||
};
|
||||
|
||||
export default MetisMenu;
|
||||
//# sourceMappingURL=metisMenu.esm.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
|
||||
/*!
|
||||
* metismenu https://github.com/onokumus/metismenu#readme
|
||||
* A collapsible jQuery menu plugin
|
||||
* @version 3.0.7
|
||||
* @author Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
|
||||
* @license: MIT
|
||||
*/
|
||||
import $ from"jquery";const Util=(e=>{const t="transitionend",s={TRANSITION_END:"mmTransitionEnd",triggerTransitionEnd(s){e(s).trigger(t)},supportsTransitionEnd:()=>Boolean(t)};function n(t){let n=!1;return e(this).one(s.TRANSITION_END,(()=>{n=!0})),setTimeout((()=>{n||s.triggerTransitionEnd(this)}),t),this}return e.fn.mmEmulateTransitionEnd=n,e.event.special[s.TRANSITION_END]={bindType:t,delegateType:t,handle(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}},s})($),NAME="metisMenu",DATA_KEY="metisMenu",EVENT_KEY=".metisMenu",DATA_API_KEY=".data-api",JQUERY_NO_CONFLICT=$.fn[NAME],TRANSITION_DURATION=350,Default={toggle:!0,preventDefault:!0,triggerElement:"a",parentTrigger:"li",subMenu:"ul"},Event={SHOW:"show.metisMenu",SHOWN:"shown.metisMenu",HIDE:"hide.metisMenu",HIDDEN:"hidden.metisMenu",CLICK_DATA_API:"click.metisMenu.data-api"},ClassName={METIS:"metismenu",ACTIVE:"mm-active",SHOW:"mm-show",COLLAPSE:"mm-collapse",COLLAPSING:"mm-collapsing",COLLAPSED:"mm-collapsed"};class MetisMenu{constructor(e,t){this.element=e,this.config={...Default,...t},this.transitioning=null,this.init()}init(){const e=this,t=this.config,s=$(this.element);s.addClass(ClassName.METIS),s.find(`${t.parentTrigger}.${ClassName.ACTIVE}`).children(t.triggerElement).attr("aria-expanded","true"),s.find(`${t.parentTrigger}.${ClassName.ACTIVE}`).parents(t.parentTrigger).addClass(ClassName.ACTIVE),s.find(`${t.parentTrigger}.${ClassName.ACTIVE}`).parents(t.parentTrigger).children(t.triggerElement).attr("aria-expanded","true"),s.find(`${t.parentTrigger}.${ClassName.ACTIVE}`).has(t.subMenu).children(t.subMenu).addClass(`${ClassName.COLLAPSE} ${ClassName.SHOW}`),s.find(t.parentTrigger).not(`.${ClassName.ACTIVE}`).has(t.subMenu).children(t.subMenu).addClass(ClassName.COLLAPSE),s.find(t.parentTrigger).children(t.triggerElement).on(Event.CLICK_DATA_API,(function(s){const n=$(this);if("true"===n.attr("aria-disabled"))return;t.preventDefault&&"#"===n.attr("href")&&s.preventDefault();const i=n.parent(t.parentTrigger),a=i.siblings(t.parentTrigger),r=a.children(t.triggerElement);i.hasClass(ClassName.ACTIVE)?(n.attr("aria-expanded","false"),e.removeActive(i)):(n.attr("aria-expanded","true"),e.setActive(i),t.toggle&&(e.removeActive(a),r.attr("aria-expanded","false"))),t.onTransitionStart&&t.onTransitionStart(s)}))}setActive(e){$(e).addClass(ClassName.ACTIVE);const t=$(e).children(this.config.subMenu);t.length>0&&!t.hasClass(ClassName.SHOW)&&this.show(t)}removeActive(e){$(e).removeClass(ClassName.ACTIVE);const t=$(e).children(`${this.config.subMenu}.${ClassName.SHOW}`);t.length>0&&this.hide(t)}show(e){if(this.transitioning||$(e).hasClass(ClassName.COLLAPSING))return;const t=$(e),s=$.Event(Event.SHOW);if(t.trigger(s),s.isDefaultPrevented())return;if(t.parent(this.config.parentTrigger).addClass(ClassName.ACTIVE),this.config.toggle){const e=t.parent(this.config.parentTrigger).siblings().children(`${this.config.subMenu}.${ClassName.SHOW}`);this.hide(e)}t.removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING).height(0),this.setTransitioning(!0);t.height(e[0].scrollHeight).one(Util.TRANSITION_END,(()=>{this.config&&this.element&&(t.removeClass(ClassName.COLLAPSING).addClass(`${ClassName.COLLAPSE} ${ClassName.SHOW}`).height(""),this.setTransitioning(!1),t.trigger(Event.SHOWN))})).mmEmulateTransitionEnd(350)}hide(e){if(this.transitioning||!$(e).hasClass(ClassName.SHOW))return;const t=$(e),s=$.Event(Event.HIDE);if(t.trigger(s),s.isDefaultPrevented())return;t.parent(this.config.parentTrigger).removeClass(ClassName.ACTIVE),t.height(t.height())[0].offsetHeight,t.addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW),this.setTransitioning(!0);const n=()=>{this.config&&this.element&&(this.transitioning&&this.config.onTransitionEnd&&this.config.onTransitionEnd(),this.setTransitioning(!1),t.trigger(Event.HIDDEN),t.removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE))};0===t.height()||"none"===t.css("display")?n():t.height(0).one(Util.TRANSITION_END,n).mmEmulateTransitionEnd(350)}setTransitioning(e){this.transitioning=e}dispose(){$.removeData(this.element,DATA_KEY),$(this.element).find(this.config.parentTrigger).children(this.config.triggerElement).off(Event.CLICK_DATA_API),this.transitioning=null,this.config=null,this.element=null}static jQueryInterface(e){return this.each((function(){const t=$(this);let s=t.data(DATA_KEY);const n={...Default,...t.data(),..."object"==typeof e&&e?e:{}};if(s||(s=new MetisMenu(this,n),t.data(DATA_KEY,s)),"string"==typeof e){if(void 0===s[e])throw new Error(`No method named "${e}"`);s[e]()}}))}}$.fn[NAME]=MetisMenu.jQueryInterface,$.fn[NAME].Constructor=MetisMenu,$.fn[NAME].noConflict=()=>($.fn[NAME]=JQUERY_NO_CONFLICT,MetisMenu.jQueryInterface);export default MetisMenu;
|
||||
//# sourceMappingURL=metisMenu.esm.min.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,103 +1,61 @@
|
||||
/*
|
||||
* metismenu - v2.7.4
|
||||
* A jQuery menu plugin
|
||||
* https://github.com/onokumus/metismenu#readme
|
||||
*
|
||||
* Made by Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
|
||||
* Under MIT License
|
||||
*/
|
||||
|
||||
/*!
|
||||
* metismenu https://github.com/onokumus/metismenu#readme
|
||||
* A collapsible jQuery menu plugin
|
||||
* @version 3.0.7
|
||||
* @author Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
|
||||
* @license: MIT
|
||||
*/
|
||||
(function (global, factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports !== "undefined") {
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
var mod = {
|
||||
exports: {}
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
||||
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.metisMenu = factory(global.$));
|
||||
}(this, (function ($) { 'use strict';
|
||||
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||
|
||||
const Util = (($) => { // eslint-disable-line no-shadow
|
||||
const TRANSITION_END = 'transitionend';
|
||||
|
||||
const Util = { // eslint-disable-line no-shadow
|
||||
TRANSITION_END: 'mmTransitionEnd',
|
||||
|
||||
triggerTransitionEnd(element) {
|
||||
$(element).trigger(TRANSITION_END);
|
||||
},
|
||||
|
||||
supportsTransitionEnd() {
|
||||
return Boolean(TRANSITION_END);
|
||||
},
|
||||
};
|
||||
factory(global.jQuery);
|
||||
global.metisMenu = mod.exports;
|
||||
}
|
||||
})(this, function (_jquery) {
|
||||
'use strict';
|
||||
|
||||
var _jquery2 = _interopRequireDefault(_jquery);
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
|
||||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
|
||||
return typeof obj;
|
||||
} : function (obj) {
|
||||
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
||||
};
|
||||
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
}
|
||||
|
||||
var _createClass = function () {
|
||||
function defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
return function (Constructor, protoProps, staticProps) {
|
||||
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
};
|
||||
}();
|
||||
|
||||
var Util = function ($) {
|
||||
var transition = false;
|
||||
|
||||
function getSpecialTransitionEndEvent() {
|
||||
return {
|
||||
bindType: transition.end,
|
||||
delegateType: transition.end,
|
||||
handle: function handle(event) {
|
||||
bindType: TRANSITION_END,
|
||||
delegateType: TRANSITION_END,
|
||||
handle(event) {
|
||||
if ($(event.target).is(this)) {
|
||||
return event.handleObj.handler.apply(this, arguments);
|
||||
return event
|
||||
.handleObj
|
||||
.handler
|
||||
.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function transitionEndTest() {
|
||||
if (typeof window !== 'undefined' && window.QUnit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
end: 'transitionend'
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function transitionEndEmulator(duration) {
|
||||
var _this2 = this;
|
||||
let called = false;
|
||||
|
||||
var called = false;
|
||||
|
||||
$(this).one(Util.TRANSITION_END, function () {
|
||||
$(this).one(Util.TRANSITION_END, () => {
|
||||
called = true;
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
setTimeout(() => {
|
||||
if (!called) {
|
||||
Util.triggerTransitionEnd(_this2);
|
||||
Util.triggerTransitionEnd(this);
|
||||
}
|
||||
}, duration);
|
||||
|
||||
@@ -105,260 +63,306 @@
|
||||
}
|
||||
|
||||
function setTransitionEndSupport() {
|
||||
transition = transitionEndTest();
|
||||
$.fn.mmEmulateTransitionEnd = transitionEndEmulator;
|
||||
|
||||
if (Util.supportsTransitionEnd()) {
|
||||
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
||||
}
|
||||
$.fn.mmEmulateTransitionEnd = transitionEndEmulator; // eslint-disable-line no-param-reassign
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
||||
}
|
||||
|
||||
var Util = {
|
||||
TRANSITION_END: 'mmTransitionEnd',
|
||||
|
||||
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
||||
$(element).trigger(transition.end);
|
||||
},
|
||||
supportsTransitionEnd: function supportsTransitionEnd() {
|
||||
return Boolean(transition);
|
||||
}
|
||||
};
|
||||
|
||||
setTransitionEndSupport();
|
||||
|
||||
return Util;
|
||||
}(_jquery2.default);
|
||||
})($__default['default']);
|
||||
|
||||
var MetisMenu = function ($) {
|
||||
const NAME = 'metisMenu';
|
||||
const DATA_KEY = 'metisMenu';
|
||||
const EVENT_KEY = `.${DATA_KEY}`;
|
||||
const DATA_API_KEY = '.data-api';
|
||||
const JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||
const TRANSITION_DURATION = 350;
|
||||
|
||||
var NAME = 'metisMenu';
|
||||
var DATA_KEY = 'metisMenu';
|
||||
var EVENT_KEY = '.' + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
var TRANSITION_DURATION = 350;
|
||||
const Default = {
|
||||
toggle: true,
|
||||
preventDefault: true,
|
||||
triggerElement: 'a',
|
||||
parentTrigger: 'li',
|
||||
subMenu: 'ul',
|
||||
};
|
||||
|
||||
var Default = {
|
||||
toggle: true,
|
||||
preventDefault: true,
|
||||
activeClass: 'active',
|
||||
collapseClass: 'collapse',
|
||||
collapseInClass: 'in',
|
||||
collapsingClass: 'collapsing',
|
||||
triggerElement: 'a',
|
||||
parentTrigger: 'li',
|
||||
subMenu: 'ul'
|
||||
};
|
||||
const Event = {
|
||||
SHOW: `show${EVENT_KEY}`,
|
||||
SHOWN: `shown${EVENT_KEY}`,
|
||||
HIDE: `hide${EVENT_KEY}`,
|
||||
HIDDEN: `hidden${EVENT_KEY}`,
|
||||
CLICK_DATA_API: `click${EVENT_KEY}${DATA_API_KEY}`,
|
||||
};
|
||||
|
||||
var Event = {
|
||||
SHOW: 'show' + EVENT_KEY,
|
||||
SHOWN: 'shown' + EVENT_KEY,
|
||||
HIDE: 'hide' + EVENT_KEY,
|
||||
HIDDEN: 'hidden' + EVENT_KEY,
|
||||
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
|
||||
};
|
||||
const ClassName = {
|
||||
METIS: 'metismenu',
|
||||
ACTIVE: 'mm-active',
|
||||
SHOW: 'mm-show',
|
||||
COLLAPSE: 'mm-collapse',
|
||||
COLLAPSING: 'mm-collapsing',
|
||||
COLLAPSED: 'mm-collapsed',
|
||||
};
|
||||
|
||||
var MetisMenu = function () {
|
||||
function MetisMenu(element, config) {
|
||||
_classCallCheck(this, MetisMenu);
|
||||
class MetisMenu {
|
||||
// eslint-disable-line no-shadow
|
||||
constructor(element, config) {
|
||||
this.element = element;
|
||||
this.config = {
|
||||
...Default,
|
||||
...config,
|
||||
};
|
||||
this.transitioning = null;
|
||||
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
this._transitioning = null;
|
||||
this.init();
|
||||
}
|
||||
|
||||
this.init();
|
||||
init() {
|
||||
const self = this;
|
||||
const conf = this.config;
|
||||
const el = $__default['default'](this.element);
|
||||
|
||||
el.addClass(ClassName.METIS); // add metismenu class to element
|
||||
|
||||
el.find(`${conf.parentTrigger}.${ClassName.ACTIVE}`)
|
||||
.children(conf.triggerElement)
|
||||
.attr('aria-expanded', 'true'); // add attribute aria-expanded=true the trigger element
|
||||
|
||||
el.find(`${conf.parentTrigger}.${ClassName.ACTIVE}`)
|
||||
.parents(conf.parentTrigger)
|
||||
.addClass(ClassName.ACTIVE);
|
||||
|
||||
el.find(`${conf.parentTrigger}.${ClassName.ACTIVE}`)
|
||||
.parents(conf.parentTrigger)
|
||||
.children(conf.triggerElement)
|
||||
.attr('aria-expanded', 'true'); // add attribute aria-expanded=true the triggers of all parents
|
||||
|
||||
el.find(`${conf.parentTrigger}.${ClassName.ACTIVE}`)
|
||||
.has(conf.subMenu)
|
||||
.children(conf.subMenu)
|
||||
.addClass(`${ClassName.COLLAPSE} ${ClassName.SHOW}`);
|
||||
|
||||
el
|
||||
.find(conf.parentTrigger)
|
||||
.not(`.${ClassName.ACTIVE}`)
|
||||
.has(conf.subMenu)
|
||||
.children(conf.subMenu)
|
||||
.addClass(ClassName.COLLAPSE);
|
||||
|
||||
el
|
||||
.find(conf.parentTrigger)
|
||||
// .has(conf.subMenu)
|
||||
.children(conf.triggerElement)
|
||||
.on(Event.CLICK_DATA_API, function (e) { // eslint-disable-line func-names
|
||||
const eTar = $__default['default'](this);
|
||||
|
||||
if (eTar.attr('aria-disabled') === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (conf.preventDefault && eTar.attr('href') === '#') {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
const paRent = eTar.parent(conf.parentTrigger);
|
||||
const sibLi = paRent.siblings(conf.parentTrigger);
|
||||
const sibTrigger = sibLi.children(conf.triggerElement);
|
||||
|
||||
if (paRent.hasClass(ClassName.ACTIVE)) {
|
||||
eTar.attr('aria-expanded', 'false');
|
||||
self.removeActive(paRent);
|
||||
} else {
|
||||
eTar.attr('aria-expanded', 'true');
|
||||
self.setActive(paRent);
|
||||
if (conf.toggle) {
|
||||
self.removeActive(sibLi);
|
||||
sibTrigger.attr('aria-expanded', 'false');
|
||||
}
|
||||
}
|
||||
|
||||
if (conf.onTransitionStart) {
|
||||
conf.onTransitionStart(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setActive(li) {
|
||||
$__default['default'](li).addClass(ClassName.ACTIVE);
|
||||
const ul = $__default['default'](li).children(this.config.subMenu);
|
||||
if (ul.length > 0 && !ul.hasClass(ClassName.SHOW)) {
|
||||
this.show(ul);
|
||||
}
|
||||
}
|
||||
|
||||
removeActive(li) {
|
||||
$__default['default'](li).removeClass(ClassName.ACTIVE);
|
||||
const ul = $__default['default'](li).children(`${this.config.subMenu}.${ClassName.SHOW}`);
|
||||
if (ul.length > 0) {
|
||||
this.hide(ul);
|
||||
}
|
||||
}
|
||||
|
||||
show(element) {
|
||||
if (this.transitioning || $__default['default'](element).hasClass(ClassName.COLLAPSING)) {
|
||||
return;
|
||||
}
|
||||
const elem = $__default['default'](element);
|
||||
|
||||
const startEvent = $__default['default'].Event(Event.SHOW);
|
||||
elem.trigger(startEvent);
|
||||
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_createClass(MetisMenu, [{
|
||||
key: 'init',
|
||||
value: function init() {
|
||||
var self = this;
|
||||
$(this._element).find(this._config.parentTrigger + '.' + this._config.activeClass).has(this._config.subMenu).children(this._config.subMenu).attr('aria-expanded', true).addClass(this._config.collapseClass + ' ' + this._config.collapseInClass);
|
||||
elem.parent(this.config.parentTrigger).addClass(ClassName.ACTIVE);
|
||||
|
||||
$(this._element).find(this._config.parentTrigger).not('.' + this._config.activeClass).has(this._config.subMenu).children(this._config.subMenu).attr('aria-expanded', false).addClass(this._config.collapseClass);
|
||||
if (this.config.toggle) {
|
||||
const toggleElem = elem.parent(this.config.parentTrigger).siblings().children(`${this.config.subMenu}.${ClassName.SHOW}`);
|
||||
this.hide(toggleElem);
|
||||
}
|
||||
|
||||
$(this._element).find(this._config.parentTrigger).has(this._config.subMenu).children(this._config.triggerElement).on(Event.CLICK_DATA_API, function (e) {
|
||||
var _this = $(this);
|
||||
var _parent = _this.parent(self._config.parentTrigger);
|
||||
var _siblings = _parent.siblings(self._config.parentTrigger).children(self._config.triggerElement);
|
||||
var _list = _parent.children(self._config.subMenu);
|
||||
if (self._config.preventDefault) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (_this.attr('aria-disabled') === 'true') {
|
||||
return;
|
||||
}
|
||||
if (_parent.hasClass(self._config.activeClass)) {
|
||||
_this.attr('aria-expanded', false);
|
||||
self._hide(_list);
|
||||
} else {
|
||||
self._show(_list);
|
||||
_this.attr('aria-expanded', true);
|
||||
if (self._config.toggle) {
|
||||
_siblings.attr('aria-expanded', false);
|
||||
}
|
||||
}
|
||||
elem
|
||||
.removeClass(ClassName.COLLAPSE)
|
||||
.addClass(ClassName.COLLAPSING)
|
||||
.height(0);
|
||||
|
||||
if (self._config.onTransitionStart) {
|
||||
self._config.onTransitionStart(e);
|
||||
}
|
||||
});
|
||||
this.setTransitioning(true);
|
||||
|
||||
const complete = () => {
|
||||
// check if disposed
|
||||
if (!this.config || !this.element) {
|
||||
return;
|
||||
}
|
||||
}, {
|
||||
key: '_show',
|
||||
value: function _show(element) {
|
||||
if (this._transitioning || $(element).hasClass(this._config.collapsingClass)) {
|
||||
return;
|
||||
}
|
||||
var _this = this;
|
||||
var _el = $(element);
|
||||
elem
|
||||
.removeClass(ClassName.COLLAPSING)
|
||||
.addClass(`${ClassName.COLLAPSE} ${ClassName.SHOW}`)
|
||||
.height('');
|
||||
|
||||
var startEvent = $.Event(Event.SHOW);
|
||||
_el.trigger(startEvent);
|
||||
this.setTransitioning(false);
|
||||
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
elem.trigger(Event.SHOWN);
|
||||
};
|
||||
|
||||
_el.parent(this._config.parentTrigger).addClass(this._config.activeClass);
|
||||
elem
|
||||
.height(element[0].scrollHeight)
|
||||
.one(Util.TRANSITION_END, complete)
|
||||
.mmEmulateTransitionEnd(TRANSITION_DURATION);
|
||||
}
|
||||
|
||||
if (this._config.toggle) {
|
||||
this._hide(_el.parent(this._config.parentTrigger).siblings().children(this._config.subMenu + '.' + this._config.collapseInClass).attr('aria-expanded', false));
|
||||
}
|
||||
hide(element) {
|
||||
if (
|
||||
this.transitioning || !$__default['default'](element).hasClass(ClassName.SHOW)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
_el.removeClass(this._config.collapseClass).addClass(this._config.collapsingClass).height(0);
|
||||
const elem = $__default['default'](element);
|
||||
|
||||
this.setTransitioning(true);
|
||||
const startEvent = $__default['default'].Event(Event.HIDE);
|
||||
elem.trigger(startEvent);
|
||||
|
||||
var complete = function complete() {
|
||||
// check if disposed
|
||||
if (!_this._config || !_this._element) {
|
||||
return;
|
||||
}
|
||||
_el.removeClass(_this._config.collapsingClass).addClass(_this._config.collapseClass + ' ' + _this._config.collapseInClass).height('').attr('aria-expanded', true);
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this.setTransitioning(false);
|
||||
elem.parent(this.config.parentTrigger).removeClass(ClassName.ACTIVE);
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
elem.height(elem.height())[0].offsetHeight;
|
||||
|
||||
_el.trigger(Event.SHOWN);
|
||||
};
|
||||
elem
|
||||
.addClass(ClassName.COLLAPSING)
|
||||
.removeClass(ClassName.COLLAPSE)
|
||||
.removeClass(ClassName.SHOW);
|
||||
|
||||
if (!Util.supportsTransitionEnd()) {
|
||||
complete();
|
||||
return;
|
||||
}
|
||||
this.setTransitioning(true);
|
||||
|
||||
_el.height(_el[0].scrollHeight).one(Util.TRANSITION_END, complete).mmEmulateTransitionEnd(TRANSITION_DURATION);
|
||||
const complete = () => {
|
||||
// check if disposed
|
||||
if (!this.config || !this.element) {
|
||||
return;
|
||||
}
|
||||
if (this.transitioning && this.config.onTransitionEnd) {
|
||||
this.config.onTransitionEnd();
|
||||
}
|
||||
}, {
|
||||
key: '_hide',
|
||||
value: function _hide(element) {
|
||||
|
||||
if (this._transitioning || !$(element).hasClass(this._config.collapseInClass)) {
|
||||
return;
|
||||
this.setTransitioning(false);
|
||||
elem.trigger(Event.HIDDEN);
|
||||
|
||||
elem
|
||||
.removeClass(ClassName.COLLAPSING)
|
||||
.addClass(ClassName.COLLAPSE);
|
||||
};
|
||||
|
||||
if (elem.height() === 0 || elem.css('display') === 'none') {
|
||||
complete();
|
||||
} else {
|
||||
elem
|
||||
.height(0)
|
||||
.one(Util.TRANSITION_END, complete)
|
||||
.mmEmulateTransitionEnd(TRANSITION_DURATION);
|
||||
}
|
||||
}
|
||||
|
||||
setTransitioning(isTransitioning) {
|
||||
this.transitioning = isTransitioning;
|
||||
}
|
||||
|
||||
dispose() {
|
||||
$__default['default'].removeData(this.element, DATA_KEY);
|
||||
|
||||
$__default['default'](this.element)
|
||||
.find(this.config.parentTrigger)
|
||||
// .has(this.config.subMenu)
|
||||
.children(this.config.triggerElement)
|
||||
.off(Event.CLICK_DATA_API);
|
||||
|
||||
this.transitioning = null;
|
||||
this.config = null;
|
||||
this.element = null;
|
||||
}
|
||||
|
||||
static jQueryInterface(config) {
|
||||
// eslint-disable-next-line func-names
|
||||
return this.each(function () {
|
||||
const $this = $__default['default'](this);
|
||||
let data = $this.data(DATA_KEY);
|
||||
const conf = {
|
||||
...Default,
|
||||
...$this.data(),
|
||||
...(typeof config === 'object' && config ? config : {}),
|
||||
};
|
||||
|
||||
if (!data) {
|
||||
data = new MetisMenu(this, conf);
|
||||
$this.data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
if (data[config] === undefined) {
|
||||
throw new Error(`No method named "${config}"`);
|
||||
}
|
||||
var _this = this;
|
||||
var _el = $(element);
|
||||
|
||||
var startEvent = $.Event(Event.HIDE);
|
||||
_el.trigger(startEvent);
|
||||
|
||||
if (startEvent.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_el.parent(this._config.parentTrigger).removeClass(this._config.activeClass);
|
||||
_el.height(_el.height())[0].offsetHeight;
|
||||
|
||||
_el.addClass(this._config.collapsingClass).removeClass(this._config.collapseClass).removeClass(this._config.collapseInClass);
|
||||
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
// check if disposed
|
||||
if (!_this._config || !_this._element) {
|
||||
return;
|
||||
}
|
||||
if (_this._transitioning && _this._config.onTransitionEnd) {
|
||||
_this._config.onTransitionEnd();
|
||||
}
|
||||
|
||||
_this.setTransitioning(false);
|
||||
_el.trigger(Event.HIDDEN);
|
||||
|
||||
_el.removeClass(_this._config.collapsingClass).addClass(_this._config.collapseClass).attr('aria-expanded', false);
|
||||
};
|
||||
|
||||
if (!Util.supportsTransitionEnd()) {
|
||||
complete();
|
||||
return;
|
||||
}
|
||||
|
||||
_el.height() == 0 || _el.css('display') == 'none' ? complete() : _el.height(0).one(Util.TRANSITION_END, complete).mmEmulateTransitionEnd(TRANSITION_DURATION);
|
||||
data[config]();
|
||||
}
|
||||
}, {
|
||||
key: 'setTransitioning',
|
||||
value: function setTransitioning(isTransitioning) {
|
||||
this._transitioning = isTransitioning;
|
||||
}
|
||||
}, {
|
||||
key: 'dispose',
|
||||
value: function dispose() {
|
||||
$.removeData(this._element, DATA_KEY);
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$(this._element).find(this._config.parentTrigger).has(this._config.subMenu).children(this._config.triggerElement).off('click');
|
||||
$__default['default'].fn[NAME] = MetisMenu.jQueryInterface; // eslint-disable-line no-param-reassign
|
||||
$__default['default'].fn[NAME].Constructor = MetisMenu; // eslint-disable-line no-param-reassign
|
||||
$__default['default'].fn[NAME].noConflict = () => {
|
||||
// eslint-disable-line no-param-reassign
|
||||
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT; // eslint-disable-line no-param-reassign
|
||||
return MetisMenu.jQueryInterface;
|
||||
};
|
||||
|
||||
this._transitioning = null;
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
}
|
||||
}, {
|
||||
key: '_getConfig',
|
||||
value: function _getConfig(config) {
|
||||
config = $.extend({}, Default, config);
|
||||
return config;
|
||||
}
|
||||
}], [{
|
||||
key: '_jQueryInterface',
|
||||
value: function _jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var data = $this.data(DATA_KEY);
|
||||
var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
|
||||
return MetisMenu;
|
||||
|
||||
if (!data && /dispose/.test(config)) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
data = new MetisMenu(this, _config);
|
||||
$this.data(DATA_KEY, data);
|
||||
}
|
||||
|
||||
if (typeof config === 'string') {
|
||||
if (data[config] === undefined) {
|
||||
throw new Error('No method named "' + config + '"');
|
||||
}
|
||||
data[config]();
|
||||
}
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return MetisMenu;
|
||||
}();
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$.fn[NAME] = MetisMenu._jQueryInterface;
|
||||
$.fn[NAME].Constructor = MetisMenu;
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return MetisMenu._jQueryInterface;
|
||||
};
|
||||
return MetisMenu;
|
||||
}(_jquery2.default);
|
||||
});
|
||||
})));
|
||||
//# sourceMappingURL=metisMenu.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* metismenu - v2.7.4
|
||||
* A jQuery menu plugin
|
||||
* https://github.com/onokumus/metismenu#readme
|
||||
*
|
||||
* Made by Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
|
||||
* Under MIT License
|
||||
*/
|
||||
|
||||
.metismenu .arrow{float:right;line-height:1.42857}[dir=rtl] .metismenu .arrow{float:left}.metismenu .glyphicon.arrow:before{content:"\e079"}.metismenu .active>a>.glyphicon.arrow:before{content:"\e114"}.metismenu .fa.arrow:before{content:"\f104"}.metismenu .active>a>.fa.arrow:before{content:"\f107"}.metismenu .ion.arrow:before{content:"\f3d2"}.metismenu .active>a>.ion.arrow:before{content:"\f3d0"}.metismenu .plus-times{float:right}[dir=rtl] .metismenu .plus-times{float:left}.metismenu .fa.plus-times:before{content:"\f067"}.metismenu .active>a>.fa.plus-times{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.metismenu .plus-minus{float:right}[dir=rtl] .metismenu .plus-minus{float:left}.metismenu .fa.plus-minus:before{content:"\f067"}.metismenu .active>a>.fa.plus-minus:before{content:"\f068"}.metismenu .collapse{display:none}.metismenu .collapse.in{display:block}.metismenu .collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.metismenu .has-arrow{position:relative}.metismenu .has-arrow:after{position:absolute;content:"";width:.5em;height:.5em;border-width:1px 0 0 1px;border-style:solid;border-color:initial;right:1em;-webkit-transform:rotate(-45deg) translateY(-50%);-ms-transform:rotate(-45deg) translateY(-50%);-o-transform:rotate(-45deg) translateY(-50%);transform:rotate(-45deg) translateY(-50%);-webkit-transform-origin:top;-ms-transform-origin:top;-o-transform-origin:top;transform-origin:top;top:50%;-webkit-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out}[dir=rtl] .metismenu .has-arrow:after{right:auto;left:1em;-webkit-transform:rotate(135deg) translateY(-50%);-ms-transform:rotate(135deg) translateY(-50%);-o-transform:rotate(135deg) translateY(-50%);transform:rotate(135deg) translateY(-50%)}.metismenu .active>.has-arrow:after,.metismenu .has-arrow[aria-expanded=true]:after{-webkit-transform:rotate(-135deg) translateY(-50%);-ms-transform:rotate(-135deg) translateY(-50%);-o-transform:rotate(-135deg) translateY(-50%);transform:rotate(-135deg) translateY(-50%)}
|
||||
/*!
|
||||
* metismenu https://github.com/onokumus/metismenu#readme
|
||||
* A collapsible jQuery menu plugin
|
||||
* @version 3.0.6
|
||||
* @author Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
|
||||
* @license: MIT
|
||||
*/.metismenu .arrow{float:right;line-height:1.42857}*[dir=rtl] .metismenu .arrow{float:left}.metismenu .glyphicon.arrow:before{content:""}.metismenu .mm-active>a>.glyphicon.arrow:before{content:""}.metismenu .fa.arrow:before{content:""}.metismenu .mm-active>a>.fa.arrow:before{content:""}.metismenu .ion.arrow:before{content:""}.metismenu .mm-active>a>.ion.arrow:before{content:""}.metismenu .plus-times{float:right}*[dir=rtl] .metismenu .plus-times{float:left}.metismenu .fa.plus-times:before{content:""}.metismenu .mm-active>a>.fa.plus-times{transform:rotate(45deg)}.metismenu .plus-minus{float:right}*[dir=rtl] .metismenu .plus-minus{float:left}.metismenu .fa.plus-minus:before{content:""}.metismenu .mm-active>a>.fa.plus-minus:before{content:""}.metismenu .mm-collapse:not(.mm-show){display:none}.metismenu .mm-collapsing{position:relative;height:0;overflow:hidden;transition-timing-function:ease;transition-duration:.35s;transition-property:height,visibility}.metismenu .has-arrow{position:relative}.metismenu .has-arrow::after{position:absolute;content:"";width:.5em;height:.5em;border-width:1px 0 0 1px;border-style:solid;border-color:initial;right:1em;transform:rotate(-45deg) translate(0, -50%);transform-origin:top;top:50%;transition:all .3s ease-out}*[dir=rtl] .metismenu .has-arrow::after{right:auto;left:1em;transform:rotate(135deg) translate(0, -50%)}.metismenu .mm-active>.has-arrow::after,.metismenu .has-arrow[aria-expanded=true]::after{transform:rotate(-135deg) translate(0, -50%)}*[dir=rtl] .metismenu .mm-active>.has-arrow::after,*[dir=rtl] .metismenu .has-arrow[aria-expanded=true]::after{transform:rotate(225deg) translate(0, -50%)}/*# sourceMappingURL=metisMenu.min.css.map */
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sourceRoot":"","sources":["../src/metisMenu.scss"],"names":[],"mappings":"CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,kBACE,YACA,oBAEF,6BACE,WAQF,mCACE,YAEF,gDACE,YAQF,4BACE,YAEF,yCACE,YAQF,6BACE,YAEF,0CACE,YAEF,uBACE,YAEF,kCACE,WAEF,iCACE,YAEF,uCACE,wBAEF,uBACE,YAEF,kCACE,WAEF,iCACE,YAEF,8CACE,YAEF,sCACE,aAGF,0BACE,kBACA,SACA,gBACA,gCACA,yBACA,sCAGF,sBACE,kBAGF,6BACE,kBACA,WACA,WACA,YACA,yBACA,mBACA,qBACA,UACA,4CACA,qBACA,QACA,4BAGF,wCACE,WACA,SACA,4CAGF,yFAEE,6CAGF,+GAEE","file":"metisMenu.min.css"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,484 +0,0 @@
|
||||
/*!
|
||||
* Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
|
||||
* Dual-licensed under the BSD or MIT licenses
|
||||
*/
|
||||
;(function($, window, document, undefined)
|
||||
{
|
||||
var hasTouch = 'ontouchstart' in document;
|
||||
|
||||
/**
|
||||
* Detect CSS pointer-events property
|
||||
* events are normally disabled on the dragging element to avoid conflicts
|
||||
* https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.js
|
||||
*/
|
||||
var hasPointerEvents = (function()
|
||||
{
|
||||
var el = document.createElement('div'),
|
||||
docEl = document.documentElement;
|
||||
if (!('pointerEvents' in el.style)) {
|
||||
return false;
|
||||
}
|
||||
el.style.pointerEvents = 'auto';
|
||||
el.style.pointerEvents = 'x';
|
||||
docEl.appendChild(el);
|
||||
var supports = window.getComputedStyle && window.getComputedStyle(el, '').pointerEvents === 'auto';
|
||||
docEl.removeChild(el);
|
||||
return !!supports;
|
||||
})();
|
||||
|
||||
var defaults = {
|
||||
listNodeName : 'ol',
|
||||
itemNodeName : 'li',
|
||||
rootClass : 'dd',
|
||||
listClass : 'dd-list',
|
||||
itemClass : 'dd-item',
|
||||
dragClass : 'dd-dragel',
|
||||
handleClass : 'dd-handle',
|
||||
collapsedClass : 'dd-collapsed',
|
||||
placeClass : 'dd-placeholder',
|
||||
noDragClass : 'dd-nodrag',
|
||||
emptyClass : 'dd-empty',
|
||||
expandBtnHTML : '<button data-action="expand" type="button">展开</button>',
|
||||
collapseBtnHTML : '<button data-action="collapse" type="button">关闭</button>',
|
||||
group : 0,
|
||||
maxDepth : 5,
|
||||
threshold : 20
|
||||
};
|
||||
|
||||
function Plugin(element, options)
|
||||
{
|
||||
this.w = $(document);
|
||||
this.el = $(element);
|
||||
this.options = $.extend({}, defaults, options);
|
||||
this.init();
|
||||
}
|
||||
|
||||
Plugin.prototype = {
|
||||
|
||||
init: function()
|
||||
{
|
||||
var list = this;
|
||||
|
||||
list.reset();
|
||||
|
||||
list.el.data('nestable-group', this.options.group);
|
||||
|
||||
list.placeEl = $('<div class="' + list.options.placeClass + '"/>');
|
||||
|
||||
$.each(this.el.find(list.options.itemNodeName), function(k, el) {
|
||||
list.setParent($(el));
|
||||
});
|
||||
|
||||
list.el.on('click', 'button', function(e) {
|
||||
if (list.dragEl) {
|
||||
return;
|
||||
}
|
||||
var target = $(e.currentTarget),
|
||||
action = target.data('action'),
|
||||
item = target.parent(list.options.itemNodeName);
|
||||
if (action === 'collapse') {
|
||||
list.collapseItem(item);
|
||||
}
|
||||
if (action === 'expand') {
|
||||
list.expandItem(item);
|
||||
}
|
||||
});
|
||||
|
||||
var onStartEvent = function(e)
|
||||
{
|
||||
var handle = $(e.target);
|
||||
if (!handle.hasClass(list.options.handleClass)) {
|
||||
if (handle.closest('.' + list.options.noDragClass).length) {
|
||||
return;
|
||||
}
|
||||
handle = handle.closest('.' + list.options.handleClass);
|
||||
}
|
||||
|
||||
if (!handle.length || list.dragEl) {
|
||||
return;
|
||||
}
|
||||
|
||||
list.isTouch = /^touch/.test(e.type);
|
||||
if (list.isTouch && e.touches.length !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
list.dragStart(e.touches ? e.touches[0] : e);
|
||||
};
|
||||
|
||||
var onMoveEvent = function(e)
|
||||
{
|
||||
if (list.dragEl) {
|
||||
e.preventDefault();
|
||||
list.dragMove(e.touches ? e.touches[0] : e);
|
||||
}
|
||||
};
|
||||
|
||||
var onEndEvent = function(e)
|
||||
{
|
||||
if (list.dragEl) {
|
||||
e.preventDefault();
|
||||
list.dragStop(e.touches ? e.touches[0] : e);
|
||||
}
|
||||
};
|
||||
|
||||
if (hasTouch) {
|
||||
list.el[0].addEventListener('touchstart', onStartEvent, false);
|
||||
window.addEventListener('touchmove', onMoveEvent, false);
|
||||
window.addEventListener('touchend', onEndEvent, false);
|
||||
window.addEventListener('touchcancel', onEndEvent, false);
|
||||
}
|
||||
|
||||
list.el.on('mousedown', onStartEvent);
|
||||
list.w.on('mousemove', onMoveEvent);
|
||||
list.w.on('mouseup', onEndEvent);
|
||||
|
||||
},
|
||||
|
||||
serialize: function()
|
||||
{
|
||||
var data,
|
||||
depth = 0,
|
||||
list = this;
|
||||
step = function(level, depth)
|
||||
{
|
||||
var array = [ ],
|
||||
items = level.children(list.options.itemNodeName);
|
||||
items.each(function()
|
||||
{
|
||||
var li = $(this),
|
||||
item = $.extend({}, li.data()),
|
||||
sub = li.children(list.options.listNodeName);
|
||||
if (sub.length) {
|
||||
item.children = step(sub, depth + 1);
|
||||
}
|
||||
array.push(item);
|
||||
});
|
||||
return array;
|
||||
};
|
||||
data = step(list.el.find(list.options.listNodeName).first(), depth);
|
||||
return data;
|
||||
},
|
||||
|
||||
serialise: function()
|
||||
{
|
||||
return this.serialize();
|
||||
},
|
||||
|
||||
reset: function()
|
||||
{
|
||||
this.mouse = {
|
||||
offsetX : 0,
|
||||
offsetY : 0,
|
||||
startX : 0,
|
||||
startY : 0,
|
||||
lastX : 0,
|
||||
lastY : 0,
|
||||
nowX : 0,
|
||||
nowY : 0,
|
||||
distX : 0,
|
||||
distY : 0,
|
||||
dirAx : 0,
|
||||
dirX : 0,
|
||||
dirY : 0,
|
||||
lastDirX : 0,
|
||||
lastDirY : 0,
|
||||
distAxX : 0,
|
||||
distAxY : 0
|
||||
};
|
||||
this.isTouch = false;
|
||||
this.moving = false;
|
||||
this.dragEl = null;
|
||||
this.dragRootEl = null;
|
||||
this.dragDepth = 0;
|
||||
this.hasNewRoot = false;
|
||||
this.pointEl = null;
|
||||
},
|
||||
|
||||
expandItem: function(li)
|
||||
{
|
||||
li.removeClass(this.options.collapsedClass);
|
||||
li.children('[data-action="expand"]').hide();
|
||||
li.children('[data-action="collapse"]').show();
|
||||
li.children(this.options.listNodeName).show();
|
||||
},
|
||||
|
||||
collapseItem: function(li)
|
||||
{
|
||||
var lists = li.children(this.options.listNodeName);
|
||||
if (lists.length) {
|
||||
li.addClass(this.options.collapsedClass);
|
||||
li.children('[data-action="collapse"]').hide();
|
||||
li.children('[data-action="expand"]').show();
|
||||
li.children(this.options.listNodeName).hide();
|
||||
}
|
||||
},
|
||||
|
||||
expandAll: function()
|
||||
{
|
||||
var list = this;
|
||||
list.el.find(list.options.itemNodeName).each(function() {
|
||||
list.expandItem($(this));
|
||||
});
|
||||
},
|
||||
|
||||
collapseAll: function()
|
||||
{
|
||||
var list = this;
|
||||
list.el.find(list.options.itemNodeName).each(function() {
|
||||
list.collapseItem($(this));
|
||||
});
|
||||
},
|
||||
|
||||
setParent: function(li)
|
||||
{
|
||||
if (li.children(this.options.listNodeName).length) {
|
||||
li.prepend($(this.options.expandBtnHTML));
|
||||
li.prepend($(this.options.collapseBtnHTML));
|
||||
}
|
||||
li.children('[data-action="expand"]').hide();
|
||||
},
|
||||
|
||||
unsetParent: function(li)
|
||||
{
|
||||
li.removeClass(this.options.collapsedClass);
|
||||
li.children('[data-action]').remove();
|
||||
li.children(this.options.listNodeName).remove();
|
||||
},
|
||||
|
||||
dragStart: function(e)
|
||||
{
|
||||
var mouse = this.mouse,
|
||||
target = $(e.target),
|
||||
dragItem = target.closest(this.options.itemNodeName);
|
||||
|
||||
this.placeEl.css('height', dragItem.height());
|
||||
|
||||
mouse.offsetX = e.offsetX !== undefined ? e.offsetX : e.pageX - target.offset().left;
|
||||
mouse.offsetY = e.offsetY !== undefined ? e.offsetY : e.pageY - target.offset().top;
|
||||
mouse.startX = mouse.lastX = e.pageX;
|
||||
mouse.startY = mouse.lastY = e.pageY;
|
||||
|
||||
this.dragRootEl = this.el;
|
||||
|
||||
this.dragEl = $(document.createElement(this.options.listNodeName)).addClass(this.options.listClass + ' ' + this.options.dragClass);
|
||||
this.dragEl.css('width', dragItem.width());
|
||||
|
||||
dragItem.after(this.placeEl);
|
||||
dragItem[0].parentNode.removeChild(dragItem[0]);
|
||||
dragItem.appendTo(this.dragEl);
|
||||
|
||||
$(document.body).append(this.dragEl);
|
||||
this.dragEl.css({
|
||||
'left' : e.pageX - mouse.offsetX,
|
||||
'top' : e.pageY - mouse.offsetY
|
||||
});
|
||||
// total depth of dragging item
|
||||
var i, depth,
|
||||
items = this.dragEl.find(this.options.itemNodeName);
|
||||
for (i = 0; i < items.length; i++) {
|
||||
depth = $(items[i]).parents(this.options.listNodeName).length;
|
||||
if (depth > this.dragDepth) {
|
||||
this.dragDepth = depth;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
dragStop: function(e)
|
||||
{
|
||||
var el = this.dragEl.children(this.options.itemNodeName).first();
|
||||
el[0].parentNode.removeChild(el[0]);
|
||||
this.placeEl.replaceWith(el);
|
||||
|
||||
this.dragEl.remove();
|
||||
this.el.trigger('change');
|
||||
if (this.hasNewRoot) {
|
||||
this.dragRootEl.trigger('change');
|
||||
}
|
||||
this.reset();
|
||||
},
|
||||
|
||||
dragMove: function(e)
|
||||
{
|
||||
var list, parent, prev, next, depth,
|
||||
opt = this.options,
|
||||
mouse = this.mouse;
|
||||
|
||||
this.dragEl.css({
|
||||
'left' : e.pageX - mouse.offsetX,
|
||||
'top' : e.pageY - mouse.offsetY
|
||||
});
|
||||
|
||||
// mouse position last events
|
||||
mouse.lastX = mouse.nowX;
|
||||
mouse.lastY = mouse.nowY;
|
||||
// mouse position this events
|
||||
mouse.nowX = e.pageX;
|
||||
mouse.nowY = e.pageY;
|
||||
// distance mouse moved between events
|
||||
mouse.distX = mouse.nowX - mouse.lastX;
|
||||
mouse.distY = mouse.nowY - mouse.lastY;
|
||||
// direction mouse was moving
|
||||
mouse.lastDirX = mouse.dirX;
|
||||
mouse.lastDirY = mouse.dirY;
|
||||
// direction mouse is now moving (on both axis)
|
||||
mouse.dirX = mouse.distX === 0 ? 0 : mouse.distX > 0 ? 1 : -1;
|
||||
mouse.dirY = mouse.distY === 0 ? 0 : mouse.distY > 0 ? 1 : -1;
|
||||
// axis mouse is now moving on
|
||||
var newAx = Math.abs(mouse.distX) > Math.abs(mouse.distY) ? 1 : 0;
|
||||
|
||||
// do nothing on first move
|
||||
if (!mouse.moving) {
|
||||
mouse.dirAx = newAx;
|
||||
mouse.moving = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// calc distance moved on this axis (and direction)
|
||||
if (mouse.dirAx !== newAx) {
|
||||
mouse.distAxX = 0;
|
||||
mouse.distAxY = 0;
|
||||
} else {
|
||||
mouse.distAxX += Math.abs(mouse.distX);
|
||||
if (mouse.dirX !== 0 && mouse.dirX !== mouse.lastDirX) {
|
||||
mouse.distAxX = 0;
|
||||
}
|
||||
mouse.distAxY += Math.abs(mouse.distY);
|
||||
if (mouse.dirY !== 0 && mouse.dirY !== mouse.lastDirY) {
|
||||
mouse.distAxY = 0;
|
||||
}
|
||||
}
|
||||
mouse.dirAx = newAx;
|
||||
|
||||
/**
|
||||
* move horizontal
|
||||
*/
|
||||
if (mouse.dirAx && mouse.distAxX >= opt.threshold) {
|
||||
// reset move distance on x-axis for new phase
|
||||
mouse.distAxX = 0;
|
||||
prev = this.placeEl.prev(opt.itemNodeName);
|
||||
// increase horizontal level if previous sibling exists and is not collapsed
|
||||
if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass)) {
|
||||
// cannot increase level when item above is collapsed
|
||||
list = prev.find(opt.listNodeName).last();
|
||||
// check if depth limit has reached
|
||||
depth = this.placeEl.parents(opt.listNodeName).length;
|
||||
if (depth + this.dragDepth <= opt.maxDepth) {
|
||||
// create new sub-level if one doesn't exist
|
||||
if (!list.length) {
|
||||
list = $('<' + opt.listNodeName + '/>').addClass(opt.listClass);
|
||||
list.append(this.placeEl);
|
||||
prev.append(list);
|
||||
this.setParent(prev);
|
||||
} else {
|
||||
// else append to next level up
|
||||
list = prev.children(opt.listNodeName).last();
|
||||
list.append(this.placeEl);
|
||||
}
|
||||
}
|
||||
}
|
||||
// decrease horizontal level
|
||||
if (mouse.distX < 0) {
|
||||
// we can't decrease a level if an item preceeds the current one
|
||||
next = this.placeEl.next(opt.itemNodeName);
|
||||
if (!next.length) {
|
||||
parent = this.placeEl.parent();
|
||||
this.placeEl.closest(opt.itemNodeName).after(this.placeEl);
|
||||
if (!parent.children().length) {
|
||||
this.unsetParent(parent.parent());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var isEmpty = false;
|
||||
|
||||
// find list item under cursor
|
||||
if (!hasPointerEvents) {
|
||||
this.dragEl[0].style.visibility = 'hidden';
|
||||
}
|
||||
this.pointEl = $(document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - (window.pageYOffset || document.documentElement.scrollTop)));
|
||||
if (!hasPointerEvents) {
|
||||
this.dragEl[0].style.visibility = 'visible';
|
||||
}
|
||||
if (this.pointEl.hasClass(opt.handleClass)) {
|
||||
this.pointEl = this.pointEl.parent(opt.itemNodeName);
|
||||
}
|
||||
if (this.pointEl.hasClass(opt.emptyClass)) {
|
||||
isEmpty = true;
|
||||
}
|
||||
else if (!this.pointEl.length || !this.pointEl.hasClass(opt.itemClass)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// find parent list of item under cursor
|
||||
var pointElRoot = this.pointEl.closest('.' + opt.rootClass),
|
||||
isNewRoot = this.dragRootEl.data('nestable-id') !== pointElRoot.data('nestable-id');
|
||||
|
||||
/**
|
||||
* move vertical
|
||||
*/
|
||||
if (!mouse.dirAx || isNewRoot || isEmpty) {
|
||||
// check if groups match if dragging over new root
|
||||
if (isNewRoot && opt.group !== pointElRoot.data('nestable-group')) {
|
||||
return;
|
||||
}
|
||||
// check depth limit
|
||||
depth = this.dragDepth - 1 + this.pointEl.parents(opt.listNodeName).length;
|
||||
if (depth > opt.maxDepth) {
|
||||
return;
|
||||
}
|
||||
var before = e.pageY < (this.pointEl.offset().top + this.pointEl.height() / 2);
|
||||
parent = this.placeEl.parent();
|
||||
// if empty create new list to replace empty placeholder
|
||||
if (isEmpty) {
|
||||
list = $(document.createElement(opt.listNodeName)).addClass(opt.listClass);
|
||||
list.append(this.placeEl);
|
||||
this.pointEl.replaceWith(list);
|
||||
}
|
||||
else if (before) {
|
||||
this.pointEl.before(this.placeEl);
|
||||
}
|
||||
else {
|
||||
this.pointEl.after(this.placeEl);
|
||||
}
|
||||
if (!parent.children().length) {
|
||||
this.unsetParent(parent.parent());
|
||||
}
|
||||
if (!this.dragRootEl.find(opt.itemNodeName).length) {
|
||||
this.dragRootEl.append('<div class="' + opt.emptyClass + '"/>');
|
||||
}
|
||||
// parent root list has changed
|
||||
if (isNewRoot) {
|
||||
this.dragRootEl = pointElRoot;
|
||||
this.hasNewRoot = this.el[0] !== this.dragRootEl[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.fn.nestable = function(params)
|
||||
{
|
||||
var lists = this,
|
||||
retval = this;
|
||||
|
||||
lists.each(function()
|
||||
{
|
||||
var plugin = $(this).data("nestable");
|
||||
|
||||
if (!plugin) {
|
||||
$(this).data("nestable", new Plugin(this, params));
|
||||
$(this).data("nestable-id", new Date().getTime());
|
||||
} else {
|
||||
if (typeof params === 'string' && typeof plugin[params] === 'function') {
|
||||
retval = plugin[params]();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return retval || lists;
|
||||
};
|
||||
|
||||
})(window.jQuery || window.Zepto, window, document);
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
|
||||
$.classVal - WTFPL - refreshless.com/classval/ */
|
||||
(function(b){function h(a,e){var d=!1;b.each(a?q:g,function(a){if(b(e).hasClass(a))return d=a,!1});return d}var n=b.fn.val,g={},q={},u={};b.classVal=function(a,b,d,l){"string"===typeof a&&"boolean"===typeof l&&(b&&(g[a]=b),d&&(q[a]=d),u[a]=l)};b.fn.val=function(){var a=Array.prototype.slice.call(arguments,0),e,d;return a.length?this.each(function(){(e=h(!0,this))?(d=u[e]?b(this):this,d[q[e]].apply(this,a)):n.apply(b(this),a)}):(e=h(!1,this))?(d=u[e]?this:this[0],d[g[e]].apply(d)):n.apply(this)}})(window.jQuery||
|
||||
window.Zepto);/*
|
||||
|
||||
$.Link (part of noUiSlider) - WTFPL */
|
||||
(function(b){function h(a,b,d){if((a[b]||a[d])&&a[b]===a[d])throw Error("(Link) '"+b+"' can't match '"+d+"'.'");}function n(a){void 0===a&&(a={});if("object"!==typeof a)throw Error("(Format) 'format' option must be an object.");var e={};b(q).each(function(b,l){if(void 0===a[l])e[l]=u[b];else if(typeof a[l]===typeof u[b]){if("decimals"===l&&(0>a[l]||7<a[l]))throw Error("(Format) 'format.decimals' option must be between 0 and 7.");e[l]=a[l]}else throw Error("(Format) 'format."+l+"' must be a "+typeof u[b]+
|
||||
".");});h(e,"mark","thousand");h(e,"prefix","negative");h(e,"prefix","negativeBefore");this.r=e}function g(a,e){"object"!==typeof a&&b.error("(Link) Initialize with an object.");return new g.prototype.p(a.target||function(){},a.method,a.format||{},e)}var q="decimals mark thousand prefix postfix encoder decoder negative negativeBefore to from".split(" "),u=[2,".","","","",function(a){return a},function(a){return a},"-","",function(a){return a},function(a){return a}];n.prototype.a=function(a){return this.r[a]};
|
||||
n.prototype.L=function(a){function b(a){return a.split("").reverse().join("")}a=this.a("encoder")(a);var d=this.a("decimals"),l="",g="",h="",n="";0===parseFloat(a.toFixed(d))&&(a="0");0>a&&(l=this.a("negative"),g=this.a("negativeBefore"));a=Math.abs(a).toFixed(d).toString();a=a.split(".");this.a("thousand")?(h=b(a[0]).match(/.{1,3}/g),h=b(h.join(b(this.a("thousand"))))):h=a[0];this.a("mark")&&1<a.length&&(n=this.a("mark")+a[1]);return this.a("to")(g+this.a("prefix")+l+h+n+this.a("postfix"))};n.prototype.w=
|
||||
function(a){function b(a){return a.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}var d;if(null===a||void 0===a)return!1;a=this.a("from")(a);a=a.toString();d=a.replace(RegExp("^"+b(this.a("negativeBefore"))),"");a!==d?(a=d,d="-"):d="";a=a.replace(RegExp("^"+b(this.a("prefix"))),"");this.a("negative")&&(d="",a=a.replace(RegExp("^"+b(this.a("negative"))),"-"));a=a.replace(RegExp(b(this.a("postfix"))+"$"),"").replace(RegExp(b(this.a("thousand")),"g"),"").replace(this.a("mark"),".");a=this.a("decoder")(parseFloat(d+
|
||||
a));return isNaN(a)?!1:a};g.prototype.K=function(a,e){this.method=e||"html";this.j=b(a.replace("-tooltip-","")||"<div/>")[0]};g.prototype.H=function(a){this.method="val";this.j=document.createElement("input");this.j.name=a;this.j.type="hidden"};g.prototype.G=function(a){function e(a,b){return[b?null:a,b?a:null]}var d=this;this.method="val";this.target=a.on("change",function(a){d.B.val(e(b(a.target).val(),d.t),{link:d,set:!0})})};g.prototype.p=function(a,e,d,g){this.g=d;this.update=!g;if("string"===
|
||||
typeof a&&0===a.indexOf("-tooltip-"))this.K(a,e);else if("string"===typeof a&&0!==a.indexOf("-"))this.H(a);else if("function"===typeof a)this.target=!1,this.method=a;else{if(a instanceof b||b.zepto&&b.zepto.isZ(a)){if(!e){if(a.is("input, select, textarea")){this.G(a);return}e="html"}if("function"===typeof e||"string"===typeof e&&a[e]){this.method=e;this.target=a;return}}throw new RangeError("(Link) Invalid Link.");}};g.prototype.write=function(a,b,d,g){if(!this.update||!1!==g)if(this.u=a,this.F=a=
|
||||
this.format(a),"function"===typeof this.method)this.method.call(this.target[0]||d[0],a,b,d);else this.target[this.method](a,b,d)};g.prototype.q=function(a){this.g=new n(b.extend({},a,this.g instanceof n?this.g.r:this.g))};g.prototype.J=function(a){this.B=a};g.prototype.I=function(a){this.t=a};g.prototype.format=function(a){return this.g.L(a)};g.prototype.A=function(a){return this.g.w(a)};g.prototype.p.prototype=g.prototype;b.Link=g})(window.jQuery||window.Zepto);/*
|
||||
|
||||
$.fn.noUiSlider - WTFPL - refreshless.com/nouislider/ */
|
||||
(function(b){function h(a){return"number"===typeof a&&!isNaN(a)&&isFinite(a)}function n(a){return b.isArray(a)?a:[a]}function g(a,c){a.addClass(c);setTimeout(function(){a.removeClass(c)},300)}function q(a,c){return 100*c/(a[1]-a[0])}function u(a,c){if(c>=a.d.slice(-1)[0])return 100;for(var b=1,f,d,e;c>=a.d[b];)b++;f=a.d[b-1];d=a.d[b];e=a.c[b-1];f=[f,d];return e+q(f,0>f[0]?c+Math.abs(f[0]):c-f[0])/(100/(a.c[b]-e))}function a(a,c){if(100<=c)return a.d.slice(-1)[0];for(var b=1,f,d,e;c>=a.c[b];)b++;f=
|
||||
a.d[b-1];d=a.d[b];e=a.c[b-1];f=[f,d];return 100/(a.c[b]-e)*(c-e)*(f[1]-f[0])/100+f[0]}function e(a,c){for(var b=1,f;c>=a.c[b];)b++;if(a.m)return f=a.c[b-1],b=a.c[b],c-f>(b-f)/2?b:f;a.h[b-1]?(f=a.h[b-1],b=a.c[b-1]+Math.round((c-a.c[b-1])/f)*f):b=c;return b}function d(a,c){if(!h(c))throw Error("noUiSlider: 'step' is not numeric.");a.h[0]=c}function l(a,c){if("object"!==typeof c||b.isArray(c))throw Error("noUiSlider: 'range' is not an object.");b.each(c,function(c,f){var d;"number"===typeof f&&(f=[f]);
|
||||
if(!b.isArray(f))throw Error("noUiSlider: 'range' contains invalid value.");d="min"===c?0:"max"===c?100:parseFloat(c);if(!h(d)||!h(f[0]))throw Error("noUiSlider: 'range' value isn't numeric.");a.c.push(d);a.d.push(f[0]);d?a.h.push(isNaN(f[1])?!1:f[1]):isNaN(f[1])||(a.h[0]=f[1])});b.each(a.h,function(c,b){if(!b)return!0;a.h[c]=q([a.d[c],a.d[c+1]],b)/(100/(a.c[c+1]-a.c[c]))})}function z(a,c){"number"===typeof c&&(c=[c]);if(!b.isArray(c)||!c.length||2<c.length)throw Error("noUiSlider: 'start' option is incorrect.");
|
||||
a.b=c.length;a.start=c}function A(a,c){a.m=c;if("boolean"!==typeof c)throw Error("noUiSlider: 'snap' option must be a boolean.");}function B(a,c){if("lower"===c&&1===a.b)a.i=1;else if("upper"===c&&1===a.b)a.i=2;else if(!0===c&&2===a.b)a.i=3;else if(!1===c)a.i=0;else throw Error("noUiSlider: 'connect' option doesn't match handle count.");}function y(a,c){switch(c){case "horizontal":a.k=0;break;case "vertical":a.k=1;break;default:throw Error("noUiSlider: 'orientation' option is invalid.");}}function I(a,
|
||||
c){if(2<a.c.length)throw Error("noUiSlider: 'margin' option is only supported on linear sliders.");a.margin=q(a.d,c);if(!h(c))throw Error("noUiSlider: 'margin' option must be numeric.");}function J(a,c){switch(c){case "ltr":a.dir=0;break;case "rtl":a.dir=1;a.i=[0,2,1,3][a.i];break;default:throw Error("noUiSlider: 'direction' option was not recognized.");}}function K(a,c){if("string"!==typeof c)throw Error("noUiSlider: 'behaviour' must be a string containing options.");var b=0<=c.indexOf("snap");a.n=
|
||||
{s:0<=c.indexOf("tap")||b,extend:0<=c.indexOf("extend"),v:0<=c.indexOf("drag"),fixed:0<=c.indexOf("fixed"),m:b}}function L(a,c,d){a.o=[c.lower,c.upper];a.g=c.format;b.each(a.o,function(a,e){if(!b.isArray(e))throw Error("noUiSlider: 'serialization."+(a?"upper":"lower")+"' must be an array.");b.each(e,function(){if(!(this instanceof b.Link))throw Error("noUiSlider: 'serialization."+(a?"upper":"lower")+"' can only contain Link instances.");this.I(a);this.J(d);this.q(c.format)})});a.dir&&1<a.b&&a.o.reverse()}
|
||||
function M(a,c){var e={c:[],d:[],h:[!1],margin:0},f;f={step:{e:!1,f:d},range:{e:!0,f:l},start:{e:!0,f:z},snap:{e:!1,f:A},connect:{e:!0,f:B},orientation:{e:!1,f:y},margin:{e:!1,f:I},direction:{e:!0,f:J},behaviour:{e:!0,f:K},serialization:{e:!0,f:L}};a=b.extend({connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal"},a);a.serialization=b.extend({lower:[],upper:[],format:{}},a.serialization);b.each(f,function(b,d){if(void 0===a[b]){if(d.e)throw Error("noUiSlider: '"+b+"' is required.");
|
||||
return!0}d.f(e,a[b],c)});e.style=e.k?"top":"left";return e}function N(a,c){var d=b("<div><div/></div>").addClass(k[2]),f=["-lower","-upper"];a.dir&&f.reverse();d.children().addClass(k[3]+" "+k[3]+f[c]);return d}function O(a,c){c.j&&(c=new b.Link({target:b(c.j).clone().appendTo(a),method:c.method,format:c.g},!0));return c}function P(a,c){var d,f=[];for(d=0;d<a.b;d++){var e=f,g=d,k=a.o[d],h=c[d].children(),l=a.g,n=void 0,q=[],n=new b.Link({},!0);n.q(l);q.push(n);for(n=0;n<k.length;n++)q.push(O(h,k[n]));
|
||||
e[g]=q}return f}function Q(a,c,b){switch(a){case 1:c.addClass(k[7]);b[0].addClass(k[6]);break;case 3:b[1].addClass(k[6]);case 2:b[0].addClass(k[7]);case 0:c.addClass(k[6])}}function R(a,b){var d,f=[];for(d=0;d<a.b;d++)f.push(N(a,d).appendTo(b));return f}function S(a,c){c.addClass([k[0],k[8+a.dir],k[4+a.k]].join(" "));return b("<div/>").appendTo(c).addClass(k[1])}function T(d,c,h){function f(){return r[["width","height"][c.k]]()}function l(a){var b,c=[s.val()];for(b=0;b<a.length;b++)s.trigger(a[b],
|
||||
c)}function q(d,p,f){var g=d[0]!==m[0][0]?1:0,H=v[0]+c.margin,l=v[1]-c.margin;f&&1<m.length&&(p=g?Math.max(p,H):Math.min(p,l));100>p&&(p=e(c,p));p=Math.max(Math.min(parseFloat(p.toFixed(7)),100),0);if(p===v[g])return 1===m.length?!1:p===H||p===l?0:!1;d.css(c.style,p+"%");d.is(":first-child")&&d.toggleClass(k[17],50<p);v[g]=p;c.dir&&(p=100-p);b(w[g]).each(function(){this.write(a(c,p),d.children(),s)});return!0}function G(a,b,c){c||g(s,k[14]);q(a,b,!1);l(["slide","set","change"])}function t(a,b,d,f){a=
|
||||
a.replace(/\s/g,".nui ")+".nui";b.on(a,function(a){var b=s.attr("disabled");if(s.hasClass(k[14])||void 0!==b&&null!==b)return!1;a.preventDefault();var b=0===a.type.indexOf("touch"),p=0===a.type.indexOf("mouse"),e=0===a.type.indexOf("pointer"),D,g,l=a;0===a.type.indexOf("MSPointer")&&(e=!0);a.originalEvent&&(a=a.originalEvent);b&&(D=a.changedTouches[0].pageX,g=a.changedTouches[0].pageY);if(p||e)e||void 0!==window.pageXOffset||(window.pageXOffset=document.documentElement.scrollLeft,window.pageYOffset=
|
||||
document.documentElement.scrollTop),D=a.clientX+window.pageXOffset,g=a.clientY+window.pageYOffset;l.C=[D,g];l.cursor=p;a=l;a.l=a.C[c.k];d(a,f)})}function y(a,b){var c=b.b||m,d,e=!1,e=100*(a.l-b.start)/f(),g=c[0][0]!==m[0][0]?1:0;var k=b.D;d=e+k[0];e+=k[1];1<c.length?(0>d&&(e+=Math.abs(d)),100<e&&(d-=e-100),d=[Math.max(Math.min(d,100),0),Math.max(Math.min(e,100),0)]):d=[d,e];e=q(c[0],d[g],1===c.length);1<c.length&&(e=q(c[1],d[g?0:1],!1)||e);e&&l(["slide"])}function z(a){b("."+k[15]).removeClass(k[15]);
|
||||
a.cursor&&b("body").css("cursor","").off(".nui");E.off(".nui");s.removeClass(k[12]);l(["set","change"])}function C(a,c){1===c.b.length&&c.b[0].children().addClass(k[15]);a.stopPropagation();t(x.move,E,y,{start:a.l,b:c.b,D:[v[0],v[m.length-1]]});t(x.end,E,z,null);a.cursor&&(b("body").css("cursor",b(a.target).css("cursor")),1<m.length&&s.addClass(k[12]),b("body").on("selectstart.nui",!1))}function A(a){var d=a.l,e=0;a.stopPropagation();b.each(m,function(){e+=this.offset()[c.style]});e=d<e/2||1===m.length?
|
||||
0:1;d-=r.offset()[c.style];d=100*d/f();G(m[e],d,c.n.m);c.n.m&&C(a,{b:[m[e]]})}function B(a){var b=(a=a.l<r.offset()[c.style])?0:100;a=a?0:m.length-1;G(m[a],b,!1)}var s=b(d),v=[-1,-1],r,w,m;if(s.hasClass(k[0]))throw Error("Slider was already initialized.");r=S(c,s);m=R(c,r);w=P(c,m);Q(c.i,s,m);(function(a){var b;if(!a.fixed)for(b=0;b<m.length;b++)t(x.start,m[b].children(),C,{b:[m[b]]});a.s&&t(x.start,r,A,{b:m});a.extend&&(s.addClass(k[16]),a.s&&t(x.start,s,B,{b:m}));a.v&&(b=r.find("."+k[7]).addClass(k[10]),
|
||||
a.fixed&&(b=b.add(r.children().not(b).children())),t(x.start,b,C,{b:m}))})(c.n);d.vSet=function(){var a=Array.prototype.slice.call(arguments,0),d,e,f,h,r,F,t=n(a[0]);"object"===typeof a[1]?(d=a[1].set,e=a[1].link,f=a[1].update,h=a[1].animate):!0===a[1]&&(d=!0);c.dir&&1<c.b&&t.reverse();h&&g(s,k[14]);a=1<m.length?3:1;1===t.length&&(a=1);for(r=0;r<a;r++)h=e||w[r%2][0],h=h.A(t[r%2]),!1!==h&&(h=u(c,h),c.dir&&(h=100-h),!0!==q(m[r%2],h,!0)&&b(w[r%2]).each(function(a){if(!a)return F=this.u,!0;this.write(F,
|
||||
m[r%2].children(),s,f)}));!0===d&&l(["set"]);return this};d.vGet=function(){var a,b=[];for(a=0;a<c.b;a++)b[a]=w[a][0].F;return 1===b.length?b[0]:c.dir?b.reverse():b};d.destroy=function(){b.each(w,function(){b.each(this,function(){this.target&&this.target.off(".nui")})});b(this).off(".nui").removeClass(k.join(" ")).empty();return h};s.val(c.start)}function U(a){if(!this.length)throw Error("noUiSlider: Can't initialize slider on empty selection.");var b=M(a,this);return this.each(function(){T(this,
|
||||
b,a)})}function V(a){return this.each(function(){var c=b(this).val(),d=this.destroy(),e=b.extend({},d,a);b(this).noUiSlider(e);d.start===e.start&&b(this).val(c)})}var E=b(document),x=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},k="noUi-target noUi-base noUi-origin noUi-handle noUi-horizontal noUi-vertical noUi-background noUi-connect noUi-ltr noUi-rtl noUi-dragable noUi-state-drag noUi-state-tap noUi-active noUi-extended noUi-stacking".split(" ");
|
||||
b.noUiSlider={Link:b.Link};b.fn.noUiSlider=function(a,b){return(b?V:U).call(this,a)};b.classVal(k[0],"vGet","vSet",!1)})(window.jQuery||window.Zepto);
|
||||
@@ -1,13 +0,0 @@
|
||||
// Peity jQuery plugin version 2.0.3
|
||||
// (c) 2014 Ben Pickles
|
||||
//
|
||||
// http://benpickles.github.io/peity
|
||||
//
|
||||
// Released under MIT license.
|
||||
(function(e,q,h){var o=function(a,b){var c=q.createElementNS("http://www.w3.org/2000/svg",a);e.each(b,function(a,b){c.setAttribute(a,b)});return c},t="createElementNS"in q&&o("svg",{}).createSVGRect,r=1/(window.devicePixelRatio||1),j=e.fn.peity=function(a,b){t&&this.each(function(){var c=e(this),d=c.data("peity");if(d)a&&(d.type=a),e.extend(d.opts,b);else{var f=j.defaults[a],g={};e.each(c.data(),function(a,b){a in f&&(g[a]=b)});var h=e.extend({},f,g,b),d=new s(c,a,h);c.change(function(){d.draw()}).data("peity",
|
||||
d)}d.draw()});return this},s=function(a,b,c){this.$el=a;this.type=b;this.opts=c},m=s.prototype;m.draw=function(){j.graphers[this.type].call(this,this.opts)};m.fill=function(){var a=this.opts.fill,b=a;e.isFunction(b)||(b=function(b,d){return a[d%a.length]});return b};m.prepare=function(a,b){var c;this.svg?c=e(this.svg).empty():(this.svg=o("svg",{"class":"peity"}),this.$el.hide().after(this.svg),c=e(this.svg).data("peity",this));this.svg.setAttribute("height",b);this.svg.setAttribute("width",a);return c};
|
||||
m.values=function(){return e.map(this.$el.text().split(this.opts.delimiter),function(a){return parseFloat(a)})};j.defaults={};j.graphers={};j.register=function(a,b,c){this.defaults[a]=b;this.graphers[a]=c};j.register("pie",{delimiter:null,diameter:16,fill:["#ff9900","#fff4dd","#ffc66e"]},function(a){if(!a.delimiter){var b=this.$el.text().match(/[^0-9\.]/);a.delimiter=b?b[0]:","}b=this.values();if("/"==a.delimiter)var c=b[0],b=[c,h.max(0,b[1]-c)];for(var d=0,c=b.length,f=0;d<c;d++)f+=b[d];for(var a=
|
||||
this.prepare(a.width||a.diameter,a.height||a.diameter),d=a.width(),g=a.height(),a=d/2,g=g/2,p=h.min(a,g),e=h.PI,j=this.fill(),i=-e/2,d=0;d<c;d++){var n=b[d],l=n/f,k;if(0!=l){if(1==l)k=o("circle",{cx:a,cy:g,r:p});else{k=2*l*e;var l=i+k,m=p*h.cos(i)+a,i=p*h.sin(i)+g,q=p*h.cos(l)+a,r=p*h.sin(l)+g;k=o("path",{d:["M",a,g,"L",m,i,"A",p,p,0,k>e?1:0,1,q,r,"Z"].join(" ")});i=l}k.setAttribute("fill",j.call(this,n,d,b));this.svg.appendChild(k)}}});j.register("line",{delimiter:",",fill:"#c6d9fd",height:16,max:null,
|
||||
min:0,stroke:"#4d89f9",strokeWidth:1,width:32},function(a){var b=this.values();1==b.length&&b.push(b[0]);for(var c=h.max.apply(h,b.concat([a.max])),d=h.min.apply(h,b.concat([a.min])),f=this.prepare(a.width,a.height),g=f.width(),f=f.height()-a.strokeWidth,e=g/(b.length-1),c=c-d,j=0==c?f:f/c,m=f+d*j,c=[0,m],i=0;i<b.length;i++)c.push(i*e,f-j*(b[i]-d)+a.strokeWidth/2);c.push(g,m);b=o("polygon",{fill:a.fill,points:c.join(" ")});this.svg.appendChild(b);a.strokeWidth&&(a=o("polyline",{fill:"transparent",
|
||||
points:c.slice(2,c.length-2).join(" "),stroke:a.stroke,"stroke-width":a.strokeWidth,"stroke-linecap":"square"}),this.svg.appendChild(a))});j.register("bar",{delimiter:",",fill:["#4D89F9"],gap:1,height:16,max:null,min:0,width:32},function(a){for(var b=this.values(),c=h.max.apply(h,b.concat([a.max])),d=h.min.apply(h,b.concat([a.min])),f=this.prepare(a.width,a.height),g=f.width(),f=f.height(),e=c-d,j=0==e?0:f/e,a=a.gap,g=(g+a)/b.length,m=this.fill(),i=0;i<b.length;i++){var n=b[i],l=f-j*(n-d),k=j*n;if(0==
|
||||
k){if(k=r,0>=d&&0<c||0==e)l-=r}else 0>k&&(l+=k,k=-k);n=o("rect",{fill:m.call(this,n,i,b),x:i*g,y:l,width:g-a,height:k});this.svg.appendChild(n)}})})(jQuery,document,Math);
|
||||
File diff suppressed because it is too large
Load Diff
-76
@@ -1,76 +0,0 @@
|
||||
// Generated by CoffeeScript 1.7.1
|
||||
|
||||
/*
|
||||
@preserve jQuery.PrettyTextDiff 1.0.4
|
||||
See https://github.com/arnab/jQuery.PrettyTextDiff/
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var $;
|
||||
|
||||
$ = jQuery;
|
||||
|
||||
$.fn.extend({
|
||||
prettyTextDiff: function(options) {
|
||||
var dmp, settings;
|
||||
settings = {
|
||||
originalContainer: ".original",
|
||||
changedContainer: ".changed",
|
||||
diffContainer: ".diff",
|
||||
cleanup: true,
|
||||
debug: false
|
||||
};
|
||||
settings = $.extend(settings, options);
|
||||
$.fn.prettyTextDiff.debug("Options: ", settings, settings);
|
||||
dmp = new diff_match_patch();
|
||||
return this.each(function() {
|
||||
var changed, diff_as_html, diffs, original;
|
||||
if (settings.originalContent && settings.changedContent) {
|
||||
original = $('<div />').html(settings.originalContent).text();
|
||||
changed = $('<div />').html(settings.changedContent).text();
|
||||
} else {
|
||||
original = $(settings.originalContainer, this).text();
|
||||
changed = $(settings.changedContainer, this).text();
|
||||
}
|
||||
$.fn.prettyTextDiff.debug("Original text found: ", original, settings);
|
||||
$.fn.prettyTextDiff.debug("Changed text found: ", changed, settings);
|
||||
diffs = dmp.diff_main(original, changed);
|
||||
if (settings.cleanup) {
|
||||
dmp.diff_cleanupSemantic(diffs);
|
||||
}
|
||||
$.fn.prettyTextDiff.debug("Diffs: ", diffs, settings);
|
||||
diff_as_html = $.map(diffs, function(diff) {
|
||||
return $.fn.prettyTextDiff.createHTML(diff);
|
||||
});
|
||||
$(settings.diffContainer, this).html(diff_as_html.join(''));
|
||||
return this;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$.fn.prettyTextDiff.debug = function(message, object, settings) {
|
||||
if (settings.debug) {
|
||||
return console.log(message, object);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.prettyTextDiff.createHTML = function(diff) {
|
||||
var data, html, operation, pattern_amp, pattern_gt, pattern_lt, pattern_para, text;
|
||||
html = [];
|
||||
pattern_amp = /&/g;
|
||||
pattern_lt = /</g;
|
||||
pattern_gt = />/g;
|
||||
pattern_para = /\n/g;
|
||||
operation = diff[0], data = diff[1];
|
||||
text = data.replace(pattern_amp, '&').replace(pattern_lt, '<').replace(pattern_gt, '>').replace(pattern_para, '<br>');
|
||||
switch (operation) {
|
||||
case DIFF_INSERT:
|
||||
return '<ins>' + text + '</ins>';
|
||||
case DIFF_DELETE:
|
||||
return '<del>' + text + '</del>';
|
||||
case DIFF_EQUAL:
|
||||
return '<span>' + text + '</span>';
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* jQuery and Bootsrap3 Plugin prettyFile
|
||||
*
|
||||
* version 2.0, Jan 20th, 2014
|
||||
* by episage, sujin2f
|
||||
* Git repository : https://github.com/episage/bootstrap-3-pretty-file-upload
|
||||
*/
|
||||
( function( $ ) {
|
||||
$.fn.extend({
|
||||
prettyFile: function( options ) {
|
||||
var defaults = {
|
||||
text : "选择文件"
|
||||
};
|
||||
|
||||
var options = $.extend(defaults, options);
|
||||
var plugin = this;
|
||||
|
||||
function make_form( $el, text ) {
|
||||
$el.wrap('<div></div>');
|
||||
|
||||
$el.hide();
|
||||
$el.after( '\
|
||||
<div class="input-append input-group"">\
|
||||
<span class="input-group-btn">\
|
||||
<button class="btn btn-white" type="button">' + text + '</button>\
|
||||
</span>\
|
||||
<input class="input-large form-control" type="text">\
|
||||
</div>\
|
||||
' );
|
||||
|
||||
return $el.parent();
|
||||
};
|
||||
|
||||
function bind_change( $wrap, multiple ) {
|
||||
$wrap.find( 'input[type="file"]' ).change(function () {
|
||||
// When original file input changes, get its value, show it in the fake input
|
||||
var files = $( this )[0].files,
|
||||
info = '';
|
||||
|
||||
if ( files.length == 0 )
|
||||
return false;
|
||||
|
||||
if ( !multiple || files.length == 1 ) {
|
||||
var path = $( this ).val().split('\\');
|
||||
info = path[path.length - 1];
|
||||
} else if ( files.length > 1 ) {
|
||||
// Display number of selected files instead of filenames
|
||||
info = "已选择了" + files.length + ' 个文件';
|
||||
}
|
||||
|
||||
$wrap.find('.input-append input').val( info );
|
||||
});
|
||||
};
|
||||
|
||||
function bind_button( $wrap, multiple ) {
|
||||
$wrap.find( '.input-append' ).click( function( e ) {
|
||||
e.preventDefault();
|
||||
$wrap.find( 'input[type="file"]' ).click();
|
||||
});
|
||||
};
|
||||
|
||||
return plugin.each( function() {
|
||||
$this = $( this );
|
||||
|
||||
if ( $this ) {
|
||||
var multiple = $this.attr( 'multiple' );
|
||||
|
||||
$wrap = make_form( $this, options.text );
|
||||
bind_change( $wrap, multiple );
|
||||
bind_button( $wrap );
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}( jQuery ));
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user