diff --git a/README.md b/README.md index 361112b..89e60df 100755 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ qnloft-onenav + PHP + SQLite ,书签管理系统,网址导航系统 -中文 | [English](./README_EN.md) +参考文档: + +- [hugo 主题Demo](https://bioit.top/#friendlink) +- [hugo 主题文档](https://www.yuque.com/shenweiyan/cookbook/webstack-hugo) +- [onenav 参考文档](https://doc.xiaoz.org/books/onenav/page/7f100#bkmrk-%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84) ___ -OneNav是一款开源免费的书签(导航)管理程序,使用使用PHP + SQLite 3开发,界面简洁,安装简单,使用方便。OneNav可帮助你将浏览器书签集中式管理,解决跨设备、跨平台、跨浏览器之间同步和访问困难问题,做到一处部署,随处访问。 +一款开源免费的书签(导航)管理程序,使用使用PHP + SQLite 3开发,界面简洁,安装简单,使用方便。OneNav可帮助你将浏览器书签集中式管理,解决跨设备、跨平台、跨浏览器之间同步和访问困难问题,做到一处部署,随处访问。 ![](https://i.bmp.ovh/imgs/2020/12/40f222b7da7a89c9.png) @@ -23,7 +28,6 @@ OneNav是一款开源免费的书签(导航)管理程序,使用使用PHP + ![](https://i.bmp.ovh/imgs/2020/12/abba0af566f3c16a.png) -> **特别声明:未经作者允许,请勿将OneNav进行获利行为或进行商业行为,亦不得用于非法用途,否则自行承担相应法律责任!!!** ## 功能特色 @@ -80,13 +84,3 @@ ___ * [https://dwz.ovh/qxsul](https://dwz.ovh/qxsul) -## 鸣谢 - -感谢`@百素`/`@itushan`的代码贡献及主题开发,以及其它OneNav贡献者和使用者,名字太多无法一一列举,还请谅解。 - -OneNav诞生离不开以下项目,在此表示感谢(排名不分先后)。 - -* [WebStackPage](https://github.com/WebStackPage/WebStackPage.github.io) -* [LayUI](https://github.com/sentsin/layui) -* [Medoo](https://github.com/catfan/Medoo) -* [MDUI](https://github.com/zdhxiong/mdui) diff --git a/data/onenav.db3 b/data/onenav.db3 index 624d7a3..5e31aaf 100644 Binary files a/data/onenav.db3 and b/data/onenav.db3 differ diff --git a/templates/qnloft/assets/images/logos/default.webp b/templates/qnloft/assets/images/logos/default.webp new file mode 100644 index 0000000..cd98518 Binary files /dev/null and b/templates/qnloft/assets/images/logos/default.webp differ diff --git a/templates/qnloft/assets/images/logos/qnLogo.png b/templates/qnloft/assets/images/logos/qnLogo.png new file mode 100644 index 0000000..3f7f553 Binary files /dev/null and b/templates/qnloft/assets/images/logos/qnLogo.png differ diff --git a/templates/qnloft/assets/images/logos/qnLogo_dark.png b/templates/qnloft/assets/images/logos/qnLogo_dark.png new file mode 100644 index 0000000..4384d7f Binary files /dev/null and b/templates/qnloft/assets/images/logos/qnLogo_dark.png differ diff --git a/templates/qnloft/assets/js/app-anim.js b/templates/qnloft/assets/js/app-anim.js index caa71ea..38bb8df 100644 --- a/templates/qnloft/assets/js/app-anim.js +++ b/templates/qnloft/assets/js/app-anim.js @@ -1,1238 +1,1497 @@ -(function($){ - $(document).ready(function(){ - // 侧栏菜单初始状态设置 - if(theme.minNav != '1')trigger_resizable(true); - // 主题状态 - switch_mode(); - // 搜索模块 - intoSearch(); - // 粘性页脚 - stickFooter(); - // 网址块提示 - if(isPC()){ $('[data-toggle="tooltip"]').tooltip({trigger: 'hover'}); }else{ $('.qr-img[data-toggle="tooltip"]').tooltip({trigger: 'hover'}); } - // 初始化tab滑块 - intoSlider(); - // 初始化theiaStickySidebar - $('.sidebar').theiaStickySidebar({ - additionalMarginTop: 90, - additionalMarginBottom: 20 - }); - // 初始化游客自定义数据 - /*if(theme.isCustomize == '1'){ +(function ($) { + $(document).ready(function () { + // 侧栏菜单初始状态设置 + if (theme.minNav != "1") trigger_resizable(true); + // 主题状态 + switch_mode(); + // 搜索模块 + intoSearch(); + // 粘性页脚 + stickFooter(); + // 网址块提示 + if (isPC()) { + $('[data-toggle="tooltip"]').tooltip({ trigger: "hover" }); + } else { + $('.qr-img[data-toggle="tooltip"]').tooltip({ trigger: "hover" }); + } + // 初始化tab滑块 + intoSlider(); + // 初始化theiaStickySidebar + $(".sidebar").theiaStickySidebar({ + additionalMarginTop: 90, + additionalMarginBottom: 20, + }); + // 初始化游客自定义数据 + /*if(theme.isCustomize == '1'){ intoSites(false); intoSites(true); }*/ - }); - $(".panel-body.single img").each(function(i) { - if (!this.parentNode.href) { - if(theme.lazyload) - $(this).wrap("") - else - $(this).wrap("") - } - }) - // Enable/Disable Resizable Event - var wid = 0; - $(window).resize(function() { - clearTimeout(wid); - wid = setTimeout(go_resize, 200); - }); - function go_resize() { - stickFooter(); - //if(theme.minNav != '1'){ - trigger_resizable(false); - //} + }); + $(".panel-body.single img").each(function (i) { + if (!this.parentNode.href) { + if (theme.lazyload) + $(this).wrap( + "" + ); + else + $(this).wrap( + "" + ); } - // count-a数字动画 - $('.count-a').each(function () { - $(this).prop('Counter', 0).animate({ - Counter: $(this).text() - }, { - duration: 1000, - easing: 'swing', - step: function (now) { - $(this).text(Math.ceil(now)); - } - }); - }); - $(document).on('click', "a[target!='_blank']", function() { - if( theme.loading=='1' && $(this).attr('href') && $(this).attr('href').indexOf("#") != 0 && $(this).attr('href').indexOf("java") != 0 && !$(this).data('fancybox') && !$(this).data('commentid') && !$(this).hasClass('nofx') ){ - var load = $('
'); - $("body").prepend(load); - load.animate({opacity:'1'},200,'swing').delay(2000).hide(300,function(){ load.remove() }); + }); + // Enable/Disable Resizable Event + var wid = 0; + $(window).resize(function () { + clearTimeout(wid); + wid = setTimeout(go_resize, 200); + }); + function go_resize() { + stickFooter(); + //if(theme.minNav != '1'){ + trigger_resizable(false); + //} + } + // count-a数字动画 + $(".count-a").each(function () { + $(this) + .prop("Counter", 0) + .animate( + { + Counter: $(this).text(), + }, + { + duration: 1000, + easing: "swing", + step: function (now) { + $(this).text(Math.ceil(now)); + }, } - }); - // 点赞 - $(".btn-like").click(function() { - var t = $(this); - if(t.data('action') == "post_like"){ - if (t.hasClass('liked')) { - showAlert(JSON.parse('{"status":3,"msg":"您已经赞过了!"}')); + ); + }); + $(document).on("click", "a[target!='_blank']", function () { + if ( + theme.loading == "1" && + $(this).attr("href") && + $(this).attr("href").indexOf("#") != 0 && + $(this).attr("href").indexOf("java") != 0 && + !$(this).data("fancybox") && + !$(this).data("commentid") && + !$(this).hasClass("nofx") + ) { + var load = $(''); + $("body").prepend(load); + load + .animate({ opacity: "1" }, 200, "swing") + .delay(2000) + .hide(300, function () { + load.remove(); + }); + } + }); + // 点赞 + $(".btn-like").click(function () { + var t = $(this); + if (t.data("action") == "post_like") { + if (t.hasClass("liked")) { + showAlert(JSON.parse('{"status":3,"msg":"您已经赞过了!"}')); + } else { + var icop = t.children(".flex-column"); + t.addClass("liked"); + $.ajax({ + type: "POST", + url: theme.ajaxurl, + data: { + action: t.data("action"), + post_id: t.data("id"), + ticket: t.data("ticket"), + }, + success: function (data) { + $am = $( + '' + ); + icop.prepend($am); + showAlert(JSON.parse('{"status":1,"msg":"谢谢点赞!"}')); + $(".like-count").html(data); + $am.addClass("home-like-hide"); + }, + error: function () { + showAlert(JSON.parse('{"status":4,"msg":"网络错误 --."}')); + }, + }); + } + } else { + if (t.hasClass("disabled")) return false; + var _delete = 0; + var id = t.data("id"); + if (t.hasClass("liked")) { + _delete = 1; + } + t.addClass("disabled"); + $.ajax({ + type: "POST", + url: theme.ajaxurl, + data: { + action: t.data("action"), + post_id: t.data("id"), + post_type: t.data("post_type"), + delete: _delete, + ticket: t.data("ticket"), + }, + success: function (data) { + t.removeClass("disabled"); + if (data.status == 1) { + $(".star-count-" + id).html(data.count); + if (_delete == 1) { + t.removeClass("liked"); + t.find(".star-ico") + .removeClass("icon-collection") + .addClass("icon-collection-line"); } else { - var icop = t.children('.flex-column'); - t.addClass('liked'); - $.ajax({ - type : 'POST', - url : theme.ajaxurl, - data : { - action: t.data('action'), - post_id: t.data("id"), - ticket: t.data("ticket") - }, - success : function( data ){ - $am = $(''); - icop.prepend($am); - showAlert(JSON.parse('{"status":1,"msg":"谢谢点赞!"}')); - $('.like-count').html(data); - $am.addClass('home-like-hide'); - }, - error:function(){ - showAlert(JSON.parse('{"status":4,"msg":"网络错误 --."}')); - } - }); + t.addClass("liked"); + t.find(".star-ico") + .removeClass("icon-collection-line") + .addClass("icon-collection"); } - }else{ - if (t.hasClass('disabled')) - return false; - var _delete = 0; - var id = t.data("id"); - if (t.hasClass('liked')) { - _delete = 1; - } - t.addClass('disabled'); - $.ajax({ - type : 'POST', - url : theme.ajaxurl, - data : { - action: t.data("action"), - post_id: t.data("id"), - post_type: t.data("post_type"), - delete: _delete, - ticket: t.data("ticket") - }, - success : function( data ){ - t.removeClass('disabled'); - if(data.status==1){ - $('.star-count-'+id).html(data.count); - if(_delete==1){ - t.removeClass('liked'); - t.find('.star-ico').removeClass('icon-collection').addClass('icon-collection-line'); - } - else{ - t.addClass('liked'); - t.find('.star-ico').removeClass('icon-collection-line').addClass('icon-collection'); - } - ioPopupTips(data.status, data.msg); - return false; - } - ioPopupTips(data.status, data.msg); - }, - error:function(){ - t.removeClass('disabled'); - ioPopupTips(4, "网络错误 --."); - } - }); - - } - return false; - }); - // 卡片点赞 - $(document).on('click', '.home-like', function() { - if ($(this).hasClass('liked')) { - showAlert(JSON.parse('{"status":3,"msg":"您已经赞过了!"}')); - } else { - var icop = $(this); - var id = $(this).data("id"); - $(this).addClass('liked'); - $.ajax({ - type : 'POST', - url : theme.ajaxurl, - data : { - action: "post_like", - post_id: id - }, - success : function( data ){ - $am = $(''); - icop.prepend($am); - showAlert(JSON.parse('{"status":1,"msg":"谢谢点赞!"}')); - $(".home-like-"+id).html(data); - $am.addClass('home-like-hide'); - }, - error:function(){ - showAlert(JSON.parse('{"status":4,"msg":"网络错误 --."}')); - } - }); - } - return false; - }); - //未开启详情页计算访客方法 - $(document).on('click', '.url-card a.is-views[data-id]', function() { - $.ajax({ - type:"GET", - url:theme.ajaxurl, - data:{ - action:'io_postviews', - postviews_id:$(this).data('id'), - }, - cache:false, - }); - }); - // app下载统计 - var clipboard = new ClipboardJS('a.down_count', { - text: $(document).on('click','a.down_count', function(e) { - var mm = $(e.target).data('clipboard-text'); - $.ajax({ - type:"POST", - url:theme.ajaxurl, - data: $(this).data(), - success : function( data ){ - $('.down-count-text').html(data); - } - }); - if( mm ){ - return mm; - } - }) - }); - clipboard.on("success",function (e) { - alert("网盘密码已复制,点“确定”进入下载页面。"); - }); - - //夜间模式 - $(document).on('click', '.switch-dark-mode', function(event) { - event.preventDefault(); - $.ajax({ - url: theme.ajaxurl, - type: 'POST', - dataType: 'html', - data: { - mode_toggle: $('body').hasClass('io-black-mode') === true ? 1 : 0, - action: 'switch_dark_mode', - }, - }) - .done(function(response) { - $('body').toggleClass('io-black-mode '+theme.defaultclass); - switch_mode(); - $("#"+ $('.switch-dark-mode').attr('aria-describedby')).remove(); - //$('.switch-dark-mode').removeAttr('aria-describedby'); - }) - }); - function switch_mode(){ - if($('body').hasClass('io-black-mode')){ - if($(".switch-dark-mode").attr("data-original-title")) - $(".switch-dark-mode").attr("data-original-title","日间模式"); - else - $(".switch-dark-mode").attr("title","日间模式"); - $(".mode-ico").removeClass("icon-night"); - $(".mode-ico").addClass("icon-light"); - } - else{ - if($(".switch-dark-mode").attr("data-original-title")) - $(".switch-dark-mode").attr("data-original-title","夜间模式"); - else - $(".switch-dark-mode").attr("title","夜间模式"); - $(".mode-ico").removeClass("icon-light"); - $(".mode-ico").addClass("icon-night"); - } + ioPopupTips(data.status, data.msg); + return false; + } + ioPopupTips(data.status, data.msg); + }, + error: function () { + t.removeClass("disabled"); + ioPopupTips(4, "网络错误 --."); + }, + }); } - //返回顶部 - $(window).scroll(function () { - if ($(this).scrollTop() >= 50) { - $('#go-to-up').fadeIn(200); - $('.big-header-banner').addClass('header-bg'); - } else { - $('#go-to-up').fadeOut(200); - $('.big-header-banner').removeClass('header-bg'); - } - }); - $('.go-up').click(function () { - $('body,html').animate({ - scrollTop: 0 - }, 500); return false; - }); + }); + // 卡片点赞 + $(document).on("click", ".home-like", function () { + if ($(this).hasClass("liked")) { + showAlert(JSON.parse('{"status":3,"msg":"您已经赞过了!"}')); + } else { + var icop = $(this); + var id = $(this).data("id"); + $(this).addClass("liked"); + $.ajax({ + type: "POST", + url: theme.ajaxurl, + data: { + action: "post_like", + post_id: id, + }, + success: function (data) { + $am = $( + '' + ); + icop.prepend($am); + showAlert(JSON.parse('{"status":1,"msg":"谢谢点赞!"}')); + $(".home-like-" + id).html(data); + $am.addClass("home-like-hide"); + }, + error: function () { + showAlert(JSON.parse('{"status":4,"msg":"网络错误 --."}')); + }, + }); + } + return false; + }); + //未开启详情页计算访客方法 + $(document).on("click", ".url-card a.is-views[data-id]", function () { + $.ajax({ + type: "GET", + url: theme.ajaxurl, + data: { + action: "io_postviews", + postviews_id: $(this).data("id"), + }, + cache: false, + }); + }); + // app下载统计 + var clipboard = new ClipboardJS("a.down_count", { + text: $(document).on("click", "a.down_count", function (e) { + var mm = $(e.target).data("clipboard-text"); + $.ajax({ + type: "POST", + url: theme.ajaxurl, + data: $(this).data(), + success: function (data) { + $(".down-count-text").html(data); + }, + }); + if (mm) { + return mm; + } + }), + }); + clipboard.on("success", function (e) { + alert("网盘密码已复制,点“确定”进入下载页面。"); + }); - - //滑块菜单 - $('.slider_menu').children("ul").children("li").not(".anchor").hover(function() { + //夜间模式 + $(document).on("click", ".switch-dark-mode", function (event) { + event.preventDefault(); + $.ajax({ + url: theme.ajaxurl, + type: "POST", + dataType: "html", + data: { + mode_toggle: $("body").hasClass("io-black-mode") === true ? 1 : 0, + action: "switch_dark_mode", + }, + }).done(function (response) { + $("body").toggleClass("io-black-mode " + theme.defaultclass); + switch_mode(); + $("#" + $(".switch-dark-mode").attr("aria-describedby")).remove(); + //$('.switch-dark-mode').removeAttr('aria-describedby'); + }); + }); + function switch_mode() { + if ($("body").hasClass("io-black-mode")) { + if ($(".switch-dark-mode").attr("data-original-title")) + $(".switch-dark-mode").attr("data-original-title", "日间模式"); + else $(".switch-dark-mode").attr("title", "日间模式"); + $(".mode-ico").removeClass("icon-night"); + $(".mode-ico").addClass("icon-light"); + } else { + if ($(".switch-dark-mode").attr("data-original-title")) + $(".switch-dark-mode").attr("data-original-title", "夜间模式"); + else $(".switch-dark-mode").attr("title", "夜间模式"); + $(".mode-ico").removeClass("icon-light"); + $(".mode-ico").addClass("icon-night"); + } + } + //返回顶部 + $(window).scroll(function () { + if ($(this).scrollTop() >= 50) { + $("#go-to-up").fadeIn(200); + $(".big-header-banner").addClass("header-bg"); + } else { + $("#go-to-up").fadeOut(200); + $(".big-header-banner").removeClass("header-bg"); + } + }); + $(".go-up").click(function () { + $("body,html").animate( + { + scrollTop: 0, + }, + 500 + ); + return false; + }); + + //滑块菜单 + $(".slider_menu") + .children("ul") + .children("li") + .not(".anchor") + .hover( + function () { $(this).addClass("hover"), - //$('li.anchor').css({ - // transform: "scale(1.05)", - //}), - toTarget($(this).parent(),true,true) - }, function() { + //$('li.anchor').css({ + // transform: "scale(1.05)", + //}), + toTarget($(this).parent(), true, true); + }, + function () { //$('li.anchor').css({ // transform: "scale(1)", //}), - $(this).removeClass("hover") - }); - $('.slider_menu').mouseleave(function(e) { + $(this).removeClass("hover"); + } + ); + $(".slider_menu").mouseleave(function (e) { + var menu = $(this).children("ul"); + window.setTimeout(function () { + toTarget(menu, true, true); + }, 50); + }); + function intoSlider() { + $(".slider_menu[sliderTab]").each(function () { + if (!$(this).hasClass("into")) { var menu = $(this).children("ul"); - window.setTimeout(function() { - toTarget(menu,true,true) - }, 50) - }) ; - function intoSlider() { - $(".slider_menu[sliderTab]").each(function() { - if(!$(this).hasClass('into')){ - var menu = $(this).children("ul"); - menu.prepend(''); - var target = menu.find('.active').parent(); - if(0 < target.length){ - menu.children(".anchor").css({ - left: target.position().left + target.scrollLeft() + "px", - width: target.outerWidth() + "px", - height: target.height() + "px", - opacity: "1" - }) - } - $(this).addClass('into'); - } - }) - } - //粘性页脚 - function stickFooter() { - $('.main-footer').attr('style', ''); - if($('.main-footer').hasClass('text-xs')) - { - var win_height = jQuery(window).height(), - footer_height = $('.main-footer').outerHeight(true), - main_content_height = $('.main-footer').position().top + footer_height ; - if(win_height > main_content_height - parseInt($('.main-footer').css('marginTop'), 10)) - { - $('.main-footer').css({ - marginTop: win_height - main_content_height - }); - } - } - } - - - $('#sidebar-switch').on('click',function(){ - $('#sidebar').removeClass('mini-sidebar'); - //221024: 调整左导航展开时,点击图标锚定定位失效 - //$('.sidebar-nav .change-href').attr('href','javascript:;'); - - }); - - // Trigger Resizable Function - var isMin = false, - isMobileMin = false; - function trigger_resizable( isNoAnim ) { - if( (theme.minNav == '1' && !isMin && 767.98<$(window).width() )||(!isMin && 767.98<$(window).width() && $(window).width()<1024) ){ - //$('#mini-button').removeAttr('checked'); - $('#mini-button').prop('checked', false); - trigger_lsm_mini(isNoAnim); - isMin = true; - if(isMobileMin){ - $('#sidebar').addClass('mini-sidebar'); - $('.sidebar-nav .change-href').each(function(){$(this).attr('href',$(this).data('change'))}); - isMobileMin = false; - } - } - else if( ( theme.minNav != '1')&&((isMin && $(window).width()>=1024) || ( isMobileMin && !isMin && $(window).width()>=1024 ) ) ){ - $('#mini-button').prop('checked', true); - trigger_lsm_mini(isNoAnim); - isMin = false; - if(isMobileMin){ - isMobileMin = false; - } - } - else if($(window).width() < 767.98 && $('#sidebar').hasClass('mini-sidebar')){ - $('#sidebar').removeClass('mini-sidebar'); - //221024: 调整左导航展开时,点击图标锚定定位失效 - //$('.sidebar-nav .change-href').attr('href','javascript:;'); - isMobileMin = true; - isMin = false; - } - } - // sidebar-menu-inner收缩展开 - $('.sidebar-menu-inner a').on('click',function(){//.sidebar-menu-inner a //.has-sub a - - //console.log('--->>>'+$(this).find('span').text()); - if (!$('.sidebar-nav').hasClass('mini-sidebar')) {//菜单栏没有最小化 - $(this).parent("li").siblings("li.sidebar-item").children('ul').slideUp(200); - if ($(this).next().css('display') == "none") { //展开 - //展开未展开 - // $('.sidebar-item').children('ul').slideUp(300); - $(this).next('ul').slideDown(200); - $(this).parent('li').addClass('sidebar-show').siblings('li').removeClass('sidebar-show'); - }else{ //收缩 - //收缩已展开 - $(this).next('ul').slideUp(200); - //$('.sidebar-item.sidebar-show').removeClass('sidebar-show'); - $(this).parent('li').removeClass('sidebar-show'); - } - } - }); - //菜单栏最小化 - $('#mini-button').on('click',function(){ - console.log('start trigger_lsm_mini'); - trigger_lsm_mini(true); - - }); - function trigger_lsm_mini(isNoAnim){ - if (!$('.header-mini-btn input[type="checkbox"]').prop("checked")) { - $('.sidebar-nav').removeClass('mini-sidebar'); - //221024: 调整左导航展开时,点击图标锚定定位失效 - //$('.sidebar-nav .change-href').attr('href','javascript:;'); - $('.sidebar-menu ul ul').css("display", "none"); - console.log('checked=true'); - if(isNoAnim){ - console.log('isNoAnim=true'); - $('.sidebar-nav').removeClass('animate-nav'); - $('.sidebar-nav').width(170); - } - else{ - console.log('isNoAnim=false'); - $('.sidebar-nav').addClass('animate-nav'); - $('.sidebar-nav').stop().animate({width: 170},200); - } - }else{ - console.log('checked=false'); - $('.sidebar-item.sidebar-show').removeClass('sidebar-show'); - $('.sidebar-menu ul').removeAttr('style'); - $('.sidebar-nav').addClass('mini-sidebar'); - $('.sidebar-nav .change-href').each(function(){$(this).attr('href',$(this).data('change'))}); - if(isNoAnim){ - $('.sidebar-nav').removeClass('animate-nav'); - $('.sidebar-nav').width(60); - } - else{ - $('.sidebar-nav').addClass('animate-nav'); - $('.sidebar-nav').stop().animate({width: 60},200); - } - } - //$('.sidebar-nav').css("transition","width .3s"); - } - //显示2级悬浮菜单 - $(document).on('mouseover','.mini-sidebar .sidebar-menu ul:first>li,.mini-sidebar .flex-bottom ul:first>li',function(){ - var offset = 2; - if($(this).parents('.flex-bottom').length!=0) - offset = -3; - $(".sidebar-popup.second").length == 0 && ($("body").append(" ")); - $(".sidebar-popup.second>div").html($(this).html()); - $(".sidebar-popup.second").show(); - var top = $(this).offset().top - $(window).scrollTop() + offset; - var d = $(window).height() - $(".sidebar-popup.second>div").height(); - if(d - top <= 0 ){ - top = d >= 0 ? d - 8 : 0; - } - $(".sidebar-popup.second").stop().animate({"top":top}, 50); - }); - //隐藏悬浮菜单面板 - $(document).on('mouseleave','.mini-sidebar .sidebar-menu ul:first, .mini-sidebar .slimScrollBar,.second.sidebar-popup',function(){ - $(".sidebar-popup.second").hide(); - }); - //常驻2级悬浮菜单面板 - $(document).on('mouseover','.mini-sidebar .slimScrollBar,.second.sidebar-popup',function(){ - $(".sidebar-popup.second").show(); - }); - - $(document).on('click', '.ajax-cm-home .ajax-cm', function(event) { - event.preventDefault(); - var t = $(this); - var id = t.data('id'); - var box = $(t.attr('href')).children('.site-list'); - //console.log(box.children('.url-card').length); - if( box.children('.url-card').length==0 ){ - t.addClass('disabled'); - $.ajax({ - url: theme.ajaxurl, - type: 'POST', - dataType: 'html', - data : { - action: t.data('action'), - term_id: id, - }, - cache: true, - }) - .done(function(response) { - if (response.trim()) { - var url = $(response); - box.html(url); - if(isPC()) url.find('[data-toggle="tooltip"]').tooltip({ trigger: 'hover' }); - } else { - } - t.removeClass('disabled'); - }) - .fail(function() { - t.removeClass('disabled'); - }) - } - }); - - //首页tab模式请求内容 - $(document).on('click', '.ajax-list a', function(event) { - event.preventDefault(); - loadAjax( $(this), $(this).parents('.ajax-list') , '.'+$(this).data('target')); - }); - - $(document).on('click', '.ajax-list-home a', function(event) { - event.preventDefault(); - loadAjax( $(this), $(this).parents('.ajax-list-home'), '.ajax-'+$(this).parents('.ajax-list-home').data('id') ); - }); - - function loadAjax(t,parent,body){ - if( !t.hasClass('active') ){ - parent.find('a').removeClass('active'); - t.addClass('active'); - if($(body).children(".ajax-loading").length == 0) - $(body).append(''+msg+'
'+ - '' + + msg + + "
" + + "/gi,""),a=a.replace(/
/gi,""),a=a.replace(/
/gi, "")), + (a = a.replace(/
/gi, "")), + (a = a.replace(/