1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub-skin.git synced 2024-06-17 07:30:48 +03:00

quicklink и без копирайта в футере

This commit is contained in:
Alexander Yakovlev 2019-02-19 01:47:48 +07:00
parent cef956d576
commit 779f6674f0
Signed by: oreolek
GPG key ID: 1CDC4B7820C93BD3
2 changed files with 11 additions and 7 deletions

View file

@ -6,7 +6,11 @@
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
// google quicklink, apache license
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.quicklink=n()}(this,function(){var e={};function n(e){return new Promise(function(n,t){var r=new XMLHttpRequest;r.open("GET",e,r.withCredentials=!0),r.onload=function(){200===r.status?n():t()},r.send()})}var t,r,i=(t="prefetch",((r=document.createElement("link")).relList||{}).supports&&r.relList.supports(t)?function(e){return new Promise(function(n,t){var r=document.createElement("link");r.rel="prefetch",r.href=e,r.onload=n,r.onerror=t,document.head.appendChild(r)})}:n);function o(t,r,o){if(!(e[t]||(o=navigator.connection)&&((o.effectiveType||"").includes("2g")||o.saveData)))return(r?function(e){return null==self.fetch?n(e):fetch(e,{credentials:"include"})}:i)(t).then(function(){e[t]=!0})}var u=u||function(e){var n=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-n))}})},1)},c=new Set,f=new IntersectionObserver(function(e){e.forEach(function(e){if(e.isIntersecting){var n=e.target.href;c.has(n)&&a(n)}})});function a(e){c.delete(e),o(new URL(e,location.href).toString(),f.priority)}return function(e){e=Object.assign({timeout:2e3,priority:!1,timeoutFn:u,el:document},e),f.priority=e.priority;var n=e.origins||[location.hostname],t=e.ignores||[];e.timeoutFn(function(){e.urls?e.urls.forEach(a):Array.from(e.el.querySelectorAll("a"),function(e){f.observe(e),n.length&&!n.includes(e.hostname)||function e(n,t){return Array.isArray(t)?t.some(function(t){return e(n,t)}):(t.test||t).call(t,n.href,n)}(e,t)||c.add(e.href)})},{timeout:e.timeout})}});
jQuery(document).ready(function($){
quicklink();
// Хук начала инициализации javascript-составляющих шаблона
ls.hook.run('ls_template_init_start',[],window);
@ -399,7 +403,7 @@ jQuery(document).ready(function($){
/**
* Talk
*/
$('.js-talk-list').lsTalkList();
// Выбор получателей в форме добавления
@ -664,4 +668,5 @@ jQuery(document).ready(function($){
// Хук конца инициализации javascript-составляющих шаблона
ls.hook.run('ls_template_init_end',[],window);
});
});

View file

@ -222,7 +222,6 @@
<footer class="ls-grid-row layout-footer">
{block 'layout_footer'}
{hook run='layout_footer_begin'}
{hook run='copyright'}
{hook run='layout_footer_end'}
{/block}
</footer>
@ -248,6 +247,7 @@
{component 'toolbar' classes='js-toolbar-default' items={show_blocks group='toolbar'}}
<!-- Yandex.Metrika counter -->
<noscript><div><img src="https://mc.yandex.ru/watch/42008629" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<script type="text/javascript" >
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
@ -272,10 +272,8 @@
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks2");
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/42008629" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<script>
// /Yandex.Metrika counter
// Google webfont loader
(function(d) {
var wf = d.createElement('script'), s = d.scripts[0];
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
@ -287,6 +285,7 @@
families: ['Open Sans:300,400,700:latin,cyrillic']
}
});
window.addEventListener('load', function(){quicklink();});
</script>
{hook run='layout_body_end'}
{/block}