Skip to content

Commit c659799

Browse files
committed
1.0
1 parent 0b88747 commit c659799

5 files changed

Lines changed: 212 additions & 0 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Bungalow Bill
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# bbbbcode
2+
**Big Beautiful BBCode**
3+
4+
A Flarum extension which adds additional BBCode. It installs multiple separate BBCode extensions so that you have the power to enable just what you need. Keep this extension (bbbbcode) enabled if you want HTML table, horizontal line, float, and possibly in the future, other BBCode. All BBCode is lightweight; most are HTML and CSS only.
5+
6+
## Install
7+
8+
`composer require zerosonesfun/bbbbcode`
9+
10+
The above command will install all of the following. Then, simply activate what you want. Or, you could instead just install one or two of the following if that's all you want.
11+
12+
~~~
13+
composer require zerosonesfun/spoiler
14+
15+
composer require zerosonesfun/blur
16+
17+
composer require zerosonesfun/tooltip
18+
19+
composer require zerosonesfun/accordion
20+
21+
composer require zerosonesfun/chat
22+
23+
composer require zerosonesfun/pop
24+
25+
composer require zerosonesfun/action
26+
27+
composer require zerosonesfun/font
28+
29+
composer require zerosonesfun/flarum-bbcode-audio
30+
~~~
31+
32+
## Update
33+
34+
1) `composer update zerosonesfun/bbbbcode`
35+
36+
2) Deactivate and reactivate the extension in your admin.
37+
38+
3) Go to your dashboard, click tools, click clear cache.
39+
40+
4) Clear your browser cache, and any other caches like Cloudflare, if applicable.
41+
42+
## Uninstall
43+
44+
`composer remove zerosonesfun/bbbbcode`
45+
46+
## Usage
47+
48+
The following BBCode are available:
49+
50+
**Tooltip:**
51+
52+
`[tooltip="your tip here" placement="right"]word[/tooltip]`
53+
54+
(for "placement" you may use: top, bottom, left, right)
55+
56+
**Spoiler:**
57+
58+
`[spoiler="The text you click on"]The hidden text goes here.[/spoiler]`
59+
60+
**Blurred Hover Spoiler:**
61+
62+
`[blur]This is the blurred secret.[/blur]`
63+
64+
(hover/press for 4 seconds to reveal)
65+
66+
**Accordion:**
67+
~~~
68+
[accordion header="YOUR HEADER TEXT"]The text that is hidden at first but then appears goes here[/accordion]
69+
[accordion header="YOUR NEXT HEADER TEXT"]The text that is hidden at first but then appears goes here[/accordion]
70+
~~~
71+
(repeat the accordion BBcode as many times as needed)
72+
73+
**Chat:**
74+
~~~
75+
[chat-a="Why did the chicken cross the road?" who="Me"]
76+
[chat-b="It was hungry?" who="Mary"]
77+
[chat-a="No! Wrong!" who="Me"]
78+
[space][/space]
79+
~~~
80+
(repeat as many times as needed alternating chat-a and chat-b)
81+
82+
("space" BBcode at end of chat is optional - it adds some extra space)
83+
84+
**Quick font colors:**
85+
86+
`[red]This will be red.[/red]`
87+
88+
(colors included: red, orange, yellow, green, blue, purple)
89+
90+
**Highlighter:**
91+
92+
`[hl]This text will be highlighted.[/hl]`
93+
94+
(That's a "L" not a one; it's hl for highlight.)
95+
96+
**Audio:**
97+
~~~
98+
[audio mp3="song.mp3" ogg="song.ogg"]
99+
[audio mp3="song.mp3"]
100+
[audio ogg="song.ogg"]
101+
[audio m4a="song.m4a"]
102+
[audio wav="song.wav"]
103+
[audio flac="song.flac"]
104+
[audio webm="song.webm"]
105+
[audio mp3="song.mp3" width="50"]
106+
~~~
107+
(You may put a mp3 and ogg file together for maximum browser compatibility, or just post a mp3, ogg, wav, flac, webm or m4a file alone. Also, as the last example shows, you may modify the width. The width will become a percentage and by default, if you choose not to declare a width, the player will be 100% width.)
108+
109+
**Action:**
110+
111+
`[action]Walks into a wall[/action]`
112+
113+
**Popup:**
114+
115+
`[pop button="Click Here" title="Hello" content="Thank you for being a friend."]`
116+
117+
**KBD:**
118+
119+
`Please type [kbd]Y[/kbd] for yes.`
120+
121+
**Also included:**
122+
123+
`[background]`, `[font]`, `[hr]`, and HTML table BBCodes. Finally, Flarum already comes with a core BBCode extension which adds other standard BBCodes such as bold, strikethrough, image, link, etc.

assets/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* For the future */

composer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "windows-vista-bar/bbbbcode",
3+
"description": "Big Beautiful BBCode (Installs multiple BBCode extensions.)",
4+
"authors": [
5+
{
6+
"name": "Billy Wilcosky",
7+
"role": "Creator"
8+
}
9+
],
10+
"type": "flarum-extension",
11+
"license": "MIT",
12+
"require": {
13+
"flarum/core": "^0.1.0-beta.8",
14+
"windows-vista-bar/spoiler": "^1.0",
15+
"windows-vista-bar/blur": "^1.0",
16+
"windows-vista-bar/tooltip": "^1.0",
17+
"windows-vista-bar/font": "^1.0",
18+
"windows-vista-bar/chat": "^1.0",
19+
"windows-vista-bar/pop": "^1.0",
20+
"windows-vista-bar/action": "^1.0",
21+
"windows-vista-bar/accordion": "^2.0",
22+
"windows-vista-bar/flarum-bbcode-audio": "^1.0"
23+
},
24+
"autoload": {
25+
"psr-4": {"ZerosOnesFun\\bbbbcode\\": "src/"}
26+
},
27+
"extra": {
28+
"flarum-extension": {
29+
"title": "BBCode - BBBBCode",
30+
"icon": {
31+
"name": "fas fa-bold",
32+
"backgroundColor": "#ddd",
33+
"color": "#000"
34+
}
35+
}
36+
}
37+
}

extend.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/*
4+
* bbbbcode is a Flarum extension created by Billy Wilcosky.
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
* For instructions, please view the README file.
8+
*/
9+
10+
use Flarum\Extend;
11+
use Flarum\Frontend\Document;
12+
use s9e\TextFormatter\Configurator;
13+
14+
return [
15+
(new Extend\Frontend('forum'))
16+
->content(function (Document $document) {
17+
$document->head[] = '<link rel="stylesheet" type="text/css" href="/assets/extensions/zerosonesfun-bbbbcode/styles.css">';
18+
}),
19+
(new Extend\Formatter)
20+
->configure(function (Configurator $config) {
21+
$config->BBCodes->addFromRepository('TABLE');
22+
$config->BBCodes->addFromRepository('TBODY');
23+
$config->BBCodes->addFromRepository('TD');
24+
$config->BBCodes->addFromRepository('TH');
25+
$config->BBCodes->addFromRepository('TR');
26+
$config->BBCodes->addFromRepository('THEAD');
27+
$config->BBCodes->addFromRepository('HR');
28+
$config->BBCodes->addFromRepository('FLOAT');
29+
})
30+
];

0 commit comments

Comments
 (0)