first commit

This commit is contained in:
2024-04-01 10:06:50 +08:00
commit 748a0b6c8f
1977 changed files with 138027 additions and 0 deletions

View File

@@ -0,0 +1,178 @@
//显示成功信息
function showSuccessMsg(msg,callback){
$.confirm({
title: '成功',
content: msg,
type: 'green',
typeAnimated: false,
buttons: {
omg: {
text: '确定!',
btnClass: 'btn-green',
action: function(){
callback();
}
}
}
});
}
//显示错误信息
function showErrorMsg(msg){
$.confirm({
title: '错误',
content: msg,
type: 'red',
typeAnimated: false,
buttons: {
omg: {
text: '知道了!',
btnClass: 'btn-red',
action: function(){
}
}
}
});
}
//显示警告信息
function showWarningMsg(msg){
$.confirm({
title: '警告',
content: msg,
type: 'red',
typeAnimated: false,
buttons: {
omg: {
text: '知道了!',
btnClass: 'btn-red',
action: function(){
}
}
}
});
}
//表单验证公用方法传表单form的id进来即可
function checkForm(formId){
var flag = true;
$("#"+formId).find(".required").each(function(i,e){
if($(e).val() == ''){
showWarningMsg($(e).attr('tips'));
flag = false;
return false;
}
});
return flag;
}
//统一图片上传方法
function upload(showPictureImg,input){
//formdata
var formData = new FormData();
formData.append('photo',document.getElementById('select-file').files[0]);
$.ajax({
url:'/upload/upload_photo',
contentType:false,
processData:false,
data:formData,
type:'POST',
success:function(data){
if(data.code == 0){
showSuccessMsg('图片上传成功!',function(){
$("#"+showPictureImg).attr('src','/photo/view?filename=' + data.data);
$("#"+input).val(data.data);
})
}else{
data = $.parseJSON(data);
showErrorMsg(data.msg);
}
},
error:function(data){
alert('网络错误!');
}
});
}
function uploadPhoto(photo,callback){
//formdata
var formData = new FormData();
formData.append('photo',photo);
$.ajax({
url:'/upload/upload_photo',
contentType:false,
processData:false,
data:formData,
type:'POST',
success:function(data){
if(data.code == 0){
callback(data);
}else{
//data = $.parseJSON(data);
showErrorMsg(data.msg);
}
},
error:function(data){
alert('网络错误!');
}
});
}
function uploadVideoToServer(video,callback){
//formdata
var formData = new FormData();
formData.append('video',video);
$.ajax({
url:'/upload/upload_video',
contentType:false,
processData:false,
data:formData,
type:'POST',
success:function(data){
if(data.code == 0){
callback(data);
}else{
//data = $.parseJSON(data);
showErrorMsg(data.msg);
}
},
error:function(data){
alert('网络错误!');
}
});
}
//统一ajax请求
function ajaxRequest(url,requestType,data,callback){
$.ajax({
url:url,
type:requestType,
data:data,
dataType:'json',
success:function(rst){
if(rst.code == 0){
callback(rst);
}else{
alert(rst.msg);
}
},
error:function(data){
alert('网络错误!');
}
});
}
//统一ajax请求
function ajaxAsyncRequest(url,requestType,data,callback){
$.ajax({
url:url,
type:requestType,
data:data,
dataType:'json',
async:false,
success:function(rst){
if(rst.code == 0){
callback(rst);
}else{
alert(rst.msg);
}
},
error:function(data){
alert('网络错误!');
}
});
}

View File

@@ -0,0 +1,320 @@
if (!Array.indexOf) {
Array.prototype.indexOf = function (obj) {
for (var i = 0; i < this.length; i++) {
if (this[i] == obj) {
return i;
}
}
return -1;
}
}
function getCityCode(cityName) {
var cityCode = "";
switch (cityName) {
case "南昌":
cityCode = '360100';
break;
case "景德镇":
cityCode = '360200';
break;
case '萍乡':
cityCode = '360300';
break;
case '九江':
cityCode = '360400';
break;
case '新余':
cityCode = '360500';
break;
case '鹰潭':
cityCode = '360600';
break;
case '赣州':
cityCode = '360700';
break;
case '吉安':
cityCode = '360800';
break;
case '宜春':
cityCode = '360900';
break;
case '抚州':
cityCode = '361000';
break;
case '上饶':
cityCode = '361100';
break;
default:
cityCode = "360100";
break;
}
return cityCode;
}
function getCityName(cityCode) {
var cityName = "";
switch (cityCode) {
case "360100":
cityName = '南昌';
break;
case "360200":
cityName = '景德镇';
break;
case '360300':
cityName = '萍乡';
break;
case '360400':
cityName = '九江';
break;
case '360500':
cityName = '新余';
break;
case '360600':
cityName = '鹰潭';
break;
case '360700':
cityName = '赣州';
break;
case '360800':
cityName = '吉安';
break;
case '360900':
cityName = '宜春';
break;
case '361000':
cityName = '抚州';
break;
case '361100':
cityName = '上饶';
break;
}
return cityName;
}
function getQueryString(name, strlocation) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r;
if (strlocation == undefined || strlocation == null)
r = window.location.search.substr(1).match(reg);
else
r = strlocation.substr(strlocation.indexOf("?") + 1).match(reg);
if (r != null) return decodeURIComponent(r[2]); return null;
}
function isnull(value) {
if (value == null)
return true;
if (value == undefined)
return true;
if (value === "")
return true;
if (value === "null")
return true;
return false;
}
function findCityCode() {
var citycode = getCookie("CityCode");
if (isnull(citycode))
return null;
return citycode.toString();
}
function findCityName() {
var cityname = getCookie("CityName");
if (isnull(cityname))
return null;
return cityname.toString();
}
function SetCookie(name, value, issession) {
if (issession == true)
document.cookie = name + "=" + encodeURIComponent(value) + ";path=/";
else {
var Days = 365;
if (!isNaN(issession))
Days = issession;
var exp = new Date();
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
document.cookie = name + "=" + encodeURIComponent(value) + ";expires=" + exp.toGMTString() + ";path=/";
document.cookie = name + "=" + encodeURIComponent(value) + ";expires=" + exp.toGMTString() + ";path=/";
}
}
function delCookie(name) {
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval = getCookie(name);
if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
}
function getCookie(name) {
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
if (arr != null)
return decodeURIComponent(arr[2]);
return null;
}
function setsessionstorage(respData) {
SetCookie('NickName', respData.NickName, true);
SetCookie('Sex', respData.Sex, true);
SetCookie('Mobile', respData.Mobile, true);
SetCookie('Account', respData.Account, true);
SetCookie('LastLoginTime', respData.LastLoginTime, true);
SetCookie('MobileOrderHint', respData.MobileOrderHint, true);
SetCookie('MobileOrderSucc', respData.MobileOrderSucc, true);
SetCookie("ShowDesc", respData.ShowDesc, true);
SetCookie("UserCenterDesc", respData.UserCenterDesc, true);
SetCookie("HeaderIcon", respData.HeaderIcon, true);
SetCookie('paylist', JSON.stringify(respData.PayTypeList), true);
SetCookie('UnUserdCoupon', respData.UnUserdCoupon, true);
SetCookie('couponlist', JSON.stringify(respData.CouponList), true);
SetCookie('Append', respData.Append, true);
SetCookie('Flag', respData.Flag, true);
var cids = "";
for (var i = 0; i < respData.CrashList.length; i++)
{
var CouponID=respData.CrashList[i]["CouponID"];
if (cids == "")
cids = CouponID;
else
cids += "," + CouponID;
SetCookie(CouponID, JSON.stringify(respData.CrashList[i]));
}
SetCookie('crashlist', cids, true);
}
function clearsessionstorage() {
delCookie('NickName');
delCookie('Sex');
delCookie('Mobile');
delCookie('Account');
delCookie('LastLoginTime');
delCookie('MobileOrderHint');
delCookie('MobileOrderSucc');
delCookie("ShowDesc");
delCookie("UserCenterDesc");
delCookie('paylist');
delCookie('UnUserdCoupon');
delCookie('couponlist');
delCookie('crashlist');
delCookie("LocalToken");
delCookie("LocalMobile");
}
function verifyautologin() {
if (getCookie("Mobile") == null) {
var Mobile = getCookie("LocalMobile");
var Token = getCookie("LocalToken");
if (isnull(Mobile) || isnull(Token))
return;
}
}
verifyautologin();
function checkUrl(url) {
var pagename = url.substr(url.indexOf("/") + 1);
var k = "";
if (pagename == "" || pagename.indexOf("index") > -1) k = "index";
if (pagename.indexOf("cinema") > -1) k = "cinema";
if (pagename.indexOf("movie") > -1) k = "movie";
if (pagename.indexOf("news") > -1) k = "news";
$(".nav-list li").removeClass("act").each(function (i) {
if ($(this).attr("data-index") == k) {
$(this).addClass("act");
}
});
}
function countDown(time, dom, msg, isParent, tag, url) {
if (time < 0) {
isParent == 1 ? $(dom).parent().text(msg) : $(dom).text(msg);
if (url) {
window.location.href = url;
}
}
else {
var timer = window.setInterval(function () {
if (time == 0) {
window.clearInterval(timer);
isParent == 1 ? $(dom).parent().text(msg) : $(dom).text(msg);
if (url) {
window.location.href = url;
}
}
else {
var min = Math.floor(time / 60);
if (tag == 1) {
$(dom).html("<strong>" + min + "</strong>分<em>" + (time % 60) + "</em>秒");
} else {
$(dom).html(min + "" + (time % 60));
}
time--;
}
}, 1000);
}
}
function getMsgStatus(StatusFlag, showtime, now) {
var msg = "";
var showtime = new Date(Date.parse(showtime.replace(/-/g, "/"))).getTime();
var now = new Date(Date.parse(now.replace(/-/g, "/"))).getTime();
switch (StatusFlag) {
case "1":
msg = "待付款";
break;
case "3":
msg = "待付款";
break;
case "9":
if (now < showtime) {
msg = "未使用";
} else {
msg = "已完成";
}
break;
case "10":
if (now < showtime) {
msg = "未使用";
} else {
msg = "已完成";
}
break;
case "21":
msg = "待付款";
break;
case "31":
msg = "已退款";
break;
case "32":
msg = "已退款";
break;
default:
msg = "暂无信息";
}
return msg;
}
$(function () {
checkUrl(window.location.pathname);
var tm = $(".menu-usercenter .numorder em");
if ($.trim(tm.text()) != "0") {
tm.parent().show();
}
});
function showMask(msg) {
if ($(".loadpanel").length == 0) {
var msg = msg || "努力加载中,么么哒~";
var strHtml = '<div style="position:relative;left:50%"><div style="text-align: center"><img class="spinnerimg" width="80px" height="80px" src="/resource/images/loading.gif")" /></div><div class="spinnermsg">' + msg + '</div></div>';
var container = document.createElement("div");
container.innerHTML = strHtml;
container.className = "loadpanel";
document.body.appendChild(container);
}
}
function closeLoadMask() {
$(".loadpanel").remove();
}
function jsonDate(v, format) {
if (!v) return "";
var reg = /^\/Date\(([-\d]*)\)\/$/;
var result = v.match(reg);
if (!result) return "";
var dt = new Date(parseInt(result[1]));
var year = dt.getYear();
year = year > 1000 ? year : (1900 + year);
var month = dt.getMonth() + 1;
if (!format)
return year + "年" + month + "月";
else
return format.replace("yyyy", year).replace("MM", month).replace("dd", dt.getDate()).replace("HH", (dt.getHours() < 10) ? "0" + dt.getHours() : dt.getHours()).replace("mm", (dt.getMinutes() < 10) ? "0" + dt.getMinutes() : dt.getMinutes()).replace("ss", (dt.getSeconds() < 10) ? "0" + dt.getSeconds() : dt.getSeconds());
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
(function(a){a.fn.jRating=function(t){var u={bigStarsPath:"jquery/icons/stars.png",smallStarsPath:"jquery/icons/small.png",phpPath:"php/jRating.php",type:"big",step:!1,isDisabled:!1,showRateInfo:!0,canRateAgain:!1,sendRequest:!0,length:5,decimalLength:0,rateMax:20,rateInfosX:-45,rateInfosY:5,nbRates:1,onSuccess:null,onError:null,onClick:null};if(0<this.length)return this.each(function(){function l(a){a=parseFloat(100*a/k*parseInt(b.rateMax)/100);var c=Math.pow(10,parseInt(b.decimalLength));return Math.round(a*c)/c}function m(a){return a?a.offsetLeft+m(a.offsetParent):0}var b=a.extend(u,t),f=0,e=0,g=0,n="",p=!1,q=0,r=b.nbRates,v=a(this).hasClass("jDisabled")||b.isDisabled?!0:!1;switch(b.type){case "small":e=13;g=12;n=b.smallStarsPath;break;default:e=18,g=16,n=b.bigStarsPath}a(this).height(g);var h=parseFloat(a(this).attr("data-average")),s=parseInt(a(this).attr("data-id")),k=e*b.length;a("\x3cdiv\x3e",{"class":"jRatingColor",css:{width:h/b.rateMax*k}}).appendTo(a(this));h=a("\x3cdiv\x3e",{"class":"jRatingAverage",css:{width:0,top:-g}}).appendTo(a(this));a("\x3cdiv\x3e",{"class":"jStar",css:{width:k,height:g,top:-(2*g),background:"url("+n+") repeat-x"}}).appendTo(a(this));a(this).css({width:k,overflow:"hidden",zIndex:1,position:"relative"});v||a(this).unbind().bind({mouseenter:function(d){var c=m(this),c=d.pageX-c;b.showRateInfo&&a("\x3cp\x3e",{"class":"jRatingInfos",html:l(c)+' \x3cspan class\x3d"maxRate"\x3e/ '+b.rateMax+"\x3c/span\x3e",css:{top:d.pageY+b.rateInfosY,left:d.pageX+b.rateInfosX}}).appendTo("body").show()},mouseover:function(b){a(this).css("cursor","pointer")},mouseout:function(){a(this).css("cursor","default");p?h.width(q):h.width(0)},mousemove:function(d){var c=m(this),c=d.pageX-c;f=b.step?Math.floor(c/e)*e+e:c;h.width(f);b.showRateInfo&&a("p.jRatingInfos").css({left:d.pageX+b.rateInfosX}).html(l(f)+' \x3cspan class\x3d"maxRate"\x3e/ '+b.rateMax+"\x3c/span\x3e")},mouseleave:function(){a("p.jRatingInfos").remove()},click:function(d){var c=this;p=!0;q=f;r--;(!b.canRateAgain||0>=parseInt(r))&&a(this).unbind().css("cursor","default").addClass("jDisabled");b.showRateInfo&&a("p.jRatingInfos").fadeOut("fast",function(){a(this).remove()});d.preventDefault();var e=l(f);h.width(f);a(".datasSent p").html("\x3cstrong\x3eidBox : \x3c/strong\x3e"+s+"\x3cbr /\x3e\x3cstrong\x3erate : \x3c/strong\x3e"+e+"\x3cbr /\x3e\x3cstrong\x3eaction :\x3c/strong\x3e rating");a(".serverResponse p").html("\x3cstrong\x3eLoading...\x3c/strong\x3e");if(b.onClick)b.onClick(c,e);b.sendRequest&&a.post(b.phpPath,{idBox:s,rate:e,action:"rating"},function(d){if(d.error){if(a(".serverResponse p").html(d.server),b.onError)b.onError(c,e)}else if(a(".serverResponse p").html(d.server),b.onSuccess)b.onSuccess(c,e)},"json")}})})}})(jQuery);

View File

@@ -0,0 +1,16 @@
(function ($) {
$.fn.pager = function (options) { var opts = $.extend({}, $.fn.pager.defaults, options); return this.each(function () { $(this).empty().append(renderpager(parseInt(options.pagenumber), parseInt(options.pagecount), options.buttonClickCallback)); $('.pages li').mouseover(function () { document.body.style.cursor = "pointer"; }).mouseout(function () { document.body.style.cursor = "auto"; }); }); }; function renderpager(pagenumber, pagecount, buttonClickCallback) {
var $pager = $('<ul class="pages"></ul>'); $pager.append(renderButton('首页', pagenumber, pagecount, buttonClickCallback)).append(renderButton('上一页', pagenumber, pagecount, buttonClickCallback)); var startPoint = 1; var endPoint = 9; if (pagenumber > 4) { startPoint = pagenumber - 4; endPoint = pagenumber + 4; }
if (endPoint > pagecount) { startPoint = pagecount - 8; endPoint = pagecount; }
if (startPoint < 1) { startPoint = 1; }
for (var page = startPoint; page <= endPoint; page++) { var currentButton = $('<li class="page-number">' + (page) + '</li>'); page == pagenumber ? currentButton.addClass('pgCurrent') : currentButton.click(function () { buttonClickCallback(this.firstChild.data); }); currentButton.appendTo($pager); }
$pager.append(renderButton('下一页', pagenumber, pagecount, buttonClickCallback)).append(renderButton('尾页', pagenumber, pagecount, buttonClickCallback)); return $pager;
}
function renderButton(buttonLabel, pagenumber, pagecount, buttonClickCallback) {
var $Button = $('<li class="pgNext">' + buttonLabel + '</li>'); var destPage = 1; switch (buttonLabel) { case "首页": destPage = 1; break; case "上一页": destPage = pagenumber - 1; break; case "下一页": destPage = pagenumber + 1; break; case "尾页": destPage = pagecount; break; }
if (buttonLabel == "首页" || buttonLabel == "上一页") { pagenumber <= 1 ? $Button.addClass('pgEmpty') : $Button.click(function () { buttonClickCallback(destPage); }); }
else { pagenumber >= pagecount ? $Button.addClass('pgEmpty') : $Button.click(function () { buttonClickCallback(destPage); }); }
return $Button;
}
$.fn.pager.defaults = { pagenumber: 1, pagecount: 1 };
})(jQuery);

View File

@@ -0,0 +1 @@
;(function(b){function l(){if(b.browser.msie){var a=b(document).height(),c=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,20>a-c?c:a]}return[b(document).width(),b(document).height()]}function g(a){if(a)return a.call(b.mask)}b.tools=b.tools||{version:"@VERSION"};var m;m=b.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:!0,closeOnEsc:!0,zIndex:9998,opacity:0.8,startOpacity:0,color:"#fff",onLoad:null,onClose:null}};var c,h,d,e,k;b.mask={load:function(a,f){if(d)return this;"string"==typeof a&&(a={color:a});a=a||e;e=a=b.extend(b.extend({},m.conf),a);c=b("#"+a.maskId);c.length||(c=b("\x3cdiv/\x3e").attr("id",a.maskId),b("body").append(c));var n=l();c.css({position:"absolute",top:0,left:0,width:n[0],height:n[1],display:"none",opacity:a.startOpacity,zIndex:a.zIndex});a.color&&c.css("backgroundColor",a.color);if(!1===g(a.onBeforeLoad))return this;if(a.closeOnEsc)b(document).on("keydown.mask",function(a){27==a.keyCode&&b.mask.close(a)});if(a.closeOnClick)c.on("click.mask",function(a){b.mask.close(a)});b(window).on("resize.mask",function(){b.mask.fit()});f&&f.length&&(k=f.eq(0).css("zIndex"),b.each(f,function(){var a=b(this);/relative|absolute|fixed/i.test(a.css("position"))||a.css("position","relative")}),h=f.css({zIndex:Math.max(a.zIndex+1,"auto"==k?0:k)}));c.css({display:"block"}).fadeTo(a.loadSpeed,a.opacity,function(){b.mask.fit();g(a.onLoad);d="full"});d=!0;return this},close:function(){if(d){if(!1===g(e.onBeforeClose))return this;c.fadeOut(e.closeSpeed,function(){g(e.onClose);h&&h.css({zIndex:k});d=!1});b(document).off("keydown.mask");c.off("click.mask");b(window).off("resize.mask")}return this},fit:function(){if(d){var a=l();c.css({width:a[0],height:a[1]})}},getMask:function(){return c},isLoaded:function(a){return a?"full"==d:d},getConf:function(){return e},getExposed:function(){return h}};b.fn.mask=function(a){b.mask.load(a);return this};b.fn.expose=function(a){b.mask.load(a,this);return this}})(jQuery);

View File

@@ -0,0 +1 @@
;(function(b){function p(a,c){var d=this,h=a.add(d),q=b(window),e,f,m,g=b.tools.expose&&(c.mask||c.expose),n=Math.random().toString().slice(10);g&&("string"==typeof g&&(g={color:g}),g.closeOnClick=g.closeOnEsc=!1);var k=c.target||a.attr("rel");f=k?b(k):a;if(!f.length)throw"Could not find Overlay: "+k;a&&-1==a.index(f)&&a.click(function(b){d.load(b);return b.preventDefault()});b.extend(d,{load:function(a){if(d.isOpened())return d;var s=r[c.effect];if(!s)throw'Overlay: cannot find effect : "'+c.effect+'"';c.oneInstance&&b.each(t,function(){this.close(a)});a=a||b.Event();a.type="onBeforeLoad";h.trigger(a);if(a.isDefaultPrevented())return d;m=!0;g&&b(f).expose(g);var l=c.top,e=c.left,k=f.outerWidth({margin:!0}),p=f.outerHeight({margin:!0});"string"==typeof l&&(l="center"==l?Math.max((q.height()-p)/2,0):parseInt(l,10)/100*q.height());"center"==e&&(e=Math.max((q.width()-k)/2,0));s[0].call(d,{top:l,left:e},function(){m&&(a.type="onLoad",h.trigger(a))});if(g&&c.closeOnClick)b.mask.getMask().one("click",d.close);if(c.closeOnClick)b(document).on("click."+n,function(a){b(a.target).parents(f).length||d.close(a)});if(c.closeOnEsc)b(document).on("keydown."+n,function(a){27==a.keyCode&&d.close(a)});return d},close:function(a){if(!d.isOpened())return d;a=a||b.Event();a.type="onBeforeClose";h.trigger(a);if(!a.isDefaultPrevented())return m=!1,r[c.effect][1].call(d,function(){a.type="onClose";h.trigger(a)}),b(document).off("click."+n+" keydown."+n),g&&b.mask.close(),d},getOverlay:function(){return f},getTrigger:function(){return a},getClosers:function(){return e},isOpened:function(){return m},getConf:function(){return c}});b.each(["onBeforeLoad","onStart","onLoad","onBeforeClose","onClose"],function(a,e){if(b.isFunction(c[e]))b(d).on(e,c[e]);d[e]=function(a){if(a)b(d).on(e,a);return d}});e=f.find(c.close||".close");e.length||c.close||(e=b('\x3ca class\x3d"close"\x3e\x3c/a\x3e'),f.prepend(e));e.click(function(a){d.close(a)});c.load&&d.load()}b.tools=b.tools||{version:"@VERSION"};b.tools.overlay={addEffect:function(a,b,d){r[a]=[b,d]},conf:{close:null,closeOnClick:!0,closeOnEsc:!0,closeSpeed:"fast",effect:"default",fixed:!b.browser.msie||6<b.browser.version,left:"center",load:!1,mask:null,oneInstance:!0,speed:"normal",target:null,top:"10%"}};var t=[],r={};b.tools.overlay.addEffect("default",function(a,c){var d=this.getConf(),h=b(window);d.fixed||(a.top+=h.scrollTop(),a.left+=h.scrollLeft());a.position=d.fixed?"fixed":"absolute";this.getOverlay().css(a).fadeIn(d.speed,c)},function(a){this.getOverlay().fadeOut(this.getConf().closeSpeed,a)});b.fn.overlay=function(a){var c=this.data("overlay");if(c)return c;b.isFunction(a)&&(a={onBeforeLoad:a});a=b.extend(!0,{},b.tools.overlay.conf,a);this.each(function(){c=new p(b(this),a);t.push(c);b(this).data("overlay",c)});return a.api?c:this}})(jQuery);

View File

@@ -0,0 +1 @@
;(function(d){function q(c,a,b){var e=this,n=c.add(this),g=c.find(b.tabs),f=a.jquery?a:c.children(a),k;g.length||(g=c.children());f.length||(f=c.parent().find(a));f.length||(f=d(a));d.extend(this,{click:function(a,h){var f=g.eq(a),l=!c.data("tabs");"string"==typeof a&&a.replace("#","")&&(f=g.filter('[href*\x3d"'+a.replace("#","")+'"]'),a=Math.max(g.index(f),0));if(b.rotate){var m=g.length-1;if(0>a)return e.click(m,h);if(a>m)return e.click(0,h)}if(!f.length){if(0<=k)return e;a=b.initialIndex;f=g.eq(a)}if(a===k)return e;h=h||d.Event();h.type="onBeforeClick";n.trigger(h,[a]);if(!h.isDefaultPrevented())return p[l?b.initialEffect&&b.effect||"default":b.effect].call(e,a,function(){k=a;h.type="onClick";n.trigger(h,[a])}),g.removeClass(b.current),f.addClass(b.current),e},getConf:function(){return b},getTabs:function(){return g},getPanes:function(){return f},getCurrentPane:function(){return f.eq(k)},getCurrentTab:function(){return g.eq(k)},getIndex:function(){return k},next:function(){return e.click(k+1)},prev:function(){return e.click(k-1)},destroy:function(){g.off(b.event).removeClass(b.current);f.find('a[href^\x3d"#"]').off("click.T");return e}});d.each(["onBeforeClick","onClick"],function(a,c){if(d.isFunction(b[c]))d(e).on(c,b[c]);e[c]=function(a){if(a)d(e).on(c,a);return e}});b.history&&d.fn.history&&(d.tools.history.init(g),b.event="history");g.each(function(a){d(this).on(b.event,function(b){e.click(a,b);return b.preventDefault()})});f.find('a[href^\x3d"#"]').on("click.T",function(a){e.click(d(this).attr("href"),a)});location.hash&&"a"==b.tabs&&c.find('[href\x3d"'+location.hash+'"]').length?e.click(location.hash):(0===b.initialIndex||0<b.initialIndex)&&e.click(b.initialIndex)}d.tools=d.tools||{version:"@VERSION"};d.tools.tabs={conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialEffect:!1,initialIndex:0,event:"click",rotate:!1,slideUpSpeed:400,slideDownSpeed:400,history:!1},addEffect:function(c,a){p[c]=a}};var p={"default":function(c,a){this.getPanes().hide().eq(c).show();a.call()},fade:function(c,a){var b=this.getConf(),e=b.fadeOutSpeed,d=this.getPanes();e?d.fadeOut(e):d.hide();d.eq(c).fadeIn(b.fadeInSpeed,a)},slide:function(c,a){var b=this.getConf();this.getPanes().slideUp(b.slideUpSpeed);this.getPanes().eq(c).slideDown(b.slideDownSpeed,a)},ajax:function(c,a){this.getPanes().eq(0).load(this.getTabs().eq(c).attr("href"),a)}},l,m;d.tools.tabs.addEffect("horizontal",function(c,a){if(!l){var b=this.getPanes().eq(c),e=this.getCurrentPane();m||(m=this.getPanes().eq(0).width());l=!0;b.show();e.animate({width:0},{step:function(a){b.css("width",m-a)},complete:function(){d(this).hide();a.call();l=!1}});e.length||(a.call(),l=!1)}});d.fn.tabs=function(c,a){var b=this.data("tabs");b&&(b.destroy(),this.removeData("tabs"));d.isFunction(a)&&(a={onBeforeClick:a});a=d.extend({},d.tools.tabs.conf,a);this.each(function(){b=new q(d(this),c,a);d(this).data("tabs",b)});return a.api?b:this}})(jQuery);

View File

@@ -0,0 +1 @@
"object"!==typeof JSON&&(JSON={});(function(){function m(a){return 10>a?"0"+a:a}function r(){return this.valueOf()}function s(a){t.lastIndex=0;return t.test(a)?'"'+a.replace(t,function(a){var c=v[a];return"string"===typeof c?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function p(a,l){var c,d,h,q,g=e,f,b=l[a];b&&"object"===typeof b&&"function"===typeof b.toJSON&&(b=b.toJSON(a));"function"===typeof k&&(b=k.call(l,a,b));switch(typeof b){case "string":return s(b);case "number":return isFinite(b)?String(b):"null";case "boolean":case "null":return String(b);case "object":if(!b)return"null";e+=n;f=[];if("[object Array]"===Object.prototype.toString.apply(b)){q=b.length;for(c=0;c<q;c+=1)f[c]=p(c,b)||"null";h=0===f.length?"[]":e?"[\n"+e+f.join(",\n"+e)+"\n"+g+"]":"["+f.join(",")+"]";e=g;return h}if(k&&"object"===typeof k)for(q=k.length,c=0;c<q;c+=1)"string"===typeof k[c]&&(d=k[c],(h=p(d,b))&&f.push(s(d)+(e?": ":":")+h));else for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(h=p(d,b))&&f.push(s(d)+(e?": ":":")+h);h=0===f.length?"{}":e?"{\n"+e+f.join(",\n"+e)+"\n"+g+"}":"{"+f.join(",")+"}";e=g;return h}}var w=/^[\],:{}\s]*$/,x=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,y=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,z=/(?:^|:|,)(?:\s*\[)+/g,t=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,u=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+m(this.getUTCMonth()+1)+"-"+m(this.getUTCDate())+"T"+m(this.getUTCHours())+":"+m(this.getUTCMinutes())+":"+m(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=r,Number.prototype.toJSON=r,String.prototype.toJSON=r);var e,n,v,k;"function"!==typeof JSON.stringify&&(v={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(a,l,c){var d;n=e="";if("number"===typeof c)for(d=0;d<c;d+=1)n+=" ";else"string"===typeof c&&(n=c);if((k=l)&&"function"!==typeof l&&("object"!==typeof l||"number"!==typeof l.length))throw Error("JSON.stringify");return p("",{"":a})});"function"!==typeof JSON.parse&&(JSON.parse=function(a,e){function c(a,d){var g,f,b=a[d];if(b&&"object"===typeof b)for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(f=c(b,g),void 0!==f?b[g]=f:delete b[g]);return e.call(a,d,b)}var d;a=String(a);u.lastIndex=0;u.test(a)&&(a=a.replace(u,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(w.test(a.replace(x,"@").replace(y,"]").replace(z,"")))return d=eval("("+a+")"),"function"===typeof e?c({"":d},""):d;throw new SyntaxError("JSON.parse");})})();