• HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Get in touch
    Get in touch
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    • Sign in
    • Start free trial
    • Get in touch
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    • Documentation
      • Home
      • Read API
      • Write API
      • Plugin Development
    1. Home
    2. Tags
    3. javascript
    Log in to post
    • All categories
    • Sebastián Cisneros

      How to call API from client side.
      Plugin Development • api client side javascript • • Sebastián Cisneros

      3
      0
      Votes
      3
      Posts
      59
      Views

      Sebastián Cisneros

      @PitaJ said in How to call API from client side.:

      require(['api', 'translator'], (api, translator) => {
      // Your code here
      });

      genius! and fast reply!

    • ufan0

      I need help with customizing the post page
      General Discussion • javascript html customize • • ufan0

      1
      0
      Votes
      1
      Posts
      69
      Views

      ufan0

      As mentioned in the title, I want to add some javascripts and html to my post. For example, I want to show data by calling api in a specific post.

      I tried the plugin -> markdown ->Allow HTML, it does not work.It seems will ban the javascript.

      So is there any good way to meet my needs?
      Thanks s lot.

      006hL0SXgy1g9xjkxn77rj30j60j6who.jpg

    • K

      Use readmore.js for blockquotes
      General Discussion • readmorejs javascript customize customizing • • klockprat

      3
      0
      Votes
      3
      Posts
      135
      Views

      baris

      Did you try with this?

      function onLoad() { require(['/assets/uploads/readmore.min.js'], function () { console.log('yeah it works'); console.log($('blockquote')); $('blockquote').readmore(); }); } $(document).ready(onLoad); $(window).on('action:ajaxify.end', onLoad);
    • phenomlab

      How to make custom JS persist
      Technical Support • javascript plugin spa scrolling • • phenomlab

      5
      0
      Votes
      5
      Posts
      233
      Views

      phenomlab

      @dogs this worked a treat - thanks. For anyone else who might be looking for something similar, here's a simple scroll to top function that you can place into your Custom JS

      // Scroll to top button $(window).on('action:ajaxify.end', function(data) { var btn = $('#btt'); $(window).scroll(function() { if ($(window).scrollTop() > 300) { btn.addClass('show'); } else { btn.removeClass('show'); } }); btn.on('click', function(e) { e.preventDefault(); $('html, body').animate({scrollTop:0}, '300'); }); })

      Then place this into your Custom Header

      <a id="btt"><i class="fas fa-chevron-up"></i></a>

      Obviously, you would need to provide some CSS to style this. An example of this can be found on https://phenomlab.com

    • dogs

      How to open composer via clientside script and add category & tags
      Tutorials • composer javascript jquery snippet • • dogs

      4
      2
      Votes
      4
      Posts
      212
      Views

      dogs

      @dunlix yeah you should! 😂

      what does discord have to do with it? I tried using that link with different values and URL of course on my site, still didn't work. I'm sure it works for you, what am I missing?

      To be honest: Nothing.

      I am building a plugin for Discord integration..So the variable names are just placeholders if you want so.

      The important part is at the end of my main post.

      I hope that you find a slick way to use it for your community maybe. 🙂 👍

    • Tilen Štraus

      Nodebb shuts down(502 bad gateway)
      NodeBB Development • google apps script javascript write-api • • Tilen Štraus

      3
      0
      Votes
      3
      Posts
      1731
      Views

      E

      Bad gateway might occur due to an incorrect setting in your Proxy.

      It is recommended by me to use Nginx as it is easy to setup and apparently automatically recovers after a bad gateway.

      What Operating System Are you using?

    • Tilen Štraus

      Write api inserting/updating tags doesn't work
      NodeBB Development • write-api tags javascript google apps script • • Tilen Štraus

      6
      0
      Votes
      6
      Posts
      2364
      Views

      julian

      @Tilen-Štraus Glad you got it working, and thank you for sharing your solution for others who may run into the same trouble 😄

    • Doppy

      Is it possible put parameter in html form another javascript?
      NodeBB Plugins • plugin javascript html jquery • • Doppy

      2
      0
      Votes
      2
      Posts
      1620
      Views

      yariplus

      in the client, those values are stored in ajaxify.data

      For your jQuery, you don't append a closing tag, it does that automatically. When you want to insert the element into the div, you need to use appendTo(). Also, unless your label has additional data, I recommend using html() instead of text().

      Here's a fiddle. I also added an ID to the new label so it isn't added more than once.

      Edit fiddle - JSFiddle - Code Playground
    • scottalanmiller

      Using JS to Render Rotating Images in the Global Sidebar Widget
      Technical Support • javascript sidebar widget area • • scottalanmiller

      5
      0
      Votes
      5
      Posts
      1789
      Views

      scottalanmiller

      Thanks, we have it working now!

    • frissdiegurke

      JavaScript edge cases
      General Discussion • javascript • • frissdiegurke

      9
      1
      Votes
      9
      Posts
      3942
      Views

      rbeer

      Duh! Of course! That annoying ;-insertion. Nicely done!

      semi: [2, "always"] 😉

    • Nicolas

      Split JS Minification on Client/Board and ACP
      Feature Requests • javascript minify uglify • • Nicolas

      8
      1
      Votes
      8
      Posts
      2725
      Views

      julian

      Nicolas, I'm assuming you don't want to put your js inline in the template? 😄

      For my plugins (I have my own fork of quickstart that I use), I actually make them require.js modules, so they are loaded on-demand: https://github.com/NodeBB/nodebb-plugin-quickstart/blob/julian/static/lib/admin.js

      But looking back, this might also minified, so... 😆

    • Nicolas

      Client actions for posts
      Plugin Development • client javascript plugin action • • Nicolas

      5
      0
      Votes
      5
      Posts
      2493
      Views

      rbeer

      @pitaj
      Boy, that was quick! Thanks 🙂

    • Nicolas

      Client JavaScript in Templates
      Technical Support • javascript client theme • • Nicolas

      6
      0
      Votes
      6
      Posts
      3543
      Views

      Nicolas

      @psychobunny nice, It's very helpful.

    • Nicolas

      ACP: JavaScript
      Plugin Development • acp javascript minification best-practices • • Nicolas

      21
      0
      Votes
      21
      Posts
      8433
      Views

      julian

      @pichalite try this 😄

    • JonDoe12

      Emaze Plugin Help
      NodeBB Plugins • help support plugin javascript • • JonDoe12

      14
      0
      Votes
      14
      Posts
      9141
      Views

      JonDoe12

      I was just going to let you take most of the credit. It's still your plugin, and you helped me make the modifications. I'm working on a new modification now, though. I'm trying to get the presentations to embed into an area of the user's profile.

      Right now, I'm testing it with the Fullname field on the profile, by entering the URL of the presentations (instead of a human name) and seeing if it parses into an embedded slide show.

      Would this be easy to accomplish? If not, are there any hints you could give me @a_5mith ?

      So far, I've edited the library.js file and replaced data.post and data.post.conent with data.fullname and data.fullname.content. I've also tried changing the hook in plugin.js from:

      { "hook": "filter:parse.post", "method": "parse", "callbacked": true } ]

      to

      { "hook": "action:user.set", "method": "parse", "callbacked": true } ]

      I feel like I'm missing something, though. If you're up to it, I'd like to collaborate with you further.

    • Tanner

      Javascript not compiling on normal start
      Bug Reports • nodebb javascript • • Tanner

      6
      0
      Votes
      6
      Posts
      2519
      Views

      B

      i removed pidfile and it started normally

    • esiao

      Hovering a link = 404
      Bug Reports • bug console javascript • • esiao

      5
      0
      Votes
      5
      Posts
      1968
      Views

      baris

      @esiao if you update to latest you shouldn't need to add a data-ajaxify anymore. https://github.com/NodeBB/NodeBB/issues/1938

      barisusakli created this issue in NodeBB/NodeBB closed href.slice(-1) === "#"; checks last element #1938
    • H

      plugin OR widget Which One for Nodebb JavaScript web Apps?
      NodeBB Plugins • plugin widget javascript • • himadree

      2
      0
      Votes
      2
      Posts
      1821
      Views

      psychobunny

      Depends, if you're doing largely front-end code (like embedding an iFrame to some chat application) then a widget works best. If you want to modify the API or save things into the database, then a plugin is right for you.

      I think your best bet is to figure out what you need to do, and then find a plugin that does something similar, and modify that plugin, or take code from it (it's open source afterall ;))

    • Ganzuelo

      How did you learn JavaScript?
      General Discussion • javascript • • Ganzuelo

      3
      0
      Votes
      3
      Posts
      1879
      Views

      Schamper

      Had half a year to waste because it was too late to switch school level (I'm not even going to bother trying to translate this into weird USA school terms :P), I already knew quite a bit of MIPS (PSP hacking) by then, and wanted to try something else.

      Don't know why I chose JavaScript, just did. Started with w3schools (ikr), eventually just learned by doing, doing and more doing. Along the way of doing I of course read the occasional article, "guide", best practices, documentations etc. No books and courses though.

    Get Started

    • Product
    • Pricing

    Resources

    • Demo Site
    • Answers
    • Docs
    • Bug Bounty

    Company

    • About
    • Blog
    • Contact
    Start Free Trial
    Github Facebook Instagram Twitter
    © 2014 – 2022 NodeBB, Inc. — Made in Canada.
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact
    Menu
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact