Skip to content

Commit

Permalink
Add phpBB syntax support
Browse files Browse the repository at this point in the history
See #18
  • Loading branch information
aledeg committed Dec 12, 2018
1 parent 7fe82b3 commit 30f9d0d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ wget -i linkdump.txt
```

If you want to add a list of links in your blog, you can dump links in a markdown
file and use that file as a starting point for your post.
or html file and use that file as a starting point for your post.
If you want to share links on a phpBB forum, you can dump links in the appropriated
format.
7 changes: 7 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const textReducer = (carry, item) => `${carry + item.url}\n`;
const markdownReducer = (carry, item) => `${carry}[${item.title}](${item.url})\n`;
const htmlReducer = (carry, item) => `${carry}<a href="${item.url}">${item.title}</a><br/>\n`;
const dokuwikiReducer = (carry, item) => `${carry}[[${item.url}|${item.title}]]\n`;
const phpbbReducer = (carry, item) => `${carry}[url=${item.url}]${item.title}[/url]\n`;
let downloadId = 0;

function notification(message) {
Expand Down Expand Up @@ -60,6 +61,12 @@ function getDownloadOptions(format) {
filename: 'linkdump.dk',
type: 'text/plain'
};
case 'phpbb':
return {
reducer: phpbbReducer,
filename: 'linkdump.bb',
type: 'text/plain'
};
default:
return {
reducer: textReducer,
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

"manifest_version": 2,
"name": "LinkDump",
"version": "1.6",
"version": "1.7",
"description": "__MSG_extensionDescription__",
"icons": {
"48": "icons/linkdump-48.png"
Expand Down
1 change: 1 addition & 0 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<label><input type="radio" name="defaultFormat" value="markdown">Markdown</label>
<label><input type="radio" name="defaultFormat" value="html">HTML</label>
<label><input type="radio" name="defaultFormat" value="dokuwiki">Dokuwiki</label>
<label><input type="radio" name="defaultFormat" value="phpbb">phpBB</label>
</div>
<div>
<label for="clearAfterDownload">Clear after download</label>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkdump",
"version": "1.6.0",
"version": "1.7.0",
"description": "Store links and dump them",
"main": "background.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion popup/load.content.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
<input type="radio" name="formats" id="html" autocomplete="off" data-format="html"> HTML
</label>
<label class="btn btn-secondary btn-sm">
<input type="radio" name="formats" id="html" autocomplete="off" data-format="dokuwiki"> Dokuwiki
<input type="radio" name="formats" id="dokuwiki" autocomplete="off" data-format="dokuwiki"> Dokuwiki
</label>
<label class="btn btn-secondary btn-sm">
<input type="radio" name="formats" id="phpbb" autocomplete="off" data-format="phpbb"> PhpBB
</label>
</div>
<div>
Expand Down

0 comments on commit 30f9d0d

Please sign in to comment.