Authored by 2586703@qq.com

分享评论相关js,图片,样式

1.67 KB | W: | H:

1.46 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.86 KB | W: | H:

1.51 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.02 KB | W: | H:

1.68 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.98 KB | W: | H:

1.62 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.09 KB | W: | H:

1.54 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
@@ -10,9 +10,12 @@ var $ = require('jquery'), @@ -10,9 +10,12 @@ var $ = require('jquery'),
10 imgZoom = require('../plugin/imgZoom'), 10 imgZoom = require('../plugin/imgZoom'),
11 tools = require('yoho-tools'), 11 tools = require('yoho-tools'),
12 mustache = require('mustache'), 12 mustache = require('mustache'),
  13 + //Handlebars = require('handlebars'),
13 mulLine = require('mlellipsis'), 14 mulLine = require('mlellipsis'),
14 flip = require("../plugin/flip"), 15 flip = require("../plugin/flip"),
15 - slide = require("../plugin/photoslide"); 16 + slide = require("../plugin/photoslide"),
  17 + jsonp = require('yoho-jsonp');
  18 +
16 19
17 require('lazyload'); 20 require('lazyload');
18 require('../plugin/slider'); 21 require('../plugin/slider');
@@ -84,21 +87,22 @@ exports.init = function() { @@ -84,21 +87,22 @@ exports.init = function() {
84 87
85 //初始化截行插件 88 //初始化截行插件
86 mulLine.init(); 89 mulLine.init();
  90 +
87 //分享 91 //分享
88 share.init({ 92 share.init({
89 shareUrl: shareUrl, 93 shareUrl: shareUrl,
90 img: shareCover, 94 img: shareCover,
91 - sinaText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(), 95 + sinaText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '(来自Yoho!GIRL)',
92 fbTextFunction: function() { 96 fbTextFunction: function() {
93 return { 97 return {
94 - des: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl',  
95 - name: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl',  
96 - caption: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl', 98 + des: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#Yoho!GIRL',
  99 + name: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#Yoho!GIRL',
  100 + caption: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#Yoho!GIRL',
97 url: location.href 101 url: location.href
98 } 102 }
99 }, 103 },
100 tweetText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(), 104 tweetText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
101 - qqText: '【Yoho!Girls】' + detailTitle.text() + ' ' + detailSubtitle.text() + '(来自Yoho!Girls)' 105 + qqText: '【Yoho!Girls】' + detailTitle.text() + ' ' + detailSubtitle.text() + '(来自Yoho!GIRL)'
102 }); 106 });
103 107
104 //懒加载 108 //懒加载
@@ -170,10 +174,8 @@ exports.init = function() { @@ -170,10 +174,8 @@ exports.init = function() {
170 }; 174 };
171 175
172 //右侧side的数据获取 176 //右侧side的数据获取
173 - $.ajax({  
174 - url: 'http://newgirls.test.yoho.cn/channel/detail/getright?id=' + ajaxParam.id + '&type=' + ajaxParam.type + '&c=' + ajaxParam.c + '&twoc=' + ajaxParam.twoc,  
175 - dataType: 'jsonp',  
176 - jsonp: 'callback', 177 + jsonp({
  178 + url: YohoConfig.mainUrl + '/channel/detail/getright?id=' + ajaxParam.id + '&type=' + ajaxParam.type + '&c=' + ajaxParam.c + '&twoc=' + ajaxParam.twoc,
177 success: function(response) { 179 success: function(response) {
178 data = response.data; 180 data = response.data;
179 //广告 181 //广告
@@ -205,7 +207,7 @@ exports.init = function() { @@ -205,7 +207,7 @@ exports.init = function() {
205 } 207 }
206 208
207 //边栏related-post 209 //边栏related-post
208 - if (data.mosts instanceof Array) return; 210 + if (data.mosts.length <= 0) return;
209 sidePostTpl = $('#side-related-posts').html(); 211 sidePostTpl = $('#side-related-posts').html();
210 sidePostData = { 212 sidePostData = {
211 relatedPost: { 213 relatedPost: {
@@ -303,10 +305,8 @@ exports.init = function() { @@ -303,10 +305,8 @@ exports.init = function() {
303 }); 305 });
304 306
305 //底部数据的获取 307 //底部数据的获取
306 - $.ajax({  
307 - url: 'http://newgirls.test.yoho.cn/channel/detail/getbottom?id=' + ajaxParam.id + '&type=' + ajaxParam.type + '&c=' + ajaxParam.c + '&twoc=' + ajaxParam.twoc,  
308 - dataType: 'jsonp',  
309 - jsonp: 'callback', 308 + jsonp({
  309 + url: YohoConfig.mainUrl + '/channel/detail/getbottom?id=' + ajaxParam.id + '&type=' + ajaxParam.type + '&c=' + ajaxParam.c + '&twoc=' + ajaxParam.twoc,
310 success: function(response) { 310 success: function(response) {
311 data = response.data; 311 data = response.data;
312 312
@@ -316,14 +316,21 @@ exports.init = function() { @@ -316,14 +316,21 @@ exports.init = function() {
316 commentnum = data.commentnum; 316 commentnum = data.commentnum;
317 317
318 //底部related-post 318 //底部related-post
319 - if (!data.related instanceof Array) { 319 + if (data.related.length > 0) {
320 bottomPostTpl = $('#bottom-related-posts').html(); 320 bottomPostTpl = $('#bottom-related-posts').html();
321 bottomPostData = { 321 bottomPostData = {
322 relatedPost: { 322 relatedPost: {
323 postList: data.related 323 postList: data.related
324 } 324 }
325 - } 325 + };
  326 + // console.log(bottomPostData);
  327 + // console.log(bottomPostTpl);
  328 +
  329 + //console.log(Handlebars);
  330 + /*var tpl = Handlebars.compile(bottomPostTpl);
  331 + var template = tpl(bottomPostData);*/
326 bottomPostHtml = mustache.render(bottomPostTpl, bottomPostData); 332 bottomPostHtml = mustache.render(bottomPostTpl, bottomPostData);
  333 + //console.log(tpl)
327 $('.detail-body').append($(bottomPostHtml)); 334 $('.detail-body').append($(bottomPostHtml));
328 335
329 postList = $('.related-posts').find("li"); 336 postList = $('.related-posts').find("li");
1 -  
2 - var $ = require("jquery");  
3 - require("../plugin/comment");  
4 - require("../plugin/login");  
5 - exports.init = function()  
6 - {  
7 - $('.about-nav .feedback').addClass('current');  
8 - $(".comments-box").comment({  
9 - cid:'0',  
10 - commentPageUrl:'/feedback/default/list',  
11 - publishUrl:'/feedback/default/publish',  
12 - deleteUrl:'/feedback/default/delete',  
13 - isFeedback:true  
14 - });  
15 - exports.updateLogin = function(){  
16 - $(".comments-box").login("updateLoginState");  
17 - $(".comments-box").comment("publishComment");  
18 - } 1 +var $ = require("jquery");
  2 +require("../plugin/comment");
  3 +require("../plugin/login");
  4 +exports.init = function() {
  5 + $('.about-nav .feedback').addClass('current');
  6 + $(".comments-box").comment({
  7 + cid: '0',
  8 + commentPageUrl: '/feedback/default/list',
  9 + publishUrl: '/feedback/default/publish',
  10 + deleteUrl: '/feedback/default/delete',
  11 + thirdLogin: true
  12 + });
  13 + exports.updateLogin = function() {
  14 + $(".comments-box").login("updateLoginState");
  15 + $(".comments-box").comment("publishComment");
19 } 16 }
  17 +}
@@ -6,7 +6,9 @@ @@ -6,7 +6,9 @@
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 share = require('../plugin/share'), 8 share = require('../plugin/share'),
9 - swiper = require('yoho-idangerous.swiper'); 9 + swiper = require('yoho-idangerous.swiper'),
  10 + jsonp = require('yoho-jsonp');
  11 +
10 12
11 require('lazyload'); 13 require('lazyload');
12 14
@@ -17,8 +19,6 @@ require('../plugin/imgZoom'); @@ -17,8 +19,6 @@ require('../plugin/imgZoom');
17 exports.init = function() { 19 exports.init = function() {
18 var shareUrl = $('.share').attr('data-link'), 20 var shareUrl = $('.share').attr('data-link'),
19 shareCover = $('.share').attr('cover-url'), 21 shareCover = $('.share').attr('cover-url'),
20 - detailTitle = $('.detail-title').find('h1'),  
21 - detailSubtitle = $('.detail-title').find('h2'),  
22 magazineSlide, 22 magazineSlide,
23 timer, 23 timer,
24 magazineTimer; 24 magazineTimer;
@@ -26,18 +26,18 @@ exports.init = function() { @@ -26,18 +26,18 @@ exports.init = function() {
26 //分享 26 //分享
27 share.init({ 27 share.init({
28 shareUrl: shareUrl, 28 shareUrl: shareUrl,
29 - img: shareCover,  
30 - sinaText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(), 29 + img: $(".mags-slide li").eq(0).find("img").attr("src"),
  30 + sinaText: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~',
31 fbTextFunction: function() { 31 fbTextFunction: function() {
32 return { 32 return {
33 - des: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl',  
34 - name: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl',  
35 - caption: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl', 33 + des: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~',
  34 + name: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~',
  35 + caption: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~',
36 url: location.href 36 url: location.href
37 } 37 }
38 }, 38 },
39 - tweetText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),  
40 - qqText: '【Yoho!Girls】' + detailTitle.text() + ' ' + detailSubtitle.text() + '(来自Yoho!Girls)' 39 + tweetText: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~',
  40 + qqText: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~'
41 }); 41 });
42 42
43 //图片懒加载 43 //图片懒加载
@@ -94,10 +94,8 @@ exports.init = function() { @@ -94,10 +94,8 @@ exports.init = function() {
94 }, 0); 94 }, 0);
95 }); 95 });
96 96
97 - $.ajax({  
98 - url: 'http://newgirls.test.yoho.cn/channel/magazine/ezine',  
99 - dataType: 'jsonp',  
100 - jsonp: 'callback', 97 + jsonp({
  98 + url: YohoConfig.mainUrl + '/channel/magazine/ezine',
101 success: function(response) { 99 success: function(response) {
102 var data = response.data, 100 var data = response.data,
103 len = data.length, 101 len = data.length,
1 -  
2 - var $ = require("jquery");  
3 - require("../plugin/comment");  
4 - require("../plugin/login");  
5 - exports.init = function()  
6 - {  
7 - var cidNum = $(".editor-comment-content").attr("cid");  
8 - $(".comment_button").on("click",function(){  
9 - if($(".comment-area").find(".comment-textarea").size()>0){  
10 - if($(".editor-comment-content").css("display") == "none"){  
11 - $(".editor-comment-content").show();  
12 - }else{  
13 - $(".editor-comment-content").hide();  
14 - }  
15 - }else{  
16 - $(".comment-area").comment({  
17 - cid:cidNum,  
18 - isEdit:true  
19 - }); 1 +var $ = require("jquery");
  2 +require("../plugin/comment");
  3 +require("../plugin/login");
  4 +exports.init = function() {
  5 + var cidNum = $(".editor-comment-content").attr("cid");
  6 + $(".comment_button").on("click", function() {
  7 + if ($(".comment-area").find(".comment-textarea").size() > 0) {
  8 + if ($(".editor-comment-content").css("display") == "none") {
20 $(".editor-comment-content").show(); 9 $(".editor-comment-content").show();
21 - }  
22 - });  
23 - exports.updateLogin = function(){  
24 - $(".comment-area").login("updateLoginState");  
25 - $(".comment-area").comment("publishComment"); 10 + } else {
  11 + $(".editor-comment-content").hide();
  12 + }
  13 + } else {
  14 + $(".comment-area").comment({
  15 + cid: cidNum,
  16 + isEdit: true
  17 + });
  18 + $(".editor-comment-content").show();
26 } 19 }
  20 + });
  21 + exports.updateLogin = function() {
  22 + $(".comment-area").login("updateLoginState");
  23 + $(".comment-area").comment("publishComment");
  24 + }
27 25
28 - var id = {id:cidNum};  
29 - $.ajax({  
30 - type:'GET',  
31 - url:YohoConfig.mainUrl+'/writer/default/comment',  
32 - data: id,  
33 - dataType:'json',  
34 - success:function(response)  
35 - {  
36 - var data = response.data;  
37 - if(data.total){  
38 - $(".comment-num").text(data.total);  
39 - } 26 + var id = {
  27 + id: cidNum
  28 + };
  29 + $.ajax({
  30 + type: 'GET',
  31 + url: YohoConfig.mainUrl + '/writer/default/comment',
  32 + data: id,
  33 + dataType: 'json',
  34 + success: function(response) {
  35 + var data = response.data;
  36 + if (data.total) {
  37 + $(".comment-num").text(data.total);
40 } 38 }
41 - })  
42 - } 39 + }
  40 + })
  41 +}
@@ -60,39 +60,6 @@ require('./lazyloadImage'); @@ -60,39 +60,6 @@ require('./lazyloadImage');
60 this._animate(this.width); 60 this._animate(this.width);
61 }, 61 },
62 62
63 - /*  
64 - * 添加节点  
65 - */  
66 - _addDom: function() {  
67 - var _this = this;  
68 - if (!this.$element.data("url")) return;  
69 - $.ajax({  
70 - type: 'GET',  
71 - url: YohoConfig.mainUrl + _this.$element.data("url") + _this.page,  
72 - dataType: 'json',  
73 - success: function(data) {  
74 - var item = '',  
75 - msg = data.data,  
76 - len = msg.length;  
77 -  
78 - for (var i = 0; i < len; i++) {  
79 - item += '<li class="' + _this.options.itemClass + '"><a href="javascript:;"><img src="" data-slide="' + msg[i].pics + '" data-original="' + msg[i].cover + '" data-imgzoom="' + msg[i].dynamic + '"/><span>' + msg[i].title + '</span></a></li>'  
80 - }  
81 - $(item).appendTo(_this.$element);  
82 -  
83 - //添加节点后重新计算宽度  
84 - if (_this.options.itemClass != '') {  
85 - _this.len = _this.$element.find("li." + _this.options.itemClass).length;  
86 - } else {  
87 - _this.len = _this.$element.find("li").length;  
88 - }  
89 -  
90 - _this._calculationWidth(_this.len, _this.width);  
91 - _this.page++;  
92 - }  
93 - });  
94 -  
95 - },  
96 /* 63 /*
97 * 插件事件绑定 64 * 插件事件绑定
98 */ 65 */
@@ -106,10 +73,6 @@ require('./lazyloadImage'); @@ -106,10 +73,6 @@ require('./lazyloadImage');
106 if (_this.index == _this.len - _this.options.pageNum + 1) { 73 if (_this.index == _this.len - _this.options.pageNum + 1) {
107 $(this).hide(); 74 $(this).hide();
108 }; 75 };
109 - if ((Math.ceil(_this.index / _this.options.pageNum)) % 3 == 0 && (Math.ceil((_this.index - 1) / _this.options.pageNum)) % 3 != 0) {  
110 - _this._addDom();  
111 -  
112 - }  
113 }); 76 });
114 77
115 this.$btnPrev.on("click", function() { 78 this.$btnPrev.on("click", function() {
@@ -3,322 +3,319 @@ @@ -3,322 +3,319 @@
3 author:liuyue 3 author:liuyue
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");  
11 -; 10 +var tips = require("./tips");;
12 (function(global, undefined) { 11 (function(global, undefined) {
13 12
14 var Login = function(element, options) { 13 var Login = function(element, options) {
15 - this.options = options;  
16 - this.$element = $(element);  
17 - this.init(); 14 + this.options = options;
  15 + this.$element = $(element);
  16 + this.init();
18 }; 17 };
19 18
20 19
21 - Login.DEFAULTS = {  
22 - }; 20 + Login.DEFAULTS = {};
23 21
24 22
25 Login.prototype = { 23 Login.prototype = {
26 constructor: Login, 24 constructor: Login,
27 25
28 - init:function(){  
29 - if($(".login-box").size()<=0){ 26 + init: function() {
  27 + if ($(".login-box").size() <= 0) {
30 this.creatLoginBox(); 28 this.creatLoginBox();
31 this._bindEvent(); 29 this._bindEvent();
32 } 30 }
33 this.initLoginState(); 31 this.initLoginState();
34 - if(!$(".cookieList").size() >0){ 32 + if (!$(".cookieList").size() > 0) {
35 var cookieList = $('<ul class="cookieList"></ul>').appendTo($(".accountwrap")); 33 var cookieList = $('<ul class="cookieList"></ul>').appendTo($(".accountwrap"));
36 } 34 }
37 this.cookieAccount(); 35 this.cookieAccount();
38 }, 36 },
39 37
40 - creatLoginBox:function(){  
41 - var $loginBox = $('<div class="login-box">'+  
42 - '<h2>登录</h2>'+  
43 - '<div class="input-box">'+  
44 - '<p class="accountwrap"><input class="yoho-account" type="text" placeholder="'+tips.getTips("yohoAccount")+'"></p>'+  
45 - '<p><input class="yoho-pwd" type="password" placeholder="'+tips.getTips("yohoPwd")+'" style="display:none;" /><input class="yoho-pwd-text" type="text" placeholder="'+tips.getTips("yohoPwd")+'" /></p>'+  
46 - '</div>'+  
47 - '<div class="warn">'+tips.getTips("loginError")+'</div>'+  
48 - '<div class="login-btn">'+  
49 - '<a id="login" href="javascript:;">'+tips.getTips("login")+'</a>'+  
50 - '</div>'+  
51 - '<div class="third-login">'+  
52 - '<p>'+tips.getTips("thirdLogin")+'</p>'+  
53 - '<div class="third-btn clearfix">'+  
54 - '<a class="sina" ref="/passport/partner/index/oauth/sina" href="javascript:;"></a>'+  
55 - '<a class="qq" ref="/passport/partner/index/oauth/qq" href="javascript:;"></a>'+  
56 - '<a class="fb" ref="/passport/partner/index/oauth/facebook" href="javascript:;"></a>'+  
57 - '</div>'+  
58 - '</div>'+  
59 - '<div class="close-btn"></div>'+  
60 - '</div>'+ 38 + creatLoginBox: function() {
  39 + var $loginBox = $('<div class="login-box">' +
  40 + '<h2>登录</h2>' +
  41 + '<div class="input-box">' +
  42 + '<p class="accountwrap"><input class="yoho-account" type="text" placeholder="' + tips.getTips("yohoAccount") + '"></p>' +
  43 + '<p><input class="yoho-pwd" type="password" placeholder="' + tips.getTips("yohoPwd") + '" style="display:none;" /><input class="yoho-pwd-text" type="text" placeholder="' + tips.getTips("yohoPwd") + '" /></p>' +
  44 + '</div>' +
  45 + '<div class="warn">' + tips.getTips("loginError") + '</div>' +
  46 + '<div class="login-btn">' +
  47 + '<a id="login" href="javascript:;">' + tips.getTips("login") + '</a>' +
  48 + '</div>' +
  49 + '<div class="third-login">' +
  50 + '<p>' + tips.getTips("thirdLogin") + '</p>' +
  51 + '<div class="third-btn clearfix">' +
  52 + '<a class="sina" ref="/passport/partner/index/oauth/sina" href="javascript:;"></a>' +
  53 + '<a class="qq" ref="/passport/partner/index/oauth/qq" href="javascript:;"></a>' +
  54 + '<a class="fb" ref="/passport/partner/index/oauth/facebook" href="javascript:;"></a>' +
  55 + '</div>' +
  56 + '</div>' +
  57 + '<div class="close-btn"></div>' +
  58 + '</div>' +
61 '<div class="login-shadow"></div>').appendTo("body"); 59 '<div class="login-shadow"></div>').appendTo("body");
62 }, 60 },
63 61
64 - _bindEvent:function(){ 62 + _bindEvent: function() {
65 var that = this; 63 var that = this;
66 //关闭登录框 64 //关闭登录框
67 - $(document).on("click.closeLogin",function(event){  
68 - if($(event.target).is(".publish-btn") || $(event.target).is(".login-box") || $(event.target).parents(".login-box").length>=1 ||$(event.target).is(".yoho")||$(event.target).parents(".yoho").length>=1||$(event.target).is(".side-bar-header")) return; 65 + $(document).on("click.closeLogin", function(event) {
  66 + if ($(event.target).is(".publish-btn") || $(event.target).is(".login-box") || $(event.target).parents(".login-box").length >= 1 || $(event.target).is(".yoho") || $(event.target).parents(".yoho").length >= 1 || $(event.target).is(".side-bar-header")) return;
69 that.closeLoginBox(); 67 that.closeLoginBox();
70 event.stopPropagation(); 68 event.stopPropagation();
71 69
72 }); 70 });
73 - $(".login-box").on("click.closeLoginBox",".close-btn",function(){ 71 + $(".login-box").on("click.closeLoginBox", ".close-btn", function() {
74 that.closeLoginBox(); 72 that.closeLoginBox();
75 }); 73 });
76 74
77 //输入账号时登录按钮样式变化 75 //输入账号时登录按钮样式变化
78 - $(".login-box").on("focus",".yoho-account",function(){ 76 + $(".login-box").on("focus", ".yoho-account", function() {
79 $(".login-box").find("#login").addClass("login"); 77 $(".login-box").find("#login").addClass("login");
80 }); 78 });
81 79
82 //账号密码输入框默认提示 80 //账号密码输入框默认提示
83 $('.yoho-account').val(tips.getTips("yohoAccount")).addClass("default-tip"); 81 $('.yoho-account').val(tips.getTips("yohoAccount")).addClass("default-tip");
84 $('.yoho-pwd-text').val(tips.getTips("yohoPwd")).addClass("default-tip"); 82 $('.yoho-pwd-text').val(tips.getTips("yohoPwd")).addClass("default-tip");
85 - $('.yoho-account').on("focus",function()  
86 - {  
87 - if ($(this).val() == tips.getTips("yohoAccount"))  
88 - {  
89 - $(this).removeClass("default-tip");  
90 - $(this).val('');  
91 - }  
92 - }).on("blur",function()  
93 - {  
94 - if ($(this).val() == '')  
95 - {  
96 - $(this).addClass("default-tip");  
97 - $(this).val(tips.getTips("yohoAccount"));  
98 - }  
99 - });  
100 - $('.yoho-pwd-text').on("focus",function()  
101 - {  
102 - if ($(this).val() == '' || $(this).val() == tips.getTips("yohoPwd"))  
103 - {  
104 -  
105 - $('.yoho-pwd').val('').show().focus();  
106 - $(this).hide();  
107 - $(this).removeClass("default-tip");  
108 - }  
109 - });  
110 - $('.yoho-pwd').on("blur",function()  
111 - {  
112 - if ($(this).val() == '')  
113 - {  
114 - $(this).hide();  
115 - $('.yoho-pwd-text').addClass("default-tip");  
116 - $('.yoho-pwd-text').val(tips.getTips("yohoPwd")).show();  
117 - }  
118 - }); 83 + $('.yoho-account').on("focus", function() {
  84 + if ($(this).val() == tips.getTips("yohoAccount")) {
  85 + $(this).removeClass("default-tip");
  86 + $(this).val('');
  87 + }
  88 + }).on("blur", function() {
  89 + if ($(this).val() == '') {
  90 + $(this).addClass("default-tip");
  91 + $(this).val(tips.getTips("yohoAccount"));
  92 + }
  93 + });
  94 + $('.yoho-pwd-text').on("focus", function() {
  95 + if ($(this).val() == '' || $(this).val() == tips.getTips("yohoPwd")) {
  96 +
  97 + $('.yoho-pwd').val('').show().focus();
  98 + $(this).hide();
  99 + $(this).removeClass("default-tip");
  100 + }
  101 + });
  102 + $('.yoho-pwd').on("blur", function() {
  103 + if ($(this).val() == '') {
  104 + $(this).hide();
  105 + $('.yoho-pwd-text').addClass("default-tip");
  106 + $('.yoho-pwd-text').val(tips.getTips("yohoPwd")).show();
  107 + }
  108 + });
119 109
120 //登录按钮点击事件 110 //登录按钮点击事件
121 - $(".login-box").on("click.login","#login",function()  
122 - {  
123 - var $this = $(this);  
124 - var account = $('.yoho-account').val();  
125 - var password = $('.yoho-pwd').val();  
126 - $.ajax  
127 - ({  
128 - type:'POST',  
129 - url:YohoConfig.mainUrl+'/passport/partner/yoho',  
130 - data:{'account':account,'password':password},  
131 - dataType:'json',  
132 - success:function(response)  
133 - {  
134 - if (response&&response.status && response.data)  
135 - {  
136 - var userName;  
137 - var currentUserName=tools.cookie('userName');  
138 - var account = $(".yoho-account").val();  
139 -  
140 - if(currentUserName==null||currentUserName==undefined){  
141 - tools.cookie('userName',account,{expires:5,path: '/'});  
142 - }else{  
143 - tools.cookie('userName',currentUserName+","+account,{expires:5,path: '/'});  
144 - }  
145 - that.cookieAccount();  
146 - that.setLogin(response.data);  
147 - $(".login-box").find(".warn").css({"visibility":"hidden"});  
148 - that.closeLoginBox();  
149 - $this.comment("publishComment");  
150 - }  
151 - else if (response&&response.message != '')  
152 - {  
153 - $(".login-box").find(".warn").css({"visibility":"visible"});  
154 - }  
155 - else  
156 - {  
157 - $(".login-box").find(".warn").css({"visibility":"visible"});  
158 - }  
159 - }  
160 -  
161 - });  
162 - }); 111 + $(".login-box").on("click.login", "#login", function() {
  112 + var $this = $(this);
  113 + var account = $('.yoho-account').val();
  114 + var password = $('.yoho-pwd').val();
  115 + $.ajax({
  116 + type: 'POST',
  117 + url: YohoConfig.mainUrl + '/passport/partner/yoho',
  118 + data: {
  119 + 'account': account,
  120 + 'password': password
  121 + },
  122 + dataType: 'jsonp',
  123 + success: function(response) {
  124 + if (response && response.status && response.data) {
  125 + var userName;
  126 + var currentUserName = tools.cookie('userName');
  127 + var account = $(".yoho-account").val();
  128 +
  129 + if (currentUserName == null || currentUserName == undefined) {
  130 + tools.cookie('userName', account, {
  131 + expires: 5,
  132 + path: '/'
  133 + });
  134 + } else {
  135 + tools.cookie('userName', currentUserName + "," + account, {
  136 + expires: 5,
  137 + path: '/'
  138 + });
  139 + }
  140 + that.cookieAccount();
  141 + that.setLogin(response.data);
  142 + $(".login-box").find(".warn").css({
  143 + "visibility": "hidden"
  144 + });
  145 + that.closeLoginBox();
  146 + $this.comment("publishComment");
  147 + } else if (response && response.message != '') {
  148 + $(".login-box").find(".warn").css({
  149 + "visibility": "visible"
  150 + });
  151 + } else {
  152 + $(".login-box").find(".warn").css({
  153 + "visibility": "visible"
  154 + });
  155 + }
  156 + }
  157 +
  158 + });
  159 + });
163 160
164 //回车执行登录 161 //回车执行登录
165 - $(".login-box").find(".yoho-pwd").keyup(function(e)  
166 - {  
167 - var e = e || window.event;  
168 - var k = e.keyCode || e.which;  
169 - if (k == 13)  
170 - {  
171 - $('#login').trigger("click.login");  
172 - }  
173 - });  
174 -  
175 - $(".third-btn").on("click","a",function(){ 162 + $(".login-box").find(".yoho-pwd").keyup(function(e) {
  163 + var e = e || window.event;
  164 + var k = e.keyCode || e.which;
  165 + if (k == 13) {
  166 + $('#login').trigger("click.login");
  167 + }
  168 + });
  169 +
  170 + $(".third-btn").on("click", "a", function() {
176 var _this = $(this); 171 var _this = $(this);
177 - if (!_this.attr('ref')) return;  
178 - window.open(_this.attr('ref'), "","width=760,height=650,top=300,left=300");  
179 - that.closeLoginBox();  
180 - return false; 172 + if (!_this.attr('ref')) return;
  173 + window.open(_this.attr('ref'), "", "width=760,height=650,top=300,left=300");
  174 + that.closeLoginBox();
  175 + return false;
181 }); 176 });
182 }, 177 },
183 //滑出登录框 178 //滑出登录框
184 - loginBoxAnimate:function(){  
185 - if($(".login-status").hasClass("login-success")) return;  
186 - if($(".side-bar-header").hasClass("login-success")) return; 179 + loginBoxAnimate: function() {
  180 + if ($(".login-status").hasClass("login-success")) return;
  181 + if ($(".side-bar-header").hasClass("login-success")) return;
187 var height = $(".login-box").outerHeight(); 182 var height = $(".login-box").outerHeight();
188 $(".login-shadow").show(); 183 $(".login-shadow").show();
189 - $("body").find(".login-box").animate({"top":"50%","margin-top":-height/2},200); 184 + $("body").find(".login-box").animate({
  185 + "top": "50%",
  186 + "margin-top": -height / 2
  187 + }, 200);
190 }, 188 },
191 //隐藏登录框 189 //隐藏登录框
192 - closeLoginBox:function(){ 190 + closeLoginBox: function() {
193 var height = $(".login-box").outerHeight(); 191 var height = $(".login-box").outerHeight();
194 - $(".login-box").css({"top":-height,"margin-top":0}); 192 + $(".login-box").css({
  193 + "top": -height,
  194 + "margin-top": 0
  195 + });
195 $(".login-shadow").hide(); 196 $(".login-shadow").hide();
196 }, 197 },
197 198
198 //初始化登录状态 199 //初始化登录状态
199 - initLoginState:function()  
200 - {  
201 - var state = tools.cookie('yh_state');  
202 - var syncs = tools.cookie('yh_syncs');  
203 -  
204 - if (state && syncs)  
205 - {  
206 - var data = $.parseJSON(syncs);  
207 - if (data && data.nick)  
208 - {  
209 - this.setLogin(data);  
210 - }  
211 - }  
212 - },  
213 -  
214 - //更新登录信息  
215 - updateLoginState:function()  
216 - {  
217 - this.initLoginState();  
218 - }, 200 + initLoginState: function() {
  201 + var state = tools.cookie('yh_state');
  202 + var syncs = tools.cookie('yh_syncs');
  203 +
  204 + if (state && syncs) {
  205 + var data = $.parseJSON(syncs);
  206 + if (data && data.nick) {
  207 + this.setLogin(data);
  208 + }
  209 + }
  210 + },
  211 +
  212 + //更新登录信息
  213 + updateLoginState: function() {
  214 + this.initLoginState();
  215 + },
219 216
220 //登录 217 //登录
221 - setLogin:function(data){ 218 + setLogin: function(data) {
222 var that = this; 219 var that = this;
223 - $(".login-status .userimg").find("i").attr("class",data.type); 220 + $(".login-status .userimg").find("i").attr("class", data.type);
224 $(".login-status .userinfo").find("span").text(data.nick); 221 $(".login-status .userinfo").find("span").text(data.nick);
225 222
226 //用户头像 223 //用户头像
227 - if (data.headpic)  
228 - {  
229 - $(".login-status .userimg").find("img").attr("src",data.headpic);  
230 - }  
231 -  
232 - //手机版  
233 - if (data.headpic)  
234 - {  
235 - $(".user-avatar").find("img").attr("src",data.headpic);  
236 - }  
237 - $(".login-username").text(data.nick);  
238 - $(".side-bar-header").addClass("login-success");  
239 - 224 + if (data.headpic) {
  225 + $(".login-status .userimg").find("img").attr("src", data.headpic);
  226 + }
  227 +
  228 + //手机版
  229 + if (data.headpic) {
  230 + $(".user-avatar").find("img").attr("src", data.headpic);
  231 + }
  232 + $(".login-username").text(data.nick);
  233 + $(".side-bar-header").addClass("login-success");
  234 +
240 $(".login-status .userinfo").show(); 235 $(".login-status .userinfo").show();
241 $(".login-status").addClass("login-success"); 236 $(".login-status").addClass("login-success");
242 237
243 //隐藏匿名 238 //隐藏匿名
244 - if($(".login-status .anonymous").size()>0){ 239 + if ($(".login-status .anonymous").size() > 0) {
245 $(".login-status .anonymous").hide(); 240 $(".login-status .anonymous").hide();
246 } 241 }
247 242
  243 + //隐藏第三方登录
  244 + $('.third-login-box').hide();
  245 +
248 //隐藏意见反馈页登录按钮 246 //隐藏意见反馈页登录按钮
249 - if($(".feedback-login").size()>0){ 247 + if ($(".feedback-login").size() > 0) {
250 $(".feedback-login").hide(); 248 $(".feedback-login").hide();
251 } 249 }
252 250
253 - $(".exit-btn").on("click",function(){  
254 - box.confirm(tips.getTips("logout"), function(){ 251 + $(".exit-btn").on("click", function() {
  252 + box.confirm(tips.getTips("logout"), function() {
255 that.setLogout(); 253 that.setLogout();
256 }); 254 });
257 }); 255 });
258 }, 256 },
259 257
260 //登出 258 //登出
261 - setLogout:function(){ 259 + setLogout: function() {
262 $(".login-status").removeClass("login-success"); 260 $(".login-status").removeClass("login-success");
263 - $(".login-status .userimg").find("img").attr("src",YohoConfig.resUrl+"/res/new/boys/images/detail/user-img.png"); 261 + $(".login-status .userimg").find("img").attr("src", YohoConfig.resUrl + "/assets/images/detail/user-img.png");
264 $(".login-status .userinfo").hide(); 262 $(".login-status .userinfo").hide();
265 - $(".login-status .userimg").find("i").attr("class",''); 263 + $(".login-status .userimg").find("i").attr("class", '');
266 $(".comments-list").find(".delete-comment").remove(); 264 $(".comments-list").find(".delete-comment").remove();
267 265
268 //手机版 266 //手机版
269 $(".side-bar-header").removeClass("login-success"); 267 $(".side-bar-header").removeClass("login-success");
270 - $(".user-avatar").find("img").attr("src",YohoConfig.resUrl+"/res/new/boys/images/detail/user-img.png"); 268 + $(".user-avatar").find("img").attr("src", YohoConfig.resUrl + "/assets/images/detail/user-img.png");
271 $(".login-username").text("登录"); 269 $(".login-username").text("登录");
272 270
273 //显示匿名 271 //显示匿名
274 - if($(".login-status .anonymous").size()>0){ 272 + if ($(".login-status .anonymous").size() > 0) {
275 $(".login-status .anonymous").show(); 273 $(".login-status .anonymous").show();
276 } 274 }
277 - 275 + //显示第三方登录
  276 + $('.third-login-box').show();
278 //显示意见反馈页登录按钮 277 //显示意见反馈页登录按钮
279 - if($(".feedback-login").size()>0){ 278 + if ($(".feedback-login").size() > 0) {
280 $(".feedback-login").show(); 279 $(".feedback-login").show();
281 } 280 }
282 281
283 - $.ajax  
284 - ({  
285 - type:'GET',  
286 - url:YohoConfig.mainUrl+'/passport/partner/logout',  
287 - dataType:'json'  
288 - }); 282 + $.ajax({
  283 + type: 'GET',
  284 + url: YohoConfig.mainUrl + '/passport/partner/logout',
  285 + dataType: 'json'
  286 + });
289 }, 287 },
290 288
291 //cookie记入账号 289 //cookie记入账号
292 - cookieAccount:function(){  
293 - //cookie  
294 - var getCookie,  
295 - arrCookie;  
296 - getCookie = decodeURIComponent(tools.cookie('userName'));  
297 -  
298 - if(!!tools.cookie('userName'))  
299 - {  
300 - arrCookie = tools.unique(getCookie.split(','));  
301 -  
302 - $(".cookieList").empty();  
303 - for (var i=0;i<arrCookie.length;i++) {  
304 - $(".cookieList").append($('<li><a href="javascript:;">'+arrCookie[i]+'</a></li>'));  
305 - }  
306 -  
307 - $(".login-box").click(function(e){  
308 - if($(e.target).is(".yoho-account")||$(e.target).is(".cookieList")|| $(e.target).closest(".cookieList").size()>0){  
309 - $(".cookieList").show();  
310 - }else{  
311 - $(".cookieList").hide();  
312 - }  
313 - })  
314 - $(".cookieList").on("click","li",function(){  
315 - $(".yoho-account").val($(this).find("a").text()).removeClass("default-tip");  
316 - $(".cookieList").hide();  
317 - return false;  
318 - });  
319 -  
320 - } 290 + cookieAccount: function() {
  291 + //cookie
  292 + var getCookie,
  293 + arrCookie;
  294 + getCookie = decodeURIComponent(tools.cookie('userName'));
  295 +
  296 + if (!!tools.cookie('userName')) {
  297 + arrCookie = tools.unique(getCookie.split(','));
  298 +
  299 + $(".cookieList").empty();
  300 + for (var i = 0; i < arrCookie.length; i++) {
  301 + $(".cookieList").append($('<li><a href="javascript:;">' + arrCookie[i] + '</a></li>'));
  302 + }
  303 +
  304 + $(".login-box").click(function(e) {
  305 + if ($(e.target).is(".yoho-account") || $(e.target).is(".cookieList") || $(e.target).closest(".cookieList").size() > 0) {
  306 + $(".cookieList").show();
  307 + } else {
  308 + $(".cookieList").hide();
  309 + }
  310 + })
  311 + $(".cookieList").on("click", "li", function() {
  312 + $(".yoho-account").val($(this).find("a").text()).removeClass("default-tip");
  313 + $(".cookieList").hide();
  314 + return false;
  315 + });
  316 +
321 } 317 }
  318 + }
322 }; 319 };
323 320
324 321
@@ -336,7 +333,7 @@ var tips=require("./tips"); @@ -336,7 +333,7 @@ var tips=require("./tips");
336 }; 333 };
337 334
338 335
339 - $.fn.login = Plugin;  
340 - $.fn.login.Constructor = Login; 336 + $.fn.login = Plugin;
  337 + $.fn.login.Constructor = Login;
341 338
342 })(this); 339 })(this);
@@ -11,75 +11,70 @@ @@ -11,75 +11,70 @@
11 * fbAppId:YohoConfig.girl.fbAppId,'657464311006064', 11 * fbAppId:YohoConfig.girl.fbAppId,'657464311006064',
12 fbUrl:YohoConfig.girl.mainUrl+'/channel/yohood/closedialog', 12 fbUrl:YohoConfig.girl.mainUrl+'/channel/yohood/closedialog',
13 */ 13 */
14 -var $=require("jquery");  
15 -exports.init=function(info){  
16 - var defaults={  
17 - width:800,  
18 - height:500,  
19 - img:"",  
20 - imgFunction:null,  
21 - sinaText:"",  
22 - sinaTextFunction:null,  
23 - tweetText:"",  
24 - tweetTextFunction:null,  
25 - fbCaption:"",  
26 - fbDescription:"",  
27 - fbName:"",  
28 - fbTextFunction:null,  
29 - shareUrl:"",  
30 - shareUrlFunction:null,  
31 - fbAppId:"",  
32 - fbUrl:"",  
33 - qqText:""  
34 - }  
35 - var options=$.extend(defaults,info); 14 +var $ = require("jquery");
  15 +exports.init = function(info) {
  16 + var defaults = {
  17 + width: 800,
  18 + height: 500,
  19 + img: "",
  20 + imgFunction: null,
  21 + sinaText: "",
  22 + sinaTextFunction: null,
  23 + tweetText: "",
  24 + tweetTextFunction: null,
  25 + fbCaption: "",
  26 + fbDescription: "",
  27 + fbName: "",
  28 + fbTextFunction: null,
  29 + shareUrl: "",
  30 + shareUrlFunction: null,
  31 + fbAppId: "",
  32 + fbUrl: "",
  33 + qqText: ""
  34 + }
  35 + var options = $.extend(defaults, info);
  36 +
  37 +
36 38
37 - 39 + $(".yohoo-share-button-sina").unbind().on("click", function() {
  40 + if (options.sinaTextFunction != null) {
  41 + options.sinaText = (function() {
  42 + return options.sinaTextFunction.apply($(".yohoo-share-button-sina"));
  43 + })();
  44 + }
  45 + options.sinaText = options.sinaText.replace(/[ ]/g, "%20")
  46 + .replace(/[&]/g, "%26")
  47 + .replace(/[#]/g, "%23")
  48 + .replace(/[+]/g, "%2B");
38 49
39 -  
40 - $(".yohoo-share-button-sina").unbind().on("click", function()  
41 - {  
42 - if(options.sinaTextFunction!=null)  
43 - {  
44 - options.sinaText=(function(){  
45 - return options.sinaTextFunction.apply($(".yohoo-share-button-sina"));  
46 - })();  
47 - }  
48 - options.sinaText=options.sinaText.replace(/[ ]/g, "%20")  
49 - .replace(/[&]/g,"%26")  
50 - .replace(/[#]/g,"%23")  
51 - .replace(/[+]/g,"%2B");  
52 -  
53 window.sharetitle = options.sinaText; 50 window.sharetitle = options.sinaText;
54 - if(options.imgFunction!=null)  
55 - {  
56 - options.img=(function(){  
57 - return options.imgFunction.apply($(".yohoo-share-button-sina"));  
58 - })(); 51 + if (options.imgFunction != null) {
  52 + options.img = (function() {
  53 + return options.imgFunction.apply($(".yohoo-share-button-sina"));
  54 + })();
59 } 55 }
60 window.shareUrl = options.img 56 window.shareUrl = options.img
61 share(); 57 share();
62 }); 58 });
63 - if(options.shareUrlFunction!=null)  
64 - {  
65 - options.shareUrl=(function(){  
66 - return options.shareUrlFunction.apply({sina:$(".yohoo-share-button-sina"),  
67 - facebook:$(".yohoo-share-button-facebook"),  
68 - tweet:$(".yohoo-share-button-tweet")});  
69 - })();  
70 - }  
71 - else  
72 - {  
73 - options.shareUrl=options.shareUrl==""?document.location.href:options.shareUrl; 59 + if (options.shareUrlFunction != null) {
  60 + options.shareUrl = (function() {
  61 + return options.shareUrlFunction.apply({
  62 + sina: $(".yohoo-share-button-sina"),
  63 + facebook: $(".yohoo-share-button-facebook"),
  64 + tweet: $(".yohoo-share-button-tweet")
  65 + });
  66 + })();
  67 + } else {
  68 + options.shareUrl = options.shareUrl == "" ? document.location.href : options.shareUrl;
74 } 69 }
75 -  
76 - function share()  
77 - { 70 +
  71 + function share() {
78 (function(s, d, e) { 72 (function(s, d, e) {
79 - try {  
80 - } catch (e) {  
81 - }  
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=2924220432', '&pic=', e(window.shareUrl)].join(''); 73 + try {} catch (e) {}
  74 + var f = 'http://v.t.sina.com.cn/share/share.php?',
  75 + u = options.shareUrl,
  76 + p = ['url=', e(u), '&title=', e(window.sharetitle), '&appkey=2924220432', '&pic=', e(window.shareUrl)].join('');
  77 +
83 function a() { 78 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(''))) 79 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(''); 80 u.href = [f, p].join('');
@@ -94,104 +89,98 @@ exports.init=function(info){ @@ -94,104 +89,98 @@ exports.init=function(info){
94 89
95 var iTop = (window.screen.availHeight - 30 - options.height) / 2; //获得窗口的垂直位置; 90 var iTop = (window.screen.availHeight - 30 - options.height) / 2; //获得窗口的垂直位置;
96 var iLeft = (window.screen.availWidth - 10 - options.width) / 2; //获得窗口的水平位置; 91 var iLeft = (window.screen.availWidth - 10 - options.width) / 2; //获得窗口的水平位置;
97 - $(".yohoo-share-button-facebook").unbind().on("click",function() {  
98 - if(options.imgFunction!=null)  
99 - {  
100 - options.img=(function(){ 92 + $(".yohoo-share-button-facebook").unbind().on("click", function() {
  93 + if (options.imgFunction != null) {
  94 + options.img = (function() {
101 return options.imgFunction.apply($(".yohoo-share-button-facebook")); 95 return options.imgFunction.apply($(".yohoo-share-button-facebook"));
102 })(); 96 })();
103 } 97 }
104 - var tmpResult={des:"",name:"",caption:""};  
105 - if(options.fbTextFunction!=null)  
106 - {  
107 - tmpResult=(function(){ 98 + var tmpResult = {
  99 + des: "",
  100 + name: "",
  101 + caption: ""
  102 + };
  103 + if (options.fbTextFunction != null) {
  104 + tmpResult = (function() {
108 return options.fbTextFunction.apply($(".yohoo-share-button-facebook")); 105 return options.fbTextFunction.apply($(".yohoo-share-button-facebook"));
109 })(); 106 })();
110 - if (!tmpResult.url)  
111 - {  
112 - options.fbCaption=tmpResult.caption;  
113 - options.fbDescription=tmpResult.des;  
114 - options.fbName=tmpResult.name;  
115 - }  
116 - else  
117 - { 107 + if (!tmpResult.url) {
  108 + options.fbCaption = tmpResult.caption;
  109 + options.fbDescription = tmpResult.des;
  110 + options.fbName = tmpResult.name;
  111 + } else {
118 options.fbUrl = tmpResult.url; 112 options.fbUrl = tmpResult.url;
119 } 113 }
120 } 114 }
121 -  
122 - if (options.fbUrl)  
123 - { 115 +
  116 + if (options.fbUrl) {
124 window.open("https://www.facebook.com/sharer/sharer.php?u=" + options.fbUrl, "", 117 window.open("https://www.facebook.com/sharer/sharer.php?u=" + options.fbUrl, "",
125 - "height="+options.height+",width="+options.width+",left=" + iLeft + ",top=" + iTop);  
126 - }  
127 - else  
128 - {  
129 - options.fbCaption=options.fbCaption.replace(/[ ]/g, "%20")  
130 - .replace(/[&]/g,"%26")  
131 - .replace(/[#]/g,"%23")  
132 - .replace(/[+]/g,"%2B");  
133 - options.fbDescription=tmpResult.des.replace(/[ ]/g, "%20")  
134 - .replace(/[&]/g,"%26")  
135 - .replace(/[#]/g,"%23")  
136 - .replace(/[+]/g,"%2B");  
137 - options.fbName=tmpResult.name.replace(/[ ]/g, "%20")  
138 - .replace(/[&]/g,"%26")  
139 - .replace(/[#]/g,"%23")  
140 - .replace(/[+]/g,"%2B"); 118 + "height=" + options.height + ",width=" + options.width + ",left=" + iLeft + ",top=" + iTop);
  119 + } else {
  120 + options.fbCaption = options.fbCaption.replace(/[ ]/g, "%20")
  121 + .replace(/[&]/g, "%26")
  122 + .replace(/[#]/g, "%23")
  123 + .replace(/[+]/g, "%2B");
  124 + options.fbDescription = tmpResult.des.replace(/[ ]/g, "%20")
  125 + .replace(/[&]/g, "%26")
  126 + .replace(/[#]/g, "%23")
  127 + .replace(/[+]/g, "%2B");
  128 + options.fbName = tmpResult.name.replace(/[ ]/g, "%20")
  129 + .replace(/[&]/g, "%26")
  130 + .replace(/[#]/g, "%23")
  131 + .replace(/[+]/g, "%2B");
141 window.open("http://www.facebook.com/dialog/feed?app_id=1431491300468916&redirect_uri=http://www.yohoboys.com/channel/yohood/closedialog&" + 132 window.open("http://www.facebook.com/dialog/feed?app_id=1431491300468916&redirect_uri=http://www.yohoboys.com/channel/yohood/closedialog&" +
142 "link=" + options.shareUrl + 133 "link=" + options.shareUrl +
143 - "&picture=" + options.img+  
144 - "&caption=" +options.fbName+  
145 - "&description="+options.fbDescription+(options.fbDescription==""?"":"(分享自 @yohoboy)")+  
146 - "&name="+options.fbCaption, 134 + "&picture=" + options.img +
  135 + "&caption=" + options.fbName +
  136 + "&description=" + options.fbDescription + (options.fbDescription == "" ? "" : "(分享自 @yohoboy)") +
  137 + "&name=" + options.fbCaption,
147 "", 138 "",
148 - "height="+options.height+",width="+options.width+",left=" + iLeft + ",top=" + iTop); 139 + "height=" + options.height + ",width=" + options.width + ",left=" + iLeft + ",top=" + iTop);
149 } 140 }
150 }); 141 });
151 142
152 - $(".yohoo-share-button-tweet").unbind().on("click",function() {  
153 - if(options.tweetTextFunction!=null)  
154 - {  
155 - options.tweetText=(function(){  
156 - return options.tweetTextFunction.apply($(".yohoo-share-button-tweet"));  
157 - })();  
158 - }  
159 - options.tweetText=options.tweetText.replace(/[ ]/g, "%20")  
160 - .replace(/[&]/g,"%26")  
161 - .replace(/[#]/g,"%23")  
162 - .replace(/[+]/g,"%2B");  
163 - window.open("http://twitter.com/intent/tweet?url=" + options.shareUrl +  
164 - "&text="+options.tweetText,  
165 - "",  
166 - "height="+options.height+",width="+options.width+",left=" + iLeft + ",top=" + iTop); 143 + $(".yohoo-share-button-tweet").unbind().on("click", function() {
  144 + if (options.tweetTextFunction != null) {
  145 + options.tweetText = (function() {
  146 + return options.tweetTextFunction.apply($(".yohoo-share-button-tweet"));
  147 + })();
  148 + }
  149 + options.tweetText = options.tweetText.replace(/[ ]/g, "%20")
  150 + .replace(/[&]/g, "%26")
  151 + .replace(/[#]/g, "%23")
  152 + .replace(/[+]/g, "%2B");
  153 + window.open("http://twitter.com/intent/tweet?url=" + options.shareUrl +
  154 + "&text=" + options.tweetText,
  155 + "",
  156 + "height=" + options.height + ",width=" + options.width + ",left=" + iLeft + ",top=" + iTop);
167 }); 157 });
168 158
169 - $(".yohoo-share-button-qq").unbind().on("click",function(){  
170 - window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+ encodeURIComponent(location.href)+  
171 - '&title='+options.qqText+  
172 - '&pics='+options.img,'_blank','height='+options.height+',width='+options.width+',left='+iLeft+',top='+iTop); 159 + $(".yohoo-share-button-qq").unbind().on("click", function() {
  160 + window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + encodeURIComponent(location.href) +
  161 + '&title=' + options.qqText +
  162 + '&pics=' + options.img, '_blank', 'height=' + options.height + ',width=' + options.width + ',left=' + iLeft + ',top=' + iTop);
173 }); 163 });
174 }; 164 };
175 -  
176 - $(".yohoo-share-button-wx").on("mouseover",function(){  
177 - $(".wx-qrcode-dialog").show();  
178 - }).on("mouseout",function(){  
179 - $(".wx-qrcode-dialog").hide();  
180 - }); 165 +
  166 +$(".yohoo-share-button-wx").on("mouseover", function() {
  167 + $(".wx-qrcode-dialog").show();
  168 +}).on("mouseout", function() {
  169 + $(".wx-qrcode-dialog").hide();
  170 +});
181 171
182 //ipad微信 172 //ipad微信
183 -$(".detail-container").on("click.closeWxDialog",function(event){  
184 - if($(event.target).is(".yohoo-share-button-wx") || $(event.target).parents(".yohoo-share-button-wx").size()>0){ 173 +$(".detail-container").on("click.closeWxDialog", function(event) {
  174 + if ($(event.target).is(".yohoo-share-button-wx") || $(event.target).parents(".yohoo-share-button-wx").size() > 0) {
185 $(".wx-qrcode-dialog").show(); 175 $(".wx-qrcode-dialog").show();
186 - }else{ 176 + } else {
187 $(".wx-qrcode-dialog").hide(); 177 $(".wx-qrcode-dialog").hide();
188 } 178 }
189 }) 179 })
190 180
191 -$(".bottom-content").on("click.closeWxDialog",function(){ 181 +$(".bottom-content").on("click.closeWxDialog", function() {
192 $(".detail-container").trigger("click.closeWxDialog"); 182 $(".detail-container").trigger("click.closeWxDialog");
193 }) 183 })
194 -$(".enterprise").on("click.closeWxDialog",function(){ 184 +$(".enterprise").on("click.closeWxDialog", function() {
195 $(".detail-container").trigger("click.closeWxDialog"); 185 $(".detail-container").trigger("click.closeWxDialog");
196 -})  
197 - 186 +})
@@ -312,7 +312,7 @@ var YohoConfig = { @@ -312,7 +312,7 @@ var YohoConfig = {
312 baseUrl: '/', 312 baseUrl: '/',
313 domain: "yohoboys.com", 313 domain: "yohoboys.com",
314 resdomain: "res.yohoboys.com", 314 resdomain: "res.yohoboys.com",
315 - mainUrl: "http://localhost:3000", 315 + mainUrl: "http://newgirls.test.yoho.cn",
316 resUrl: "http://res.yohoboys.com", 316 resUrl: "http://res.yohoboys.com",
317 uploadUrl: "http://www.yohoboys.com/upload" 317 uploadUrl: "http://www.yohoboys.com/upload"
318 }; 318 };
@@ -27,7 +27,8 @@ @@ -27,7 +27,8 @@
27 "mustache": "2.0.0", 27 "mustache": "2.0.0",
28 "jquery.autocomplete": "~0.0.2", 28 "jquery.autocomplete": "~0.0.2",
29 "mlellipsis": "0.0.3", 29 "mlellipsis": "0.0.3",
30 - "jquery.rotate2d": "0.0.3" 30 + "jquery.rotate2d": "0.0.3",
  31 + "yoho-jsonp": "0.0.1"
31 }, 32 },
32 "devDependencies": { 33 "devDependencies": {
33 "expect.js": "0.3.1" 34 "expect.js": "0.3.1"
@@ -70,12 +70,19 @@ @@ -70,12 +70,19 @@
70 } 70 }
71 } 71 }
72 .feedback .comment-textarea { 72 .feedback .comment-textarea {
73 - width: 558px; 73 + .anonymous-info {
  74 + input {
  75 + width: 259px;
  76 + }
  77 + input:first-child {
  78 + width: 258px;
  79 + }
  80 + }
74 textarea { 81 textarea {
75 - width: 542px; 82 + width: 538px;
76 } 83 }
77 .login-status { 84 .login-status {
78 - width: 558px; 85 + width: 554px;
79 } 86 }
80 } 87 }
81 } 88 }
@@ -372,7 +372,7 @@ $shareicons: sprite-map('share/*.png', $spacing:5px); @@ -372,7 +372,7 @@ $shareicons: sprite-map('share/*.png', $spacing:5px);
372 li.yohoo-share-button-sina { 372 li.yohoo-share-button-sina {
373 @include retina-sprite ($shareicons, share-sina-btn, 28/32); 373 @include retina-sprite ($shareicons, share-sina-btn, 28/32);
374 } 374 }
375 - li.yohoo-share-button-fb { 375 + li.yohoo-share-button-facebook {
376 @include retina-sprite ($shareicons, share-fb-btn, 28/32); 376 @include retina-sprite ($shareicons, share-fb-btn, 28/32);
377 } 377 }
378 li.yohoo-share-button-wx { 378 li.yohoo-share-button-wx {
@@ -381,7 +381,7 @@ $shareicons: sprite-map('share/*.png', $spacing:5px); @@ -381,7 +381,7 @@ $shareicons: sprite-map('share/*.png', $spacing:5px);
381 li.yohoo-share-button-qq { 381 li.yohoo-share-button-qq {
382 @include retina-sprite ($shareicons, share-qq-btn, 28/32); 382 @include retina-sprite ($shareicons, share-qq-btn, 28/32);
383 } 383 }
384 - li.yohoo-share-button-tt { 384 + li.yohoo-share-button-tweet {
385 @include retina-sprite ($shareicons, share-tt-btn, 28/32); 385 @include retina-sprite ($shareicons, share-tt-btn, 28/32);
386 } 386 }
387 } 387 }
@@ -84,12 +84,19 @@ @@ -84,12 +84,19 @@
84 } 84 }
85 } 85 }
86 .feedback .comment-textarea { 86 .feedback .comment-textarea {
87 - width: 370px; 87 + .anonymous-info {
  88 + input {
  89 + width: 172px;
  90 + }
  91 + input:first-child {
  92 + width: 171px;
  93 + }
  94 + }
88 textarea { 95 textarea {
89 - width: 354px; 96 + width: 356px;
90 } 97 }
91 .login-status { 98 .login-status {
92 - width: 100%; 99 + width: 364px;
93 } 100 }
94 } 101 }
95 } 102 }
@@ -304,7 +304,7 @@ @@ -304,7 +304,7 @@
304 border-top: none; 304 border-top: none;
305 .userimg { 305 .userimg {
306 float: left; 306 float: left;
307 - margin: 3px 0 0 10px; 307 + margin: 1px 0 0 10px;
308 width: 20px; 308 width: 20px;
309 height: 20px; 309 height: 20px;
310 i { 310 i {
@@ -593,7 +593,7 @@ @@ -593,7 +593,7 @@
593 background: #000; 593 background: #000;
594 color: #fff; 594 color: #fff;
595 font-size: 12px; 595 font-size: 12px;
596 - text-align: center; 596 + text-align: center;
597 } 597 }
598 } 598 }
599 } 599 }
@@ -121,11 +121,18 @@ @@ -121,11 +121,18 @@
121 } 121 }
122 122
123 .feedback .comment-textarea { 123 .feedback .comment-textarea {
124 - width: 500px; 124 + .anonymous-info {
  125 + input {
  126 + width: 229px;
  127 + }
  128 + input:first-child {
  129 + width: 228px;
  130 + }
  131 + }
125 textarea { 132 textarea {
126 - width: 484px; 133 + width: 478px;
127 } 134 }
128 .login-status { 135 .login-status {
129 - width: 500px\0; 136 + width: 494px;
130 } 137 }
131 } 138 }
@@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
62 background: #fff; 62 background: #fff;
63 padding: 20px 10px 10px; 63 padding: 20px 10px 10px;
64 z-index: 100; 64 z-index: 100;
65 - object{ 65 + object{
66 width: 246px; 66 width: 246px;
67 height: 138px; 67 height: 138px;
68 } 68 }
@@ -689,11 +689,17 @@ $shareicons: sprite-map('share/*.png', $spacing:5px); @@ -689,11 +689,17 @@ $shareicons: sprite-map('share/*.png', $spacing:5px);
689 height: 28px; 689 height: 28px;
690 margin-bottom: 10px; 690 margin-bottom: 10px;
691 background-repeat: no-repeat; 691 background-repeat: no-repeat;
  692 +
  693 + a {
  694 + display:block;
  695 + width:100%;
  696 + height:100%;
  697 + }
692 } 698 }
693 li.yohoo-share-button-sina { 699 li.yohoo-share-button-sina {
694 background: sprite($shareicons, share-sina-btn); 700 background: sprite($shareicons, share-sina-btn);
695 } 701 }
696 - li.yohoo-share-button-fb { 702 + li.yohoo-share-button-facebook {
697 background: sprite($shareicons, share-fb-btn); 703 background: sprite($shareicons, share-fb-btn);
698 } 704 }
699 li.yohoo-share-button-wx { 705 li.yohoo-share-button-wx {
@@ -702,7 +708,7 @@ $shareicons: sprite-map('share/*.png', $spacing:5px); @@ -702,7 +708,7 @@ $shareicons: sprite-map('share/*.png', $spacing:5px);
702 li.yohoo-share-button-qq { 708 li.yohoo-share-button-qq {
703 background: sprite($shareicons, share-qq-btn); 709 background: sprite($shareicons, share-qq-btn);
704 } 710 }
705 - li.yohoo-share-button-tt { 711 + li.yohoo-share-button-tweet {
706 background: sprite($shareicons, share-tt-btn); 712 background: sprite($shareicons, share-tt-btn);
707 } 713 }
708 .wx-qrcode-dialog{ 714 .wx-qrcode-dialog{