js-statusio-selector/pointer-script.js

42 lines
1.3 KiB
JavaScript

// ==UserScript==
// @name Status.io Selector Pointer Script
// @require file:///home/tyler/code/js-statusio-selector/code-payload.js
// @version 0.0.1
// @include /^https?://app\.status\.io/dashboard/.*/?(maintenance|incident)/create$/
// @include /^https?://app\.status\.io/dashboard/.*/?(maintenance|incident)/.*/?edit$/
// @grant GM_addStyle
// @grant GM_setClipboard
// ==/UserScript==
//--- Style our newly added elements using CSS.
GM_addStyle ( multilineStr ( function () {/*!
#myContainer {
position: fixed;
bottom: 150px;
right: 0;
font-size: 14px;
background: orange;
border: 3px outset black;
margin: 3px;
opacity: 0.7;
z-index: 222;
padding: 5px 5px;
}
#myButton {
cursor: pointer;
}
#myContainer p {
color: red;
background: white;
}
*/} ) );
function multilineStr (dummyFunc) {
var str = dummyFunc.toString ();
str = str.replace (/^[^\/]+\/\*!?/, '') // Strip function () { /*!
.replace (/\s*\*\/\s*\}\s*$/, '') // Strip */ }
.replace (/\/\/.+$/gm, '') // Double-slash comments wreck CSS. Strip them.
;
return str;
}