Authored by lore-w

代码检查

@@ -8,23 +8,23 @@ var $ = require("jquery"); @@ -8,23 +8,23 @@ var $ = require("jquery");
8 var tools = require("yoho-tools"); 8 var tools = require("yoho-tools");
9 9
10 var html_front = 10 var html_front =
11 -'<div class="comfirm">\n\  
12 -<div class="comfirm-head">\n\  
13 - <a href="javascript:void(0);" class="iconfont close" title="close">&#xe64d;</a>\n\  
14 -</div>\n\  
15 -<div class="comfirm-content">\n\  
16 - <p class="comfirm-text">'; 11 +'<div class="comfirm">'+
  12 +'<div class="comfirm-head">'+
  13 + '<a href="javascript:void(0);" class="iconfont close" title="close">&#xe64d;</a>'+
  14 +'</div>'+
  15 +'<div class="comfirm-content">'+
  16 + '<p class="comfirm-text">';
17 var html_end = 17 var html_end =
18 - '</p>\n\  
19 -</div>\n\  
20 -<div class="comfirm-foot">\n\  
21 - <div class="comfirm-line"></div>\n\  
22 - <div class="comfirm-ctrl clearfix">\n\  
23 - <a href="javascript:void(0);" class="cancel">取消</a>\n\  
24 - <a href="javascript:void(0);" class="ok">确定</a>\n\  
25 - </div>\n\  
26 -</div>\n\  
27 -</div>'; 18 + '</p>'+
  19 +'</div>'+
  20 +'<div class="comfirm-foot">'+
  21 + '<div class="comfirm-line"></div>'+
  22 + '<div class="comfirm-ctrl clearfix">'+
  23 + '<a href="javascript:void(0);" class="cancel">取消</a>'+
  24 + '<a href="javascript:void(0);" class="ok">确定</a>'+
  25 + '</div>'+
  26 +'</div>'+
  27 +'</div>';
28 28
29 var zhHK = { 29 var zhHK = {
30 '晕了晕了...明明是空的!':'暈了暈了...明明是空的!', 30 '晕了晕了...明明是空的!':'暈了暈了...明明是空的!',
@@ -72,7 +72,7 @@ require("./login"); @@ -72,7 +72,7 @@ require("./login");
72 commentsItem = ''; 72 commentsItem = '';
73 commentsList.prependTo(that.$element); 73 commentsList.prependTo(that.$element);
74 74
75 - if(data.length == 0) return; 75 + if(data.length === 0) return;
76 var total = data.total, 76 var total = data.total,
77 viewMoreNum = total-5; 77 viewMoreNum = total-5;
78 viewMore = $('<div class="view-more"><a href="javascript:;">View&nbsp;<span>'+viewMoreNum+'</span>&nbsp;more</a></div>'), 78 viewMore = $('<div class="view-more"><a href="javascript:;">View&nbsp;<span>'+viewMoreNum+'</span>&nbsp;more</a></div>'),
@@ -82,29 +82,29 @@ require("./login"); @@ -82,29 +82,29 @@ require("./login");
82 82
83 83
84 for (var i = 0; i < commentLen; i++){ 84 for (var i = 0; i < commentLen; i++){
85 - if(commentArr[i].isSelf == true){  
86 - commentsItem = $('<li class="clearfix">\n\  
87 - <div class="userimg">\n\  
88 - <img src="'+commentArr[i].userimg+'" alt="">\n\  
89 - <i class="'+commentArr[i].partnerType+'"></i>\n\  
90 - </div>\n\  
91 - <div class="userinfo">\n\  
92 - <h6>'+commentArr[i].username+'</h6>\n\  
93 - <p class="comment-text">'+commentArr[i].content+'</p>\n\  
94 - <a class="delete-comment" href="javascript:;" pid="'+commentArr[i].id+'"></a>\n\  
95 - </div>\n\  
96 - </li>'); 85 + if(commentArr[i].isSelf === true){
  86 + commentsItem = $('<li class="clearfix">'+
  87 + '<div class="userimg">'+
  88 + '<img src="'+commentArr[i].userimg+'" alt="">'+
  89 + '<i class="'+commentArr[i].partnerType+'"></i>'+
  90 + '</div>'+
  91 + '<div class="userinfo">'+
  92 + '<h6>'+commentArr[i].username+'</h6>'+
  93 + '<p class="comment-text">'+commentArr[i].content+'</p>'+
  94 + '<a class="delete-comment" href="javascript:;" pid="'+commentArr[i].id+'"></a>'+
  95 + '</div>'+
  96 + '</li>');
97 }else{ 97 }else{
98 - commentsItem = $('<li class="clearfix">\n\  
99 - <div class="userimg">\n\  
100 - <img src="'+commentArr[i].userimg+'" alt="">\n\  
101 - <i class="'+commentArr[i].partnerType+'"></i>\n\  
102 - </div>\n\  
103 - <div class="userinfo">\n\  
104 - <h6>'+commentArr[i].username+'</h6>\n\  
105 - <p class="comment-text">'+commentArr[i].content+'</p>\n\  
106 - </div>\n\  
107 - </li>'); 98 + commentsItem = $('<li class="clearfix">'+
  99 + '<div class="userimg">'+
  100 + '<img src="'+commentArr[i].userimg+'" alt="">'+
  101 + '<i class="'+commentArr[i].partnerType+'"></i>'+
  102 + '</div>'+
  103 + '<div class="userinfo">'+
  104 + '<h6>'+commentArr[i].username+'</h6>'+
  105 + '<p class="comment-text">'+commentArr[i].content+'</p>'+
  106 + '</div>'+
  107 + '</li>');
108 } 108 }
109 commentsList.append(commentsItem); 109 commentsList.append(commentsItem);
110 } 110 }
@@ -118,8 +118,8 @@ require("./login"); @@ -118,8 +118,8 @@ require("./login");
118 $(".view-more").find("span").text(num+'k+'); 118 $(".view-more").find("span").text(num+'k+');
119 }else if(string.length == 5){ 119 }else if(string.length == 5){
120 $(".view-more").find("span").text(num+'w+'); 120 $(".view-more").find("span").text(num+'w+');
121 - };  
122 } 121 }
  122 + };
123 123
124 if(data.page){ 124 if(data.page){
125 var commentPage = data.page; 125 var commentPage = data.page;
@@ -138,19 +138,19 @@ require("./login"); @@ -138,19 +138,19 @@ require("./login");
138 _creatTextareaDom:function(){ 138 _creatTextareaDom:function(){
139 data = this.options.login; 139 data = this.options.login;
140 var textarea = $('<div class="comment-textarea"><textarea placeholder="'+tips.getTips("textareaPlaceholder")+'" cid='+this.options.cid+'></textarea></div>'), 140 var textarea = $('<div class="comment-textarea"><textarea placeholder="'+tips.getTips("textareaPlaceholder")+'" cid='+this.options.cid+'></textarea></div>'),
141 - loginarea = $('<div class="login-status clearfix">\n\  
142 - <div class="userimg">\n\  
143 - <img src="'+YohoConfig.resUrl+'/res/new/boys/images/detail/user-img.png" alt="">\n\  
144 - <i></i>\n\  
145 - </div>\n\  
146 - <div class="userinfo">\n\  
147 - <span></span>\n\  
148 - <a class="exit-btn" href="javascript:;">退出</a>\n\  
149 - </div>\n\  
150 - <div class="publish">\n\  
151 - <a class="publish-btn" href="javascript:;">Publish</a>\n\  
152 - </div>\n\  
153 - </div>'); 141 + loginarea = $('<div class="login-status clearfix">'+
  142 + '<div class="userimg">'+
  143 + '<img src="'+YohoConfig.resUrl+'/res/new/boys/images/detail/user-img.png" alt="">'+
  144 + '<i></i>'+
  145 + '</div>'+
  146 + '<div class="userinfo">'+
  147 + '<span></span>'+
  148 + '<a class="exit-btn" href="javascript:;">退出</a>'+
  149 + '</div>'+
  150 + '<div class="publish">'+
  151 + '<a class="publish-btn" href="javascript:;">Publish</a>'+
  152 + '</div>'+
  153 + '</div>');
154 textarea.appendTo(this.$element); 154 textarea.appendTo(this.$element);
155 loginarea.appendTo(textarea); 155 loginarea.appendTo(textarea);
156 if(this.options.isFeedback){ 156 if(this.options.isFeedback){
@@ -166,20 +166,20 @@ require("./login"); @@ -166,20 +166,20 @@ require("./login");
166 _creatFeedbackLogin:function(){ 166 _creatFeedbackLogin:function(){
167 var $feedbackLogin = ''; 167 var $feedbackLogin = '';
168 if(tips.isJian){ 168 if(tips.isJian){
169 - $feedbackLogin = $('<div class="feedback-login clearfix">\n\  
170 - <span>'+tips.getTips("thirdLoginFeedback")+'</span>\n\  
171 - <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\  
172 - <a class="yoho" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-yoho.png" alt="" /></a>\n\  
173 - <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\  
174 - </div>'); 169 + $feedbackLogin = $('<div class="feedback-login clearfix">'+
  170 + '<span>'+tips.getTips("thirdLoginFeedback")+'</span>'+
  171 + '<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>'+
  172 + '<a class="yoho" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-yoho.png" alt="" /></a>'+
  173 + '<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>'+
  174 + '</div>');
175 }else{ 175 }else{
176 - $feedbackLogin = $('<div class="feedback-login clearfix">\n\  
177 - <span>'+tips.getTips("thirdLoginFeedback")+'</span>\n\  
178 - <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\  
179 - <a class="yoho" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-yoho.png" alt="" /></a>\n\  
180 - <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\  
181 - <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\  
182 - </div>'); 176 + $feedbackLogin = $('<div class="feedback-login clearfix">'+
  177 + '<span>'+tips.getTips("thirdLoginFeedback")+'</span>'+
  178 + '<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>'+
  179 + '<a class="yoho" href="javascript:;"><img src="'+YohoConfig.resUrl+'/res/new/boys/images/about/thirdbtn-yoho.png" alt="" /></a>'+
  180 + '<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>'+
  181 + '<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>'+
  182 + '</div>');
183 } 183 }
184 $feedbackLogin.appendTo(this.$element); 184 $feedbackLogin.appendTo(this.$element);
185 }, 185 },
@@ -286,7 +286,7 @@ require("./login"); @@ -286,7 +286,7 @@ require("./login");
286 '</div>'+ 286 '</div>'+
287 '</li>'; 287 '</li>';
288 } 288 }
289 - if($target.find("li").size()==0){ 289 + if($target.find("li").size()===0){
290 $target.html(commentItem); 290 $target.html(commentItem);
291 }else{ 291 }else{
292 $target.find("li").eq(0).before(commentItem); 292 $target.find("li").eq(0).before(commentItem);
@@ -302,7 +302,7 @@ require("./login"); @@ -302,7 +302,7 @@ require("./login");
302 var comments = 1; 302 var comments = 1;
303 if(!!parseInt(that.options.commentNum.eq(0).text())){ 303 if(!!parseInt(that.options.commentNum.eq(0).text())){
304 comments = parseInt(that.options.commentNum.eq(0).text())+1; 304 comments = parseInt(that.options.commentNum.eq(0).text())+1;
305 - }; 305 + }
306 that.options.commentNum.text(comments); 306 that.options.commentNum.text(comments);
307 } 307 }
308 else if(900000 == response.code){ 308 else if(900000 == response.code){
@@ -337,29 +337,29 @@ require("./login"); @@ -337,29 +337,29 @@ require("./login");
337 var pageIcon = $('<div class="channel-index-pager">'+commentPage+'</div>'); 337 var pageIcon = $('<div class="channel-index-pager">'+commentPage+'</div>');
338 $(".comments-list").empty(); 338 $(".comments-list").empty();
339 for (var i = 0; i < commentLen; i++){ 339 for (var i = 0; i < commentLen; i++){
340 - if(commentArr[i].isSelf == true){  
341 - commentsItem = $('<li class="clearfix">\n\  
342 - <div class="userimg">\n\  
343 - <img src="'+commentArr[i].userimg+'" alt="">\n\  
344 - <i class="'+commentArr[i].partnerType+'"></i>\n\  
345 - </div>\n\  
346 - <div class="userinfo">\n\  
347 - <h6>'+commentArr[i].username+'</h6>\n\  
348 - <p class="comment-text">'+commentArr[i].content+'</p>\n\  
349 - <a class="delete-comment" href="javascript:;" pid="'+commentArr[i].id+'"></a>\n\  
350 - </div>\n\  
351 - </li>'); 340 + if(commentArr[i].isSelf === true){
  341 + commentsItem = $('<li class="clearfix">'+
  342 + '<div class="userimg">'+
  343 + '<img src="'+commentArr[i].userimg+'" alt="">'+
  344 + '<i class="'+commentArr[i].partnerType+'"></i>'+
  345 + '</div>'+
  346 + '<div class="userinfo">'+
  347 + '<h6>'+commentArr[i].username+'</h6>'+
  348 + '<p class="comment-text">'+commentArr[i].content+'</p>'+
  349 + '<a class="delete-comment" href="javascript:;" pid="'+commentArr[i].id+'"></a>'+
  350 + '</div>'+
  351 + '</li>');
352 }else{ 352 }else{
353 - commentsItem = $('<li class="clearfix">\n\  
354 - <div class="userimg">\n\  
355 - <img src="'+commentArr[i].userimg+'" alt="">\n\  
356 - <i class="'+commentArr[i].partnerType+'"></i>\n\  
357 - </div>\n\  
358 - <div class="userinfo">\n\  
359 - <h6>'+commentArr[i].username+'</h6>\n\  
360 - <p class="comment-text">'+commentArr[i].content+'</p>\n\  
361 - </div>\n\  
362 - </li>'); 353 + commentsItem = $('<li class="clearfix">'+
  354 + '<div class="userimg">'+
  355 + '<img src="'+commentArr[i].userimg+'" alt="">'+
  356 + '<i class="'+commentArr[i].partnerType+'"></i>'+
  357 + '</div>'+
  358 + '<div class="userinfo">'+
  359 + '<h6>'+commentArr[i].username+'</h6>'+
  360 + '<p class="comment-text">'+commentArr[i].content+'</p>'+
  361 + '</div>'+
  362 + '</li>');
363 } 363 }
364 $(".comments-list").append(commentsItem); 364 $(".comments-list").append(commentsItem);
365 } 365 }
@@ -32,7 +32,7 @@ var flip = require("./flip"); @@ -32,7 +32,7 @@ var flip = require("./flip");
32 32
33 init:function(){ 33 init:function(){
34 //this.$contentWrap.text(this.$contentWrap.html()); 34 //this.$contentWrap.text(this.$contentWrap.html());
35 - if(this.len ==0) return; 35 + if(this.len ===0) return;
36 this._browserjuge(); 36 this._browserjuge();
37 this._creat(); 37 this._creat();
38 this._bindEvent(); 38 this._bindEvent();
@@ -78,7 +78,7 @@ var flip = require("./flip"); @@ -78,7 +78,7 @@ var flip = require("./flip");
78 var _this = this; 78 var _this = this;
79 if(this.len<=1) return; 79 if(this.len<=1) return;
80 //除了第一页,均不显示封面图 80 //除了第一页,均不显示封面图
81 - if(index == 0){ 81 + if(index === 0){
82 this.$coverPic.show(); 82 this.$coverPic.show();
83 }else{ 83 }else{
84 this.$coverPic.hide(); 84 this.$coverPic.hide();
@@ -136,7 +136,7 @@ var flip = require("./flip"); @@ -136,7 +136,7 @@ var flip = require("./flip");
136 // 如果传递的options是一个字符串,则表示调用改对象的原型方法。 136 // 如果传递的options是一个字符串,则表示调用改对象的原型方法。
137 if (typeof option == 'string') data[option](_relatedTarget); 137 if (typeof option == 'string') data[option](_relatedTarget);
138 }); 138 });
139 - }; 139 + }
140 140
141 141
142 $.fn.contentPaging = Plugin; 142 $.fn.contentPaging = Plugin;
@@ -4,11 +4,11 @@ @@ -4,11 +4,11 @@
4 date:2015-01-07 4 date:2015-01-07
5 */ 5 */
6 var $=require("jquery"); 6 var $=require("jquery");
7 -var validate = require("./validate"); 7 +//var validate = require("./validate");
8 var box = require("./box"); 8 var box = require("./box");
9 var tools = require("yoho-tools"); 9 var tools = require("yoho-tools");
10 var tips=require("./tips"); 10 var tips=require("./tips");
11 -; 11 +
12 (function(global, undefined) { 12 (function(global, undefined) {
13 13
14 var Login = function(element, options) { 14 var Login = function(element, options) {
@@ -31,7 +31,7 @@ var tips=require("./tips"); @@ -31,7 +31,7 @@ var tips=require("./tips");
31 this._bindEvent(); 31 this._bindEvent();
32 } 32 }
33 this.initLoginState(); 33 this.initLoginState();
34 - if(!$(".cookieList").size() >0){ 34 + if($(".cookieList").size()<=0){
35 var cookieList = $('<ul class="cookieList"></ul>').appendTo($(".accountwrap")); 35 var cookieList = $('<ul class="cookieList"></ul>').appendTo($(".accountwrap"));
36 } 36 }
37 this.cookieAccount(); 37 this.cookieAccount();
@@ -91,7 +91,7 @@ var tips=require("./tips"); @@ -91,7 +91,7 @@ var tips=require("./tips");
91 } 91 }
92 }).on("blur",function() 92 }).on("blur",function()
93 { 93 {
94 - if ($(this).val() == '') 94 + if ($(this).val() === '')
95 { 95 {
96 $(this).addClass("default-tip"); 96 $(this).addClass("default-tip");
97 $(this).val(tips.getTips("yohoAccount")); 97 $(this).val(tips.getTips("yohoAccount"));
@@ -99,7 +99,7 @@ var tips=require("./tips"); @@ -99,7 +99,7 @@ var tips=require("./tips");
99 }); 99 });
100 $('.yoho-pwd-text').on("focus",function() 100 $('.yoho-pwd-text').on("focus",function()
101 { 101 {
102 - if ($(this).val() == '' || $(this).val() == tips.getTips("yohoPwd")) 102 + if ($(this).val() === '' || $(this).val() == tips.getTips("yohoPwd"))
103 { 103 {
104 104
105 $('.yoho-pwd').val('').show().focus(); 105 $('.yoho-pwd').val('').show().focus();
@@ -109,7 +109,7 @@ var tips=require("./tips"); @@ -109,7 +109,7 @@ var tips=require("./tips");
109 }); 109 });
110 $('.yoho-pwd').on("blur",function() 110 $('.yoho-pwd').on("blur",function()
111 { 111 {
112 - if ($(this).val() == '') 112 + if ($(this).val() === '')
113 { 113 {
114 $(this).hide(); 114 $(this).hide();
115 $('.yoho-pwd-text').addClass("default-tip"); 115 $('.yoho-pwd-text').addClass("default-tip");
@@ -137,7 +137,7 @@ var tips=require("./tips"); @@ -137,7 +137,7 @@ var tips=require("./tips");
137 var currentUserName=tools.cookie('userName'); 137 var currentUserName=tools.cookie('userName');
138 var account = $(".yoho-account").val(); 138 var account = $(".yoho-account").val();
139 139
140 - if(currentUserName==null||currentUserName==undefined){ 140 + if(currentUserName===null||currentUserName===undefined){
141 tools.cookie('userName',account,{expires:5,path: '/'}); 141 tools.cookie('userName',account,{expires:5,path: '/'});
142 }else{ 142 }else{
143 tools.cookie('userName',currentUserName+","+account,{expires:5,path: '/'}); 143 tools.cookie('userName',currentUserName+","+account,{expires:5,path: '/'});
@@ -148,7 +148,7 @@ var tips=require("./tips"); @@ -148,7 +148,7 @@ var tips=require("./tips");
148 that.closeLoginBox(); 148 that.closeLoginBox();
149 $this.comment("publishComment"); 149 $this.comment("publishComment");
150 } 150 }
151 - else if (response&&response.message != '') 151 + else if (response&&response.message !== '')
152 { 152 {
153 $(".login-box").find(".warn").css({"visibility":"visible"}); 153 $(".login-box").find(".warn").css({"visibility":"visible"});
154 } 154 }
@@ -164,8 +164,8 @@ var tips=require("./tips"); @@ -164,8 +164,8 @@ var tips=require("./tips");
164 //回车执行登录 164 //回车执行登录
165 $(".login-box").find(".yoho-pwd").keyup(function(e) 165 $(".login-box").find(".yoho-pwd").keyup(function(e)
166 { 166 {
167 - var e = e || window.event;  
168 - var k = e.keyCode || e.which; 167 + var event = e || window.event;
  168 + var k = event.keyCode || event.which;
169 if (k == 13) 169 if (k == 13)
170 { 170 {
171 $('#login').trigger("click.login"); 171 $('#login').trigger("click.login");
@@ -333,7 +333,7 @@ var tips=require("./tips"); @@ -333,7 +333,7 @@ var tips=require("./tips");
333 // 如果传递的options是一个字符串,则表示调用改对象的原型方法。 333 // 如果传递的options是一个字符串,则表示调用改对象的原型方法。
334 if (typeof option == 'string') data[option](_relatedTarget); 334 if (typeof option == 'string') data[option](_relatedTarget);
335 }); 335 });
336 - }; 336 + }
337 337
338 338
339 $.fn.login = Plugin; 339 $.fn.login = Plugin;
@@ -9,11 +9,12 @@ exports.init=function(){ @@ -9,11 +9,12 @@ exports.init=function(){
9 var $this=$(this); 9 var $this=$(this);
10 10
11 11
12 - var fontSize ; 12 + var fontSize;
  13 + var lineHeight;
13 if(!window.lineHeightDatabase[keyword]){ 14 if(!window.lineHeightDatabase[keyword]){
14 window.lineHeightDatabase[keyword]={fontSize:0,lineHeight:0}; 15 window.lineHeightDatabase[keyword]={fontSize:0,lineHeight:0};
15 } 16 }
16 - if(window.lineHeightDatabase[keyword].fontSize!=0) 17 + if(window.lineHeightDatabase[keyword].fontSize!==0)
17 { 18 {
18 fontSize=window.lineHeightDatabase[keyword].fontSize; 19 fontSize=window.lineHeightDatabase[keyword].fontSize;
19 } 20 }
@@ -23,7 +24,7 @@ exports.init=function(){ @@ -23,7 +24,7 @@ exports.init=function(){
23 window.lineHeightDatabase[keyword].fontSize=fontSize; 24 window.lineHeightDatabase[keyword].fontSize=fontSize;
24 } 25 }
25 //获取计算后的样式 26 //获取计算后的样式
26 - if(window.lineHeightDatabase[keyword].lineHeight!=0) 27 + if(window.lineHeightDatabase[keyword].lineHeight!==0)
27 { 28 {
28 lineHeight=window.lineHeightDatabase[keyword].lineHeight; 29 lineHeight=window.lineHeightDatabase[keyword].lineHeight;
29 window.lineHeightDatabase[keyword].lineHeight=lineHeight; 30 window.lineHeightDatabase[keyword].lineHeight=lineHeight;
@@ -31,14 +32,14 @@ exports.init=function(){ @@ -31,14 +32,14 @@ exports.init=function(){
31 else 32 else
32 { 33 {
33 if(/msie/i.test(navigator.userAgent)){ 34 if(/msie/i.test(navigator.userAgent)){
34 - var lineHeight = getFinalStyle(this[0],"lineHeight",fontSize); 35 + lineHeight = getFinalStyle(this[0],"lineHeight",fontSize);
35 } 36 }
36 else{ 37 else{
37 - var lineHeight = getFinalStyle(this[0],"lineHeight"); 38 + lineHeight = getFinalStyle(this[0],"lineHeight");
38 } 39 }
39 } 40 }
40 41
41 - if(this[0]==null) 42 + if(this[0]===null)
42 return; 43 return;
43 44
44 var height = this[0].clientHeight; 45 var height = this[0].clientHeight;
@@ -50,44 +51,46 @@ exports.init=function(){ @@ -50,44 +51,46 @@ exports.init=function(){
50 else{lineHeight = Number(lineHeight);} 51 else{lineHeight = Number(lineHeight);}
51 52
52 return parseInt(height/lineHeight); 53 return parseInt(height/lineHeight);
53 - } 54 + };
54 $.fn.mlellipsis=function(row,keyword){ 55 $.fn.mlellipsis=function(row,keyword){
55 //省略后加上title 56 //省略后加上title
56 var $this=$(this); 57 var $this=$(this);
57 var title = $this.attr("_title"); 58 var title = $this.attr("_title");
58 if(!title){ 59 if(!title){
59 $this.attr("_title",$this.text()); 60 $this.attr("_title",$this.text());
60 -  
61 } 61 }
62 else{ 62 else{
63 $this.text(title); 63 $this.text(title);
64 } 64 }
65 //获取计算后的样式 65 //获取计算后的样式
66 - var fontSize ; 66 + var fontSize;
  67 + var lineHeight;
67 if(!window.lineHeightDatabase[keyword]){ 68 if(!window.lineHeightDatabase[keyword]){
68 window.lineHeightDatabase[keyword]={fontSize:0,lineHeight:0}; 69 window.lineHeightDatabase[keyword]={fontSize:0,lineHeight:0};
69 } 70 }
70 - if(window.lineHeightDatabase[keyword].fontSize!=0) 71 + if(window.lineHeightDatabase[keyword].fontSize!==0)
71 { 72 {
72 fontSize=window.lineHeightDatabase[keyword].fontSize; 73 fontSize=window.lineHeightDatabase[keyword].fontSize;
73 } 74 }
74 else 75 else
75 { 76 {
76 - var fontSize= getFinalStyle(this[0],"fontSize"); 77 + //var fontSize= getFinalStyle(this[0],"fontSize");
  78 + fontSize= getFinalStyle(this[0],"fontSize");
77 window.lineHeightDatabase[keyword].fontSize=fontSize; 79 window.lineHeightDatabase[keyword].fontSize=fontSize;
78 } 80 }
79 //获取计算后的样式 81 //获取计算后的样式
80 - if(window.lineHeightDatabase[keyword].lineHeight!=0) 82 +
  83 + if(window.lineHeightDatabase[keyword].lineHeight!==0)
81 { 84 {
82 lineHeight=window.lineHeightDatabase[keyword].lineHeight; 85 lineHeight=window.lineHeightDatabase[keyword].lineHeight;
83 } 86 }
84 else 87 else
85 { 88 {
86 if(/msie/i.test(navigator.userAgent)){ 89 if(/msie/i.test(navigator.userAgent)){
87 - var lineHeight = getFinalStyle(this[0],"lineHeight",fontSize); 90 + lineHeight = getFinalStyle(this[0],"lineHeight",fontSize);
88 } 91 }
89 else{ 92 else{
90 - var lineHeight = getFinalStyle(this[0],"lineHeight"); 93 + lineHeight = getFinalStyle(this[0],"lineHeight");
91 //window.lineHeightDatabase[keyword].lineHeight=lineHeight; 94 //window.lineHeightDatabase[keyword].lineHeight=lineHeight;
92 } 95 }
93 } 96 }
@@ -125,7 +128,7 @@ exports.init=function(){ @@ -125,7 +128,7 @@ exports.init=function(){
125 return parseInt(height/lineHeight); 128 return parseInt(height/lineHeight);
126 } 129 }
127 130
128 - } 131 + };
129 $.fn.fillText=function(keyword){ 132 $.fn.fillText=function(keyword){
130 //省略后加上title 133 //省略后加上title
131 var $this=$(this); 134 var $this=$(this);
@@ -138,31 +141,33 @@ exports.init=function(){ @@ -138,31 +141,33 @@ exports.init=function(){
138 $this.text(title); 141 $this.text(title);
139 } 142 }
140 //获取计算后的样式 143 //获取计算后的样式
141 - var fontSize ; 144 + var fontSize;
  145 + var lineHeight;
142 if(!window.lineHeightDatabase[keyword]){ 146 if(!window.lineHeightDatabase[keyword]){
143 window.lineHeightDatabase[keyword]={fontSize:0,lineHeight:0}; 147 window.lineHeightDatabase[keyword]={fontSize:0,lineHeight:0};
144 } 148 }
145 - if(window.lineHeightDatabase[keyword].fontSize!=0) 149 + if(window.lineHeightDatabase[keyword].fontSize!==0)
146 { 150 {
147 fontSize=window.lineHeightDatabase[keyword].fontSize; 151 fontSize=window.lineHeightDatabase[keyword].fontSize;
148 } 152 }
149 else 153 else
150 { 154 {
151 - var fontSize= getFinalStyle(this[0],"fontSize"); 155 + //var fontSize= getFinalStyle(this[0],"fontSize");
  156 + fontSize= getFinalStyle(this[0],"fontSize");
152 window.lineHeightDatabase[keyword].fontSize=fontSize; 157 window.lineHeightDatabase[keyword].fontSize=fontSize;
153 } 158 }
154 //获取计算后的样式 159 //获取计算后的样式
155 - if(window.lineHeightDatabase[keyword].lineHeight!=0) 160 + if(window.lineHeightDatabase[keyword].lineHeight!==0)
156 { 161 {
157 lineHeight=window.lineHeightDatabase[keyword].lineHeight; 162 lineHeight=window.lineHeightDatabase[keyword].lineHeight;
158 } 163 }
159 else 164 else
160 { 165 {
161 if(/msie/i.test(navigator.userAgent)){ 166 if(/msie/i.test(navigator.userAgent)){
162 - var lineHeight = getFinalStyle(this[0],"lineHeight",fontSize); 167 + lineHeight = getFinalStyle(this[0],"lineHeight",fontSize);
163 } 168 }
164 else{ 169 else{
165 - var lineHeight = getFinalStyle(this[0],"lineHeight"); 170 + lineHeight = getFinalStyle(this[0],"lineHeight");
166 //window.lineHeightDatabase[keyword].lineHeight=lineHeight; 171 //window.lineHeightDatabase[keyword].lineHeight=lineHeight;
167 } 172 }
168 } 173 }
@@ -212,16 +217,16 @@ exports.init=function(){ @@ -212,16 +217,16 @@ exports.init=function(){
212 } 217 }
213 } 218 }
214 219
215 -} 220 +};
216 221
217 -function getFinalStyle( obj, property,fontSize) 222 +function getFinalStyle( obj, property)
218 { 223 {
219 var s; 224 var s;
220 - if(obj!=null&&obj.currentStyle){ 225 + if(obj!==null&&obj.currentStyle){
221 s = parseInt(obj.currentStyle[property].replace("px","")); 226 s = parseInt(obj.currentStyle[property].replace("px",""));
222 } 227 }
223 else 228 else
224 - if(window.getComputedStyle&&obj!=null){ 229 + if(window.getComputedStyle&&obj!==null){
225 s = window.getComputedStyle(obj, null)[property].replace("px",""); 230 s = window.getComputedStyle(obj, null)[property].replace("px","");
226 } 231 }
227 232
@@ -47,9 +47,9 @@ exports.initSlide=function(info){ @@ -47,9 +47,9 @@ exports.initSlide=function(info){
47 $(".photoslider_drag_message") 47 $(".photoslider_drag_message")
48 .html("← SLIDE →") 48 .html("← SLIDE →")
49 .show(); 49 .show();
50 - var u = navigator.userAgent; 50 + //var u = navigator.userAgent;
51 51
52 - if(isMobile&&$(obj).find(".drageObject")[0]==null||brow.bIsIpad||brow.bIsAndroid) 52 + if(isMobile&&$(obj).find(".drageObject")[0]===null||brow.bIsIpad||brow.bIsAndroid)
53 { 53 {
54 $("<div/>").css({ 54 $("<div/>").css({
55 position:"absolute", 55 position:"absolute",
@@ -115,7 +115,7 @@ exports.initSlide=function(info){ @@ -115,7 +115,7 @@ exports.initSlide=function(info){
115 } 115 }
116 }); 116 });
117 117
118 - var self=this; 118 + //var self=this;
119 119
120 } 120 }
121 }); 121 });
@@ -39,7 +39,7 @@ exports.init=function(info){ @@ -39,7 +39,7 @@ exports.init=function(info){
39 39
40 $(".yohoo-share-button-sina").unbind().on("click", function() 40 $(".yohoo-share-button-sina").unbind().on("click", function()
41 { 41 {
42 - if(options.sinaTextFunction!=null) 42 + if(options.sinaTextFunction!==null)
43 { 43 {
44 options.sinaText=(function(){ 44 options.sinaText=(function(){
45 return options.sinaTextFunction.apply($(".yohoo-share-button-sina")); 45 return options.sinaTextFunction.apply($(".yohoo-share-button-sina"));
@@ -51,7 +51,7 @@ exports.init=function(info){ @@ -51,7 +51,7 @@ exports.init=function(info){
51 .replace(/[+]/g,"%2B"); 51 .replace(/[+]/g,"%2B");
52 52
53 window.sharetitle = options.sinaText; 53 window.sharetitle = options.sinaText;
54 - if(options.imgFunction!=null) 54 + if(options.imgFunction!==null)
55 { 55 {
56 options.img=(function(){ 56 options.img=(function(){
57 return options.imgFunction.apply($(".yohoo-share-button-sina")); 57 return options.imgFunction.apply($(".yohoo-share-button-sina"));
@@ -60,7 +60,7 @@ exports.init=function(info){ @@ -60,7 +60,7 @@ exports.init=function(info){
60 window.shareUrl = options.img 60 window.shareUrl = options.img
61 share(); 61 share();
62 }); 62 });
63 - if(options.shareUrlFunction!=null) 63 + if(options.shareUrlFunction!==null)
64 { 64 {
65 options.shareUrl=(function(){ 65 options.shareUrl=(function(){
66 return options.shareUrlFunction.apply({sina:$(".yohoo-share-button-sina"), 66 return options.shareUrlFunction.apply({sina:$(".yohoo-share-button-sina"),
@@ -70,20 +70,19 @@ exports.init=function(info){ @@ -70,20 +70,19 @@ exports.init=function(info){
70 } 70 }
71 else 71 else
72 { 72 {
73 - options.shareUrl=options.shareUrl==""?document.location.href:options.shareUrl; 73 + options.shareUrl=options.shareUrl===""?document.location.href:options.shareUrl;
74 } 74 }
75 75
76 - function share()  
77 - { 76 + function share() {
78 (function(s, d, e) { 77 (function(s, d, e) {
79 - try {  
80 - } catch (e) {  
81 - } 78 + /*try {
  79 + } catch (err) {
  80 + }*/
82 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(''); 81 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('');
83 function a() { 82 function a() {
84 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(''))) 83 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('')))
85 u.href = [f, p].join(''); 84 u.href = [f, p].join('');
86 - }; 85 + }
87 if (/Firefox/.test(navigator.userAgent)) { 86 if (/Firefox/.test(navigator.userAgent)) {
88 setTimeout(a, 0) 87 setTimeout(a, 0)
89 } else { 88 } else {
@@ -95,14 +94,14 @@ exports.init=function(info){ @@ -95,14 +94,14 @@ exports.init=function(info){
95 var iTop = (window.screen.availHeight - 30 - options.height) / 2; //获得窗口的垂直位置; 94 var iTop = (window.screen.availHeight - 30 - options.height) / 2; //获得窗口的垂直位置;
96 var iLeft = (window.screen.availWidth - 10 - options.width) / 2; //获得窗口的水平位置; 95 var iLeft = (window.screen.availWidth - 10 - options.width) / 2; //获得窗口的水平位置;
97 $(".yohoo-share-button-facebook").unbind().on("click",function() { 96 $(".yohoo-share-button-facebook").unbind().on("click",function() {
98 - if(options.imgFunction!=null) 97 + if(options.imgFunction!==null)
99 { 98 {
100 options.img=(function(){ 99 options.img=(function(){
101 return options.imgFunction.apply($(".yohoo-share-button-facebook")); 100 return options.imgFunction.apply($(".yohoo-share-button-facebook"));
102 })(); 101 })();
103 } 102 }
104 var tmpResult={des:"",name:"",caption:""}; 103 var tmpResult={des:"",name:"",caption:""};
105 - if(options.fbTextFunction!=null) 104 + if(options.fbTextFunction!==null)
106 { 105 {
107 tmpResult=(function(){ 106 tmpResult=(function(){
108 return options.fbTextFunction.apply($(".yohoo-share-button-facebook")); 107 return options.fbTextFunction.apply($(".yohoo-share-button-facebook"));
@@ -142,7 +141,7 @@ exports.init=function(info){ @@ -142,7 +141,7 @@ exports.init=function(info){
142 "link=" + options.shareUrl + 141 "link=" + options.shareUrl +
143 "&picture=" + options.img+ 142 "&picture=" + options.img+
144 "&caption=" +options.fbName+ 143 "&caption=" +options.fbName+
145 - "&description="+options.fbDescription+(options.fbDescription==""?"":"(分享自 @yohoboy)")+ 144 + "&description="+options.fbDescription+(options.fbDescription===""?"":"(分享自 @yohoboy)")+
146 "&name="+options.fbCaption, 145 "&name="+options.fbCaption,
147 "", 146 "",
148 "height="+options.height+",width="+options.width+",left=" + iLeft + ",top=" + iTop); 147 "height="+options.height+",width="+options.width+",left=" + iLeft + ",top=" + iTop);
@@ -150,7 +149,7 @@ exports.init=function(info){ @@ -150,7 +149,7 @@ exports.init=function(info){
150 }); 149 });
151 150
152 $(".yohoo-share-button-tweet").unbind().on("click",function() { 151 $(".yohoo-share-button-tweet").unbind().on("click",function() {
153 - if(options.tweetTextFunction!=null) 152 + if(options.tweetTextFunction!==null)
154 { 153 {
155 options.tweetText=(function(){ 154 options.tweetText=(function(){
156 return options.tweetTextFunction.apply($(".yohoo-share-button-tweet")); 155 return options.tweetTextFunction.apply($(".yohoo-share-button-tweet"));
@@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
6 var $=require("jquery"); 6 var $=require("jquery");
7 require('./lazyloadImage'); 7 require('./lazyloadImage');
8 8
9 -;  
10 (function(global, undefined) { 9 (function(global, undefined) {
11 10
12 var Slider = function(element, options) { 11 var Slider = function(element, options) {
@@ -63,7 +62,7 @@ require('./lazyloadImage'); @@ -63,7 +62,7 @@ require('./lazyloadImage');
63 }, 62 },
64 63
65 addIndex:function(){ 64 addIndex:function(){
66 - this.options.pageCtrl.children().each(function(i,value){ 65 + this.options.pageCtrl.children().each(function(i){
67 $(this).attr("index",i); 66 $(this).attr("index",i);
68 }) 67 })
69 }, 68 },
@@ -114,7 +113,7 @@ require('./lazyloadImage'); @@ -114,7 +113,7 @@ require('./lazyloadImage');
114 if(this.ctrlIndex < 0){ 113 if(this.ctrlIndex < 0){
115 this.ctrlIndex = maxCtrlIndex; 114 this.ctrlIndex = maxCtrlIndex;
116 } 115 }
117 - if(this.ctrlIndex == 0){ 116 + if(this.ctrlIndex === 0){
118 this.options.pageCtrl.stop().animate({"left":0}); 117 this.options.pageCtrl.stop().animate({"left":0});
119 }else{ 118 }else{
120 this.options.pageCtrl.stop().animate({"left":-this.ctrlWidth*this.ctrlIndex-excessWidth}); 119 this.options.pageCtrl.stop().animate({"left":-this.ctrlWidth*this.ctrlIndex-excessWidth});
@@ -141,7 +140,7 @@ require('./lazyloadImage'); @@ -141,7 +140,7 @@ require('./lazyloadImage');
141 }, 140 },
142 141
143 animate:function(offset){ 142 animate:function(offset){
144 - var left = parseInt(this.$element.css('left')) + offset; 143 + //var left = parseInt(this.$element.css('left')) + offset;
145 var _this = this; 144 var _this = this;
146 if (offset>0) { 145 if (offset>0) {
147 offset = '+=' + offset; 146 offset = '+=' + offset;
@@ -159,11 +158,11 @@ require('./lazyloadImage'); @@ -159,11 +158,11 @@ require('./lazyloadImage');
159 this.ctrlWidth = this.ctrlEle.width() + parseInt(this.ctrlEle.eq(1).css("marginLeft")); 158 this.ctrlWidth = this.ctrlEle.width() + parseInt(this.ctrlEle.eq(1).css("marginLeft"));
160 this.setWidth(); 159 this.setWidth();
161 this.$element.css({'left': -this.index*this.width}); 160 this.$element.css({'left': -this.index*this.width});
162 - if(this.ctrlIndex == 0) return; 161 + if(this.ctrlIndex === 0) return;
163 this.options.pageCtrl.css({"left":-this.ctrlWidth*this.ctrlIndex-this.excessWidth}); 162 this.options.pageCtrl.css({"left":-this.ctrlWidth*this.ctrlIndex-this.excessWidth});
164 163
165 } 164 }
166 - } 165 + };
167 166
168 167
169 function Plugin(option, _relatedTarget) { 168 function Plugin(option, _relatedTarget) {
@@ -177,8 +176,7 @@ require('./lazyloadImage'); @@ -177,8 +176,7 @@ require('./lazyloadImage');
177 // 如果传递的options是一个字符串,则表示调用改对象的原型方法。 176 // 如果传递的options是一个字符串,则表示调用改对象的原型方法。
178 if (typeof option == 'string') data[option](_relatedTarget); 177 if (typeof option == 'string') data[option](_relatedTarget);
179 }); 178 });
180 - };  
181 - 179 + }
182 180
183 $.fn.slider = Plugin; 181 $.fn.slider = Plugin;
184 $.fn.slider.Constructor = Slider; 182 $.fn.slider.Constructor = Slider;
@@ -25,4 +25,4 @@ function isJian(){ @@ -25,4 +25,4 @@ function isJian(){
25 25
26 window.DicTips={ 26 window.DicTips={
27 27
28 -} 28 +};
@@ -19,7 +19,7 @@ exports.isMobile = function (val) @@ -19,7 +19,7 @@ exports.isMobile = function (val)
19 //昵称检测 19 //昵称检测
20 exports.isNickname = function (val) 20 exports.isNickname = function (val)
21 { 21 {
22 - valid = /^[\u4E00-\u9FA5A-Za-z0-9_-]{2,32}$/; 22 + var valid = /^[\u4E00-\u9FA5A-Za-z0-9_-]{2,32}$/;
23 return valid.test(val); 23 return valid.test(val);
24 }; 24 };
25 25