Перейти к содержанию

MediaWiki:Common.js: различия между версиями

Материал из Марксопедии
Нет описания правки
Нет описания правки
 
Строка 20: Строка 20:
       position: fixed;
       position: fixed;
       right: 20px;
       right: 20px;
       top: 60px;
       bottom: 60px;
       color: #5cb53f;
       color: #5cb53f;
       background-color: #fff;
       background-color: #fff;

Текущая версия от 20:44, 23 января 2026

/* Размещённый здесь код JavaScript будет загружаться пользователям при обращении к каждой странице */

function showHideFootnote(){document.body.classList.toggle("hide-footnotes");}
  document.body.innerHTML = document.body.innerHTML.replace(/\[#(\s)?(\w+)\]/g, '<sup class="footnote">[#$2]</sup>');
  
  document.body.innerHTML = document.body.innerHTML+
  `<a id="footnotes-visibility-trigger" onclick="showHideFootnote()" href="javascript:void(0)">PN</a>
    <style>
    sup.footnote{color: #3eaf7c !important; cursor: pointer}
    .hide-footnotes sup.footnote{display:none}
    #footnotes-visibility-trigger {
      border-radius: 50px;
      width: 35px;
      height: 35px;
      display: block;
      line-height: 33px;
      text-align: center;
      text-decoration: none;
      border: 2px solid #5cb53f;
      position: fixed;
      right: 20px;
      bottom: 60px;
      color: #5cb53f;
      background-color: #fff;
      font-weight: 700;
      transition: all 0.1s ease-in-out;
     }
    .hide-footnotes #footnotes-visibility-trigger {
      color: #e96c6c;
      border-color: #e96c6c;
    }
    #footnotes-visibility-trigger:hover{
      opacity: 0.8
    }
  </style>
  `;