Web based family history software

Question javascript

  • mariannevanharten
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 10 months ago #1 by mariannevanharten
javascript was created by mariannevanharten
Referring to my previous questions ( here and here ) I want to know how to do.
I am not familiar with Javascript.

The name of the person which is in use in regular situations (in Dutch "roepnaam"), the name friends and relatives use when they are talking to and/or about you, I prefer to show in parentheses:
Code:
1 NAME Alexander Boris de Pfeffel"Boris"/ Johnson/
shoud be presented as:
Alexander Boris de Pfeffel (Boris) Johnson

Therefore I tried to enter the given code into the JS section in the box Add content to the end of the <body> element, but that doesn't result in a good presentation.

Regarding the other item about the omitting the notes for a new user: where do I have to place the JS code?

Any help is appreciated.

Best regards,
Marianne

Please Log in or Create an account to join the conversation.

  • fisharebest
  • Away
  • Administrator
  • Administrator
More
2 years 10 months ago #2 by fisharebest
Replied by fisharebest on topic javascript
> Therefore I tried to enter the given code into the JS section

That was CSS, and so needs to be enclosed in script tags and placed in the head.

> Regarding the other item about the omitting the notes for a new user: where do I have to place the JS code?

Control panel -> Modules -> Custom JS and CSS

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • mariannevanharten
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 10 months ago #3 by mariannevanharten
Replied by mariannevanharten on topic javascript
I already installed and used the plugin Custom JS and CSS.



What did I wrong here?
Do I have to place both strings into the same box?
Code:
<script>q { quotes: " (" ")" " (" ")"; }</script> <script> (function () { const el = document.querySelector('.wt-route-RegisterPage #comment'); if (el) { el.value = 'no comment'; el.closest('.row').style.display = 'none'; } })(); </script>

Please Log in or Create an account to join the conversation.

  • fisharebest
  • Away
  • Administrator
  • Administrator
More
2 years 10 months ago #4 by fisharebest
Replied by fisharebest on topic javascript
The CSS (quotes...) requires STYLE tags, not SCRIPT tags, and goes in the HEAD.

The JS (function ...) requires SCRIPT tags, and goes in the BODY.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • mariannevanharten
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 10 months ago - 2 years 10 months ago #5 by mariannevanharten
Replied by mariannevanharten on topic javascript
Thank you very much.
Last edit: 2 years 10 months ago by mariannevanharten.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}