[nodebb-plugin-buttons-galore] NodeBB: Buttons Galore
-
@Tanner, I might be able to lend a hand next weekend-ish.
I've got a huge project planned for this weekend in regards to getting a new server up and running with NodeBB, then launching live.
@a_5mith, that's an excellent visual representation!
@psychobunny, presently I haven't started a regex - so maybe that'll get brought about next weekend. -
@psychobunny said:
You can use text-center and text-right, it's built into bootstrap. What's the regex you're trying to do maybe I can give it a shot
Something along the lines of
composer.addButton('fa fa-align-center', function(textarea, selectionStart, selectionEnd) { if(selectionStart === selectionEnd){ controls.insertIntoTextarea(textarea, '+center+Centered Text'); controls.updateTextareaSelection(textarea, selectionStart + 8, selectionEnd + 21); } else { controls.wrapSelectionInTextareaWith(textarea, '+center+,''); controls.updateTextareaSelection(textarea, selectionStart, selectionEnd); } });
Then
.replace(/<p>+center+([\S\s]*?)<\/p>/gm, '<p class="align-center">$1</p>')
but that didn't even put the font awesome icon in. Although I installed it on the 0.5.1 test rig I've built. So I don't know what may have changed.
-
Am I right in assuming the syntax for centering is
+center+ my text
?
Also I think I already know what your problem is, make sure that this plugin is executing that hook post-markdown, so that the
<p>
tags are already in place -
@psychobunny That would be up to @Ted, it was an example rry. I'm not sure what's best in terms of actual use case.
Also the missing apostrophe on line 6 of that snipper isn't in the code, I changed it in the composer from something else to +center+, must have pulled the
'
out with it.The current hook is
{ "hook": "filter:post.parse", "method": "parse", "callbacked": true, "priority": 6 }
-
@Ted You can review this PR https://github.com/TedRinehart/nodebb-plugin-buttons-galore/pull/1
Added some features :- Solved a bug with nodebb-plugin-spoiler (duplicate code was making it not working anymore)
- Text alignements :
<-Text align left<-
->Text align center<-
->Text align right->
=>Justified text<=
(regex was challenging) - Line breaks, every
\n
inside a<p>
is converted to<br>
- Underlined text
~Underline~
-
@esiao, I just got a moment to review it. Thanks for submitting it.
Administration has taken a bit of time lately and I haven't been able to develop as I had wished.
I didn't see any issues with the input you had selected to be parsed, and thought it was quite clever that you used ~ for underlining since ~~ begins a strike-through.Already pushed it to NPM after testing on the master commit, and I couldn't detect any issues.
Now, we just need to get button re-ordering and disabling knocked out.Edit: I stumbled across a bug. Hopefully we can co-op to determine the cause and get it sorted.
-
@Ted Thanks, keep me updated
For the reorder I have an idea but need to determine how it should work in admin panel first. -
Latest PR merged in, v0.0.5 published.
-
@Ted
Updated the plugin for NodeBB 0.6.x support and code between code tags is now supported
https://github.com/TedRinehart/nodebb-plugin-buttons-galore/pull/6 -
@Ted Hey man, I'd love to see an up to date version of this plugin. A lot of the text align seems to be broken at the moment.
-
@nodecurious, this plugin doesn't get much attention so I've been neglecting it. I'll have some free time next week that I can use to do a rework of the plugin.
-
As a follow up, I'm still reworking the plugin. Free time for coding seems to be rare these days.
-
NodeBB: Buttons Galore
Current version: 0.0.6is there an update to this code?
-
@buynsellcloudcom said in [nodebb-plugin-buttons-galore] NodeBB: Buttons Galore:
@julian is there an update for this plugin as of March 2019? thanks
No, that was four years ago and the link is gone. This is no longer active.