[nodebb-plugin-magicblock] Macros, Color, Embeding
-
Thanks always~
@frissdiegurke said:
- I guess the lib/defaults.js is never used and duplicates lib/magicblock/defaults.js, just a side note xD
Actually I use magicblock as a sepereated module, and
lib/defaults.js
is aplugin side defaults
which can be different frommagicblock defaults
, (they are yet same but.. ). Now,buildOptions
is called twice inlibrary.js
andlib/magicblock/index.js
with different(but same)default.js
.- There are a few tools at
npm
you could use rather than creating your own utilities I preferlodash
(link), it's written for performance and consistency of usage. YourdeepCopy
/buildOptions
would get replaced by_.merge
for example. It's really not a deal to have dependencies for such matters. Plus knowing a utilities features helps a lot keeping code to necessary stuff.
Yes, after I learned
lodash
from your emoji plugin, I thought exactly same thing. Thanks twice :).- I see some space for improvement here; Checking
opts.attrStrAllowColor
first would improve the code and performance.
Eagle eye!!
- A
.npmignore
file does not extend of a.gitignore
, you have to either fill it properly or remove it entirely (in this case npm will use the.gitignore
). You have some a bit of trash within your npm release
This is really something new I have never known.
I will quickly improve 3,4 first. -
I got a question if this plugin works under v0.9.4.
But I tested/developed this my first plugin with only with v1.0.0, and have no idea about version compatibility.What I can imagine to are
- Study what changed between v0.9.4 and v1.0.0
- Install v0.9.4 and test.
- Ask volunteers who (will) test the plugin with one's v0.9.4
Could anybody give better or recommendable ideas?
-
-
@julian HI, I needed you 30 minitues ago!!
I just found out thisacpScripts
after an hours testing and debuging.
I have(had) to read that post also.
Here is a link for others ( to save server resource from searching)Actually, I have an question related with
acpScript
.
So if I want to support v0.9.4 then what is best way?- put a
admin.js
( commonly called ) to both ofacpScript
andscripts
- put it to only
scripts
and remove fromacpScript
- embed into an admin tpl of a plugin.
I guess most effective way to support both versions is 3.
Could you let me know the best way? - put a
-
@qgp9 You can embed the script into the template -- depends how comfortable you are with mixing your templates and client-side code, in terms of organisation
In order to support both, you'd have to maintain two branches in git. One for each level of support. You'd need to ensure the
nbbpm.compatibility
values are set to the appropriate values in each branch'spackage.json
, and npm publish them both (though npm will show the readme of the latest published version).nbbpm should be smart enough to figure out that different versions have different compatibilities and adjust its records accordingly. If not, let me know,.
-
Hi , All
I'm testing the plugin with v0.9.4 on Cloud9.
If you are interested on this, you can post/test freely without login.
https://nodebb-0-9-4-magicblock-qgp9.c9users.io/topic/2It seems that [email protected] works well with [email protected]
-
-
Nice job!