Jump to content

Hide @ from user mentions


Stefan Werner

Recommended Posts

Hi,

thank you for the code. I've tried the jquery way, which does not work correctly. It removes the @, but multiple mentions on a page are replaced by the first username.

Kind regards,

Stefan

Edit: I've changed the jquery code from implicit to explicit iteration and this works:

$('a[data-mentionid]').each(function() {
  $(this).html($(this).html().substring(1));
});

 

Link to comment
Share on other sites

  • 3 months later...
On 11/13/2018 at 8:24 PM, Stefan Werner said:

Hi,

thank you for the code. I've tried the jquery way, which does not work correctly. It removes the @, but multiple mentions on a page are replaced by the first username.

Kind regards,

Stefan

Edit: I've changed the jquery code from implicit to explicit iteration and this works:


$('a[data-mentionid]').each(function() {
  $(this).html($(this).html().substring(1));
});

 

does it still work, and if so, where should i put this code(tried globalTemplate, didn't worked)?

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

On 2/14/2019 at 9:54 AM, ~Jakso.` said:

does it still work, and if so, where should i put this code(tried globalTemplate, didn't worked)?

for me it works most of the times, I'm using IPS 4.3. It does not fully work in quotes.

I've added the code to a custom js file and uploaded it to my theme ("Manage resources" -> "Add resource"). Then I included the js file in the globalTemplate

<script src='{resource="Theme.js" app="core" location="front"}'></script>

Kind regards,

Stefan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...