MyBB Community Forums

Full Version: Tutorial: Adding Extra Function Buttons to the Editor v2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
This is extremely helpful and I've started using the tutorial with no issues. I do have one question that hopefully someone can assist with though. Using this tutorial, the new buttons are given closing tabs (such as [/spoiler] for example). I wanted to add the horizontal line code to the editor ([*hr]). But it doesn't require a closing code. Adding that button to the menu following this tutorial creates an unnecessary closing tag. Is there a way to modify that button's code specifically so it doesn't generate a closing tag?
How would you do this with a plugin? I'm using a spoiler plugin.
This plugin is not connected to the MyCode system in any way. What it does is inserts the tag specified between the []. The rest is the parser's work.
Edit: Please delete.
What would the code be for a spoiler? like [spoiler] text here [/spoiler] how could you do that?
It didnt work. using mybb 1.6.9 latest one out. I used notepad++ for editing. I checked 3 times. can you make a video tut using cam studio or something.
When I did this my whole editor bar disappeared.
I'm having trouble reading this, but I'll add something anyway. When I opened my forum I added a spoiler button but the problem was the message window is not wide enough to display another button. So, I put it on the upper row. See attached. Then it showed up.
What if I didn't want an image for the button, but instead to display text to make it much simpler? How would I do that?
Quote:7.3 Add after it:

	insertSpoiler: function()
	{
		selectedText = this.getSelectedText($(this.textarea));
		title = prompt("Please enter a title for your spoiler.", "");
 
		if(title)
		{
			if(!selectedText)
			{
				text = prompt("Enter a text for your spoiler.", "");
			}
			else
			{
				text = selectedText;
			}
 
			if(title && text)
			{
				this.performInsert("[spoiler="+title+"]"+text+"[/spoiler]", "", true, false);
			}
 
		}
	},

Possible to edit the input box so that the carriage returns / line breaks show? Now it's lumping the text together into one paragraph.

This:

- MTK6592 1.7GHz Octa Core
- 6.5 inch 1920*1080 FHD IPS Screen
- 2GB RAM + 32GB ROM
- Android 4.2.2 Smartphone
- 13.0MP Rear Camera + 5.0MP Front Camera
- Support Multi language, 3G, GPS, WIFI, Bluetooth, Play Store, etc

Pastes as this:

Goophone S4 Max MTK6592 1.7GHz Octa Core Android 4.2 Smartphone 2G Ram 32G Rom 6.5 Inch FHD IPS Screen - MTK6592 1.7GHz Octa Core - 6.5 inch 1920*1080 FHD IPS Screen - 2GB RAM + 32GB ROM - Android 4.2.2 Smartphone - 13.0MP Rear Camera + 5.0MP Front Camera - Support Multi language, 3G, GPS, WIFI, Bluetooth, Play Store, etc
Pages: 1 2 3