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'),
imgZoom = require('../plugin/imgZoom'),
tools = require('yoho-tools'),
mustache = require('mustache'),
//Handlebars = require('handlebars'),
mulLine = require('mlellipsis'),
flip = require("../plugin/flip"),
slide = require("../plugin/photoslide");
slide = require("../plugin/photoslide"),
jsonp = require('yoho-jsonp');
require('lazyload');
require('../plugin/slider');
... ... @@ -84,21 +87,22 @@ exports.init = function() {
//初始化截行插件
mulLine.init();
//分享
share.init({
shareUrl: shareUrl,
img: shareCover,
sinaText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
sinaText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '(来自Yoho!GIRL)',
fbTextFunction: function() {
return {
des: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl',
name: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl',
caption: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl',
des: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#Yoho!GIRL',
name: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#Yoho!GIRL',
caption: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#Yoho!GIRL',
url: location.href
}
},
tweetText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
qqText: '【Yoho!Girls】' + detailTitle.text() + ' ' + detailSubtitle.text() + '(来自Yoho!Girls)'
qqText: '【Yoho!Girls】' + detailTitle.text() + ' ' + detailSubtitle.text() + '(来自Yoho!GIRL)'
});
//懒加载
... ... @@ -170,10 +174,8 @@ exports.init = function() {
};
//右侧side的数据获取
$.ajax({
url: 'http://newgirls.test.yoho.cn/channel/detail/getright?id=' + ajaxParam.id + '&type=' + ajaxParam.type + '&c=' + ajaxParam.c + '&twoc=' + ajaxParam.twoc,
dataType: 'jsonp',
jsonp: 'callback',
jsonp({
url: YohoConfig.mainUrl + '/channel/detail/getright?id=' + ajaxParam.id + '&type=' + ajaxParam.type + '&c=' + ajaxParam.c + '&twoc=' + ajaxParam.twoc,
success: function(response) {
data = response.data;
//广告
... ... @@ -205,7 +207,7 @@ exports.init = function() {
}
//边栏related-post
if (data.mosts instanceof Array) return;
if (data.mosts.length <= 0) return;
sidePostTpl = $('#side-related-posts').html();
sidePostData = {
relatedPost: {
... ... @@ -303,10 +305,8 @@ exports.init = function() {
});
//底部数据的获取
$.ajax({
url: 'http://newgirls.test.yoho.cn/channel/detail/getbottom?id=' + ajaxParam.id + '&type=' + ajaxParam.type + '&c=' + ajaxParam.c + '&twoc=' + ajaxParam.twoc,
dataType: 'jsonp',
jsonp: 'callback',
jsonp({
url: YohoConfig.mainUrl + '/channel/detail/getbottom?id=' + ajaxParam.id + '&type=' + ajaxParam.type + '&c=' + ajaxParam.c + '&twoc=' + ajaxParam.twoc,
success: function(response) {
data = response.data;
... ... @@ -316,14 +316,21 @@ exports.init = function() {
commentnum = data.commentnum;
//底部related-post
if (!data.related instanceof Array) {
if (data.related.length > 0) {
bottomPostTpl = $('#bottom-related-posts').html();
bottomPostData = {
relatedPost: {
postList: data.related
}
}
};
// console.log(bottomPostData);
// console.log(bottomPostTpl);
//console.log(Handlebars);
/*var tpl = Handlebars.compile(bottomPostTpl);
var template = tpl(bottomPostData);*/
bottomPostHtml = mustache.render(bottomPostTpl, bottomPostData);
//console.log(tpl)
$('.detail-body').append($(bottomPostHtml));
postList = $('.related-posts').find("li");
... ...
var $ = require("jquery");
require("../plugin/comment");
require("../plugin/login");
exports.init = function()
{
$('.about-nav .feedback').addClass('current');
$(".comments-box").comment({
cid:'0',
commentPageUrl:'/feedback/default/list',
publishUrl:'/feedback/default/publish',
deleteUrl:'/feedback/default/delete',
isFeedback:true
});
exports.updateLogin = function(){
$(".comments-box").login("updateLoginState");
$(".comments-box").comment("publishComment");
}
var $ = require("jquery");
require("../plugin/comment");
require("../plugin/login");
exports.init = function() {
$('.about-nav .feedback').addClass('current');
$(".comments-box").comment({
cid: '0',
commentPageUrl: '/feedback/default/list',
publishUrl: '/feedback/default/publish',
deleteUrl: '/feedback/default/delete',
thirdLogin: true
});
exports.updateLogin = function() {
$(".comments-box").login("updateLoginState");
$(".comments-box").comment("publishComment");
}
}
\ No newline at end of file
... ...
... ... @@ -6,7 +6,9 @@
var $ = require('jquery'),
share = require('../plugin/share'),
swiper = require('yoho-idangerous.swiper');
swiper = require('yoho-idangerous.swiper'),
jsonp = require('yoho-jsonp');
require('lazyload');
... ... @@ -17,8 +19,6 @@ require('../plugin/imgZoom');
exports.init = function() {
var shareUrl = $('.share').attr('data-link'),
shareCover = $('.share').attr('cover-url'),
detailTitle = $('.detail-title').find('h1'),
detailSubtitle = $('.detail-title').find('h2'),
magazineSlide,
timer,
magazineTimer;
... ... @@ -26,18 +26,18 @@ exports.init = function() {
//分享
share.init({
shareUrl: shareUrl,
img: shareCover,
sinaText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
img: $(".mags-slide li").eq(0).find("img").attr("src"),
sinaText: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~',
fbTextFunction: function() {
return {
des: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl',
name: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl',
caption: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl',
des: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~',
name: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~',
caption: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~',
url: location.href
}
},
tweetText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
qqText: '【Yoho!Girls】' + detailTitle.text() + ' ' + detailSubtitle.text() + '(来自Yoho!Girls)'
tweetText: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~',
qqText: '随时引领潮流生活,我正在看《YOHO!潮流志》' + $(".date-price").find("span").text() + '期点杂志,每月7日,17日,27日出刊哦~'
});
//图片懒加载
... ... @@ -94,10 +94,8 @@ exports.init = function() {
}, 0);
});
$.ajax({
url: 'http://newgirls.test.yoho.cn/channel/magazine/ezine',
dataType: 'jsonp',
jsonp: 'callback',
jsonp({
url: YohoConfig.mainUrl + '/channel/magazine/ezine',
success: function(response) {
var data = response.data,
len = data.length,
... ...
var $ = require("jquery");
require("../plugin/comment");
require("../plugin/login");
exports.init = function()
{
var cidNum = $(".editor-comment-content").attr("cid");
$(".comment_button").on("click",function(){
if($(".comment-area").find(".comment-textarea").size()>0){
if($(".editor-comment-content").css("display") == "none"){
$(".editor-comment-content").show();
}else{
$(".editor-comment-content").hide();
}
}else{
$(".comment-area").comment({
cid:cidNum,
isEdit:true
});
var $ = require("jquery");
require("../plugin/comment");
require("../plugin/login");
exports.init = function() {
var cidNum = $(".editor-comment-content").attr("cid");
$(".comment_button").on("click", function() {
if ($(".comment-area").find(".comment-textarea").size() > 0) {
if ($(".editor-comment-content").css("display") == "none") {
$(".editor-comment-content").show();
}
});
exports.updateLogin = function(){
$(".comment-area").login("updateLoginState");
$(".comment-area").comment("publishComment");
} else {
$(".editor-comment-content").hide();
}
} else {
$(".comment-area").comment({
cid: cidNum,
isEdit: true
});
$(".editor-comment-content").show();
}
});
exports.updateLogin = function() {
$(".comment-area").login("updateLoginState");
$(".comment-area").comment("publishComment");
}
var id = {id:cidNum};
$.ajax({
type:'GET',
url:YohoConfig.mainUrl+'/writer/default/comment',
data: id,
dataType:'json',
success:function(response)
{
var data = response.data;
if(data.total){
$(".comment-num").text(data.total);
}
var id = {
id: cidNum
};
$.ajax({
type: 'GET',
url: YohoConfig.mainUrl + '/writer/default/comment',
data: id,
dataType: 'json',
success: function(response) {
var data = response.data;
if (data.total) {
$(".comment-num").text(data.total);
}
})
}
}
})
}
\ No newline at end of file
... ...
... ... @@ -60,39 +60,6 @@ require('./lazyloadImage');
this._animate(this.width);
},
/*
* 添加节点
*/
_addDom: function() {
var _this = this;
if (!this.$element.data("url")) return;
$.ajax({
type: 'GET',
url: YohoConfig.mainUrl + _this.$element.data("url") + _this.page,
dataType: 'json',
success: function(data) {
var item = '',
msg = data.data,
len = msg.length;
for (var i = 0; i < len; i++) {
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>'
}
$(item).appendTo(_this.$element);
//添加节点后重新计算宽度
if (_this.options.itemClass != '') {
_this.len = _this.$element.find("li." + _this.options.itemClass).length;
} else {
_this.len = _this.$element.find("li").length;
}
_this._calculationWidth(_this.len, _this.width);
_this.page++;
}
});
},
/*
* 插件事件绑定
*/
... ... @@ -106,10 +73,6 @@ require('./lazyloadImage');
if (_this.index == _this.len - _this.options.pageNum + 1) {
$(this).hide();
};
if ((Math.ceil(_this.index / _this.options.pageNum)) % 3 == 0 && (Math.ceil((_this.index - 1) / _this.options.pageNum)) % 3 != 0) {
_this._addDom();
}
});
this.$btnPrev.on("click", function() {
... ...
... ... @@ -3,322 +3,319 @@
author:liuyue
date:2015-01-07
*/
var $=require("jquery");
var $ = require("jquery");
var validate = require("./validate");
var box = require("./box");
var tools = require("yoho-tools");
var tips=require("./tips");
;
var tips = require("./tips");;
(function(global, undefined) {
var Login = function(element, options) {
this.options = options;
this.$element = $(element);
this.init();
this.options = options;
this.$element = $(element);
this.init();
};
Login.DEFAULTS = {
};
Login.DEFAULTS = {};
Login.prototype = {
constructor: Login,
init:function(){
if($(".login-box").size()<=0){
init: function() {
if ($(".login-box").size() <= 0) {
this.creatLoginBox();
this._bindEvent();
}
this.initLoginState();
if(!$(".cookieList").size() >0){
if (!$(".cookieList").size() > 0) {
var cookieList = $('<ul class="cookieList"></ul>').appendTo($(".accountwrap"));
}
this.cookieAccount();
},
creatLoginBox:function(){
var $loginBox = $('<div class="login-box">'+
'<h2>登录</h2>'+
'<div class="input-box">'+
'<p class="accountwrap"><input class="yoho-account" type="text" placeholder="'+tips.getTips("yohoAccount")+'"></p>'+
'<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>'+
'</div>'+
'<div class="warn">'+tips.getTips("loginError")+'</div>'+
'<div class="login-btn">'+
'<a id="login" href="javascript:;">'+tips.getTips("login")+'</a>'+
'</div>'+
'<div class="third-login">'+
'<p>'+tips.getTips("thirdLogin")+'</p>'+
'<div class="third-btn clearfix">'+
'<a class="sina" ref="/passport/partner/index/oauth/sina" href="javascript:;"></a>'+
'<a class="qq" ref="/passport/partner/index/oauth/qq" href="javascript:;"></a>'+
'<a class="fb" ref="/passport/partner/index/oauth/facebook" href="javascript:;"></a>'+
'</div>'+
'</div>'+
'<div class="close-btn"></div>'+
'</div>'+
creatLoginBox: function() {
var $loginBox = $('<div class="login-box">' +
'<h2>登录</h2>' +
'<div class="input-box">' +
'<p class="accountwrap"><input class="yoho-account" type="text" placeholder="' + tips.getTips("yohoAccount") + '"></p>' +
'<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>' +
'</div>' +
'<div class="warn">' + tips.getTips("loginError") + '</div>' +
'<div class="login-btn">' +
'<a id="login" href="javascript:;">' + tips.getTips("login") + '</a>' +
'</div>' +
'<div class="third-login">' +
'<p>' + tips.getTips("thirdLogin") + '</p>' +
'<div class="third-btn clearfix">' +
'<a class="sina" ref="/passport/partner/index/oauth/sina" href="javascript:;"></a>' +
'<a class="qq" ref="/passport/partner/index/oauth/qq" href="javascript:;"></a>' +
'<a class="fb" ref="/passport/partner/index/oauth/facebook" href="javascript:;"></a>' +
'</div>' +
'</div>' +
'<div class="close-btn"></div>' +
'</div>' +
'<div class="login-shadow"></div>').appendTo("body");
},
_bindEvent:function(){
_bindEvent: function() {
var that = this;
//关闭登录框
$(document).on("click.closeLogin",function(event){
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;
$(document).on("click.closeLogin", function(event) {
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;
that.closeLoginBox();
event.stopPropagation();
});
$(".login-box").on("click.closeLoginBox",".close-btn",function(){
$(".login-box").on("click.closeLoginBox", ".close-btn", function() {
that.closeLoginBox();
});
//输入账号时登录按钮样式变化
$(".login-box").on("focus",".yoho-account",function(){
$(".login-box").on("focus", ".yoho-account", function() {
$(".login-box").find("#login").addClass("login");
});
//账号密码输入框默认提示
$('.yoho-account').val(tips.getTips("yohoAccount")).addClass("default-tip");
$('.yoho-pwd-text').val(tips.getTips("yohoPwd")).addClass("default-tip");
$('.yoho-account').on("focus",function()
{
if ($(this).val() == tips.getTips("yohoAccount"))
{
$(this).removeClass("default-tip");
$(this).val('');
}
}).on("blur",function()
{
if ($(this).val() == '')
{
$(this).addClass("default-tip");
$(this).val(tips.getTips("yohoAccount"));
}
});
$('.yoho-pwd-text').on("focus",function()
{
if ($(this).val() == '' || $(this).val() == tips.getTips("yohoPwd"))
{
$('.yoho-pwd').val('').show().focus();
$(this).hide();
$(this).removeClass("default-tip");
}
});
$('.yoho-pwd').on("blur",function()
{
if ($(this).val() == '')
{
$(this).hide();
$('.yoho-pwd-text').addClass("default-tip");
$('.yoho-pwd-text').val(tips.getTips("yohoPwd")).show();
}
});
$('.yoho-account').on("focus", function() {
if ($(this).val() == tips.getTips("yohoAccount")) {
$(this).removeClass("default-tip");
$(this).val('');
}
}).on("blur", function() {
if ($(this).val() == '') {
$(this).addClass("default-tip");
$(this).val(tips.getTips("yohoAccount"));
}
});
$('.yoho-pwd-text').on("focus", function() {
if ($(this).val() == '' || $(this).val() == tips.getTips("yohoPwd")) {
$('.yoho-pwd').val('').show().focus();
$(this).hide();
$(this).removeClass("default-tip");
}
});
$('.yoho-pwd').on("blur", function() {
if ($(this).val() == '') {
$(this).hide();
$('.yoho-pwd-text').addClass("default-tip");
$('.yoho-pwd-text').val(tips.getTips("yohoPwd")).show();
}
});
//登录按钮点击事件
$(".login-box").on("click.login","#login",function()
{
var $this = $(this);
var account = $('.yoho-account').val();
var password = $('.yoho-pwd').val();
$.ajax
({
type:'POST',
url:YohoConfig.mainUrl+'/passport/partner/yoho',
data:{'account':account,'password':password},
dataType:'json',
success:function(response)
{
if (response&&response.status && response.data)
{
var userName;
var currentUserName=tools.cookie('userName');
var account = $(".yoho-account").val();
if(currentUserName==null||currentUserName==undefined){
tools.cookie('userName',account,{expires:5,path: '/'});
}else{
tools.cookie('userName',currentUserName+","+account,{expires:5,path: '/'});
}
that.cookieAccount();
that.setLogin(response.data);
$(".login-box").find(".warn").css({"visibility":"hidden"});
that.closeLoginBox();
$this.comment("publishComment");
}
else if (response&&response.message != '')
{
$(".login-box").find(".warn").css({"visibility":"visible"});
}
else
{
$(".login-box").find(".warn").css({"visibility":"visible"});
}
}
});
});
$(".login-box").on("click.login", "#login", function() {
var $this = $(this);
var account = $('.yoho-account').val();
var password = $('.yoho-pwd').val();
$.ajax({
type: 'POST',
url: YohoConfig.mainUrl + '/passport/partner/yoho',
data: {
'account': account,
'password': password
},
dataType: 'jsonp',
success: function(response) {
if (response && response.status && response.data) {
var userName;
var currentUserName = tools.cookie('userName');
var account = $(".yoho-account").val();
if (currentUserName == null || currentUserName == undefined) {
tools.cookie('userName', account, {
expires: 5,
path: '/'
});
} else {
tools.cookie('userName', currentUserName + "," + account, {
expires: 5,
path: '/'
});
}
that.cookieAccount();
that.setLogin(response.data);
$(".login-box").find(".warn").css({
"visibility": "hidden"
});
that.closeLoginBox();
$this.comment("publishComment");
} else if (response && response.message != '') {
$(".login-box").find(".warn").css({
"visibility": "visible"
});
} else {
$(".login-box").find(".warn").css({
"visibility": "visible"
});
}
}
});
});
//回车执行登录
$(".login-box").find(".yoho-pwd").keyup(function(e)
{
var e = e || window.event;
var k = e.keyCode || e.which;
if (k == 13)
{
$('#login').trigger("click.login");
}
});
$(".third-btn").on("click","a",function(){
$(".login-box").find(".yoho-pwd").keyup(function(e) {
var e = e || window.event;
var k = e.keyCode || e.which;
if (k == 13) {
$('#login').trigger("click.login");
}
});
$(".third-btn").on("click", "a", function() {
var _this = $(this);
if (!_this.attr('ref')) return;
window.open(_this.attr('ref'), "","width=760,height=650,top=300,left=300");
that.closeLoginBox();
return false;
if (!_this.attr('ref')) return;
window.open(_this.attr('ref'), "", "width=760,height=650,top=300,left=300");
that.closeLoginBox();
return false;
});
},
//滑出登录框
loginBoxAnimate:function(){
if($(".login-status").hasClass("login-success")) return;
if($(".side-bar-header").hasClass("login-success")) return;
loginBoxAnimate: function() {
if ($(".login-status").hasClass("login-success")) return;
if ($(".side-bar-header").hasClass("login-success")) return;
var height = $(".login-box").outerHeight();
$(".login-shadow").show();
$("body").find(".login-box").animate({"top":"50%","margin-top":-height/2},200);
$("body").find(".login-box").animate({
"top": "50%",
"margin-top": -height / 2
}, 200);
},
//隐藏登录框
closeLoginBox:function(){
closeLoginBox: function() {
var height = $(".login-box").outerHeight();
$(".login-box").css({"top":-height,"margin-top":0});
$(".login-box").css({
"top": -height,
"margin-top": 0
});
$(".login-shadow").hide();
},
//初始化登录状态
initLoginState:function()
{
var state = tools.cookie('yh_state');
var syncs = tools.cookie('yh_syncs');
if (state && syncs)
{
var data = $.parseJSON(syncs);
if (data && data.nick)
{
this.setLogin(data);
}
}
},
//更新登录信息
updateLoginState:function()
{
this.initLoginState();
},
initLoginState: function() {
var state = tools.cookie('yh_state');
var syncs = tools.cookie('yh_syncs');
if (state && syncs) {
var data = $.parseJSON(syncs);
if (data && data.nick) {
this.setLogin(data);
}
}
},
//更新登录信息
updateLoginState: function() {
this.initLoginState();
},
//登录
setLogin:function(data){
setLogin: function(data) {
var that = this;
$(".login-status .userimg").find("i").attr("class",data.type);
$(".login-status .userimg").find("i").attr("class", data.type);
$(".login-status .userinfo").find("span").text(data.nick);
//用户头像
if (data.headpic)
{
$(".login-status .userimg").find("img").attr("src",data.headpic);
}
//手机版
if (data.headpic)
{
$(".user-avatar").find("img").attr("src",data.headpic);
}
$(".login-username").text(data.nick);
$(".side-bar-header").addClass("login-success");
if (data.headpic) {
$(".login-status .userimg").find("img").attr("src", data.headpic);
}
//手机版
if (data.headpic) {
$(".user-avatar").find("img").attr("src", data.headpic);
}
$(".login-username").text(data.nick);
$(".side-bar-header").addClass("login-success");
$(".login-status .userinfo").show();
$(".login-status").addClass("login-success");
//隐藏匿名
if($(".login-status .anonymous").size()>0){
if ($(".login-status .anonymous").size() > 0) {
$(".login-status .anonymous").hide();
}
//隐藏第三方登录
$('.third-login-box').hide();
//隐藏意见反馈页登录按钮
if($(".feedback-login").size()>0){
if ($(".feedback-login").size() > 0) {
$(".feedback-login").hide();
}
$(".exit-btn").on("click",function(){
box.confirm(tips.getTips("logout"), function(){
$(".exit-btn").on("click", function() {
box.confirm(tips.getTips("logout"), function() {
that.setLogout();
});
});
},
//登出
setLogout:function(){
setLogout: function() {
$(".login-status").removeClass("login-success");
$(".login-status .userimg").find("img").attr("src",YohoConfig.resUrl+"/res/new/boys/images/detail/user-img.png");
$(".login-status .userimg").find("img").attr("src", YohoConfig.resUrl + "/assets/images/detail/user-img.png");
$(".login-status .userinfo").hide();
$(".login-status .userimg").find("i").attr("class",'');
$(".login-status .userimg").find("i").attr("class", '');
$(".comments-list").find(".delete-comment").remove();
//手机版
$(".side-bar-header").removeClass("login-success");
$(".user-avatar").find("img").attr("src",YohoConfig.resUrl+"/res/new/boys/images/detail/user-img.png");
$(".user-avatar").find("img").attr("src", YohoConfig.resUrl + "/assets/images/detail/user-img.png");
$(".login-username").text("登录");
//显示匿名
if($(".login-status .anonymous").size()>0){
if ($(".login-status .anonymous").size() > 0) {
$(".login-status .anonymous").show();
}
//显示第三方登录
$('.third-login-box').show();
//显示意见反馈页登录按钮
if($(".feedback-login").size()>0){
if ($(".feedback-login").size() > 0) {
$(".feedback-login").show();
}
$.ajax
({
type:'GET',
url:YohoConfig.mainUrl+'/passport/partner/logout',
dataType:'json'
});
$.ajax({
type: 'GET',
url: YohoConfig.mainUrl + '/passport/partner/logout',
dataType: 'json'
});
},
//cookie记入账号
cookieAccount:function(){
//cookie
var getCookie,
arrCookie;
getCookie = decodeURIComponent(tools.cookie('userName'));
if(!!tools.cookie('userName'))
{
arrCookie = tools.unique(getCookie.split(','));
$(".cookieList").empty();
for (var i=0;i<arrCookie.length;i++) {
$(".cookieList").append($('<li><a href="javascript:;">'+arrCookie[i]+'</a></li>'));
}
$(".login-box").click(function(e){
if($(e.target).is(".yoho-account")||$(e.target).is(".cookieList")|| $(e.target).closest(".cookieList").size()>0){
$(".cookieList").show();
}else{
$(".cookieList").hide();
}
})
$(".cookieList").on("click","li",function(){
$(".yoho-account").val($(this).find("a").text()).removeClass("default-tip");
$(".cookieList").hide();
return false;
});
}
cookieAccount: function() {
//cookie
var getCookie,
arrCookie;
getCookie = decodeURIComponent(tools.cookie('userName'));
if (!!tools.cookie('userName')) {
arrCookie = tools.unique(getCookie.split(','));
$(".cookieList").empty();
for (var i = 0; i < arrCookie.length; i++) {
$(".cookieList").append($('<li><a href="javascript:;">' + arrCookie[i] + '</a></li>'));
}
$(".login-box").click(function(e) {
if ($(e.target).is(".yoho-account") || $(e.target).is(".cookieList") || $(e.target).closest(".cookieList").size() > 0) {
$(".cookieList").show();
} else {
$(".cookieList").hide();
}
})
$(".cookieList").on("click", "li", function() {
$(".yoho-account").val($(this).find("a").text()).removeClass("default-tip");
$(".cookieList").hide();
return false;
});
}
}
};
... ... @@ -336,7 +333,7 @@ var tips=require("./tips");
};
$.fn.login = Plugin;
$.fn.login.Constructor = Login;
$.fn.login = Plugin;
$.fn.login.Constructor = Login;
})(this);
\ No newline at end of file
... ...
... ... @@ -11,75 +11,70 @@
* fbAppId:YohoConfig.girl.fbAppId,'657464311006064',
fbUrl:YohoConfig.girl.mainUrl+'/channel/yohood/closedialog',
*/
var $=require("jquery");
exports.init=function(info){
var defaults={
width:800,
height:500,
img:"",
imgFunction:null,
sinaText:"",
sinaTextFunction:null,
tweetText:"",
tweetTextFunction:null,
fbCaption:"",
fbDescription:"",
fbName:"",
fbTextFunction:null,
shareUrl:"",
shareUrlFunction:null,
fbAppId:"",
fbUrl:"",
qqText:""
}
var options=$.extend(defaults,info);
var $ = require("jquery");
exports.init = function(info) {
var defaults = {
width: 800,
height: 500,
img: "",
imgFunction: null,
sinaText: "",
sinaTextFunction: null,
tweetText: "",
tweetTextFunction: null,
fbCaption: "",
fbDescription: "",
fbName: "",
fbTextFunction: null,
shareUrl: "",
shareUrlFunction: null,
fbAppId: "",
fbUrl: "",
qqText: ""
}
var options = $.extend(defaults, info);
$(".yohoo-share-button-sina").unbind().on("click", function() {
if (options.sinaTextFunction != null) {
options.sinaText = (function() {
return options.sinaTextFunction.apply($(".yohoo-share-button-sina"));
})();
}
options.sinaText = options.sinaText.replace(/[ ]/g, "%20")
.replace(/[&]/g, "%26")
.replace(/[#]/g, "%23")
.replace(/[+]/g, "%2B");
$(".yohoo-share-button-sina").unbind().on("click", function()
{
if(options.sinaTextFunction!=null)
{
options.sinaText=(function(){
return options.sinaTextFunction.apply($(".yohoo-share-button-sina"));
})();
}
options.sinaText=options.sinaText.replace(/[ ]/g, "%20")
.replace(/[&]/g,"%26")
.replace(/[#]/g,"%23")
.replace(/[+]/g,"%2B");
window.sharetitle = options.sinaText;
if(options.imgFunction!=null)
{
options.img=(function(){
return options.imgFunction.apply($(".yohoo-share-button-sina"));
})();
if (options.imgFunction != null) {
options.img = (function() {
return options.imgFunction.apply($(".yohoo-share-button-sina"));
})();
}
window.shareUrl = options.img
share();
});
if(options.shareUrlFunction!=null)
{
options.shareUrl=(function(){
return options.shareUrlFunction.apply({sina:$(".yohoo-share-button-sina"),
facebook:$(".yohoo-share-button-facebook"),
tweet:$(".yohoo-share-button-tweet")});
})();
}
else
{
options.shareUrl=options.shareUrl==""?document.location.href:options.shareUrl;
if (options.shareUrlFunction != null) {
options.shareUrl = (function() {
return options.shareUrlFunction.apply({
sina: $(".yohoo-share-button-sina"),
facebook: $(".yohoo-share-button-facebook"),
tweet: $(".yohoo-share-button-tweet")
});
})();
} else {
options.shareUrl = options.shareUrl == "" ? document.location.href : options.shareUrl;
}
function share()
{
function share() {
(function(s, d, e) {
try {
} catch (e) {
}
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('');
try {} catch (e) {}
var f = 'http://v.t.sina.com.cn/share/share.php?',
u = options.shareUrl,
p = ['url=', e(u), '&title=', e(window.sharetitle), '&appkey=2924220432', '&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('');
... ... @@ -94,104 +89,98 @@ 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)
{
options.img=(function(){
$(".yohoo-share-button-facebook").unbind().on("click", function() {
if (options.imgFunction != null) {
options.img = (function() {
return options.imgFunction.apply($(".yohoo-share-button-facebook"));
})();
}
var tmpResult={des:"",name:"",caption:""};
if(options.fbTextFunction!=null)
{
tmpResult=(function(){
var tmpResult = {
des: "",
name: "",
caption: ""
};
if (options.fbTextFunction != null) {
tmpResult = (function() {
return options.fbTextFunction.apply($(".yohoo-share-button-facebook"));
})();
if (!tmpResult.url)
{
options.fbCaption=tmpResult.caption;
options.fbDescription=tmpResult.des;
options.fbName=tmpResult.name;
}
else
{
if (!tmpResult.url) {
options.fbCaption = tmpResult.caption;
options.fbDescription = tmpResult.des;
options.fbName = tmpResult.name;
} else {
options.fbUrl = tmpResult.url;
}
}
if (options.fbUrl)
{
if (options.fbUrl) {
window.open("https://www.facebook.com/sharer/sharer.php?u=" + options.fbUrl, "",
"height="+options.height+",width="+options.width+",left=" + iLeft + ",top=" + iTop);
}
else
{
options.fbCaption=options.fbCaption.replace(/[ ]/g, "%20")
.replace(/[&]/g,"%26")
.replace(/[#]/g,"%23")
.replace(/[+]/g,"%2B");
options.fbDescription=tmpResult.des.replace(/[ ]/g, "%20")
.replace(/[&]/g,"%26")
.replace(/[#]/g,"%23")
.replace(/[+]/g,"%2B");
options.fbName=tmpResult.name.replace(/[ ]/g, "%20")
.replace(/[&]/g,"%26")
.replace(/[#]/g,"%23")
.replace(/[+]/g,"%2B");
"height=" + options.height + ",width=" + options.width + ",left=" + iLeft + ",top=" + iTop);
} else {
options.fbCaption = options.fbCaption.replace(/[ ]/g, "%20")
.replace(/[&]/g, "%26")
.replace(/[#]/g, "%23")
.replace(/[+]/g, "%2B");
options.fbDescription = tmpResult.des.replace(/[ ]/g, "%20")
.replace(/[&]/g, "%26")
.replace(/[#]/g, "%23")
.replace(/[+]/g, "%2B");
options.fbName = tmpResult.name.replace(/[ ]/g, "%20")
.replace(/[&]/g, "%26")
.replace(/[#]/g, "%23")
.replace(/[+]/g, "%2B");
window.open("http://www.facebook.com/dialog/feed?app_id=1431491300468916&redirect_uri=http://www.yohoboys.com/channel/yohood/closedialog&" +
"link=" + options.shareUrl +
"&picture=" + options.img+
"&caption=" +options.fbName+
"&description="+options.fbDescription+(options.fbDescription==""?"":"(分享自 @yohoboy)")+
"&name="+options.fbCaption,
"&picture=" + options.img +
"&caption=" + options.fbName +
"&description=" + options.fbDescription + (options.fbDescription == "" ? "" : "(分享自 @yohoboy)") +
"&name=" + options.fbCaption,
"",
"height="+options.height+",width="+options.width+",left=" + iLeft + ",top=" + iTop);
"height=" + options.height + ",width=" + options.width + ",left=" + iLeft + ",top=" + iTop);
}
});
$(".yohoo-share-button-tweet").unbind().on("click",function() {
if(options.tweetTextFunction!=null)
{
options.tweetText=(function(){
return options.tweetTextFunction.apply($(".yohoo-share-button-tweet"));
})();
}
options.tweetText=options.tweetText.replace(/[ ]/g, "%20")
.replace(/[&]/g,"%26")
.replace(/[#]/g,"%23")
.replace(/[+]/g,"%2B");
window.open("http://twitter.com/intent/tweet?url=" + options.shareUrl +
"&text="+options.tweetText,
"",
"height="+options.height+",width="+options.width+",left=" + iLeft + ",top=" + iTop);
$(".yohoo-share-button-tweet").unbind().on("click", function() {
if (options.tweetTextFunction != null) {
options.tweetText = (function() {
return options.tweetTextFunction.apply($(".yohoo-share-button-tweet"));
})();
}
options.tweetText = options.tweetText.replace(/[ ]/g, "%20")
.replace(/[&]/g, "%26")
.replace(/[#]/g, "%23")
.replace(/[+]/g, "%2B");
window.open("http://twitter.com/intent/tweet?url=" + options.shareUrl +
"&text=" + options.tweetText,
"",
"height=" + options.height + ",width=" + options.width + ",left=" + iLeft + ",top=" + iTop);
});
$(".yohoo-share-button-qq").unbind().on("click",function(){
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+ encodeURIComponent(location.href)+
'&title='+options.qqText+
'&pics='+options.img,'_blank','height='+options.height+',width='+options.width+',left='+iLeft+',top='+iTop);
$(".yohoo-share-button-qq").unbind().on("click", function() {
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + encodeURIComponent(location.href) +
'&title=' + options.qqText +
'&pics=' + options.img, '_blank', 'height=' + options.height + ',width=' + options.width + ',left=' + iLeft + ',top=' + iTop);
});
};
$(".yohoo-share-button-wx").on("mouseover",function(){
$(".wx-qrcode-dialog").show();
}).on("mouseout",function(){
$(".wx-qrcode-dialog").hide();
});
$(".yohoo-share-button-wx").on("mouseover", function() {
$(".wx-qrcode-dialog").show();
}).on("mouseout", function() {
$(".wx-qrcode-dialog").hide();
});
//ipad微信
$(".detail-container").on("click.closeWxDialog",function(event){
if($(event.target).is(".yohoo-share-button-wx") || $(event.target).parents(".yohoo-share-button-wx").size()>0){
$(".detail-container").on("click.closeWxDialog", function(event) {
if ($(event.target).is(".yohoo-share-button-wx") || $(event.target).parents(".yohoo-share-button-wx").size() > 0) {
$(".wx-qrcode-dialog").show();
}else{
} else {
$(".wx-qrcode-dialog").hide();
}
})
$(".bottom-content").on("click.closeWxDialog",function(){
$(".bottom-content").on("click.closeWxDialog", function() {
$(".detail-container").trigger("click.closeWxDialog");
})
$(".enterprise").on("click.closeWxDialog",function(){
$(".enterprise").on("click.closeWxDialog", function() {
$(".detail-container").trigger("click.closeWxDialog");
})
})
\ No newline at end of file
... ...
... ... @@ -312,7 +312,7 @@ var YohoConfig = {
baseUrl: '/',
domain: "yohoboys.com",
resdomain: "res.yohoboys.com",
mainUrl: "http://localhost:3000",
mainUrl: "http://newgirls.test.yoho.cn",
resUrl: "http://res.yohoboys.com",
uploadUrl: "http://www.yohoboys.com/upload"
};
\ No newline at end of file
... ...
... ... @@ -27,7 +27,8 @@
"mustache": "2.0.0",
"jquery.autocomplete": "~0.0.2",
"mlellipsis": "0.0.3",
"jquery.rotate2d": "0.0.3"
"jquery.rotate2d": "0.0.3",
"yoho-jsonp": "0.0.1"
},
"devDependencies": {
"expect.js": "0.3.1"
... ...
... ... @@ -70,12 +70,19 @@
}
}
.feedback .comment-textarea {
width: 558px;
.anonymous-info {
input {
width: 259px;
}
input:first-child {
width: 258px;
}
}
textarea {
width: 542px;
width: 538px;
}
.login-status {
width: 558px;
width: 554px;
}
}
}
\ No newline at end of file
... ...
... ... @@ -372,7 +372,7 @@ $shareicons: sprite-map('share/*.png', $spacing:5px);
li.yohoo-share-button-sina {
@include retina-sprite ($shareicons, share-sina-btn, 28/32);
}
li.yohoo-share-button-fb {
li.yohoo-share-button-facebook {
@include retina-sprite ($shareicons, share-fb-btn, 28/32);
}
li.yohoo-share-button-wx {
... ... @@ -381,7 +381,7 @@ $shareicons: sprite-map('share/*.png', $spacing:5px);
li.yohoo-share-button-qq {
@include retina-sprite ($shareicons, share-qq-btn, 28/32);
}
li.yohoo-share-button-tt {
li.yohoo-share-button-tweet {
@include retina-sprite ($shareicons, share-tt-btn, 28/32);
}
}
... ...
... ... @@ -84,12 +84,19 @@
}
}
.feedback .comment-textarea {
width: 370px;
.anonymous-info {
input {
width: 172px;
}
input:first-child {
width: 171px;
}
}
textarea {
width: 354px;
width: 356px;
}
.login-status {
width: 100%;
width: 364px;
}
}
}
\ No newline at end of file
... ...
... ... @@ -304,7 +304,7 @@
border-top: none;
.userimg {
float: left;
margin: 3px 0 0 10px;
margin: 1px 0 0 10px;
width: 20px;
height: 20px;
i {
... ... @@ -593,7 +593,7 @@
background: #000;
color: #fff;
font-size: 12px;
text-align: center;
text-align: center;
}
}
}
... ...
... ... @@ -121,11 +121,18 @@
}
.feedback .comment-textarea {
width: 500px;
.anonymous-info {
input {
width: 229px;
}
input:first-child {
width: 228px;
}
}
textarea {
width: 484px;
width: 478px;
}
.login-status {
width: 500px\0;
width: 494px;
}
}
\ No newline at end of file
... ...
... ... @@ -62,7 +62,7 @@
background: #fff;
padding: 20px 10px 10px;
z-index: 100;
object{
object{
width: 246px;
height: 138px;
}
... ... @@ -689,11 +689,17 @@ $shareicons: sprite-map('share/*.png', $spacing:5px);
height: 28px;
margin-bottom: 10px;
background-repeat: no-repeat;
a {
display:block;
width:100%;
height:100%;
}
}
li.yohoo-share-button-sina {
background: sprite($shareicons, share-sina-btn);
}
li.yohoo-share-button-fb {
li.yohoo-share-button-facebook {
background: sprite($shareicons, share-fb-btn);
}
li.yohoo-share-button-wx {
... ... @@ -702,7 +708,7 @@ $shareicons: sprite-map('share/*.png', $spacing:5px);
li.yohoo-share-button-qq {
background: sprite($shareicons, share-qq-btn);
}
li.yohoo-share-button-tt {
li.yohoo-share-button-tweet {
background: sprite($shareicons, share-tt-btn);
}
.wx-qrcode-dialog{
... ...