• billypanorama_fish_eye
    17 posts
    2 years ago

    I noticed that it is possible to mark up a YouTube video by using the 'markup_link_url' function to input a YouTube link. Additionally, I would like to introduce a new matching rule similar to YouTube videos to accommodate different content from another platform. Therefore, I attempted to write some rules and related code in the '/frontend/src/services/one-box.js' file. However, I encountered difficulties in making it work successfully. Would you be able to assist me with this?

  • arrow_forward

    Thread has been moved from Feedback.

  • rafalplens
    2 years ago

    Can you write what problem you are experiencing? My time is quite limited and I really can't afford to analyse large portions of code like that to guess myself where the problem is.

  • billypanorama_fish_eye
    17 posts
    2 years ago

    Apologies, I'm just wondering whether I should write the related code in "one-box.js" or some other ".js" file to achieve a similar function of accepting a YouTube link as input.

    Thanks again.

  • rafalplens
    2 years ago

    Currently the one-box.js is the way to do this. The logic for oneboxing is finding links that are only content of their paragraphs, checking if those links are YouTube video links, and if they are, replacing them with the HTML for the player.

  • billypanorama_fish_eye
    17 posts
    2 years ago

    Yep, I also got this. I tried writing similar code to validate the link, but it didn't work successfully. It seems that besides coding correctly in 'one-box.js', there might be some other actions that need to be taken to make it work.

  • rafalplens
    2 years ago

    but it didn't work successfully

    Why it didn't work? Did you get an error in browser's console?

  • billypanorama_fish_eye
    17 posts
    2 years ago

    image.png

    image.png

    PNG, 800.5 KB, uploaded by billy 2 years ago.

  • rafalplens
    2 years ago

    This is not where browser console displays JavaScript errors. Look at the "console" tab.

  • billypanorama_fish_eye
    17 posts
    2 years ago

    There are no errors in the console, and I noticed that the markup action only loads the JavaScript file with 'http://localhost:8000/static/misago/js/misago.js', without including the code I wrote in 'one-box.js'. So I suspect that there should be a step to compile the code from 'one-box.js' into 'misago.js'.

    image.png

    misago-project.org/media/attachments/13/99/4q0TucEfYiADMGgkJd5x0Bqu8mailT1nv8fM7UNQiGO1jAYRpOQzcG9RPBfcNkl6/image.png

    image.png

    PNG, 702.5 KB, uploaded by billy 2 years ago.

  • rafalplens
    2 years ago

    Thats because there is. See:

    Those guides describe how to customize Misago’s JavaScript and make it use your customized version instead of standard one.

  • billypanorama_fish_eye
    17 posts
    2 years ago

    I sincerely appreciate it!

  • rafalplens
    2 years ago

    @billy please stop posting testing messages outside of testing category.

  • billypanorama_fish_eye
    17 posts
    2 years ago

    yes, so sorry for that

Search
  • Enter search query (at least 3 characters).

Your options