Skip to content

Commit 336102e

Browse files
committed
Initial commit
0 parents  commit 336102e

22 files changed

+1727
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
web-ext-artifacts
2+
node_modules

LICENSE.md

Lines changed: 675 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[![](https://img.shields.io/github/issues/mojira/message-extension)](https://github.com/mojira/message-extension/issues)
2+
[![](https://img.shields.io/github/stars/mojira/message-extension)](https://github.com/mojira/message-extension/stargazers)
3+
[![](https://img.shields.io/github/license/mojira/message-extension)](https://github.com/mojira/message-extension/blob/master/LICENSE.md)
4+
5+
# Mojira Helper Message Browser Extension
6+
This is a browser extension made for simplifying the mod and helper workflow on Mojira. It integrates the helper messages from the [`helper-messages`](https://github.com/mojira/helper-messages) repository directly into the Mojira interface, so that messages can be pasted very easily without the need of visiting another website.
7+
8+
On top of that, it always keeps the messages up-to-date with the latest version from the `helper-messages` repository.
9+
10+
As of right now, the extension has only been tested in Mozilla Firefox. It is possible that it works in other browsers like Chrome or Opera as well, but those are currently unsupported.
11+
12+
⚠ Please note that the helper messages may only be used on the bug tracker by helpers, moderators or Mojang staff. Do not use them yourself if you do not belong to one of these groups as it may confuse users regarding your role.
13+
14+
## Installation
15+
1. Download the latest version of the extension from the [releases](https://github.com/mojira/message-extension/releases) page.
16+
2. Open `about:addons` in your browser
17+
3. Click on the gear icon
18+
4. Select "Install Add-on from File..."
19+
5. Select the downloaded file
20+
21+
## Usage
22+
When the addon recognizes a Mojira text field, it automatically highlights it in a green color to indicate that the addon is active. At the same time, it adds an additional "Add Message" button to the toolbar of that text field. You can use that button to insert messages and view all available messages along with their shortcuts.
23+
24+
You can also insert messages by typing the shortcut of the message prefixed with a configurable prefix into the text field.
25+
26+
Currently, both methods only work with the "Text" version of the text field. In "Visual" mode, the addon will not function properly!
27+
28+
Once a text field is initialized, its available messages will no longer change, even if the addon settings have been changed. You need to reload the page in order for any potential changes to take effect.
29+
30+
### Message updates
31+
The addon regularily checks whether the helper messages have been updated, and if they have, it automatically saves the new messages and continues to use the new version. This is indicated by a badge on the Mojira icon.
32+
33+
While the addon is checking for addons, the badge is green and display a question mark.
34+
35+
When the addon has found an update, the badge turns blue and contains the letter "i", and if an error occurred, it is red with an exclamation mark. These two badges can be dismissed by clicking on the icon.
36+
37+
### Settings
38+
You can configure the addon by clicking the Mojira icon in the browser's toolbar. There you can configure which messages you want to use, and how often (if at all) the addon should check for message updates.
39+
40+
## Contributing
41+
Issues and pull requests are always very much appreciated. If you want to help developing the extension, here are a few tips:
42+
43+
* Run `npm i` in order to install the needed dependencies. Currently this only includes the type definitions for web extensions.
44+
* Run `npm i -g web-ext` in order to install some handy developer tools for web extension development.
45+
* Run `web-ext run` in order to launch a blank instance of Firefox where your addon is running. The addon is reloaded every time a file is changed.
46+
* You can visit `about:debugging` in that Firefox instance and access the addon's console and dev interface from the "This Firefox" tab.
47+
* You can run `web-ext lint --self-hosted` in order to check whether the addon has any issues that might prevent it from being signed.
48+
49+
## Publishing
50+
When a new version is released, it first needs to be signed by Mozilla. After this is done, the addon file is uploaded to the "releases" page and the version manifest in the `releases` branch is updated.

icons/mojira-logo-32.png

10 KB
Loading

icons/mojira-logo-48.png

13.7 KB
Loading

icons/mojira-logo-96.png

15.4 KB
Loading

manifest.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"manifest_version": 2,
3+
"name": "Mojira Message Extension",
4+
"version": "0.1",
5+
6+
"description": "Easily access helper messages directly on Mojira by using shortcuts. Please note that the helper messages may only be used by Mojira helpers, Mojira moderators, and Mojang staff.",
7+
8+
"browser_specific_settings": {
9+
"gecko": {
10+
"id": "message-extension@mojira.github.io",
11+
"update_url": "https://raw.githubusercontent.com/mojira/message-extension/releases/updates.json",
12+
"strict_min_version": "68.0"
13+
}
14+
},
15+
16+
"icons": {
17+
"48": "icons/mojira-logo-48.png",
18+
"96": "icons/mojira-logo-96.png"
19+
},
20+
21+
"background": {
22+
"page": "src/background.html"
23+
},
24+
25+
"options_ui": {
26+
"page": "src/options/options.html",
27+
"browser_style": true
28+
},
29+
30+
"browser_action": {
31+
"default_icon": "icons/mojira-logo-32.png",
32+
"default_title": "Mojira Helper Messages",
33+
"browser_style": true
34+
},
35+
36+
"content_scripts": [{
37+
"matches": ["*://bugs.mojang.com/*"],
38+
"css": [
39+
"src/styling.css"
40+
],
41+
"js": [
42+
"src/util/util.js",
43+
"src/main.js"
44+
]
45+
}],
46+
47+
"permissions": [
48+
"alarms",
49+
"clipboardRead",
50+
"storage"
51+
]
52+
}

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "mojira-message-extension",
3+
"version": "0.1.0",
4+
"description": "A browser extension for simplifying the mod & helper workflow on Mojang's bug tracker Mojira",
5+
"main": "main.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "violine1101",
10+
"license": "GPL-3.0",
11+
"devDependencies": {
12+
"web-ext-types": "github:kelseasy/web-ext-types"
13+
}
14+
}

src/background.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<script type="module" src="./util/messages.js"></script>
6+
<script type="module" src="./background.js"></script>
7+
</head>
8+
</html>

0 commit comments

Comments
 (0)