Jump to content

User:GhostInTheMachine/TalkHelper2.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by GhostInTheMachine (talk | contribs) at 19:02, 30 June 2020 (So far). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
mw.loader.load( '/w/index.php?title=User:BrandonXLF/FloatSide.css&action=raw&ctype=text/css', 'text/css' );

mw.loader.using(
  [ 'ext.gadget.CommentsInLocalTime',
    'jquery.makeCollapsible'
  ],
  TalkHelper2Init,
  function(){
    alert('Could not load dependencies');
  }
);

function TalkHelper2Init() {
  console.log('TalkHelper2 init');

  if (window.commentsInLocalTimeWasRun) {
    TalkHelper2Run();
  } else {
    setTimeout(TalkHelper2Init, 10);
  }
}

function TalkHelper2Run() {
  console.log('TalkHelper2 run');

  //  Wikipedia

  $('#mw-panel').wrapInner('<div id="mw-panel-wp" class="navbox" style="text-align: left;"></div>');

  $subPanel = $('#mw-panel-wp');

  $subPanel.wrapInner('<div class="mw-collapsible-content"></div>');
  $subPanel.prepend('Wikipedia');
  $subPanel.makeCollapsible();
  $subPanel.addClass('navbox');

  //  Yesterday

  $('#mw-panel').append('<p><div id="mw-panel-yest" class="navbox" style="text-align: left;"></div>');

  $subPanel = $('#mw-panel-yest');

  $subPanel.wrapInner('<div class="mw-collapsible-content"></div>');
  $subPanel.prepend('Yesterday');
  $subPanel.makeCollapsible();

  //  Today

  $('#mw-panel').append('<p><div id="mw-panel-yest" class="navbox" style="text-align: left;"></div>');

  $subPanel = $('#mw-panel-yest');

  $subPanel.wrapInner('<div class="mw-collapsible-content"></div>');
  $subPanel.prepend('Yesterday');
  $subPanel.makeCollapsible();
}