mw.loader.load( '/w/index.php?title=User:Evad37/rater.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Evad37/rater.js]] // UTC clock with m
mw.loader.load( '/w/index.php?title=User:Evad37/rater.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Evad37/rater.js]]
// UTC clock with modifications
mw.loader.using(['mediawiki.util', 'mediawiki.api', 'user']).then(function() {
function padWithZeroes(num) {
return num < 10 ? '0' + num.toString() : num.toString();
}
function showTime($target) {
var now = new Date();
var timezone = window.LiveClockTimeZone || 'UTC';
var hh, mm, ss;
if (timezone === "UTC") {
hh = now.getUTCHours();
mm = now.getUTCMinutes();
ss = now.getUTCSeconds();
} else if (timezone === "local") {
hh = now.getHours();
mm = now.getMinutes();
ss = now.getSeconds();
} else {
var newNow;
try {
newNow = new Date(now.toLocaleString("en-US", { timeZone: timezone }));
hh = newNow.getHours();
mm = newNow.getMinutes();
ss = newNow.getSeconds();
} catch (err) {
console.log("LiveClock - error creating Date object with timezone '" + timezone + "': " + err.name);
timezone = "UTC";
newNow = now;
hh = now.getUTCHours();
mm = now.getUTCMinutes();
ss = now.getUTCSeconds();
}
}
var time = padWithZeroes(hh) + ':' + padWithZeroes(mm);
$target.text(time);
var ms = now.getUTCMilliseconds();
setTimeout(function() {
showTime($target);
}, 1100 - ms);
}
function addLiveClockInstance(clockLocation) {
var node = document.createElement('span'); // Changed from div to span
node.id = 'utcdate';
node.style.cssText = 'font-weight: bold; font-size: 120%; display: inline-block;'; // Ensure it's inline
var container = document.getElementById(clockLocation);
if (container) {
var list = container.querySelector('ul'); // Ensuring it's added to a list if it exists
if (list) {
var listItem = document.createElement('li');
listItem.appendChild(node);
list.appendChild(listItem); // Adding it as a list item
} else {
container.appendChild(node); // Fallback if no list
}
showTime($(node));
}
}
function liveClock() {
var dbName = mw.config.get('wgDBname');
var showOutsideDropdown = dbName === 'mediawikiwiki' || dbName === 'enwiki';
var clockLocation = document.getElementById('p-vector-user-menu-overflow') && showOutsideDropdown ? 'p-vector-user-menu-overflow' : 'p-personal';
addLiveClockInstance(clockLocation);
addLiveClockInstance('p-personal-sticky-header');
}
$(liveClock);
});
// Cite RCDB
$('head').one('reftoolbarbase', function() {
new citeTemplate('Cite RCDB', 'Cite RCDB',
[ // Basic fields
{"field": "coaster_name", "label":"Coaster name"},
{"field": "location", "label":"Location"},
{"field": "rcdb_number", "label":"RCDB number"},
{"field": "accessdate", "label":"Access date"},
{"field": "url", "label":"URL"}
],
[ // Expanded fields
]);
});
importScript('User:BrandonXLF/Autoref.js'); // Backlink: [[User:BrandonXLF/Autoref.js]]
importScript('User:Taavi/Aligner.js'); // Backlink: [[User:Taavi/Aligner.js]]
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.