This commit is contained in:
2025-07-10 23:55:26 +08:00
commit f140c92ddd
1840 changed files with 184740 additions and 0 deletions

View File

@@ -0,0 +1,441 @@
function AlertLoginCH(){}
AlertLoginCH.prototype.tip = function(e,m){
var html = "<p class='AlertLogintip'>"+m+"</p>";
e&&e.after(html)
};
AlertLoginCH.prototype.sendAjax = function(url,callback,data,type){
jQuery.ajax({
type : type||'GET',
cache : "true",
data:data,
url : url,
dataType : 'jsonp',
jsonp : 'jsonpCallback',
async : false,
success : callback
});
};
var AL = new AlertLoginCH();
AL.config = function(obj){
var config = {
"coverBox":jQuery("#AlertLoginCH"),
"AlertBOX":jQuery("#AlertLoginCH-main"),
"RegisterBox":jQuery("#RigisterCH"),
"LoginBox":jQuery("#LoginCH"),
"LgBtn":jQuery("#loginch-btn"),
"RgBtn":jQuery("#register-btn"),
"QQBtn":jQuery("#LoginCH-qqlogin"),
"tip":jQuery(".AlertLogintip"),
"closedBtn":jQuery("#LoginCH-closed"),
"LgUser":jQuery("#LoginCH-username"),
"LgPass":jQuery("#LoginCH-password"),
"LgCode":jQuery("#LoginCH-code"),
"RgUser":jQuery("#RigisterCH-username"),
"RgPas":jQuery("#RigisterCH-password"),
"RgPas2":jQuery("#RigisterCH-password2"),
"Code":jQuery('#RigisterCH-code'),
"COdeImg":jQuery('#code_img'),
"LgEdBox":jQuery("#user-box"),
"logout":jQuery(".logout"),
"qqloginBtn":"true"
};
AL.a = (obj!=undefined)?jQuery.extend(config,obj):config;
};
AL.showLgBox = function(){
var B = AL.a;
B["LoginBox"].show();
B["RegisterBox"].hide();
};
AL.showRgBox = function(){
var B = AL.a;
B["LoginBox"].hide();
B["RegisterBox"].show();
};
AL.closed = function(){
var B = AL.a;
B["coverBox"].hide().remove();
B["AlertBOX"].hide().remove();
};
AL.regLg = function(){
var B = AL.a;
B["LgUser"].focus(function(){
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
len != 0&&tip.remove();
jQuery(this).parent().addClass("Alertfocus").removeClass("blur");
});
B["LgUser"].blur(function(){
var val = jQuery(this).val();
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
if(val == ""){
AL.tip(jQuery(this).parent(),"请输入用户名");
jQuery(this).parent().removeClass("Alertfocus").addClass("blur")
}
len != 0&&tip.remove();
jQuery(this).parent().removeClass("Alertfocus");
});
B["LgPass"].focus(function(){
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
len != 0&&tip.remove();
jQuery(this).parent().addClass("Alertfocus").removeClass("blur");
});
B["LgPass"].blur(function(){
var val = jQuery(this).val();
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
if(val == ""){
AL.tip(B["LgPass"].parent(),"请输入密码");
B["LgPass"].parent().removeClass("Alertfocus").addClass("blur")
}
len != 0&&tip.remove();
jQuery(this).parent().removeClass("Alertfocus");
});
};
AL.LgLogin = function(){
var B = AL.a;
function login(){
var LgUserV = B["LgUser"].val();
var LgpassV = B["LgPass"].val();
if(!LgUserV){
B["LgUser"].blur()
}
if(!LgpassV){
B["LgPass"].blur()
}
if(LgUserV&&LgpassV){
var url = "/index.php?m=member&c=email&a=checkUsername&service=login&cn=" + LgUserV + "&pwd=" + encodeURIComponent(LgpassV) + "&random="+ Math.random();
AL.sendAjax(url,function(respons){
var err = respons.result;
if(err == "err0001"){
var tip = B["LgPass"].parent().next(".AlertLogintip");
tip.remove();
B["LgPass"].val("");
B["LgPass"].parent().removeClass("Alertfocus").addClass("blur")
AL.tip(B["LgPass"].parent(),"账号或者密码错误!");
}
else if(err == "success"){
AL.closed();
AL.loginSuccess(respons)
}
})
}
}
B["LgBtn"].click(function(){
login();
});
B["LgPass"].keyup(function(e){
var code = e.keyCode||"";
code == 13&&login();
})
};
AL.RegRg = function(){
var B = AL.a;
B["RgUser"].focus(function(){
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
len != 0&&tip.remove();
jQuery(this).parent().addClass("Alertfocus").removeClass("blur");
});
B["RgUser"].blur(function(){
var val = jQuery(this).val();
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
if(val == ""){
AL.tip(jQuery(this).parent(),"请输入用户名");
jQuery(this).parent().removeClass("Alertfocus").addClass("blur")
}else {
AL.sendAjax("index.php?m=member&c=email&a=checkUsername&service=checkCn&cn=" + val + "", function (data) {
if (data.result == "success") {
B["RgUser"].parent().next(".AlertLogintip").remove();
B["RgUser"].parent().removeClass("Alertfocus").addClass("succ");
AL.tip(B["RgUser"].parent(), "通过用户名验证!");
B["RgUser"].parent().next(".AlertLogintip").css("color","green")
AL.isRguser = true;
} else {
B["RgUser"].parent().next(".AlertLogintip").remove();
B["RgUser"].parent().removeClass("succ Alertfocus blur").addClass("blur");
AL.tip(B["RgUser"].parent(), "用户名已经存在!");
}
});
}
len != 0&&tip.remove();
jQuery(this).parent().removeClass("Alertfocus");
});
B["RgPas"].focus(function(){
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
len != 0&&tip.remove();
jQuery(this).parent().addClass("Alertfocus").removeClass("blur");
});
B["RgPas"].blur(function(){
var val = jQuery(this).val();
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
if(val == ""){
AL.tip( jQuery(this).parent(),"请输入密码!");
jQuery(this).parent().removeClass("Alertfocus").addClass("blur")
}else if(val.length<6||val.length>16){
AL.tip( jQuery(this).parent(),"密码范围在6~16位之间!");
jQuery(this).parent().removeClass("Alertfocus").addClass("blur")
}
else{
AL.isRgpas = true;
}
len != 0&&tip.remove();
jQuery(this).parent().removeClass("Alertfocus");
});
B["RgPas2"].focus(function(){
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
len != 0&&tip.remove();
jQuery(this).parent().addClass("Alertfocus").removeClass("blur");
});
B["RgPas2"].blur(function(){
var val = jQuery(this).val();
var pval = B["RgPas"].val();
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
if(val == ""){
AL.tip( jQuery(this).parent(),"请重复密码!");
jQuery(this).parent().removeClass("Alertfocus").addClass("blur")
}
else if(val!==pval){
AL.tip( jQuery(this).parent(),"两次输入的密码不一致!");
jQuery(this).parent().removeClass("Alertfocus").addClass("blur")
}else{
AL.isRgpas2 = true;
}
len != 0&&tip.remove();
jQuery(this).parent().removeClass("Alertfocus");
});
B["Code"].focus(function(){
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
len != 0&&tip.remove();
jQuery(this).parent().addClass("Alertfocus").removeClass("blur");
});
B["Code"].blur(function(){
var val = jQuery(this).val();
var tip = jQuery(this).parent().next(".AlertLogintip");
var len = tip.length;
if(val == ""){
AL.tip( jQuery(this).parent(),"请输入验证码!");
jQuery(this).parent().removeClass("Alertfocus").addClass("blur")
}else if(val.length!=4){
AL.tip( jQuery(this).parent(),"验证码不正确!");
jQuery(this).parent().removeClass("Alertfocus").addClass("blur")
}
else{
AL.isCode = true;
}
len != 0&&tip.remove();
jQuery(this).parent().removeClass("Alertfocus");
});
B["COdeImg"].click(function(){
var src = $(this).attr('src');
var newSrc = src+Math.random();
$(this).attr({'src':newSrc});
})
};
AL.RgRigester = function(){
var B = AL.a;
function register (){
var ruser = B["RgUser"].val();
var rpass = B["RgPas"].val();
var rpass2 = B["RgPas2"].val();
var code = B['Code'].val();
!ruser ? B["RgUser"].blur() : !rpass ? B["RgPas"].blur() : (!rpass2 || (rpass2 != rpass)) ? B["RgPas"].blur(): !code ? B["Code"].blur():registerbtn();
function registerbtn(){
if(AL.isRguser && AL.isRgpas&&AL.isRgpas2&&AL.isCode){
var regUrl = "/index.php?m=member&c=email&a=alertWindowReg&Math="+Math.random()+'&';
var paramObj = packParam({
cn:ruser,
pwd:rpass,
code:code,
uid : "",
suid: "alertLogin2"||""
});
AL.sendAjax(regUrl+paramObj,function(data) {
if (data.result=="success") {
alert("注册成功");
AL.closed();
AL.loginSuccess();
}else if(data.result=="error00"){
B["Code"].val("");
B["Code"].parent().next(".AlertLogintip").remove();
B["Code"].parent().removeClass("Alertfocus succ").addClass("blur");
AL.tip(B["Code"].parent(),"验证码不正确!");
}
else {
B["RgUser"].val("");
B["RgUser"].parent().next(".AlertLogintip").remove();
B["RgUser"].parent().removeClass("Alertfocus succ").addClass("blur");
AL.tip(B["RgUser"].parent(),"账号已经存在!");
}
});
}
}
function packParam (json) {
var string = '';
for ( var key in json) {
string += "&" + key + "=" + (json[key] || '');
}
return string.length > 0 ? string.substring(1) : '';
};
}
B["RgBtn"].click(function(){
register();
});
B["RgPas2"].keyup(function(e){
var code = e.keyCode||"";
code == 13 && register();
})
};
AL.loginSuccess = function(){
location.reload()
};
AL.qqlogin = function(){
var Host ='//' + document.domain + '/';
var gameid = "";
var uid= "alertLogin"||"";
var suid= "alertLogin"||"";
location.href = Host+'index.php?m=member&c=index&a=public_qq_loginnew&sid='+gameid+'&uid='+uid+'&suid='+suid+'&notlast=1&forward='+encodeURIComponent(location.href);
};
AL.wxlogin = function(){
var Host ='//' + document.domain + '/';
var gameid ="";
var uid= "alertLogin"||"";
var suid= "alertLogin"||"";
location.href = Host+'index.php?m=member&c=weixin&a=public_weixin_login&sid='+gameid+'&uid='+uid+'&suid='+suid+'&notlast=1&forward='+encodeURIComponent(location.href);
};
AL.genereteHtml = function(){
var html = "";
html+= '<div id="AlertLoginCH" class="AlertLoginCH"></div>';
html+= '<div id="AlertLoginCH-main" class="AlertLoginCH-main">';
html+= '<div class="LoginCH" id="LoginCH">' +
'<div class="loginCH-tit">' +
'<div class="loginCHname" >快速登录</div>' +
'<a id="loginCH-goregister" class="loginCH-goregister" href="javascript:void(0);" onclick="AL.showRgBox();AL.RegRg();AL.RgRigester()">注册</a>'+
'</div>';
html+= '<div class="LoginCH-mr u">' +
'<input type="text" id="LoginCH-username" placeholder="用户名"/>'+
'</div>' +
'<div class="LoginCH-mr p">' +
'<input type="password" id="LoginCH-password" placeholder="密码"/>'+
'</div>';
html+= '<div class="LoginCH-mr y">' +
'<input type="text" id="LoginCH-code" placeholder="验证码"/>' +
'</div>' +
'<div class="other">' +
'<div class="jz">' +
'<input type="checkbox" checked/>' +
'<label>记住密码</label>' +
'</div>' +
'<div class="forgetpass">' +
'<a href="//' + document.domain + '/index.php?m=mymember&c=forgetPassword&a=index&siteid=1" target="_blank">忘记密码</a>' +
'</div>' +
'</div>' +
'<a href="javascript:void(0);" class="loginch-btn" id="loginch-btn">立即登录</a></div>'
html+= '<div class="RigisterCH" id="RigisterCH">';
html+= '<div class="RigisterCH-tit">' +
'<div class="RigisterCHname">注册账号</div>' +
'<a id="RigisterCH-gologin" class="RigisterCH-gologin" href="javascript:void(0);" onclick="AL.showLgBox();AL.regLg();AL.LgLogin();">登录</a>'+
'</div>';
html+= '<div class="RigisterCH-mr u">'+
'<input type="text" id="RigisterCH-username" placeholder="4-15位字符内(仅限数字,英文)"/>'+
'</div>';
html+= '<div class="RigisterCH-mr p">'+
'<input type="password" id="RigisterCH-password" placeholder="密码:6-20个字符"/>'+
'</div>';
html+= '<div class="RigisterCH-mr p2">'+
'<input type="password" id="RigisterCH-password2" placeholder="确认密码"/>'+
'</div>';
html+= '<div class="RigisterCH-mr code">'+
'<input type="text" id="RigisterCH-code" placeholder="验证码"/>'+
'<img id="code_img" src="//' + document.domain + '/api.php?op=checkcode&code_len=4&font_size=14&width=75&height=29&font_color=&background=">'+
'</div>';
html+= '<a href="javascript:void(0);" class="register-btn" id="register-btn">立即登录</a>' +
'</div>';
html+= '<div class="LoginCH-qqlogin" id="LoginCH-qqlogin">'+
'<div class="tit">第三方账号登录</div>'+
'<a href="javascript:void (0);" onclick="AL.qqlogin();" class="qq">qq登录</a>'+
'<a href="javascript:void (0);" onclick="AL.wxlogin();" class="wx">微信登录</a>'+
'</div>'+
'<a class="LoginCH-closed" id="LoginCH-closed" href="javascript:void(0);" onclick="AL.closed()"></a>' +
'</div>';
jQuery("body").append(html);
}
AL.BoxInit = function(){
var B = AL.a;
if(B["box"]=="register"){
AL.showRgBox();
AL.RegRg();
AL.RgRigester();
}else{
AL.showLgBox();
AL.regLg();
AL.LgLogin();
}
if(!B["qqloginBtn"]){
jQuery("#LoginCH-qqlogin").hide();
}
};
AL.Init = function(obj){
AL.genereteHtml();
AL.config(obj);
AL.BoxInit();
};
jQuery.fn.extend({
AlertLogin:function(obj){
jQuery(this).click(function(){
AL.Init(obj);
})
}
});

View File

@@ -0,0 +1,78 @@
var Video = function(){};
var a = new Video();
a.ex = function(obj){
var config = {
Width:"800",
Height:"400",
Src:"",
Type:"flv",
unit:'px'
};
a.d = obj? $.extend(config,obj):config;
};
a.genereteHtml = function(){
var d = a.d;
var type = a.d.Type;
var width = d.Width+d.unit,height = d.Height+d.unit;
console.log(width,height);
if(type == 'mp4'){
var html = '<div class="Alert-cover"></div><div id="AlertVideo" class="AlertVideo">';
html += '<div class="AlertVideo-main">';
html += '<video style="width:'+width+';height:'+height+';" src="'+d.Src+'" autoplay controls>';
html += '</div><div class="AlertVideo-Closed"><a href="javascript:a.closedVideo()"></a></div>';
}else{
var html = '<div class="Alert-cover"></div><div id="AlertVideo" class="AlertVideo">';
html += '<div class="AlertVideo-main">';
html += '<embed type="application/x-shockwave-flash"';
html += 'wmode="transparent"';
html += 'src="http://s2.qhimg.com/static/8dccccc36ce33293.swf"';
html += 'width="'+ d.Width+'" height="'+d.Height+'"';
html += 'quality="high" allowfullscreen="true"';
html += 'flashvars="file='+ d.Src+'&amp;width=800&amp;height=450">';
html += '</div><div class="AlertVideo-Closed"><a href="javascript:a.closedVideo()"></a></div>';
}
return html;
};
a.countCss = function(){
var d = a.d;
var css = {
width: d.Width+d.unit,
height: d.Height+d.unit
};
var mar = '-'+ (d.Height/2)+d.unit+' 0 0 -'+(d.Width/2)+d.unit;
$(".AlertVideo-main").css(css)
$(".AlertVideo").css("margin",mar)
};
a.closedVideo = function(){
$(".Alert-cover").remove();
$("#AlertVideo").remove();
a.isShow = false;
};
a.isShow = false;
a.showVideo = function(){
if(a.isShow){return false}
var html = a.genereteHtml();
$("body").append(html);
a.countCss();
a.isShow = true;
};
a.Init = function(obj){
a.ex(obj);
a.showVideo();
};
$.fn.extend({
insertVideo:function(obj){
$(this).click(function(){
a.Init(obj)
})
}
})

1
static/home/js/Gw_Fn.js Normal file

File diff suppressed because one or more lines are too long

73
static/home/js/common.js Normal file
View File

@@ -0,0 +1,73 @@
require.config({
baseUrl:'//' + location.host + '/static/home/js/',
paths:{
'jquery':'jquery-1.7.2.min',
'AlertLogin':'AlertLogin',
'insertFlash':'inserFlash',
'AlertVideo':'AlertVideo',
'SuperSlide':'jquery.SuperSlide',
'picShow1':'picShow1',
'picShow2':'picShow2',
'Gw_Fn':'//' + location.host + '/static/home/js/Gw_Fn',
'top':'//' + location.host + '/static/home/js/top'
},
shim:{
'jquery':{exports:'$'},
'SuperSlide':{deps:['jquery']},
'Gw_Fn':{deps:['jquery','SuperSlide']},
'AlertLogin':{deps:['jquery']},
'insertFlash':{deps:['jquery']},
'AlertVideo':{deps:['jquery']},
'picShow1':{deps:['jquery']},
'picShow2':{deps:['jquery']},
'top':{deps:['jquery','insertFlash','AlertLogin']}
}
});
require(['top'],function (top) {
top('文网游备字2022-RPG 001 号', '/')
});
require(['jquery','Gw_Fn','SuperSlide','AlertVideo','picShow1','picShow2'], function ($,Gw){
Gw({
GameId : "415",
GameName :"yscq",
Slide:{
SlideId : "765",
SlideBox : $("#slideBox")
},
Login:{
LoginBox:$('.log-box'),
LoginUser:$("#username"),
LoginPass:$("#password"),
LoginSubmit:$("#login-sub")
},
SwitchTab:{
TabNav:$("#news-nav"),
TabContent:$("#news-con"),
TabCurrent:"current",
TabEvent:"hover",
TabFind:""
},
Server:{
ServerTemplate:'<li><i class="ico ico_s"></i><a href="%url%" target="_blank">%serverName%</a><span style="margin-left:30px;">%serverState%</span></li>',
ServerBox:$("#index_server_list_ul_id"),
ServerL:"7"
}
});
$('.zf-sec').click(function(){
"use strict";
$(this).addClass('fadeIn').siblings().removeClass('fadeIn');
});
$('#news-nav li').hover(function(){
var url = $(this).attr('more_url');
$('#news_more_zonghe').attr({'href':url})
});
$('.job-tab-menu li').hover(function(){
var i = $(this).index();
$(this).addClass('on').siblings().removeClass('on');
$('.job-con > div').removeClass('job_cur').eq(i).addClass('job_cur');
});
});

File diff suppressed because one or more lines are too long

49
static/home/js/index.js Normal file
View File

@@ -0,0 +1,49 @@
//banner图切换
var banner = new Swiper("#bannerSwiper", {
direction: "horizontal",
autoplay: 2000,
speed: 300,
loop: true,
pagination: '.pagination',
createPagination: false,
paginationClickable: true,
noSwiping : true,
onAutoplayStop: function(banner){
if(!banner.support.transitions){ //IE7、IE8
banner.startAutoplay();
}
}
});
$(".pagination span").hover(function() {
$(this).click();
},function(){
banner.startAutoplay();
}
);
//职业简介切换
//切换男女角色
$('.roleTab a').on('mouseenter', function() {
if ($(this).hasClass('i-r_w')) {
$('#role_swiper .i-r_w').addClass('i-r_w_a').siblings('.i-r_m').removeClass('i-r_m_a');
$('#role_swiper .woman').css('display', 'block').siblings('.man').css('display', 'none');
} else {
$('#role_swiper .i-r_m').addClass('i-r_m_a').siblings('.i-r_w').removeClass('i-r_w_a');
$('#role_swiper .man').css('display', 'block').siblings('.woman').css('display', 'none');
}
});
$(".wrapperNav a").click(function(){
var _index = $(this).index();
$(this).addClass('act').siblings().removeClass('act');
$(".roleRlide").hide().eq(_index).show();
});
//留言弹窗
$('.i-b_message').on('click', function() {
$('#mask').show().children('.message_mask').show();
});
$('#mask .close').on('click', function() {
$(this).parent().hide().parent('#mask').hide();
});

View File

@@ -0,0 +1,27 @@
$.fn.extend({
insertFlash:function(src,url){
var w = this.width();
var h = this.height();
var salf = this;
this.css({"width":"800px",height:"800px","opacity":"0"});
this.append(this.genereteHtml(800,800,src,url));
if(url){
$("#conver").css({"width":w,height:h,"display":"block","position":"absolute","z-index":"10000","left":"0","top":"0"})
}
setTimeout(function(){
salf.css({"width":w,"height":h,"opacity":1})
},100)
},
genereteHtml:function(w,h,src,url){
var html ='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">';
html+='<param name="movie" value="'+src+'">';
html+='<param name="quality" value="autohigh">';
html+='<param name="wmode" value="Transparent">';
html+='<embed src="'+src+'" quality="autohigh" wmode="transparent" name="flashad" swliveconnect="TRUE" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100%" height="100%">';
html+="</object>";
if(url){
html+='<a href="'+url+'" target="_blank" id="conver"></a>';
}
return html
}
});

View File

@@ -0,0 +1,90 @@
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.6
*
* Requires: 1.2.2+
*/
(function($) {
var types = ['DOMMouseScroll', 'mousewheel'];
if ($.event.fixHooks) {
for (var i = types.length; i;) {
$.event.fixHooks[types[--i]] = $.event.mouseHooks;
}
}
$.event.special.mousewheel = {
setup: function() {
if (this.addEventListener) {
for (var i = types.length; i;) {
this.addEventListener(types[--i], handler, false);
}
} else {
this.onmousewheel = handler;
}
},
teardown: function() {
if (this.removeEventListener) {
for (var i = types.length; i;) {
this.removeEventListener(types[--i], handler, false);
}
} else {
this.onmousewheel = null;
}
}
};
$.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
},
unmousewheel: function(fn) {
return this.unbind("mousewheel", fn);
}
});
function handler(event) {
var orgEvent = event || window.event,
args = [].slice.call(arguments, 1),
delta = 0,
returnValue = true,
deltaX = 0,
deltaY = 0;
event = $.event.fix(orgEvent);
event.type = "mousewheel";
// Old school scrollwheel delta
if (orgEvent.wheelDelta) { delta = orgEvent.wheelDelta / 120; }
if (orgEvent.detail) { delta = -orgEvent.detail / 3; }
// New school multidimensional scroll (touchpads) deltas
deltaY = delta;
// Gecko
if (orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
deltaY = 0;
deltaX = -1 * delta;
}
// Webkit
if (orgEvent.wheelDeltaY !== undefined) { deltaY = orgEvent.wheelDeltaY / 120; }
if (orgEvent.wheelDeltaX !== undefined) { deltaX = -1 * orgEvent.wheelDeltaX / 120; }
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
return ($.event.dispatch || $.event.handle).apply(this, args);
}
})(jQuery);
/* |xGv00|0c5f9ba2d17f5b8891e4fbb77e789dad */

2
static/home/js/jquery-1.7.2.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5
static/home/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

172
static/home/js/picShow1.js Normal file
View File

@@ -0,0 +1,172 @@
/*
* 懒人建站 http://www.51xuediannao.com
*/
// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend( jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
//alert(jQuery.easing.default);
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
});
/*
*
* TERMS OF USE - EASING EQUATIONS
*
* Open source under the BSD License.
*
* Copyright © 2001 Robert Penner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/

746
static/home/js/picShow2.js Normal file
View File

@@ -0,0 +1,746 @@
/**
* ÀÁÈ˽¨Õ¾ http://www.51xuediannao.com
*/
jQuery.bind = function(object, method){
var args = Array.prototype.slice.call(arguments, 2);
return function() {
var args2 = [this].concat(args, $.makeArray( arguments ));
return method.apply(object, args2);
};
};
(function($) {
SexyLightbox = {
getOptions: function() {
return {
name : 'SLB',
zIndex : 32000,
color : 'black',
find : 'sexylightbox',
dir : 'sexyimages',
emergefrom : 'top',
background : 'bgSexy.png',
backgroundIE : 'bgSexy.gif',
buttons : 'buttons.png',
displayed : 0,
showDuration : 200,
closeDuration : 400,
moveDuration : 1000,
moveEffect : 'easeInOutBack',
resizeDuration: 1000,
resizeEffect : 'easeInOutBack',
shake : {
distance : 10,
duration : 100,
transition : 'easeInOutBack',
loops : 2
},
BoxStyles : { 'width' : 486, 'height': 320 },
Skin : {
'white' : { 'hexcolor': '#FFFFFF', 'captionColor': '#000000', 'background-color': '#000000', 'opacity': 0.6 },
'black' : { 'hexcolor': '#000000', 'captionColor': '#FFFFFF', 'background-color': '#000000', 'opacity': 0.6 },
'blanco': { 'hexcolor': '#FFFFFF', 'captionColor': '#000000', 'background-color': '#000000', 'opacity': 0.6 },
'negro' : { 'hexcolor': '#000000', 'captionColor': '#FFFFFF', 'background-color': '#000000', 'opacity': 0.6 }
}
};
},
overlay: {
create: function(options) {
this.options = options;
this.element = $('<div id="'+new Date().getTime()+'"></div>');
this.element.css($.extend({}, {
'position' : 'absolute',
'top' : 0,
'left' : 0,
'opacity' : 0,
'display' : 'none',
'z-index' : this.options.zIndex
}, this.options.style));
this.element.bind('click', $.bind(this, function(obj, event) {
if (this.options.hideOnClick) {
if (this.options.callback) {
this.options.callback();
} else {
this.hide();
}
}
event.preventDefault();
}));
this.hidden = true;
this.inject();
},
inject: function() {
this.target = $(document.body);
this.target.append(this.element);
//if((Browser.Engine.trident4 || (Browser.Engine.gecko && !Browser.Engine.gecko19 && Browser.Platform.mac)))
if($.browser.msie && $.browser.version=="6.0")
// No tengo tiempo para agregar la detecci?n del OS que deber?a
// haber estado integrada en jQuery, pero que el est?pido de su creador no puso
// Me cago en John Resig
{
var zIndex = parseInt(this.element.css('zIndex'));
if (!zIndex)
{
zIndex = 1;
var pos = this.element.css('position');
if (pos == 'static' || !pos)
{
this.element.css({'position': 'relative'});
}
this.element.css({'zIndex': zIndex});
}
// Diossss por diosss, pongan funciones ?tiles en jQuery,
// no todo es Selectores! la puta madre, lo que hay que hacer
// para detectar si una variable est? definida:
zIndex = (!!(this.options.zIndex || this.options.zIndex === 0) && zIndex > this.options.zIndex) ? this.options.zIndex : zIndex - 1;
if (zIndex < 0)
{
zIndex = 1;
}
this.shim = $('<iframe id="IF_'+new Date().getTime()+'" scrolling="no" frameborder=0 src=""></div>');
this.shim.css({
zIndex : zIndex,
position : 'absolute',
top : 0,
left : 0,
border : 'none',
opacity : 0
});
this.shim.insertAfter(this.element);
}
},
resize: function(x, y) {
this.element.css({ 'height': 0, 'width': 0 });
if (this.shim) this.shim.css({ 'height': 0, 'width': 0 });
var win = { x: $(document).width(), y: $(document).height() };
var chromebugfix = $.browser.safari ? (win.x - 25 < document.body.clientWidth ? document.body.clientWidth : win.x) : win.x;
this.element.css({
width : x ? x : chromebugfix, //* chrome fix
height : y ? y : win.y
});
if (this.shim)
{
this.shim.css({ 'height': 0, 'width': 0 });
this.shim.css({
width : x ? x : chromebugfix, //* chrome fix
height : y ? y : win.y
});
}
return this;
},
show: function() {
if (!this.hidden) return this;
if (this.transition) this.transition.stop();
this.target.bind('resize', $.bind(this, this.resize));
this.resize();
if (this.shim) this.shim.css({'display': 'block'});
this.hidden = false;
this.transition = this.element.fadeIn(this.options.showDuration, $.bind(this, function(){
this.element.trigger('show');
}));
return this;
},
hide: function() {
if (this.hidden) return this;
if (this.transition) this.transition.stop();
this.target.unbind('resize');
if (this.shim) this.shim.css({'display': 'none'});
this.hidden = true;
this.transition = this.element.fadeOut(this.options.closeDuration, $.bind(this, function(){
this.element.trigger('hide');
this.element.css({ 'height': 0, 'width': 0 });
}));
return this;
}
},
backwardcompatibility: function(option) {
this.options.dir = option.imagesdir || option.path || option.folder || option.dir;
this.options.OverlayStyles = $.extend(this.options.Skin[this.options.color], this.options.OverlayStyles || {});
},
preloadimage: function(url) {
img = new Image();
img.src = url;
},
initialize: function(options) {
this.options = $.extend(this.getOptions(), options);
this.backwardcompatibility(this.options);
var strBG = this.options.dir+'/'+this.options.color+'/'+((((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined)))?this.options.backgroundIE:this.options.background);
var name = this.options.name;
this.preloadimage(strBG);
this.preloadimage(this.options.dir+'/'+this.options.color+'/'+this.options.buttons);
this.overlay.create({
style : this.options.Skin[this.options.color],
hideOnClick : true,
zIndex : this.options.zIndex-1,
callback : $.bind(this, this.close),
showDuration : this.options.showDuration,
showEffect : this.options.showEffect,
closeDuration : this.options.closeDuration,
closeEffect : this.options.closeEffect
});
this.lightbox = {};
$('body').append('<div id="'+name+'-Wrapper"><div id="'+name+'-Background"></div><div id="'+name+'-Contenedor"><div id="'+name+'-Top" style="background-image: url('+strBG+')"><a id="'+name+'-CloseButton" href="#">&nbsp;</a><div id="'+name+'-TopLeft" style="background-image: url('+strBG+')"></div></div><div id="'+name+'-Contenido"></div><div id="'+name+'-Bottom" style="background-image: url('+strBG+')"><div id="'+name+'-BottomRight" style="background-image: url('+strBG+')"><div id="'+name+'-Navegador"><strong id="'+name+'-Caption"></strong></div></div></div></div></div>');
this.Wrapper = $('#'+name+'-Wrapper');
this.Background = $('#'+name+'-Background');
this.Contenedor = $('#'+name+'-Contenedor');
this.Top = $('#'+name+'-Top');
this.CloseButton = $('#'+name+'-CloseButton');
this.Contenido = $('#'+name+'-Contenido');
this.bb = $('#'+name+'-Bottom');
this.innerbb = $('#'+name+'-BottomRight');
this.Nav = $('#'+name+'-Navegador');
this.Descripcion = $('#'+name+'-Caption');
this.Wrapper.css({
'z-index' : this.options.zIndex,
'display' : 'none'
}).hide();
this.Background.css({
'z-index' : this.options.zIndex + 1
});
this.Contenedor.css({
'position' : 'absolute',
'width' : this.options.BoxStyles['width'],
'z-index' : this.options.zIndex + 2
});
this.Contenido.css({
'height' : this.options.BoxStyles['height'],
'border-left-color' : this.options.Skin[this.options.color].hexcolor,
'border-right-color': this.options.Skin[this.options.color].hexcolor
});
this.CloseButton.css({
'background-image' : 'url('+this.options.dir+'/'+this.options.color+'/'+this.options.buttons+')'
});
this.Nav.css({
'color' : this.options.Skin[this.options.color].captionColor
});
this.Descripcion.css({
'color' : this.options.Skin[this.options.color].captionColor
});
/**
* AGREGAMOS LOS EVENTOS
************************/
this.CloseButton.bind('click', $.bind(this, function(){
this.close();
return false;
}));
$(document).bind('keydown', $.bind(this, function(obj, event){
if (this.options.displayed == 1) {
if (event.keyCode == 27){
this.close();
}
if (event.keyCode == 37){
if (this.prev) {
this.prev.trigger('click', event);
}
}
if (event.keyCode == 39){
if (this.next) {
this.next.trigger('click', event);
}
}
}
}));
$(window).bind('resize', $.bind(this, function() {
if(this.options.displayed == 1) {
this.replaceBox();
this.overlay.resize();
}
}));
$(window).bind('scroll', $.bind(this, function() {
if(this.options.displayed == 1) {
this.replaceBox();
}
}));
this.refresh();
},
hook: function(enlace) {
enlace = $(enlace);
enlace.blur();
this.show((enlace.attr("title") || enlace.attr("name") || ""), enlace.attr("href"), (enlace.attr('rel') || false));
},
close: function() {
this.animate(0);
},
refresh: function() {
var self = this;
this.anchors = [];
$("a, area").each(function() {
if ($(this).attr('rel') && new RegExp("^"+self.options.find).test($(this).attr('rel'))){
$(this).click(function(event) {
event.preventDefault();
self.hook(this);
});
if (!($(this).attr('id')==self.options.name+"-Left" || $(this).attr('id')==self.options.name+"-Right")) {
self.anchors.push(this);
}
}
});
},
animate: function(option) {
if(this.options.displayed == 0 && option != 0 || option == 1)
{
this.overlay.show();
this.options.displayed = 1;
this.Wrapper.css({'display': 'block'});
}
else //Cerrar el Lightbox
{
this.Wrapper.css({
'display' : 'none',
'top' : -(this.options.BoxStyles['height']+280)
}).hide();
this.overlay.hide();
this.overlay.element.bind('hide', $.bind(this, function(){
if (this.options.displayed) {
if (this.Image) this.Image.remove();
this.options.displayed = 0;
}
}));
}
},
/*
Function: replaceBox
@description Cambiar de tama?o y posicionar el lightbox en el centro de la pantalla
*/
replaceBox: function(data) {
var size = { x: $(window).width(), y: $(window).height() };
var scroll = { x: $(window).scrollLeft(), y: $(window).scrollTop() };
var width = this.options.BoxStyles['width'];
var height = this.options.BoxStyles['height'];
if (this.options.displayed == 0)
{
var x = 0;
var y = 0;
// vertically center
y = scroll.x + ((size.x - width) / 2);
if (this.options.emergefrom == "bottom")
{
x = (scroll.y + size.y + 80);
}
else // top
{
x = (scroll.y - height) - 80;
}
this.Wrapper.css({
'display' : 'none',
'top' : x,
'left' : y
});
this.Contenedor.css({
'width' : width
});
this.Contenido.css({
'height' : height - 80
});
}
data = $.extend({}, {
'width' : this.lightbox.width,
'height' : this.lightbox.height,
'resize' : 0
}, data);
if (this.MoveBox) this.MoveBox.stop();
this.MoveBox = this.Wrapper.animate({
'left': (scroll.x + ((size.x - data.width) / 2)),
'top' : (scroll.y + (size.y - (data.height + (this.navigator ? 80 : 48))) / 2)
}, {
duration : this.options.moveDuration,
easing : this.options.moveEffect
});
if (data.resize) {
if (this.ResizeBox2) this.ResizeBox2.stop();
this.ResizeBox2 = this.Contenido.animate({
height : data.height
}, {
duration : this.options.resizeDuration,
easing : this.options.resizeEffect
});
if (this.ResizeBox) this.ResizeBox.stop();
this.ResizeBox = this.Contenedor.animate({
width : data.width
}, {
duration : this.options.resizeDuration,
easing : this.options.resizeEffect,
complete : function(){
$(this).trigger('complete');
}
});
}
},
getInfo: function (image, id) {
image=$(image);
IEuta = $('<a id="'+this.options.name+'-'+id+'" title="'+image.attr('title')+'" rel="'+image.attr('rel')+'">&nbsp;</a>');
IEuta.css({ 'background-image' : 'url('+this.options.dir+'/'+this.options.color+'/'+this.options.buttons+')' });
IEuta.attr('href', image.attr('href')); //IE fix
return IEuta;
},
display: function(url, title, force) {
return this.show(title, url, '', force);
},
show: function(caption, url, rel, force) {
this.showLoading();
var baseURL = url.match(/(.+)?/)[1] || url;
var imageURL = /\.(jpe?g|png|gif|bmp)/gi;
var queryString = url.match(/\?(.+)/);
if (queryString) queryString = queryString[1];
var params = this.parseQuery( queryString );
if (this.ResizeBox) this.ResizeBox.unbind('complete'); //fix for jQuery
params = $.extend({}, {
'width' : 0,
'height' : 0,
'modal' : 0,
'background': '',
'title' : caption
}, params || {});
params['width'] = parseInt(params['width']);
params['height'] = parseInt(params['height']);
params['modal'] = parseInt(params['modal']);
this.overlay.options.hideOnClick = !params['modal'];
this.lightbox = $.extend({}, params, { 'width' : params['width'] + 14 });
this.navigator = this.lightbox.title ? true : false;
if ( force=='image' || baseURL.match(imageURL) )
{
this.img = new Image();
this.img.onload = $.bind(this, function(){
this.img.onload=function(){};
if (!params['width'])
{
var objsize = this.calculate(this.img.width, this.img.height);
params['width'] = objsize.x;
params['height'] = objsize.y;
this.lightbox.width = params['width'] + 14;
}
this.lightbox.height = params['height'] - (this.navigator ? 21 : 35);
this.replaceBox({ 'resize' : 1 });
// Mostrar la imagen, solo cuando la animacion de resizado se ha completado
this.ResizeBox.bind('complete', $.bind(this, function(){
this.showImage(this.img.src, params);
}));
});
this.img.onerror = $.bind(this, function() {
this.show('', this.options.imagesdir+'/'+this.options.color+'/404.png', this.options.find);
});
this.img.src = url;
} else { //code to show html pages
this.lightbox.height = params['height']+($.browser.opera?2:0);
this.replaceBox({'resize' : 1});
if (url.indexOf('TB_inline') != -1) //INLINE ID
{
this.ResizeBox.bind('complete', $.bind(this, function(){
this.showContent($('#'+params['inlineId']).html(), this.lightbox);
}));
}
else if(url.indexOf('TB_iframe') != -1) //IFRAME
{
var urlNoQuery = url.split('TB_');
this.ResizeBox.bind('complete', $.bind(this, function(){
this.showIframe(urlNoQuery[0], this.lightbox);
}));
}
else //AJAX
{
this.ResizeBox.bind('complete', $.bind(this, function(){
$.ajax({
url: url,
type: "GET",
cache: false,
error: $.bind(this, function(){this.show('', this.options.imagesdir+'/'+this.options.color+'/404html.png', this.options.find)}),
success: $.bind(this, this.handlerFunc)
});
}));
}
}
this.next = false;
this.prev = false;
//Si la imagen pertenece a un grupo
if (rel.length > this.options.find.length)
{
this.navigator = true;
var foundSelf = false;
var exit = false;
var self = this;
$.each(this.anchors, function(index){
if ($(this).attr('rel') == rel && !exit) {
if ($(this).attr('href') == url) {
foundSelf = true;
} else {
if (foundSelf) {
self.next = self.getInfo(this, "Right");
//stop searching
exit = true;
} else {
self.prev = self.getInfo(this, "Left");
}
}
}
});
}
this.addButtons();
this.showNavBar(caption);
this.animate(1);
},// end function
calculate: function(x, y) {
// Resizing large images
var maxx = $(window).width() - 100;
var maxy = $(window).height() - 100;
if (x > maxx)
{
y = y * (maxx / x);
x = maxx;
if (y > maxy)
{
x = x * (maxy / y);
y = maxy;
}
}
else if (y > maxy)
{
x = x * (maxy / y);
y = maxy;
if (x > maxx)
{
y = y * (maxx / x);
x = maxx;
}
}
// End Resizing
return {x: parseInt(x), y: parseInt(y)};
},
handlerFunc: function(obj, html) {
this.showContent(html, this.lightbox);
},
addButtons: function(){
if(this.prev) this.prev.bind('click', $.bind(this, function(obj, event) {event.preventDefault();this.hook(this.prev);}));
if(this.next) this.next.bind('click', $.bind(this, function(obj, event) {event.preventDefault();this.hook(this.next);}));
},
showNavBar: function() {
if (this.navigator)
{
this.bb.addClass("SLB-bbnav");
this.Nav.empty();
this.innerbb.empty();
this.innerbb.append(this.Nav);
this.Descripcion.html(this.lightbox.title);
this.Nav.append(this.prev);
this.Nav.append(this.next);
this.Nav.append(this.Descripcion);
}
else
{
this.bb.removeClass("SLB-bbnav");
this.innerbb.empty();
}
},
showImage: function(image, size) {
this.Background.empty().removeAttr('style').css({'width':'auto', 'height':'auto'}).append('<img id="'+this.options.name+'-Image"/>');
this.Image = $('#'+this.options.name+'-Image');
this.Image.attr('src', image).css({
'width' : size['width'],
'height' : size['height']
});
this.Contenedor.css({
'background' : 'none'
});
this.Contenido.empty().css({
'background-color': 'transparent',
'padding' : '0px',
'width' : 'auto'
});
},
showContent: function(html, size) {
this.Background.empty().css({
'width' : size['width']-14,
'height' : size['height']+35,
'background-color' : size['background'] || '#ffffff'
});
this.Contenido.empty().css({
'width' : size['width']-14,
'background-color' : size['background'] || '#ffffff'
}).append('<div id="'+this.options.name+'-Image"/>');
this.Image = $('#'+this.options.name+'-Image');
this.Image.css({
'width' : size['width']-14,
'height' : size['height'],
'overflow' : 'auto',
'background' : size['height'] || '#ffffff'
}).append(html);
this.Contenedor.css({
'background': 'none'
});
},
showIframe: function(src, size, bg) {
this.Background.empty().css({
'width' : size['width']-14,
'height' : size['height']+35,
'background-color': size['background'] || '#ffffff'
});
var id = "if_"+new Date().getTime()+"-Image";
this.Contenido.empty().css({
'width' : size['width']-14,
'background-color' : size['background'] || '#ffffff',
'padding' : '0px'
}).append('<iframe id="'+id+'" frameborder="0"></iframe>');
this.Image = $('#'+id);
this.Image.css({
'width' : size['width']-14,
'height' : size['height'],
'background' : size['background'] || '#ffffff'
}).attr('src', src);
this.Contenedor.css({
'background' : 'none'
});
},
showLoading: function() {
this.Background.empty().removeAttr('style').css({'width':'auto', 'height':'auto'});
this.Contenido.empty().css({
'background-color' : 'transparent',
'padding' : '0px',
'width' : 'auto'
});
this.Contenedor.css({
'background' : 'url('+this.options.dir+'/'+this.options.color+'/loading.gif) no-repeat 50% 50%'
});
this.Contenido.empty().css({
'background-color': 'transparent',
'padding' : '0px',
'width' : 'auto'
});
this.replaceBox($.extend(this.options.BoxStyles, {'resize' : 1}));
},
parseQuery: function (query) {
if( !query )
return {};
var params = {};
var pairs = query.split(/[;&]/);
for ( var i = 0; i < pairs.length; i++ ) {
var pair = pairs[i].split('=');
if ( !pair || pair.length != 2 )
continue;
params[unescape(pair[0])] = unescape(pair[1]).replace(/\+/g, ' ');
}
return params;
},
shake: function() {
var d=this.options.shake.distance;
var l=this.Wrapper.position();
l=l.left;
for(x=0;x<this.options.shake.loops;x++) {
this.Wrapper.animate({left: l+d}, this.options.shake.duration, this.options.shake.transition)
.animate({left: l-d}, this.options.shake.duration, this.options.shake.transition);
}
this.Wrapper.animate({"left": l+d}, this.options.shake.duration, this.options.shake.transition)
.animate({"left": l}, this.options.shake.duration, this.options.shake.transition);
}
}
})(jQuery);

File diff suppressed because one or more lines are too long

140
static/home/js/top.js Normal file
View File

@@ -0,0 +1,140 @@
define(function() {
var SendAjax = function (url,callback){
$.ajax({
type : 'GET',
cache : true,
url : url,
dataType : 'jsonp',
jsonp : 'jsonpCallback',
async : false,
success : callback
});
};
var insertHtml = function(bah,url){
var jc = location.href.split('/')[2].split('.')[0];
var bah = bah||'文网游备字2022-RPG 001 号';
var url = url||'';
var htmlft='<div id="footer_b">';
htmlft+='<div class="top">';
htmlft+='<div class="footer_logo">';
htmlft+='<a class="footer_logo_a" title="网页游戏平台">网页游戏</a>';
htmlft+='</div>';
htmlft+='<div class="footer_link">';
htmlft+='<a>关于我们</a>&nbsp;|&nbsp; <a>商务合作</a>&nbsp;|&nbsp; <a>客服中心</a>&nbsp;|&nbsp; <a>人才招聘</a>&nbsp;|&nbsp; <a>家长监护</a><br>';
htmlft+='</div>';
htmlft+='</div>';
htmlft+='<div class="footer_info">';
htmlft+='<div class="footer_1002">';
htmlft+='<p style="height: 30px;line-height: 30px;">游戏平台—做玩家最爱最信任的游戏平台适龄提示本游戏适合18岁以上玩家进入</p>';
htmlft+='<p style="height: 30px;line-height: 30px;">游戏版权所有 Copyright (c) 2022 317743968Game All Rights Reserved&nbsp;&nbsp;</p>';
htmlft+='<p style="line-height: 40px;height: 40px"><a style="color: #666">粤ICP备123456789号-2</a>&nbsp;&nbsp;';
htmlft+='<a style="color: #666">粤公网安备007号</a>&nbsp;&nbsp;';
htmlft+='<a style="color: #666">粤网文[2022] 001-007号 </a>';
htmlft+='&nbsp;&nbsp;'+bah;
htmlft+='</p>';
htmlft+='</div>';
htmlft+='</div>';
htmlft+='</div>';
$("#top .top-pay").attr("href", 'http://' + location.host + '/?g=' + jc);
$("body").append(htmlft);
};
var insertGameList = function () {
/*var url = '//' + location.host + '/?m=game&c=gameApi&a=getHomeGameApi&random=' + Math.random();
var html = "";
SendAjax(url,function(result){
if(!result){return false}
html += "<dt>热门游戏</dt>";
for(var i in result){
if(result[i].g_org&&result[i].g_name){
if(i%3==0){html+="<tr>"}
html+= "<dd><a class='hot-icon' href='"+result[i].g_org+"'>"+result[i].g_name+"<span class='n'></span></a></dd>";
if(i%3==2){html+="</tr>"}
}
}
html += '<dd class="last-dd"><a href="//' + location.host + '/game/" target="_blank" title="更多游戏" ">更多&gt;&gt;</a></dd>'
$("#TopAllGameName").html(html);
});*/
var html = '';
html += '<dt>热门游戏</dt>';
html += '<dd><a class="hot-icon">热血传奇<span class="n"></span></a></dd>';
html += '<dd class="last-dd"><a href="//' + location.host + '/game/" target="_blank" title="更多游戏" ">更多&gt;&gt;</a></dd>';
$("#TopAllGameName").html(html);
};
$.fn.extend({
insertImg:function(obj){
var createHtml = function () {
var html =""
if(obj.url&&obj.src){
html+='<a href="'+obj.url+'" target="_blank"><img src="'+obj.src+'" alt=""></a>';
}else if(obj.src){
html+='<img src="'+obj.src+'" alt="">';
}else {
html=''
}
return html;
}
this.html(createHtml())
}
});
/*var inserImg = function(){
$(".top-wrap .default-flash").insertImg({
src:'//' + location.host + '/js/require/top/images/27090636xnhZ8.jpg',
url:'//' + location.host
});
$(".top-wrap .show-flash").insertImg({
src:'//' + location.host + '/js/require/top/images/27090715hwvpB.png',
url:'//' + location.host
});
};*/
var elementEvent = function(){
$(".all-game,.top-allGame").hover(function(){
$(".top-allGame").show()
}, function(){
$(".top-allGame").hide()
});
$("#allGame").hover(function(){
$("#allGameList").show()
$(this).addClass('active');
},function(){
$("#allGameList").hide();
$(this).removeClass('active');
});
$("#allGameList").hover(function(){
$("#allGameList").show()
$("#allGame").addClass('active');
},function(){
$("#allGameList").hide()
$("#allGame").removeClass('active');
});
$(".top-wrap .top-flash").hover(function(){
$(".top-wrap .show-flash").show();
$(".default-flash").hide();
},function(){
$(".top-wrap .show-flash").hide();
$(".top-wrap .default-flash").show();
});
$("#top .top-login").click(function(){
AL.Init({"box":"login"})
});
$("#top .top-register").click(function(){
AL.Init({"box":"register"})
});
};
return topInit = function(obj,url){
insertHtml(obj,url);
insertGameList();
elementEvent();
//inserImg()
};
});