Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. PitaJ
    • Profile
    • Following 0
    • Followers 43
    • Topics 58
    • Posts 3593
    • Best 907
    • Groups 5

    PitaJ

    @PitaJ

    Global Moderator

    1199
    Reputation
    7071
    Profile views
    3593
    Posts
    43
    Followers
    0
    Following
    Joined Last Online
    Website github.com/pitaj

    PitaJ Unfollow Follow
    NodeBB GNU/Linux Gamers Plugin & Theme Dev Global Moderator

    Best posts made by PitaJ

    • [nodebb-plugin-calendar] Fully featured calendar plugin for NodeBB - Testers needed

      I need testers for my calendar plugin. I've been working on it for a while, and I just got into a feature full stage, so now I need it to be tested. If you're willing to test it for me, please install it to your NodeBB and report any bugs or anything here or on Github. Thanks!

      nodebb-plugin-calendar v1.0.0-alpha.x

      This plugin adds a site-wide calendar to NodeBB.

      Installation

      1. npm install nodebb-plugin-calendar@latest
      2. Activate it in the ACP and restart NodeBB
      3. Configure permissions at ACP Manage > Categories page

      Don't forget to restart after installing the plugin.

      Features

      • Events created, edited, and deleted as part of a post
      • Native NodeBB category permissions are used to determine who can post and view events
      • Public events as part of the same permissions system
      • Response system for easy user responses (yes, maybe, no)
      • Configurable automated reminders for upcoming events using NodeBB's notifications system
      • Centralized calendar interface to view all upcoming events

      In The Works

      • iCal export
      • Simplistic, graceful calendar UI (infinite scroll) with mobile support
      posted in NodeBB Plugins
      PitaJ
      PitaJ
    • Introducing Our New Templating Engine

      Hi everybody,

      Over the past year I've been working on building a new templating engine from the ground up. I did this for several main reasons:

      • templates.js was buggy and hard to maintain
      • templates.js was orders of magnitude slower compared to other templating engines
      • templates.js uses orders of magnitude more CPU time than other templating engines
      • Curiosity surrounding parsers and compilers, especially dealing with how Babel and JS AST formats work

      Why was templates.js slow?

      It works opposite of most templating engines, iterating over the entire data object, instead of fetching values from it based on template tokens. This meant iterating through the template string possibly hundreds of times per request.

      templates.js was begging for a replacement. My solution:

      Benchpress

      Benchpress is a brand new templating engine built from the ground up to be feature-rich and very fast. It is mostly backwards compatible with templates.js, and in some areas providing more flexible syntax.

      How is it so fast?

      Benchpress compiles template files into Javascript functions composed of string concatenation. For example, the following template:

      I love {{forum}} because it uses {{templater}}!
      

      Is compiled into this Javascript module:

      (function (factory) {
              if (typeof module === 'object' && module.exports) {
                      module.exports = factory();
              } else if (typeof define === 'function' && define.amd) {
                      define(factory);
              }
      })(function () {
              function compiled(helpers, context, get, iter, helper) {
                return 'I love ' + get(context && context['forum']) + ' because it uses ' + get(context && context['templater']) + '!';
              }
      
              return compiled;
      });
      

      This puts Benchpress among the fastest templating libraries available. Faster than Handlebars, EJS, underscore, and Pug (Jade). It's almost 40x faster than templates.js was.

      Breaking changes between templates.js and Benchpress

      I tried to make Benchpress as backwards compatible as possible. Most existing templates should work fine. However, there are a few instances where Benchpress will behave differently.

      • If you are iterating over an object or array, you can't access it's properties directly, since you can use {obj.prop} to mean the prop property of each element. templates.js supported both of these, but due to the ambiguity of the syntax, Benchpress requires you to use {../../obj.prop} to access that specific property.
      • Somehow templates.js supports iterating over deep values. For example, for this data: { obj: { arr: [4, 7, 2] } } and this template: <!-- BEGIN arr -->{@value}<!-- END arr --> it would output 472, even though arr isn't at the top level of the input data. Obviously, this is not supported in Benchpress.
      • Another crazy thing that templates.js supported was reversing the iterators in the template, so <!-- BEGIN arr1 --><!-- BEGIN arr2 --> behaved the same as <!-- BEGIN arr2 --><!-- BEGIN arr1 -->. This is unsupported in Benchpress because it makes no sense.

      By far, the largest breaking change in Benchpress is that client-side template compilation is unsupported. In fact, using Benchpress.parse(template, data) is entirely unsupported. There is a new function only available on the server side, Benchpress.compileParse(template, data, callback) which will compile a given template and then execute it with the given data. You must otherwise precompile templates before using them client-side. Any templates in NodeBB, themes, and plugins that are provided normally will continue to be compiled automatically.

      I'm very excited to introduce you all to Benchpress, and for the future it has with NodeBB! Benchpress is planned on being shipped with NodeBB in an upcoming major release.

      Edit: just to clarify, client-side parsing, using Benchpress.parse(templateName, data, callback) is still available client side. Client side compilation is unsupported, but client side parsing is still supported.

      Edit2: I forgot to mention that this forum is currently powered by Benchpress.

      posted in Announcements
      PitaJ
      PitaJ
    • [nodebb-plugin-forms] Request for feedback

      I'm developing a plugin that will allow Admins to create forms for their website to perform various functions (apply for private groups, contact the admin, etc).

      I am planning on the following features (feel free to suggest more):

      • All different kinds of form elements
      • Responsive forms (answers affect what is shown)
      • Multiple stages (a user fills out one stage, another user fills out another stage) (maybe)
      • Easy-to-use, drag and drop creation interface
      • Private forms (only certain groups or users can see them)
      • Forms can be cloned and edited
      • Captcha (including no-captcha)
      • Ability to add custom actions via an external api
      • Option for the ability for users to edit their form response and see past forms

      So, this is my question: what actions would you like the forms to be able to do?

      Here is my current list of actions, which I will update with other suggestions as they come in.

      • Apply a group to a user
      • Send an email to user(s) and/or group(s)
      • Send a notification to user(s) and/or group(s)
      • Send a pm on behalf of certain users to other users or groups
      • Create a new topic
      • Send email to a specific address
      posted in General Discussion
      PitaJ
      PitaJ
    • New Persona Mobile Menus

      Hello, everyone!

      As you may have noticed, we've made some changes to our flagship Persona theme. On mobile, the slideout menu is now on the left to match with the convention on native phone UIs. We've also moved chats into a separate slideout menu on the right side, so it is now much easier to see how many unread messages you have.

      To accomplish these changes, we moved from the existing slideout menu library, Slideout.js, to a brand new, custom built slideout menu library, which we plan on releasing as a separate module soon.

      This was a large change, and we want to ensure the functionality and behavior of the menus are flawless. So, we're asking for your feedback. Please reply with any bugs or concerns, thanks!

      Child Themes

      This Persona change is a breaking change for child themes. To adapt your child theme to the new Persona, you will need to do the following after this new version of Persona is released:

      • if overriding the partials/menu or header templates, update them to include the changes
      • add the slit.js file to the modules property of theme.json, and remove slideout.js from the scripts
      • if using your own client-side JS library instead of the one shipped with Persona, you'll need to implement the same changes made to persona.js

      If you wish to keep the old version of the menus, you will need to do this instead:

      • copy the partials/menu and header templates from Persona so your theme overrides them
      • copy persona.js and slideout.js to your theme and include them in your scripts if you aren't using custom versions already

      Known issues

      It appears that the Recent Cards plugin incorrectly set the marker telling the slideout menus to ignore touch moves on the cards. This has been fixed and will be released in a new version soon.

      posted in Announcements
      PitaJ
      PitaJ
    • Optimizing Benchpress

      Recently, I saw the release of nom v6 and decided I wanted to try it out, and see if I could speed up my hobby JS template compiler, BenchpressJS.

      Click here to see the full blog post

      posted in NodeBB Blog
      PitaJ
      PitaJ
    • [nodebb-plugin-header-extend] Custom links in the site's main menu

      nodebb-plugin-header-extend

      Latest version: 0.1.3

      I made a new plugin. It adds links to the site menu. These links can be within the site or external.

      Usage of this plugin is simple. Just click icons or drag stuff. 😄

      Installation

      Two options:

      Install the plugin through the ACP (if it ever gets added to the list cough cough)
      Run npm install nodebb-plugin-header-extend in the root directory of the NodeBB install
      Don't forget to restart after installing and activating the plugin. After installing, an entry should appear in the menu in the ACP.

      Everything you need to know is on that page.

      Features

      • Simple, drag-and-drop interface
      • Mobile compatible sub-menus
      [nodebb-plugin-header-extend] Demo video

      Suggestions? Encountered a Bug?

      Please submit all feature requests and bugs with the Issue tracker at Github. Thanks

      posted in NodeBB Plugins
      PitaJ
      PitaJ
    • RE: [nodebb-plugin-calendar] Fully featured calendar plugin for NodeBB - Testers needed

      @Jam tl;dr: no

      I have finished the backend. Now I'm working on finishing the front end event creator and calendar view. The calendar view is the hardest part. I may just release an interim version using FullCalendar while I work on the view I want (an infinite scrolling view compatible with mobile and that can be turned off if you want a normal paginated view instead).

      posted in NodeBB Plugins
      PitaJ
      PitaJ
    • RE: [nodebb-plugin-calendar] Fully featured calendar plugin for NodeBB - Testers needed

      nodebb-plugin-calendar v1.0.0-alpha.x

      This is a preliminary alpha release of the upcoming version of nodebb-plugin-calendar. Testers are needed.
      So glad to finally be making some real progress on this. Feels like I've been doing everything backwards before now.

      Installation:

      1. Confirm your node -v is >=6.0.0
      2. npm install nodebb-plugin-calendar@latest
      3. Activate plugin in ACP
      4. Configure category permissions in the ACP Manage > Categories area

      @teh_g @SergioNG @Jam @azeus Pinging all of you to notify you of this alpha release since you expressed interest.

      Please assist me in testing the plugin by installing it and trying it out. Thanks!

      posted in NodeBB Plugins
      PitaJ
      PitaJ
    • RE: Is node.js "dying"?

      node.js is insecure crap written by children with no clue how the world works

      And vBulletin, written in PHP, must be a military-grade secure platform.

      I like almost everything he says is wayyyy more applicable to PHP than it is to Node.

      posted in General Discussion
      PitaJ
      PitaJ
    • RE: [nodebb-plugin-calendar] Fully featured calendar plugin for NodeBB - Testers needed

      @Tahru I'm in the process of rewriting this from scratch at the moment. Right now, I'm almost done with the back end. Then I'll write a front end interface, and then it will be done. I want to make this modular and usable on mobile.

      posted in NodeBB Plugins
      PitaJ
      PitaJ

    Latest posts made by PitaJ

    • RE: How to print NodeBB current version in HTML

      @inna first let me explain how these tokens work

      [[admin/menu:alerts.version, 1.2.3]]
      

      This is a translation token. It gets replaced with

      Running NodeBB v1.2.3
      

      So you don't need to have [[]] around {{}} if you want to print just the version:

      {{ version }}
      

      However, it looks like the version isn't exposed on the front-end. So you'll either need to hard code it (and update it whenever you update NodeBB), or use a plugin hook to expose it.

      posted in General Discussion
      PitaJ
      PitaJ
    • RE: Section name not being included in breadcrumb

      @inna you can try putting a console.log call in there to see whether it's executing. Is it still in the persona file?

      posted in General Discussion
      PitaJ
      PitaJ
    • RE: Forum is not available anymore

      What happens when you attempt to access with ./nodebb start? Do you get an error? Can you try sending a request to your forum with curl on the server (port 8081)?

      Do you see anything in the logs? With ./nodebb slog do you see it start up normally?

      posted in Technical Support
      PitaJ
      PitaJ
    • RE: Section name not being included in breadcrumb

      @inna yeah I recommend doing this in a custom plugin or theme, rather than editing the persona files directly.

      Anyways, you'll need to import categories and meta as well like so:

      const categories = require.main.require('./src/categories');
      const meta = require.main.require('./src/meta');
      

      Everything else looks right

      posted in General Discussion
      PitaJ
      PitaJ
    • RE: How to print NodeBB current version in HTML

      @inna files in build are compilation artifacts. Don't edit anything in there.

      What you want to do is add an HTML widget to your global footer. In your ACP go to Customize -> Widgets

      Then add a widget to the global footer and put this in it:

      [[admin/menu:alerts.version, {{ config.version }}]]
      posted in General Discussion
      PitaJ
      PitaJ
    • RE: Forum is not available anymore

      @nicolas have you tried killing all node processes, then starting?

      posted in Technical Support
      PitaJ
      PitaJ
    • RE: Write API v3 - Changing category permissions

      @brophy oh woops yeah sorry I didn't fully read into that. I don't see a way right now, I suggest opening an issue on GitHub requesting this.

      Or if you need it right now, you could create a plugin to expose an API to do what you want.

      posted in Technical Support
      PitaJ
      PitaJ
    • RE: Section name not being included in breadcrumb

      @inna in a plugin/theme you could overwrite that function

      // library.js
      
      const helpers = require.main.require('./src/controllers/helpers');
      
      helpers.buildCategoryBreadcrumbs = // copy of function from core with your modifications
      
      posted in General Discussion
      PitaJ
      PitaJ
    • RE: Facebook SSO Plugin Issues: Data Deletion Callback Request URL needed

      @julian we have Facebook SSO here, mind sharing how that's set up?

      posted in General Discussion
      PitaJ
      PitaJ
    • RE: Cannot get emojis to work

      @taloche thanks for the example. Like you, I wasn't able to reproduce the issue unfortunately.

      posted in Technical Support
      PitaJ
      PitaJ