';
html += ''
$('.conch-user').after(html);
$('.conch-user').removeClass('conch-user');
}
}
}
},
'Alert':{
'Init': function() {
Conch.Alert.Popup();
},
'Close': function() {
$('.hl-close-full').click(function(){
$("html,body").removeClass("hl-htmlover");
$('.hl-full-alert').removeClass('hl-full-x0')
});
$(".hl-pops-bg-active,.hl-from-list li").click(function(){
$('.hl-half-alert').removeClass("hl-half-y0");
$('.hl-from-btn').removeClass("hl-from-op");
setTimeout(function(){
$(".hl-pops-bg-active").removeClass("hl-pops-bg-active");
$(".hl-pops-bg").remove();
},200);
});
},
'Popbg': function() {
if($(".hl-pops-bg").length>0){
$(".hl-pops-bg").addClass("hl-pops-bg-active");
}else{
$("body").append('');
$(".hl-pops-bg").addClass("hl-pops-bg-active");
}
},
'Popup': function() {
$('.hl-alert-items').each(function(){
if ($(this).length) {
$(this).hover(function(){
$(this).find(".hl-alert-box").show();
$(this).find('.hl-lazy').lazyload({threshold: 100});
},function(){
$(this).find(".hl-alert-box").hide();
})
}
});
$('.hl-full-items').each(function(){
if ($(this).length) {
var $this = $(this);
var $wrap = $(this).find('.hl-full-alert');
var $btn = $(this).parent().find('.hl-full-op');
$btn.click(function(){
if(Conch.Browser.Swidth<768){
$wrap.addClass('hl-full-x0');
$("html,body").addClass("hl-htmlover");
}else{
if($this.children().css('display')=='block'){
$this.parent().removeClass('hl-data-show');
}else{
$this.parent().addClass('hl-data-show');
}
}
$this.find('.hl-lazy').lazyload({threshold: 100});
Conch.Alert.Close();
});
}
});
$('.hl-pops-items').each(function(){
if ($(this).length) {
$(this).click(function(){
if(Conch.Browser.Swidth<768){
Conch.Alert.Popbg();
}
Conch.Alert.Close();
});
}
});
$('.hl-half-items').each(function(){
if ($(this).length) {
var $box = $(this).find('.hl-half-y100');
$(this).click(function(){
if(Conch.Browser.Swidth<768){
Conch.Alert.Popbg();
}
$box.addClass('hl-half-y0');
Conch.Alert.Close();
});
}
});
$('.hl-from-buttons').each(function(){
if ($(this).length) {
var $_this = $(this),
$btn = $_this.find('.hl-from-btn'),
$wrap = $_this.find('.hl-from-wrap');
$btn.click(function(){
var $__this = $(this);
$btn.addClass('hl-from-op');
$wrap.addClass('hl-half-y0');
if(Conch.Browser.Swidth<768){
Conch.Alert.Popbg();
}
Conch.Alert.Close();
});
$(".hl-from-list li").bind("click", function(){
var e = $(this).index(),
$from = $(".hl-from-btn"),
$href = $(this).data("href");
$(this).removeClass().addClass("active").siblings().removeClass();
$from.hide();
$from.eq(e).show();
$(".hl-play-btn").attr("href",$href);
});
}
});
},
'Notice':function(){
if(Conch.Cookie.Get('tips')===null){
Conch.Alert.Popbg();
$("body").append(''+conchtpl.tipt+'
'+conchtpl.tipc+'
');
$(".hl-poptips-btn a.no").click(function() {
Conch.Cookie.Set('tips','ok',1);
$('.hl-poptips-wrap').remove();
$(".hl-pops-bg").remove();
});
$(".hl-poptips-btn a").click(function() {
$('.hl-poptips-wrap').remove();
$(".hl-pops-bg").remove();
});
}
},
},
'Shows':{
'Init': function() {
Conch.Shows.Text();
Conch.Shows.List();
Conch.Shows.Sort();
Conch.Shows.Tabs();
Conch.Shows.Change();
Conch.Shows.Copyright();
},
'Text': function() {
$(".hl-show-text").each(function(){
var $wrap=$(this).parent(),
$text=$wrap.find('.hl-content-text').children(),
$t=$(this).find('em');
if($text.height() > 48){
$(this).show();
}else{
$(this).hide();
}
$(this).on("click",function(){
if($wrap.hasClass("hl-content-hide")){
$wrap.removeClass('hl-content-hide');
$wrap.addClass('hl-content-show');
$t.text('收起')
}else{
$wrap.removeClass('hl-content-show');
$wrap.addClass('hl-content-hide');
$t.text('展开')
}
});
});
},
'List': function() {
$('.hl-show-list').each(function(){
var $wrap=$(this).parent().parent(),
$t=$(this).find('em');
$(this).on('click',function(){
if($wrap.hasClass('hl-list-hide-xs')){
$(this).attr('href','javascript:void(0)');
$wrap.removeClass('hl-list-hide-xs');
$t.text('收起全部')
}else{
$(this).attr('href','#playlist');
$wrap.addClass('hl-list-hide-xs');
$t.text('展开全部')
}
Conch.Swiper.Scrolls();
});
});
},
'Sort': function() {
$(".hl-sort-btn").each(function(){
var $i=$(this).find('i');
var $t=$(this).find('span');
$(this).on("click",function(e){
if($i.hasClass("hl-icon-daoxu")){
$i.removeClass('hl-icon-daoxu');
$i.addClass('hl-icon-zhengxu');
$t.text('正序')
}else{
$i.removeClass('hl-icon-zhengxu');
$i.addClass('hl-icon-daoxu');
$t.text('倒序')
}
e.preventDefault();
$(this).parent().parent().find(".hl-sort-list").each(function(){
var $pl=$(this).find("li");
for(let i=0,j=$pl.length-1;i浅色模式');
}else{
$btn.attr("id","black");$btn.html('
深色模式');
}
}
$(".hl-color-item a").click(function(){
var $Color = $(this).attr("id");
$("link[name='color']").attr("href","/template/conch/asset/css/"+$Color+".css?v="+conchtpl.ver+"");
$.cookie("color",$Color,{expires:365, path: '/'});
if($Color=='black'){
$(this).attr("id","white");
$(this).html('
浅色模式');
}else{
$(this).attr("id","black");
$(this).html('
深色模式');
}
});
},
'Navs': function() {
$('.hl-nav-item').each(function(){
var $Active = $('.hl-nav-item a.active'),
$Display = $Active.parent().css('display'),
$text = $Active.text();
if ($Active.length>0 && $Display=='none') {
$('.hl-nav-more a>span').addClass('hl-text-conch').addClass('active');
$('.hl-nav-more a>span').text($text);
}else{
$('.hl-nav-more a>span').removeClass('hl-text-conch').removeClass('active');
$('.hl-nav-more a>span').text('全部');
}
});
$(".hl-open-menu").on('click', function(){
$(".conch-menus").addClass("active");
$(".conch-ms-close,.conch-ms-overlay").on('click', function(){
$(".conch-menus").removeClass("active");
});
});
},
'Url': function(){
var short = $(".hl-short-url");
if (conchtpl.slink=="") {
var url = encodeURI(Conch.Browser.url);
}else{
var url = conchtpl.slink + encodeURI(Conch.Browser.urlpath);
};
if (conchtpl.short=='1'){
if (conchtpl.api=='1'){
$.ajax({
url: conchtpl.aurl + url,
type: "GET",
dataType: "jsonp",
cache: false,
success: function (data, status) {
for(x in data.data.urls[0]) ;
short.prepend( data.data.urls[0].url_short);
},
error: function(obj,info,errObj){
short.prepend(url);
},
});
}else{
var ajax = new XMLHttpRequest();
var token = conchtpl.tok;
var longUrl = url;
var termOfValidity = conchtpl.term;
ajax.open('post','https://dwz.cn/admin/v2/create', 'true');
ajax.setRequestHeader("Content-Type", "application/json");
ajax.setRequestHeader("Token", token);
ajax.send(JSON.stringify({
Url: longUrl,
TermOfValidity: termOfValidity
}));
ajax.onreadystatechange = function () {
if (ajax.readyState === 4 && ajax.status === 200) {
var obj =JSON.parse(ajax.responseText)
console.log(ajax.responseText);
if (obj.Code===0){short.prepend(obj.ShortUrl);}else{short.prepend(url);}
}
}
};
}else{
short.prepend(url);
}
},
'Target':function(){
$('a').each(function(){
var str = $(this).attr("href");
if($(this).length && str.indexOf("java") == -1){
$(this).attr("target","_blank");
}
});
},
'Copy': function() {
var btn=document.getElementsByClassName('conch-copy');
var clipboard=new Clipboard(btn);
clipboard.on('success', function(e){
$('body').append('
');
setTimeout(function(){$('.hl-pop-msg').remove();},1000);
});
clipboard.on('error', function(e){
$('body').append('
');
setTimeout(function(){$('.hl-pop-msg').remove();},1000);
});
},
'Set': function() {
$('.hl-more-list').each(function(){
if ($(this).length) {
var $wrap = $(this).parent().parent();
$(this).click(function(){
$wrap.removeClass('hl-list-hide');
$(this).parent().remove();
});
}
});
$('.hl-vod-big').each(function(){
if ($(this).length && Conch.Browser.Swidth>767) {
var $ul = $(this).find('.hl-vod-list');
var $one = $ul.find('li:nth-child(1) a');
var $two = $ul.find('li:nth-child(2) a'),
$high= $two.innerHeight();
$one.css('height',''+$high+'px');
}
});
$('.hl-vod-widebig.hl-list-v12').each(function(){
if ($(this).length && Conch.Browser.Swidth>767) {
var $ul = $(this).find('.hl-vod-list');
var $one = $ul.find('li:nth-child(1) a');
var $two = $ul.find('li:nth-child(2) a'),
$high= $two.innerHeight()*2+80;
$one.css('height',''+$high+'px');
}
});
$('.hl-setups-op a').click(function(){
var $setup=$(this).parent().parent();
if($setup.css('right')=='0px'){
$setup.removeClass('active');
}else{
$setup.addClass('active');
}
});
$('.hl-head-slide').each(function(){
if ($(this).length) {
var Title = $(this).find('h2').innerWidth();
var Swrap = Title+10;
$(this).find('.hl-rb-type-child').css('width','calc(100% - '+Swrap+'px)');
}
});
$('.hl-this-box').each(function(){
var $this = $(this),
$btn = $this.find(".hl-close-this");
$btn.click(function(){
$this.remove();
});
});
},
},
};
$(document).ready(function() {
Conch.Host();
Conch.Resize();
Conch.Images.Init();
Conch.Swiper.Init();
Conch.Scroll.Init();
Conch.Search.Init();
Conch.History.Init();
Conch.User.Init();
Conch.Alert.Init();
Conch.Shows.Init();
Conch.Other.Init();
});