Skip to content

Opening links in nodebb widget

Solved Configure
  • @phenomlab the convo we started on nodebb forum, I thought to continue it here.
    Still having the issue of links not loading often in widgets
    Have you been able to take a look?

  • A more efficient way of including this would be to not over complicate it and leverage a standard iframe (providing the CSP headers of the remote site permit this) like below

    <iframe src="https://www.classmarker.com/online-test/start/?quiz=gag66aea7922f0a5" width="700" height="800"></iframe>
    

    This works first time every time on your site as intended.

  • @Panda not yet, will do so later. For continuity, can you provide the code here that you want to use?

  • @phenomlab yes, its just a quiz.

    <script src="https://www.classmarker.com/public/js/embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5" data-quiz="gag66aea7922f0a5" data-width="700" data-height="800" ></script>
    

    The fact this is so problematic makes me wonder if something should be built into the widget code in nodebb to sort whatever the timing issue is, that causes loading to fail

  • @Panda I’ll test this and revert. Will get back to you later.

  • @Panda It’s not caused by NodeBB, but the way you are calling the URL - see the error message below reported in the console

    embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:7  Uncaught TypeError: Failed to construct 'URL': Invalid URL
        at __createIframe (embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:7:80)
        at load (embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:3:100)
        at embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:1:1
    
  • A more efficient way of including this would be to not over complicate it and leverage a standard iframe (providing the CSP headers of the remote site permit this) like below

    <iframe src="https://www.classmarker.com/online-test/start/?quiz=gag66aea7922f0a5" width="700" height="800"></iframe>
    

    This works first time every time on your site as intended.

  • phenomlabundefined phenomlab has marked this topic as solved

Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

Related Topics
  • Interesting Widget code, but can't fetch API

    Solved Customisation
    26
    2 Votes
    26 Posts
    1k Views

    @Panda said in Interesting Widget code, but can’t fetch API:

    How did you drop that widget into the post there?
    I hadnt seen this BSgenerator anywhere on sudonix site, do you use it somewhere already?

    Yes, here

    https://sudonix.org/topic/414/corporate-bullshit-generator?_=1687774393044

    It’s not a “post” or “topic” in the common sense. It is actually a page in it’s own right and leverages nodebb-plugin-custom-pages. This in turn creates a new “route” which behaves like a page, meaning it is then exposed for widgets.

    @Panda said in Interesting Widget code, but can’t fetch API:

    Also can you explain more what you mean by calling the code externally. In my API call example, how would I go about doing that?

    By this, I mean create all the required code in an external JS file that is reachable by the NodeBB instance - so, in “public” for example - or in my case /public/js. The widget then “calls” that file and because it runs outside of the scope of NodeBB, you just need to return the values to the widget.

    Hope this makes sense?

  • Why CSS acts different in Desktop?

    Bugs
    11
    4 Votes
    11 Posts
    533 Views

    @DownPW I’d have to agree with that.

  • Composer options on nodebb

    Solved Configure
    8
    3 Votes
    8 Posts
    371 Views

    @Panda You should be able to expose the CSS for these using F12 to get into console

    3591518c-e3a3-4ada-a43c-6b32a5e0359c-image.png

    a2b8ed46-4157-4ff2-85f0-576543380107-image.png

    That should then expose the element once selected

    89d9c545-a47a-40d1-98f4-80cf3b958e8f-image.png

    Here’s the below CSS you need based on the screenshot provided.

    .composer .formatting-bar .formatting-group li[data-format="picture-o"], .composer .formatting-bar .formatting-group li[data-format="spoiler"] { display: none; }
  • MailGun Not Working NodeBB

    Solved Configure
    6
    1 Votes
    6 Posts
    433 Views

    @phenomlab did it 🙂 i did not create smtp user on mailgun. everything is working now.

    6cc6061f-ed5d-41f6-8eb7-5d98f98b3706-image.png

  • what does sound/mute button do?

    Solved Customisation
    20
    9 Votes
    20 Posts
    1k Views

    @crazycells Yeah, looking at the plugin itself, that’s a hard coded limit

    3d6dbc10-185b-4102-9470-0c2731a10750-image.png

    I’ll probably remove that… eventually…

  • NodeBB 1.19.3

    Solved Performance
    33
    4 Votes
    33 Posts
    3k Views

    @phenomlab

    I find the problem Mark 😉

    The error message indicated this path :

    http://localhost:4567/assets/plugins/nodebb-plugin-emoji/emoji/styles.css?v=6983dobg16u

    I change the path url on config.json

    47bacc80-f141-41e4-a261-3f8d650cc6f6-image.png

    And all it’s good 🙂

    Weird, I didn’t have to change that path before 1.19.3

    But this does not prevent the problem from a clean install with Emoji Plugin

    EDIT: After test, that resolv the problem installation for 1.18.x but not for 1.19.x (I have other error message when I run ./nodebb Setup

    For resume: NodeJS 16_x with 1.18.x is ok

  • IRC Server/Client - Chat App with NodeBB

    Linux
    6
    1 Votes
    6 Posts
    635 Views

    @Hari not sure from the consumer perspective, but Skype has been all but completely consumed by Microsoft Teams when it comes to business usage.

  • nodebb dropdown menu

    Solved Configure
    5
    0 Votes
    5 Posts
    497 Views

    @phenomlab said in nodebb dropdown menu:

    @kurulumu-net You set it like the below example taken from this site

    aae36790-3257-4bb2-ad5a-0d744309876a-image.png

    Which presents this

    77f47260-2941-4afe-9614-8e17dcfc8c19-image.png

    Very interesting…

    I actually thought this wasn’t possible, as I remember it being asked in the NodeBB forum.

    Is this something new that’s been implemented? I’ll 100% be doing that when I’m on the laptop over the weekend.