stevermeister/ngWig

adding link on mozilla don't work

Closed this issue · 6 comments

I'm getting a strange behavior on mozilla ( version 48.0.1 on windows 7 )

The link button open the popup, i paste for example "www.google.com" but when i click "ok" the popup close nut nothink is added in the text. no link !

It work on my chrome but not on mozilla.
any advice please ?

@alainib
you should select text first, which you want to make a link

@alainib What version of ngWig are you using?

@stevermeister oooh yeah it work this way on mozilla. On chrome you can just create a link without selecting text before.

@bampakoa i use the version: 2.3.4 version

I look at the code but cannot find how to make link be created with "targer=_blank" option. What i have to edit please ?

@alainib this has been resolved in the latest version of the library as far as I can tell.You can either upgrade or, if you dont wish to, you can copy paste the appropriate piece of code into your fork.

yes thank you. i update angular to 1.5.7 and ng-wig to v3 and now it work.

i edit the line 115 to get target _blank and add "http://" in the begining of the link

// use insertHtml forcreatelinkcommand to account for IE/Edge purposes, in case there is no selection if (command === 'createlink') { var display = selection || options ; if(!tools_stringStartsWith(options,"http")){ options = "http://"+ options; } $document[0].execCommand('insertHtml', false, '<a href="' + options + '" target="_blank">' + display + '</a>'); } else { $document[0].execCommand(command, false, options); }

@alainib I am glad you solved it. If there is anything else you would like to ask, please feel free to do so 😄