inherit
173263
0
Apr 19, 2022 8:46:43 GMT -8
Shi
You were perfection, I was the mess
61
October 2011
methamphetamorphin
|
Post by Shi on Dec 2, 2018 8:36:49 GMT -8
So, I've decided to try and create my own plugin, and I'm currently going through the eBook posted by Peter on how to do that on Proboards. I don't want anything overly complex, just for there to be a calculator to add/remove "points" from a profile and to add them when they post in certain areas of our site.
My question, for those of you who have created plugins, is it easier to write the javascript code and then tailor it to Proboards? Or is it just not worth the time to write the actual functionality and go right to tailoring it to Proboards?
|
|
inherit
249312
0
Nov 2, 2018 14:34:00 GMT -8
bartlesby
110
September 2017
bartlesby
|
Post by bartlesby on Dec 6, 2018 7:13:06 GMT -8
So, I've decided to try and create my own plugin, and I'm currently going through the eBook posted by Peter on how to do that on Proboards. I don't want anything overly complex, just for there to be a calculator to add/remove "points" from a profile and to add them when they post in certain areas of our site. My question, for those of you who have created plugins, is it easier to write the javascript code and then tailor it to Proboards? Or is it just not worth the time to write the actual functionality and go right to tailoring it to Proboards? I know it's been a few days but to answer your question, it's best to write your code in a way that can be used standalone with minimal changes. You never know if you might need to use it on another site or on your own site. So work on the core first, keeping it as modular as possible, and then tailor it to Proboards. Creating individual functions that handle aspects of Proboards is preferable in the long run, as Javascript isn't going to change, but Proboards might. For instance, if you need to display a value, use functions that do the lifting rather than baking Proboards into your script. I.E, use: function showValue ( myValue ) { // <-- Proboards specific script here to handle myValue }
(function () { // entry point var myValue = "value"; showValue( value ); }); Instead of: (function () { // entry point var myValue = "value"; // <-- Proboards specific script here to handle myValue });
There's no downside to doing this aside from it taking slightly longer to script and having modular code far outweighs that negative in the long run.
|
|