Skip to main content
Topic: [ADDON/TRICK] favicon next to links (Read 9126 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: [ADDON/TRICK] favicon next to links

Reply #16

This works with the correct selectors (also in SMF 2,1 with our Portal system)  :D
Code: [Select]
 /* add Favicon to links with the class "bbc_link", but not in signatures! */
 $(':not(.signature)>.bbc_link').each(function() {
 var url = $(this).attr('href'),
 domain = url.match(/:\/\/(.[^/]+)/)[1],
 schema = url.match(/^(http[s]*):\/\//)[1];
 $(this).css({
 'background-image':'url(//www.google.com/s2/favicons?domain=' + schema + '://' + domain + ')',
 'background-repeat':'no-repeat',
 'padding-left':'20px',
 'background-position':'0'
 });
 });
Last Edit: February 21, 2016, 03:31:35 pm by Feline
Many are stubborn in relation to the path, a few in relation to the target.
Visit our new Forum Project on https://www.portamx.com

Re: [ADDON/TRICK] favicon next to links

Reply #17

@emanuele,
I have forked and done an update to this, with the not-in signatures fix, (Per http://www.elkarte.net/community/index.php?topic=1419.msg23396#msg23396 ) and sent a PR to your master, if want it.
If would like to keep both versions, let me know, and I'll make it another Branch and then send new PR, so you can have both Branches. (Also added a ReadMe....XD)

Re: [ADDON/TRICK] favicon next to links

Reply #18

I saw it, let me pass February and I'll catch up with everything left around (including 1.1 beta release!). ;)
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON/TRICK] favicon next to links

Reply #19

@emanuele‍ don't forget about 1.1 release, the actual version installs without errors on 1.1 RC2, but no icon is shown near to links
sorry for my bad english

Re: [ADDON/TRICK] favicon next to links

Reply #20

PR was made, but while its pending

  • use js core hostname function to eliminate the regex
  • allow install w/o emulation, but this is 1.1 only (.0.0.2 did not work on 1.1, 0.0.1 did)
  • update links
  • Fix not adding favicon on signature links was broken on 1.1

 

Re: [ADDON/TRICK] favicon next to links

Reply #21

Just installed and seems to work fine now
sorry for my bad english