add pointer script for local development

This commit is contained in:
Tyler 2021-04-09 11:01:03 -05:00
parent a161c58766
commit 16cae2c74b
1 changed files with 41 additions and 0 deletions

41
pointer-script.js Normal file
View File

@ -0,0 +1,41 @@
// ==UserScript==
// @name Status.io Selector 2
// @require file:///home/tyler/code/js-statusio-selector/statusio-selector.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: 0;
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;
}