Bone Overlord.gif The Roost of the Graveborn Quest Spoiler!
Domine Graveborn: todos os bosses e mecânicas ilustradas!
Saiba mais ➔
Winter Tree.png Winter Update 2025
Acompanhe tudo sobre o Winter Update 2025!
Saiba mais ➔
Stag.gif The Order of the Stag Quest Spoiler!
Conheça Isle of Ada: sua quest, missões secundárias e todos os bosses!
Saiba mais ➔

MediaWiki:Tibiadrome.js: mudanças entre as edições

De Tibia Wiki - A Enciclopédia do Tibia
Ir para navegação Ir para pesquisar
m
m
 
(25 revisões intermediárias por 2 usuários não estão sendo mostradas)
Linha 1: Linha 1:
if (typeof mw !== 'undefined') {
if (typeof mw !== 'undefined') {
   mw.loader.load('/index.php?title=MediaWiki:luxon.min.js&action=raw&ctype=text/javascript')
   mw.loader.addScriptTag('/index.php?title=MediaWiki:luxon.min.js&action=raw&ctype=text/javascript', ready)
  ready()
}
}


function ready () {
function ready () {
   $('#tibiadrome_cal').html('' +
   $('#tibiadrome_cal').html('' +
     '<table class="wikitable">' +
     '<table style="width:100%; margin:0px;">' +
     '<tbody>' +
     '<tbody>' +
     '<tr>' +
     '<tr>' +
     '<td><b>Rotação Atual</b></td>' +
     '<td colspan="2" style="font-size:14px; width:100%; text-align:center; vertical-align:top; border-bottom:1px dashed #999;"><b>Rotação Número&nbsp;<span id="tibiadrome_rot"></span></b></td>' +
    '<td id="tibiadrome_rot">-</td>' +
     '</tr>' +
     '</tr>' +
     '<tr>' +
     '<tr>' +
     '<td><b>Iniciou em</b></td>' +
     '<td style="width:50%; text-align:center; vertical-align:top; border-bottom:1px dashed #999;"><b>Início:</b></td>' +
     '<td id="tibiadrome_start">-</td>' +
     '<td style="width:50%; text-align:center; vertical-align:top; border-bottom:1px dashed #999;"><b>Fim:</b></td>' +
     '</tr>' +
     '</tr>' +
     '<tr>' +
     '<tr>' +
     '<td><b>Terminará em</b></td>' +
     '<td style="width:50%; text-align:center; vertical-align:top; border-bottom:1px dashed #999;" id="tibiadrome_start">-</td>' +
     '<td id="tibiadrome_end">-</td>' +
     '<td style="width:50%; text-align:center; vertical-align:top; border-bottom:1px dashed #999;" id="tibiadrome_end">-</td>' +
     '</tr>' +
     '</tr>' +
     '</td></tr></tbody></table>')
     '</td></tr></tbody></table>')
   setInterval(updateTibiadrome, 1000)
  updateTibiadrome()
   setInterval(updateTibiadrome, 60 * 1000)
}
}


function updateTibiadrome () {
function updateTibiadrome () {
   const secondRotation = luxon.DateTime.fromSeconds(1627372800) // July 27, 2021 10:00:00 (CEST)
   const secondRotation = luxon.DateTime.fromSeconds(1627459200).setZone('Europe/Berlin') // July 28, 2021 10:00:00 (CEST)
   const now = (new luxon.DateTime()).setZone('Europe/Berlin')
   const now = luxon.DateTime.now().setZone('Europe/Berlin')
   let rot = 2
   let rot = 2
   for (let i = 0; secondRotation.plus({ days: i * 14 }) < now; i++) {
   for (let i = 0; secondRotation.plus({ days: i * 14 }) < now; i++) {
Linha 32: Linha 31:
   }
   }


   const start = luxon.DateTime.fromSeconds(secondRotation + (rot - 2) * 14 * 24 * 60 * 60)
   const start = luxon.DateTime.fromSeconds(secondRotation.plus({ days: (rot - 2) * 14 }).toUnixInteger())
   const end = luxon.DateTime.fromSeconds(secondRotation + (rot - 1) * 14 * 24 * 60 * 60)
   const end = luxon.DateTime.fromSeconds(secondRotation.plus({ days: (rot - 1) * 14 }).toUnixInteger())
   $('#tibiadrome_rot').text(rot)
  const f = luxon.DateTime.DATETIME_SHORT
   $('#tibiadrome_start').text(start.toLocaleString(luxon.DateTime.DATETIME_SHORT) + ' (' + start.toRelativeCalendar() + ')')
  f.timeZoneName = 'short'
   $('#tibiadrome_end').text(end.toLocaleString(luxon.DateTime.DATETIME_SHORT) + ' (' + end.toRelativeCalendar() + ')')
 
   $('#tibiadrome_rot').text('#' + rot)
   $('#tibiadrome_start').text(start.toLocaleString(f) + ' (' + start.toRelative() + ')')
   $('#tibiadrome_end').text(end.toLocaleString(f) + ' (' + end.toRelative() + ')')
}
}

Edição atual tal como às 13h53min de 28 de novembro de 2023

if (typeof mw !== 'undefined') {
  mw.loader.addScriptTag('/index.php?title=MediaWiki:luxon.min.js&action=raw&ctype=text/javascript', ready)
}

function ready () {
  $('#tibiadrome_cal').html('' +
    '<table style="width:100%; margin:0px;">' +
    '<tbody>' +
    '<tr>' +
    '<td colspan="2" style="font-size:14px; width:100%; text-align:center; vertical-align:top; border-bottom:1px dashed #999;"><b>Rotação Número&nbsp;<span id="tibiadrome_rot"></span></b></td>' +
    '</tr>' +
    '<tr>' +
    '<td style="width:50%; text-align:center; vertical-align:top; border-bottom:1px dashed #999;"><b>Início:</b></td>' +
    '<td style="width:50%; text-align:center; vertical-align:top; border-bottom:1px dashed #999;"><b>Fim:</b></td>' +
    '</tr>' +
    '<tr>' +
    '<td style="width:50%; text-align:center; vertical-align:top; border-bottom:1px dashed #999;" id="tibiadrome_start">-</td>' +
    '<td style="width:50%; text-align:center; vertical-align:top; border-bottom:1px dashed #999;" id="tibiadrome_end">-</td>' +
    '</tr>' +
    '</td></tr></tbody></table>')
  updateTibiadrome()
  setInterval(updateTibiadrome, 60 * 1000)
}

function updateTibiadrome () {
  const secondRotation = luxon.DateTime.fromSeconds(1627459200).setZone('Europe/Berlin') // July 28, 2021 10:00:00 (CEST)
  const now = luxon.DateTime.now().setZone('Europe/Berlin')
  let rot = 2
  for (let i = 0; secondRotation.plus({ days: i * 14 }) < now; i++) {
    rot = 2 + i
  }

  const start = luxon.DateTime.fromSeconds(secondRotation.plus({ days: (rot - 2) * 14 }).toUnixInteger())
  const end = luxon.DateTime.fromSeconds(secondRotation.plus({ days: (rot - 1) * 14 }).toUnixInteger())
  const f = luxon.DateTime.DATETIME_SHORT
  f.timeZoneName = 'short'

  $('#tibiadrome_rot').text('#' + rot)
  $('#tibiadrome_start').text(start.toLocaleString(f) + ' (' + start.toRelative() + ')')
  $('#tibiadrome_end').text(end.toLocaleString(f) + ' (' + end.toRelative() + ')')
}