Authored by lore-w

代码检查

... ... @@ -8,23 +8,23 @@ var $ = require("jquery");
var tools = require("yoho-tools");
var html_front =
'<div class="comfirm">\n\
<div class="comfirm-head">\n\
<a href="javascript:void(0);" class="iconfont close" title="close">&#xe64d;</a>\n\
</div>\n\
<div class="comfirm-content">\n\
<p class="comfirm-text">';
'<div class="comfirm">'+
'<div class="comfirm-head">'+
'<a href="javascript:void(0);" class="iconfont close" title="close">&#xe64d;</a>'+
'</div>'+
'<div class="comfirm-content">'+
'<p class="comfirm-text">';
var html_end =
'</p>\n\
</div>\n\
<div class="comfirm-foot">\n\
<div class="comfirm-line"></div>\n\
<div class="comfirm-ctrl clearfix">\n\
<a href="javascript:void(0);" class="cancel">取消</a>\n\
<a href="javascript:void(0);" class="ok">确定</a>\n\
</div>\n\
</div>\n\
</div>';
'</p>'+
'</div>'+
'<div class="comfirm-foot">'+
'<div class="comfirm-line"></div>'+
'<div class="comfirm-ctrl clearfix">'+
'<a href="javascript:void(0);" class="cancel">取消</a>'+
'<a href="javascript:void(0);" class="ok">确定</a>'+
'</div>'+
'</div>'+
'</div>';
var zhHK = {
'晕了晕了...明明是空的!':'暈了暈了...明明是空的!',
... ...
... ... @@ -72,7 +72,7 @@ require("./login");
commentsItem = '';
commentsList.prependTo(that.$element);
if(data.length == 0) return;
if(data.length === 0) return;
var total = data.total,
viewMoreNum = total-5;
viewMore = $('<div class="view-more"><a href="javascript:;">View&nbsp;<span>'+viewMoreNum+'</span>&nbsp;more</a></div>'),
... ... @@ -82,29 +82,29 @@ require("./login");
for (var i = 0; i < commentLen; i++){
if(commentArr[i].isSelf == true){
commentsItem = $('<li class="clearfix">\n\
<div class="userimg">\n\
<img src="'+commentArr[i].userimg+'" alt="">\n\
<i class="'+commentArr[i].partnerType+'"></i>\n\
</div>\n\
<div class="userinfo">\n\
<h6>'+commentArr[i].username+'</h6>\n\
<p class="comment-text">'+commentArr[i].content+'</p>\n\
<a class="delete-comment" href="javascript:;" pid="'+commentArr[i].id+'"></a>\n\
</div>\n\
</li>');
if(commentArr[i].isSelf === true){
commentsItem = $('<li class="clearfix">'+
'<div class="userimg">'+
'<img src="'+commentArr[i].userimg+'" alt="">'+
'<i class="'+commentArr[i].partnerType+'"></i>'+
'</div>'+
'<div class="userinfo">'+
'<h6>'+commentArr[i].username+'</h6>'+
'<p class="comment-text">'+commentArr[i].content+'</p>'+
'<a class="delete-comment" href="javascript:;" pid="'+commentArr[i].id+'"></a>'+
'</div>'+
'</li>');
}else{
commentsItem = $('<li class="clearfix">\n\
<div class="userimg">\n\
<img src="'+commentArr[i].userimg+'" alt="">\n\
<i class="'+commentArr[i].partnerType+'"></i>\n\
</div>\n\
<div class="userinfo">\n\
<h6>'+commentArr[i].username+'</h6>\n\
<p class="comment-text">'+commentArr[i].content+'</p>\n\
</div>\n\
</li>');
commentsItem = $('<li class="clearfix">'+
'<div class="userimg">'+
'<img src="'+commentArr[i].userimg+'" alt="">'+
'<i class="'+commentArr[i].partnerType+'"></i>'+
'</div>'+
'<div class="userinfo">'+
'<h6>'+commentArr[i].username+'</h6>'+
'<p class="comment-text">'+commentArr[i].content+'</p>'+
'</div>'+
'</li>');
}
commentsList.append(commentsItem);
}
... ... @@ -118,8 +118,8 @@ require("./login");
$(".view-more").find("span").text(num+'k+');
}else if(string.length == 5){
$(".view-more").find("span").text(num+'w+');
};
}
}
};
if(data.page){
var commentPage = data.page;
... ... @@ -138,19 +138,19 @@ require("./login");
_creatTextareaDom:function(){
data = this.options.login;
var textarea = $('<div class="comment-textarea"><textarea placeholder="'+tips.getTips("textareaPlaceholder")+'" cid='+this.options.cid+'></textarea></div>'),
loginarea = $('<div class="login-status clearfix">\n\
<div class="userimg">\n\
<img src="'+YohoConfig.resUrl+'/res/new/boys/images/detail/user-img.png" alt="">\n\
<i></i>\n\
</div>\n\
<div class="userinfo">\n\
<span></span>\n\
<a class="exit-btn" href="javascript:;">退出</a>\n\
</div>\n\
<div class="publish">\n\
<a class="publish-btn" href="javascript:;">Publish</a>\n\
</div>\n\
</div>');
loginarea = $('<div class="login-status clearfix">'+
'<div class="userimg">'+
'<img src="'+YohoConfig.resUrl+'/res/new/boys/images/detail/user-img.png" alt="">'+
'<i></i>'+
'</div>'+
'<div class="userinfo">'+
'<span></span>'+
'<a class="exit-btn" href="javascript:;">退出</a>'+
'</div>'+
'<div class="publish">'+
'<a class="publish-btn" href="javascript:;">Publish</a>'+
'</div>'+
'</div>');
textarea.appendTo(this.$element);
loginarea.appendTo(textarea);
if(this.options.isFeedback){
... ... @@ -166,20 +166,20 @@ require("./login");
_creatFeedbackLogin:function(){
var $feedbackLogin = '';
if(tips.isJian){
$feedbackLogin = $('<div class="feedback-login clearfix">\n\
<span>'+tips.getTips("thirdLoginFeedback")+'</span>\n\
<a class="qq" ref="/passport/partner/index/oauth/qq" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-qq.png" alt="" /></a>\n\
<a class="yoho" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-yoho.png" alt="" /></a>\n\
<a class="sina" ref="/passport/partner/index/oauth/sina" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-sina.png" alt="" /></a>\n\
</div>');
$feedbackLogin = $('<div class="feedback-login clearfix">'+
'<span>'+tips.getTips("thirdLoginFeedback")+'</span>'+
'<a class="qq" ref="/passport/partner/index/oauth/qq" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-qq.png" alt="" /></a>'+
'<a class="yoho" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-yoho.png" alt="" /></a>'+
'<a class="sina" ref="/passport/partner/index/oauth/sina" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-sina.png" alt="" /></a>'+
'</div>');
}else{
$feedbackLogin = $('<div class="feedback-login clearfix">\n\
<span>'+tips.getTips("thirdLoginFeedback")+'</span>\n\
<a class="fb" ref="/passport/partner/index/oauth/facebook" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-facebook.png" alt="" /></a>\n\
<a class="yoho" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-yoho.png" alt="" /></a>\n\
<a class="sina" ref="/passport/partner/index/oauth/sina" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-sina.png" alt="" /></a>\n\
<a class="qq" ref="/passport/partner/index/oauth/qq" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-qq.png" alt="" /></a>\n\
</div>');
$feedbackLogin = $('<div class="feedback-login clearfix">'+
'<span>'+tips.getTips("thirdLoginFeedback")+'</span>'+
'<a class="fb" ref="/passport/partner/index/oauth/facebook" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-facebook.png" alt="" /></a>'+
'<a class="yoho" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-yoho.png" alt="" /></a>'+
'<a class="sina" ref="/passport/partner/index/oauth/sina" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-sina.png" alt="" /></a>'+
'<a class="qq" ref="/passport/partner/index/oauth/qq" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-qq.png" alt="" /></a>'+
'</div>');
}
$feedbackLogin.appendTo(this.$element);
},
... ... @@ -286,7 +286,7 @@ require("./login");
'</div>'+
'</li>';
}
if($target.find("li").size()==0){
if($target.find("li").size()===0){
$target.html(commentItem);
}else{
$target.find("li").eq(0).before(commentItem);
... ... @@ -302,7 +302,7 @@ require("./login");
var comments = 1;
if(!!parseInt(that.options.commentNum.eq(0).text())){
comments = parseInt(that.options.commentNum.eq(0).text())+1;
};
}
that.options.commentNum.text(comments);
}
else if(900000 == response.code){
... ... @@ -337,29 +337,29 @@ require("./login");
var pageIcon = $('<div class="channel-index-pager">'+commentPage+'</div>');
$(".comments-list").empty();
for (var i = 0; i < commentLen; i++){
if(commentArr[i].isSelf == true){
commentsItem = $('<li class="clearfix">\n\
<div class="userimg">\n\
<img src="'+commentArr[i].userimg+'" alt="">\n\
<i class="'+commentArr[i].partnerType+'"></i>\n\
</div>\n\
<div class="userinfo">\n\
<h6>'+commentArr[i].username+'</h6>\n\
<p class="comment-text">'+commentArr[i].content+'</p>\n\
<a class="delete-comment" href="javascript:;" pid="'+commentArr[i].id+'"></a>\n\
</div>\n\
</li>');
if(commentArr[i].isSelf === true){
commentsItem = $('<li class="clearfix">'+
'<div class="userimg">'+
'<img src="'+commentArr[i].userimg+'" alt="">'+
'<i class="'+commentArr[i].partnerType+'"></i>'+
'</div>'+
'<div class="userinfo">'+
'<h6>'+commentArr[i].username+'</h6>'+
'<p class="comment-text">'+commentArr[i].content+'</p>'+
'<a class="delete-comment" href="javascript:;" pid="'+commentArr[i].id+'"></a>'+
'</div>'+
'</li>');
}else{
commentsItem = $('<li class="clearfix">\n\
<div class="userimg">\n\
<img src="'+commentArr[i].userimg+'" alt="">\n\
<i class="'+commentArr[i].partnerType+'"></i>\n\
</div>\n\
<div class="userinfo">\n\
<h6>'+commentArr[i].username+'</h6>\n\
<p class="comment-text">'+commentArr[i].content+'</p>\n\
</div>\n\
</li>');
commentsItem = $('<li class="clearfix">'+
'<div class="userimg">'+
'<img src="'+commentArr[i].userimg+'" alt="">'+
'<i class="'+commentArr[i].partnerType+'"></i>'+
'</div>'+
'<div class="userinfo">'+
'<h6>'+commentArr[i].username+'</h6>'+
'<p class="comment-text">'+commentArr[i].content+'</p>'+
'</div>'+
'</li>');
}
$(".comments-list").append(commentsItem);
}
... ...
... ... @@ -32,7 +32,7 @@ var flip = require("./flip");
init:function(){
//this.$contentWrap.text(this.$contentWrap.html());
if(this.len ==0) return;
if(this.len ===0) return;
this._browserjuge();
this._creat();
this._bindEvent();
... ... @@ -78,7 +78,7 @@ var flip = require("./flip");
var _this = this;
if(this.len<=1) return;
//除了第一页,均不显示封面图
if(index == 0){
if(index === 0){
this.$coverPic.show();
}else{
this.$coverPic.hide();
... ... @@ -136,7 +136,7 @@ var flip = require("./flip");
// 如果传递的options是一个字符串,则表示调用改对象的原型方法。
if (typeof option == 'string') data[option](_relatedTarget);
});
};
}
$.fn.contentPaging = Plugin;
... ...
... ... @@ -4,11 +4,11 @@
date:2015-01-07
*/
var $=require("jquery");
var validate = require("./validate");
//var validate = require("./validate");
var box = require("./box");
var tools = require("yoho-tools");
var tips=require("./tips");
;
(function(global, undefined) {
var Login = function(element, options) {
... ... @@ -31,7 +31,7 @@ var tips=require("./tips");
this._bindEvent();
}
this.initLoginState();
if(!$(".cookieList").size() >0){
if($(".cookieList").size()<=0){
var cookieList = $('<ul class="cookieList"></ul>').appendTo($(".accountwrap"));
}
this.cookieAccount();
... ... @@ -91,7 +91,7 @@ var tips=require("./tips");
}
}).on("blur",function()
{
if ($(this).val() == '')
if ($(this).val() === '')
{
$(this).addClass("default-tip");
$(this).val(tips.getTips("yohoAccount"));
... ... @@ -99,7 +99,7 @@ var tips=require("./tips");
});
$('.yoho-pwd-text').on("focus",function()
{
if ($(this).val() == '' || $(this).val() == tips.getTips("yohoPwd"))
if ($(this).val() === '' || $(this).val() == tips.getTips("yohoPwd"))
{
$('.yoho-pwd').val('').show().focus();
... ... @@ -109,7 +109,7 @@ var tips=require("./tips");
});
$('.yoho-pwd').on("blur",function()
{
if ($(this).val() == '')
if ($(this).val() === '')
{
$(this).hide();
$('.yoho-pwd-text').addClass("default-tip");
... ... @@ -137,7 +137,7 @@ var tips=require("./tips");
var currentUserName=tools.cookie('userName');
var account = $(".yoho-account").val();
if(currentUserName==null||currentUserName==undefined){
if(currentUserName===null||currentUserName===undefined){
tools.cookie('userName',account,{expires:5,path: '/'});
}else{
tools.cookie('userName',currentUserName+","+account,{expires:5,path: '/'});
... ... @@ -148,7 +148,7 @@ var tips=require("./tips");
that.closeLoginBox();
$this.comment("publishComment");
}
else if (response&&response.message != '')
else if (response&&response.message !== '')
{
$(".login-box").find(".warn").css({"visibility":"visible"});
}
... ... @@ -164,9 +164,9 @@ var tips=require("./tips");
//回车执行登录
$(".login-box").find(".yoho-pwd").keyup(function(e)
{
var e = e || window.event;
var k = e.keyCode || e.which;
if (k == 13)
var event = e || window.event;
var k = event.keyCode || event.which;
if (k == 13)
{
$('#login').trigger("click.login");
}
... ... @@ -333,7 +333,7 @@ var tips=require("./tips");
// 如果传递的options是一个字符串,则表示调用改对象的原型方法。
if (typeof option == 'string') data[option](_relatedTarget);
});
};
}
$.fn.login = Plugin;
... ...
... ... @@ -9,11 +9,12 @@ exports.init=function(){
var $this=$(this);
var fontSize ;
var fontSize;
var lineHeight;
if(!window.lineHeightDatabase[keyword]){
window.lineHeightDatabase[keyword]={fontSize:0,lineHeight:0};
}
if(window.lineHeightDatabase[keyword].fontSize!=0)
if(window.lineHeightDatabase[keyword].fontSize!==0)
{
fontSize=window.lineHeightDatabase[keyword].fontSize;
}
... ... @@ -23,7 +24,7 @@ exports.init=function(){
window.lineHeightDatabase[keyword].fontSize=fontSize;
}
//获取计算后的样式
if(window.lineHeightDatabase[keyword].lineHeight!=0)
if(window.lineHeightDatabase[keyword].lineHeight!==0)
{
lineHeight=window.lineHeightDatabase[keyword].lineHeight;
window.lineHeightDatabase[keyword].lineHeight=lineHeight;
... ... @@ -31,14 +32,14 @@ exports.init=function(){
else
{
if(/msie/i.test(navigator.userAgent)){
var lineHeight = getFinalStyle(this[0],"lineHeight",fontSize);
lineHeight = getFinalStyle(this[0],"lineHeight",fontSize);
}
else{
var lineHeight = getFinalStyle(this[0],"lineHeight");
lineHeight = getFinalStyle(this[0],"lineHeight");
}
}
if(this[0]==null)
if(this[0]===null)
return;
var height = this[0].clientHeight;
... ... @@ -50,44 +51,46 @@ exports.init=function(){
else{lineHeight = Number(lineHeight);}
return parseInt(height/lineHeight);
}
};
$.fn.mlellipsis=function(row,keyword){
//省略后加上title
var $this=$(this);
var title = $this.attr("_title");
if(!title){
$this.attr("_title",$this.text());
}
else{
$this.text(title);
}
//获取计算后的样式
var fontSize ;
var fontSize;
var lineHeight;
if(!window.lineHeightDatabase[keyword]){
window.lineHeightDatabase[keyword]={fontSize:0,lineHeight:0};
}
if(window.lineHeightDatabase[keyword].fontSize!=0)
if(window.lineHeightDatabase[keyword].fontSize!==0)
{
fontSize=window.lineHeightDatabase[keyword].fontSize;
}
else
{
var fontSize= getFinalStyle(this[0],"fontSize");
//var fontSize= getFinalStyle(this[0],"fontSize");
fontSize= getFinalStyle(this[0],"fontSize");
window.lineHeightDatabase[keyword].fontSize=fontSize;
}
//获取计算后的样式
if(window.lineHeightDatabase[keyword].lineHeight!=0)
if(window.lineHeightDatabase[keyword].lineHeight!==0)
{
lineHeight=window.lineHeightDatabase[keyword].lineHeight;
}
else
{
if(/msie/i.test(navigator.userAgent)){
var lineHeight = getFinalStyle(this[0],"lineHeight",fontSize);
lineHeight = getFinalStyle(this[0],"lineHeight",fontSize);
}
else{
var lineHeight = getFinalStyle(this[0],"lineHeight");
lineHeight = getFinalStyle(this[0],"lineHeight");
//window.lineHeightDatabase[keyword].lineHeight=lineHeight;
}
}
... ... @@ -125,7 +128,7 @@ exports.init=function(){
return parseInt(height/lineHeight);
}
}
};
$.fn.fillText=function(keyword){
//省略后加上title
var $this=$(this);
... ... @@ -138,31 +141,33 @@ exports.init=function(){
$this.text(title);
}
//获取计算后的样式
var fontSize ;
var fontSize;
var lineHeight;
if(!window.lineHeightDatabase[keyword]){
window.lineHeightDatabase[keyword]={fontSize:0,lineHeight:0};
}
if(window.lineHeightDatabase[keyword].fontSize!=0)
if(window.lineHeightDatabase[keyword].fontSize!==0)
{
fontSize=window.lineHeightDatabase[keyword].fontSize;
}
else
{
var fontSize= getFinalStyle(this[0],"fontSize");
//var fontSize= getFinalStyle(this[0],"fontSize");
fontSize= getFinalStyle(this[0],"fontSize");
window.lineHeightDatabase[keyword].fontSize=fontSize;
}
//获取计算后的样式
if(window.lineHeightDatabase[keyword].lineHeight!=0)
if(window.lineHeightDatabase[keyword].lineHeight!==0)
{
lineHeight=window.lineHeightDatabase[keyword].lineHeight;
}
else
{
if(/msie/i.test(navigator.userAgent)){
var lineHeight = getFinalStyle(this[0],"lineHeight",fontSize);
lineHeight = getFinalStyle(this[0],"lineHeight",fontSize);
}
else{
var lineHeight = getFinalStyle(this[0],"lineHeight");
lineHeight = getFinalStyle(this[0],"lineHeight");
//window.lineHeightDatabase[keyword].lineHeight=lineHeight;
}
}
... ... @@ -212,16 +217,16 @@ exports.init=function(){
}
}
}
};
function getFinalStyle( obj, property,fontSize)
function getFinalStyle( obj, property)
{
var s;
if(obj!=null&&obj.currentStyle){
if(obj!==null&&obj.currentStyle){
s = parseInt(obj.currentStyle[property].replace("px",""));
}
else
if(window.getComputedStyle&&obj!=null){
if(window.getComputedStyle&&obj!==null){
s = window.getComputedStyle(obj, null)[property].replace("px","");
}
... ...
... ... @@ -47,9 +47,9 @@ exports.initSlide=function(info){
$(".photoslider_drag_message")
.html("← SLIDE →")
.show();
var u = navigator.userAgent;
//var u = navigator.userAgent;
if(isMobile&&$(obj).find(".drageObject")[0]==null||brow.bIsIpad||brow.bIsAndroid)
if(isMobile&&$(obj).find(".drageObject")[0]===null||brow.bIsIpad||brow.bIsAndroid)
{
$("<div/>").css({
position:"absolute",
... ... @@ -115,7 +115,7 @@ exports.initSlide=function(info){
}
});
var self=this;
//var self=this;
}
});
... ...
... ... @@ -39,7 +39,7 @@ exports.init=function(info){
$(".yohoo-share-button-sina").unbind().on("click", function()
{
if(options.sinaTextFunction!=null)
if(options.sinaTextFunction!==null)
{
options.sinaText=(function(){
return options.sinaTextFunction.apply($(".yohoo-share-button-sina"));
... ... @@ -51,7 +51,7 @@ exports.init=function(info){
.replace(/[+]/g,"%2B");
window.sharetitle = options.sinaText;
if(options.imgFunction!=null)
if(options.imgFunction!==null)
{
options.img=(function(){
return options.imgFunction.apply($(".yohoo-share-button-sina"));
... ... @@ -60,7 +60,7 @@ exports.init=function(info){
window.shareUrl = options.img
share();
});
if(options.shareUrlFunction!=null)
if(options.shareUrlFunction!==null)
{
options.shareUrl=(function(){
return options.shareUrlFunction.apply({sina:$(".yohoo-share-button-sina"),
... ... @@ -70,20 +70,19 @@ exports.init=function(info){
}
else
{
options.shareUrl=options.shareUrl==""?document.location.href:options.shareUrl;
options.shareUrl=options.shareUrl===""?document.location.href:options.shareUrl;
}
function share()
{
function share() {
(function(s, d, e) {
try {
} catch (e) {
}
/*try {
} catch (err) {
}*/
var f = 'http://v.t.sina.com.cn/share/share.php?', u = options.shareUrl, p = ['url=', e(u), '&title=', e(window.sharetitle+' @YOHO潮流志'), '&appkey=3910025296', '&pic=', e(window.shareUrl)].join('');
function a() {
if (!window.open([f, p].join(''), 'mb', ['toolbar=0,status=0,resizable=1,width=620,height=450,left=', (s.width - 620) / 2, ',top=', (s.height - 450) / 2].join('')))
u.href = [f, p].join('');
};
}
if (/Firefox/.test(navigator.userAgent)) {
setTimeout(a, 0)
} else {
... ... @@ -95,14 +94,14 @@ exports.init=function(info){
var iTop = (window.screen.availHeight - 30 - options.height) / 2; //获得窗口的垂直位置;
var iLeft = (window.screen.availWidth - 10 - options.width) / 2; //获得窗口的水平位置;
$(".yohoo-share-button-facebook").unbind().on("click",function() {
if(options.imgFunction!=null)
if(options.imgFunction!==null)
{
options.img=(function(){
return options.imgFunction.apply($(".yohoo-share-button-facebook"));
})();
}
var tmpResult={des:"",name:"",caption:""};
if(options.fbTextFunction!=null)
if(options.fbTextFunction!==null)
{
tmpResult=(function(){
return options.fbTextFunction.apply($(".yohoo-share-button-facebook"));
... ... @@ -142,7 +141,7 @@ exports.init=function(info){
"link=" + options.shareUrl +
"&picture=" + options.img+
"&caption=" +options.fbName+
"&description="+options.fbDescription+(options.fbDescription==""?"":"(分享自 @yohoboy)")+
"&description="+options.fbDescription+(options.fbDescription===""?"":"(分享自 @yohoboy)")+
"&name="+options.fbCaption,
"",
"height="+options.height+",width="+options.width+",left=" + iLeft + ",top=" + iTop);
... ... @@ -150,7 +149,7 @@ exports.init=function(info){
});
$(".yohoo-share-button-tweet").unbind().on("click",function() {
if(options.tweetTextFunction!=null)
if(options.tweetTextFunction!==null)
{
options.tweetText=(function(){
return options.tweetTextFunction.apply($(".yohoo-share-button-tweet"));
... ...
... ... @@ -6,7 +6,6 @@
var $=require("jquery");
require('./lazyloadImage');
;
(function(global, undefined) {
var Slider = function(element, options) {
... ... @@ -63,7 +62,7 @@ require('./lazyloadImage');
},
addIndex:function(){
this.options.pageCtrl.children().each(function(i,value){
this.options.pageCtrl.children().each(function(i){
$(this).attr("index",i);
})
},
... ... @@ -114,7 +113,7 @@ require('./lazyloadImage');
if(this.ctrlIndex < 0){
this.ctrlIndex = maxCtrlIndex;
}
if(this.ctrlIndex == 0){
if(this.ctrlIndex === 0){
this.options.pageCtrl.stop().animate({"left":0});
}else{
this.options.pageCtrl.stop().animate({"left":-this.ctrlWidth*this.ctrlIndex-excessWidth});
... ... @@ -141,7 +140,7 @@ require('./lazyloadImage');
},
animate:function(offset){
var left = parseInt(this.$element.css('left')) + offset;
//var left = parseInt(this.$element.css('left')) + offset;
var _this = this;
if (offset>0) {
offset = '+=' + offset;
... ... @@ -159,11 +158,11 @@ require('./lazyloadImage');
this.ctrlWidth = this.ctrlEle.width() + parseInt(this.ctrlEle.eq(1).css("marginLeft"));
this.setWidth();
this.$element.css({'left': -this.index*this.width});
if(this.ctrlIndex == 0) return;
if(this.ctrlIndex === 0) return;
this.options.pageCtrl.css({"left":-this.ctrlWidth*this.ctrlIndex-this.excessWidth});
}
}
};
function Plugin(option, _relatedTarget) {
... ... @@ -177,8 +176,7 @@ require('./lazyloadImage');
// 如果传递的options是一个字符串,则表示调用改对象的原型方法。
if (typeof option == 'string') data[option](_relatedTarget);
});
};
}
$.fn.slider = Plugin;
$.fn.slider.Constructor = Slider;
... ...
... ... @@ -25,4 +25,4 @@ function isJian(){
window.DicTips={
}
};
... ...
... ... @@ -19,7 +19,7 @@ exports.isMobile = function (val)
//昵称检测
exports.isNickname = function (val)
{
valid = /^[\u4E00-\u9FA5A-Za-z0-9_-]{2,32}$/;
var valid = /^[\u4E00-\u9FA5A-Za-z0-9_-]{2,32}$/;
return valid.test(val);
};
... ...