Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

Tuur

Erleuchteter

  • »Tuur« ist der Autor dieses Themas

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

1

Dienstag, 26. September 2023, 15:41

copy url issue

Hi,

I was wondering..being on Mac.
When I copy an url from the safari browser and paste it into and editable textfield and trace the value, I get:
<a href="https://krpano.com">https://krpano.com</a>

I also see it is underlined etc..
which is problematic as I just need the url .. not all the a href stuff.

When copied from Chrome it works just good, I get:
https://krpano.com/

Is there a way to strip the input of an editable textfield from all extra stuff/attributes before it is set as text value?
I'm looking for a setting or so.
Obviously i could strip it with indexof text .. but that would be my last, if at all, option.

I already use var.toString(); but the issue above is another one..

Tuur *thumbsup*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Tuur« (26. September 2023, 17:40)


2

Freitag, 29. September 2023, 15:18

Hi,

hmm... that doesn't happen when I test it...

Beside that - that would mean that Safari was putting that text with the surrounding the html code into the clipboard... and when pasting then just that text was inserted...

Somehow filtering pasted content would be a bad idea, what if such code was intended to be pasted?

Best regards,
Klaus

Tuur

Erleuchteter

  • »Tuur« ist der Autor dieses Themas

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

3

Freitag, 29. September 2023, 15:23

Mm.. not sure..
Perhaps it is a safari developer setting i changed by accident(?).
Copy url as html or so ..
I'll investigate.

edit..
so.. when I paste it with cmd+option+shift+V it works ok.
Anybody aware of a setting that let's me just copy an url as plain text?
It seems not everyone has this issue.
.. maybe I should re-install OSX..


Attached a picture with what happens when I just paste a, from safari, copied url in an editable textfield.



Tuur *thumbsup*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Tuur« (29. September 2023, 17:08)


Tuur

Erleuchteter

  • »Tuur« ist der Autor dieses Themas

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

4

Montag, 2. Oktober 2023, 12:20

Hi,

if you encounter this issue.. so when you have an editable textfield and want anybody to input an url.. which is copied from safari url bar .. just to be compatible with 'all' systems.. (chrome does this just right (Mac).

put this code anywhere in the project

Quellcode

1
2
3
4
5
6
7
8
9
<action autorun="preinit" type="js">
 krpano.inlinefunctions.filterhtml = function(s)
 {
   var div = document.createElement("div");
   div.innerHTML = s;
   s = div.innerText;
   return s;
 }
</action>


then add this to your layer

Quellcode

1
oneditchange="text=filterhtml(text);"


Thanks to Klaus! *love*

Tuur *thumbsup*