MediaWiki:Gadget-tilemarkers-core.js

From RuneRealm Wiki

This is the current revision of this page, as edited by Alex (talk | contribs) at 02:10, 13 October 2024 (Created page with "var ACTIVE_TEXT = 'Copied' var DEFAULT_TEXT = 'Copy tile markers' function onClick(button) { t = button.$element[0] navigator.clipboard.writeText(t.nextElementSibling.innerHTML); // Set the copied state and queue changing back button.setLabel(ACTIVE_TEXT); button.setIcon('check') setTimeout(function() { button.setLabel(DEFAULT_TEXT); button.setIcon(null) }, 3000) } function createButton() { button = new OO.ui.ButtonWidget({ label: DEFAULT_TEXT,..."). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

After saving, you may need to bypass your browser's cache to see the changes. For further information, see Wikipedia:Bypass your cache.

  • In most Windows and Linux browsers: Hold down Ctrl and press F5.
  • In Safari: Hold down ⇧ Shift and click the Reload button.
  • In Chrome and Firefox for Mac: Hold down both ⌘ Cmd+⇧ Shift and press R.
var ACTIVE_TEXT = 'Copied'
var DEFAULT_TEXT = 'Copy tile markers'

function onClick(button) {
    t = button.$element[0]
	navigator.clipboard.writeText(t.nextElementSibling.innerHTML);
	
	// Set the copied state and queue changing back
    button.setLabel(ACTIVE_TEXT); button.setIcon('check')
    setTimeout(function() { button.setLabel(DEFAULT_TEXT); button.setIcon(null) }, 3000)
}

function createButton() {
	button = new OO.ui.ButtonWidget({
        label: DEFAULT_TEXT,
        flags: ['primary', 'progressive'],
        classes: ['tile-marker-button']
    });
    button.on('click', onClick, [button])
    return button
}

$('.tilemarker-div').before(function() { return createButton().$element})