-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c391a67
commit 2cbb934
Showing
5 changed files
with
571 additions
and
1,490 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { build } from 'esbuild'; | ||
import info from './package.json' assert { type: 'json' }; | ||
|
||
const svgsNeeded = ['Checkmark', 'Clear', 'EyeOff', 'Flag', 'Pencil', 'Trash']; | ||
const svgsUrls = svgsNeeded.map(svgName => { | ||
return `// @resource icon${svgName} https://cdn.sstatic.net/Img/stacks-icons/${svgName}.svg`; | ||
}); | ||
|
||
const userscriptHeader = `// ==UserScript== | ||
// @name Advanced Flagging | ||
// @namespace https://github.com/SOBotics | ||
// @version ${info.version} | ||
// @author Robert Rudman | ||
// @contributor double-beep | ||
// @match *://*.stackexchange.com/* | ||
// @match *://*.stackoverflow.com/* | ||
// @match *://*.superuser.com/* | ||
// @match *://*.serverfault.com/* | ||
// @match *://*.askubuntu.com/* | ||
// @match *://*.stackapps.com/* | ||
// @match *://*.mathoverflow.net/* | ||
// @exclude *://chat.stackexchange.com/* | ||
// @exclude *://chat.meta.stackexchange.com/* | ||
// @exclude *://chat.stackoverflow.com/* | ||
// @exclude *://area51.stackexchange.com/* | ||
// @exclude *://data.stackexchange.com/* | ||
// @exclude *://stackoverflow.com/c/* | ||
// @exclude *://winterbash*.stackexchange.com/* | ||
// @exclude *://api.stackexchange.com/* | ||
${svgsUrls.join('\n')} | ||
// @grant GM_xmlhttpRequest | ||
// @grant GM_getValue | ||
// @grant GM_setValue | ||
// @grant GM_deleteValue | ||
// @grant GM_addStyle | ||
// @grant GM_getResourceText | ||
// @downloadURL https://github.com/SOBotics/AdvancedFlagging/raw/master/dist/AdvancedFlagging.user.js | ||
// @updateURL https://github.com/SOBotics/AdvancedFlagging/raw/master/dist/AdvancedFlagging.user.js | ||
// ==/UserScript== | ||
/* globals StackExchange, Stacks, $ */\n`; | ||
|
||
|
||
await build({ | ||
entryPoints: [ 'src/AdvancedFlagging.ts' ], | ||
bundle: true, | ||
banner: { | ||
js: userscriptHeader | ||
}, | ||
outfile: 'dist/AdvancedFlagging.user.js', | ||
}); |
Oops, something went wrong.