It looks like you're new here. If you want to get involved, click one of these buttons!
I'm a complete noob to Vanilla. The only thing stopping me from making the switch is the editor. So now I'm trying to make a editor plugin, and I'm not having much luck. My PHP knowledge is limited...
I have everything for my plugin ready, the images, files, etc. However, I need to be able to change
This:
<textarea id="Form_Body" name="Comment/Body" rows="6" cols="100" class="TextBox"></textarea>
To This:
<textarea id="redactor_content" name="comment" rows="6" cols="100" class="TextBox"></textarea>
Any suggestions and examples of how I can accomplish this?
Thanks.
x00
Don't PM about development, I'm not currently taking on clients MVP
one of the key things the live load, as comment editbox are loaded asynchronously.
$('.TextBox').livequery(function(){
$(this).redactor();
}
One of the problem is that as the form is loaded in place, when editing you can have severall Form_Body id which is technically illegal, but hey ho.
Some editor rely of the id so this a problem, there is a workaround, but it can break other plugins, and css that rely on that id not being unique.
I'm hoping that is not the case with redactor. It seem to support multiple editor out of the box.
Don't PM about development, I'm not currently taking on clients.
grep is your friend.
Answers
I would look at some of the other plugins that replace the editor to see how they integrate
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I wouldn't bother changing the markup, just uses jquery selector to load it as a appropriate.
$('.TextBox').redactor();Don't PM about development, I'm not currently taking on clients.
grep is your friend.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Hmmm... Redactor? That looks like something definitely useful in VanillaBootstrap :) Mind if I borrow your idea @Xarcell?
Kasper Kronborg Isager | Full-time interwebs monkey working @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me at Github
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Go right ahead!
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Ok, I'm still trying to figure this out as a learning experience. So far, it's not working. Here's what I have in my default.php:
Code based off of CLEditor Plugin...
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Shouldn't it actually be this?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I guess I'm in over my head. I am unable to disable the plugin once enabled.
It also appears this isn't working:
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Does your plugin enable? - by the looks of your default.php (unless there are typos) is pretty much impossible to execute.
3 suggestions from the get go
$PluginInfo['redactor'] = array(
should be (if your file directory is RedactorEditor) $PluginInfo['RedactorEditor'] = array(
'Name' => 'WYSIWYG (redactor)',
if you want to be able to find the plugin in the dashboard without guessing what the descriptive name might be. I immensely dislike plugin names that don't match the plugin name at least with the first word.
'Name' => 'Redactor Editor',
gdn_Plugin has no closing bracket.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •You might also look at the basic structure of most of the approved plugins with regards as to where to put js files, css files, and php files and break the plugin into little pieces and add as you go until you have the complete plugin working.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Thanks for your suggestions. I originally has the name as you suggested, but changed it to reflect the CLEditor plugin(approved).
The gnd_plugin closing bracket is on line 65.
Changing the $pluginInfo fixed the problem with it not disabling. I did not realize that it needed to match the directory.
The only problem I see is the livequery isn't working. When I view the source, it still says:
<textarea id="Form_Body" name="Discussion/Body" rows="6" cols="100" class="TextBox" style="overflow: hidden; display: block; "></textarea>Instead of:
<textarea id="#redactor_content" name="Discussion/Body" rows="6" cols="100" class="TextBox" style="overflow: hidden; display: block; "></textarea>- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I have, that's the only reason I've gotten as far as I did.
Here is the updated default.php:
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I couldn't get it working either even tough the rendered html and jquery looks good.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •However, I did a sample page in the CustomPages plugin and it works:
http://supernepal.com/plugin/page/redactor
Its so much better than cleditor. So It would be nice to get it working.
http://news.ycombinator.com/item?id=4034147
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Never mind, got it working!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Great! I hope you intend to release it as a plugin?
Also, did you manage to get images and videos working?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •What did you do to get it to work?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Try this:
$Sender->AddCssFile('http://redactorjs.com/js/redactor/css/redactor.css'); $Sender->AddJsFile('http://redactorjs.com/js/jquery-1.7.min.js'); $Sender->AddJsFile('http://redactorjs.com/js/redactor/redactor.js');
I haven't got the images, links working yet, but I am assuming its just a relative path thing.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •You can see the Redactor Editor in action here as it's now a part of VanillaBootstrap 2.0a-2.1: http://vanilla.ungdomsrod.dk/ I haven't tested out how it reacts if other editors are enabled though, will test it out tonight if I find the time :)
Kudos to @Xarcell for the idea and to @x00 for the livequery thingy, that worked out like a charm!
Kasper Kronborg Isager | Full-time interwebs monkey working @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me at Github
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I tried that and it still isn't working for me. Can you post your default.php so I can have a look at it?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@Xarcell Here you go:
http://www.pastie.org/4016968
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I was having an argument with another software guru about implementing Redactor. Apparently, if your website generates revenue, you gotta pay a $19 fee per domain to use this.
which is a deal breaker for me.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •http://creativecommons.org/licenses/by-nc/3.0/ Yup :(
Kasper Kronborg Isager | Full-time interwebs monkey working @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me at Github
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@kasperisager @Xarcell That really sucks. Free but not really!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •He says that if you site generates revenue, you need to pay $19. A multi-site license is $89. That doesn't mean you can't make a free plugin out of it. I reckon fee's are based on the honor system...
I will continue to work on this for public use. The owner of redactor basically says, add-ons, modules, or plugins with redactor can be made free to the public. Who pays for a license or not is between that person using it on his/her domain and redactor owner. Just be sure to make note of that with the application.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Open source doesn't mean it is free of cost. I think a lot of people assume that, but are wrong in general.
Don't PM about development, I'm not currently taking on clients.
grep is your friend.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •just a FYI, I came back to look at making this a plugin. ATM, I got everything working except the insert image(only upload part), video, and file.
If anyone has any ideas or suggestions let me know.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I need help getting the upload to work with Vanilla. Here is the sample code:
How can this be coded to be secure, and have the proper paths.
Thanks.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Have you looked at FileUpload plugin to see if they do any better?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •yes, I've looked at it, but don't understand it. I think I can get it to work if I can get the absolute path for the $dir = '/home/web/sitecom/redactor/images/'; part.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •