Attention:

Support Rules and Guidelines
Before you post your support topic, please remember to:
  • Read the support forum rules.
  • Check the wiki and use search to see if your problem can be answered there first.
  • Link your board please, and make sure that the problem on your board is visible to guests or provide a test account.
  • Do not post Board Wrappers and CSS unless requested. With a board link, this is not necessary.
  • Be as descriptive as you can and use as many details as possible when describing your problem.
  • Please briefly mark any links to forums that may not be work-safe.
This will help ensure your support issue will be attended to in a quick and efficient manner.

  Add ReplyNew TopicNew Poll

 Removing comma from topic description?
#
So, I've done some searching on this & saw someone say "it's easy to target & remove the comma before the topic title description with JS" but they didn't say how & I'm really honestly a neophyte of JS so I just can't figure it out...

If I want to remove the comma before the description under a topic title, how would I do it?

You know...
user posted image
That annoying comma.

This post has been edited by All Perspicacity: Jan 9 2018, 01:23 AM

signature
"Trust me, I'm a doctor."
user posted image
PM
#
Depends on your board structure, but the gist is along these lines:

CODE
document.getElementsByClassName('topic-title')[0].nextSibling.innerHTML = document.getElementsByClassName('topic-title')[0].nextSibling.innerHTML.substring(1)
PM
#
So, it's effectively removing the first letter from the line immediately after the topic title? How would I input this in the html template, just wrapped in a script tag?

signature
"Trust me, I'm a doctor."
user posted image
PM
#
It's actually removing both the comma and the space, as the substring method is zero based.

Wrap it in a script tag and put it in your board wrapper's footer. You don't want to put any script in a repeating template, generally speaking.
PM
#
Doesn't seem to have any effect when wrapped in a script tag? If it helps, the current css related to topic view maintitle is;

CODE
.topic-title{
font-family: ailerons;
color: #a67b74;
display: inline-block;
width: 100%;
border-bottom: 3px solid #574a4a;
font-size: 38px;
font-weight: normal;
word-spacing: -7px;
font-style: normal;
text-align: left;
letter-spacing: 0px;
}

#ST .maintitle {
display: block;
font-family: calibri;
letter-spacing: 1px;
font-style: italic;
color: #8a8282;
text-align: right;
margin: 0px auto 15px;
height: 100%;
font-size: 16px;
}

That's all I've got editing the topic view Maintitle.

signature
"Trust me, I'm a doctor."
user posted image
PM
#
CSS won't affect it. You'll need to either link your board, or determine the correct selector string for the text node. I should clarify: the actual functionality of that comes from the .substring(1) method. The rest is just selection.

or you could just use JQuery but in the interest of "good coding practices" shhh use JS

EDIT:

wait whoops that script was for the other skin.. or something. weird. what did I DO?

Anyways this should work (or at least it does for this forum)
CODE
<script>document.getElementsByClassName('topic-title')[0].nextSibling.nodeValue = document.getElementsByClassName('topic-title')[0].nextSibling.nodeValue.substring(1)</script>


EDIT:

add a .trim() method to the very end after .substring(1) if you want to get rid of the whitespace

This post has been edited by Dusty: Jan 14 2018, 03:22 AM
PM
#
OH CHRIST, YOU'RE A GOD, IT WORKED. Thank you so much! Saving this for future skins <3

signature
"Trust me, I'm a doctor."
user posted image
PM
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Share this topic:
« Next Oldest | General Support | Next Newest »

Options Add ReplyNew TopicNew Poll