diff --git a/nijigen/js/common.js b/nijigen/js/common.js index 3ae79a9..5271d12 100644 --- a/nijigen/js/common.js +++ b/nijigen/js/common.js @@ -36,21 +36,7 @@ var Skin = { } }) }, - init: function () { - Util.initPjax() - - $('body').on('click', '.content-reset img', function () { - window.open(this.src) - }) - - this._initCommon($('.icon__up')) - - $('.header__nav a, .header__m a').each(function () { - if (this.href === location.href) { - this.className = 'current' - } - }) - + _initAnimation: function () { if (!('IntersectionObserver' in window)) { $('.item').addClass('item--active') return false @@ -82,6 +68,36 @@ var Skin = { }) } }, + init: function () { + Util.initPjax(function () { + Skin._initAnimation() + if (!Util.isArticlePage(location.href)) { + $('.b3-solo-list').closest('.module').remove() + } + }) + + Skin._initAnimation() + + $('body').on('click', '.content-reset img', function () { + window.open(this.src) + }) + + this._initCommon($('.icon__up')) + + $('.header__nav a, .header__m a').each(function () { + if (this.href === location.href) { + this.className = 'current' + } + }).click(function () { + $('.header__nav a, .header__m a').removeClass('current') + this.className = 'current' + $('.header__m .module__list').hide() + }) + + $('.header__logo').click(function () { + $('.header__nav a, .header__m a').removeClass('current') + }) + }, _initArticleCommon: function () { if ($('.b3-solo-list li').length > 0 && $(window).width() > 1000) { $('.side'). diff --git a/nijigen/js/common.min.js b/nijigen/js/common.min.js index fa0d74f..4a2a519 100644 --- a/nijigen/js/common.min.js +++ b/nijigen/js/common.min.js @@ -15,4 +15,4 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -var Skin={_initCommon:function(e){$(window).scroll(function(){$(window).scrollTop()>125?e.show():e.hide()})},init:function(){if(Util.initPjax(),$("body").on("click",".content-reset img",function(){window.open(this.src)}),this._initCommon($(".icon__up")),$(".header__nav a, .header__m a").each(function(){this.href===location.href&&(this.className="current")}),!("IntersectionObserver"in window))return $(".item").addClass("item--active"),!1;window.imageIntersectionObserver?(window.imageIntersectionObserver.disconnect(),$(".item").each(function(){window.imageIntersectionObserver.observe(this)})):(window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){if(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)$(e.target).addClass("item--active");else{if(1===$(e.target).closest(".side").length||$(e.target).closest(".article-list").hasClass("content"))return;$(e.target).removeClass("item--active")}})}),$(".item").each(function(){window.imageIntersectionObserver.observe(this)}))},_initArticleCommon:function(){$(".b3-solo-list li").length>0&&$(window).width()>1e3&&($(".side").prepend('
'),$(".side .module:eq(0) .module__list").html($(".b3-solo-list")))},initArticle:function(){this._initArticleCommon(),setTimeout(function(){0===$("#externalRelevantArticlesWrap li").length&&($("#externalRelevantArticlesWrap").next().remove(),$("#externalRelevantArticlesWrap").remove()),0===$("#relevantArticlesWrap li").length&&($("#relevantArticlesWrap").prev().remove(),$("#relevantArticlesWrap").remove()),0===$("#randomArticlesWrap li").length&&($("#randomArticlesWrap").prev().remove(),$("#randomArticlesWrap").remove())},1e3)}};Skin.init(); \ No newline at end of file +var Skin={_initCommon:function(e){$(window).scroll(function(){$(window).scrollTop()>125?e.show():e.hide()})},_initAnimation:function(){if(!("IntersectionObserver"in window))return $(".item").addClass("item--active"),!1;window.imageIntersectionObserver?(window.imageIntersectionObserver.disconnect(),$(".item").each(function(){window.imageIntersectionObserver.observe(this)})):(window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){if(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)$(e.target).addClass("item--active");else{if(1===$(e.target).closest(".side").length||$(e.target).closest(".article-list").hasClass("content"))return;$(e.target).removeClass("item--active")}})}),$(".item").each(function(){window.imageIntersectionObserver.observe(this)}))},init:function(){Util.initPjax(function(){Skin._initAnimation(),Util.isArticlePage(location.href)||$(".b3-solo-list").closest(".module").remove()}),Skin._initAnimation(),$("body").on("click",".content-reset img",function(){window.open(this.src)}),this._initCommon($(".icon__up")),$(".header__nav a, .header__m a").each(function(){this.href===location.href&&(this.className="current")}).click(function(){$(".header__nav a, .header__m a").removeClass("current"),this.className="current",$(".header__m .module__list").hide()}),$(".header__logo").click(function(){$(".header__nav a, .header__m a").removeClass("current")})},_initArticleCommon:function(){$(".b3-solo-list li").length>0&&$(window).width()>1e3&&($(".side").prepend('
'),$(".side .module:eq(0) .module__list").html($(".b3-solo-list")))},initArticle:function(){this._initArticleCommon(),setTimeout(function(){0===$("#externalRelevantArticlesWrap li").length&&($("#externalRelevantArticlesWrap").next().remove(),$("#externalRelevantArticlesWrap").remove()),0===$("#relevantArticlesWrap li").length&&($("#relevantArticlesWrap").prev().remove(),$("#relevantArticlesWrap").remove()),0===$("#randomArticlesWrap li").length&&($("#randomArticlesWrap").prev().remove(),$("#randomArticlesWrap").remove())},1e3)}};Skin.init(); \ No newline at end of file diff --git a/nijigen/js/isotope.pkgd.js b/nijigen/js/isotope.pkgd.js index b5f1f40..e536715 100644 --- a/nijigen/js/isotope.pkgd.js +++ b/nijigen/js/isotope.pkgd.js @@ -15,5 +15,5 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,o){var n,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}(a=a||e||t.jQuery)&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){return u(this,t,n.call(arguments,1))}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r=void 0===s?function(){}:function(t){s.error(t)};return o(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return-1==o.indexOf(e)&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return-1!=o&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=0,n=i[o];e=e||[];for(var s=this._onceEvents&&this._onceEvents[t];n;){var r=s&&s[n];r&&(this.off(t,n),delete s[n]),n.apply(this,e),o+=r?0:1,n=i[o]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e