wiselinks icon indicating copy to clipboard operation
wiselinks copied to clipboard

Use Wiselinks on all links by default

Open ssbb opened this issue 11 years ago • 6 comments

Hi! And thanks for a great solution.

What do you think about adding the option to turn wiselinks by default for all links and forms?

I am developing a website where all the links have to be handled with wiselinks and a little uncomfortable add data-push for each link. Personally, I would be more convenient to add data-no-push for links where wiselinks not needed.

thank you

ssbb avatar Oct 10 '13 04:10 ssbb

:+1:

jcemer avatar Oct 13 '13 21:10 jcemer

+1 Is this possible already?

LaurensN avatar Feb 03 '14 16:02 LaurensN

Still not, but I promise to make this work as soon as possible.

igor-alexandrov avatar Feb 03 '14 17:02 igor-alexandrov

$('button').data('push',true);
$('a').data('push',true);

mibamur avatar Nov 19 '14 21:11 mibamur

:+1:

Better way is to activate all links with push where no data-push and data-replace attributes are present.

$(function(){
    $('button, a').not('[data-no-push], [data-replace], [href$="#"]').attr('data-push', true);
}
$(document).on('page:always', function() { $('button, a').not('[data-no-push], [data-replace], [href$="#"]').attr('data-push', true); });

With data attribute data-no-push="true" you can disable wiselinks on a link.

phlegx avatar Dec 10 '14 18:12 phlegx

If anyone stumbles, this should be relatively easy to do just by binding at the document level as a click capture; and in that callback; bind to the regular (so that you are always last), and triggering if default was not prevented. (note: you may want to also handle MetaKey's etc)

AlexRiedler avatar Feb 11 '15 03:02 AlexRiedler