Skip to content

Commit 31750e0

Browse files
authored
feat(plugin): support label property for Bug Report button (#11)
* #3 add label option * #3 add label usage on README * #3 remove unnecessary property for explanation
1 parent 9e6625a commit 31750e0

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,26 @@ For private repositories, set this flag.
5353
}
5454
```
5555

56+
- `label`: button label (optional, default is `Bug Report`)
57+
58+
Set button label if you want to use other than default.
59+
60+
```json
61+
{
62+
"gitbook": ">=3.0.0",
63+
"title": "Example",
64+
"plugins": [
65+
"github-issue-feedback"
66+
],
67+
"pluginsConfig": {
68+
"github-issue-feedback": {
69+
"repo": "your/private_repo",
70+
"label": "Report Issue on GitHub"
71+
}
72+
}
73+
}
74+
```
75+
5676
## Changelog
5777

5878
See [Releases page](https://github.com/azu/gitbook-plugin-github-issue-feedback/releases).

src/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ window.require(["gitbook"], function(gitbook) {
6262
gitbook.events.bind("start", function(e, pluginConfig) {
6363
var config = pluginConfig["github-issue-feedback"];
6464
var reportElement = document.createElement("button");
65-
reportElement.textContent = "Bug Report";
65+
reportElement.textContent = config["label"] || "Bug Report";
6666
reportElement.className = "gitbook-plugin-github-issue-feedback";
6767
reportElement.setAttribute("style", "position:fixed; right:0;bottom:0;");
6868
var clickEvent = ("ontouchstart" in window) ? "touchend" : "click";

0 commit comments

Comments
 (0)