User:Base/crosswatchlink.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
var mwcrosswatchicon = '<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24"  viewBox="0 0 80 80"><g id="d" transform="rotate(45 40,40)" stroke="#000" stroke-width=".3"><path d="M 40,6 V 40 L 33.2,33.2 z" fill="#00b3ff"/><path d="M 40,6 V 40 L 46.8,33.2 z" fill="#0ff"/></g><use xlink:href="#d" transform="rotate(90 40,40)"/><use xlink:href="#d" transform="rotate(180 40,40)"/><use xlink:href="#d" transform="rotate(270 40,40)"/><g id="r" stroke="#000" stroke-width=".3"><path d="M 40,0 V 40 L 32,32 z" fill="#03f"/><path d="M 40,0 V 40 L 48,32 z" fill="#c8ffff"/></g><use xlink:href="#r" transform="rotate(90 40,40)"/><use xlink:href="#r" transform="rotate(180 40,40)"/><use xlink:href="#r" transform="rotate(270 40,40)"/></svg>';
$("body.mw-special-Watchlist div.mw-indicators")
         	.prepend( $( document.createElement( "div" ) )
                   	.addClass( "mw-indicator" )
               		.attr( "id", "mw-indicator-mw-crosswatchlink" )
                	.append( $( document.createElement( "a" ) )
                            .addClass( "mw-crosswatchlink" )
                            .attr( "target", "_blank" )
                            .attr( "href", "https://tools.wmflabs.org/crosswatch/" )
                            .text("Crosswatch")
                            .css( "background-image" , 'linear-gradient(transparent, transparent), url("data:image/svg+xml,'+encodeURIComponent(mwcrosswatchicon)) /*[[:File:Compass_rose_simple_plain.svg]]*/
                            .css( "background-repeat" , "no-repeat")
                            .css( "background-position" , "left center")
                            .css( "padding-left" , "28px")
                          )
            	    );