inherit
259044
0
Apr 6, 2024 5:45:41 GMT -8
hdd
Happy New Year
132
July 2019
hdd
|
Post by hdd on Dec 29, 2019 7:10:52 GMT -8
Is it possible to make label with different background colour(from colour picker) and single text color(like white/black)?
|
|
inherit
259044
0
Apr 6, 2024 5:45:41 GMT -8
hdd
Happy New Year
132
July 2019
hdd
|
Post by hdd on Dec 31, 2019 4:36:43 GMT -8
BUMP!!! I solved it. var elements = document.getElementsByClassName('ui-label'); for(var i = 0; i < elements.length; i++){ elements[i].style.background = elements[i].style.color; elements[i].style.color = null; } & Add a CSS to stylesheet .ui-label{border-radius:3px; color:white;}
|
|
inherit
140147
0
Apr 20, 2024 22:11:25 GMT -8
Nscalerr 🐺
Throw me to the wolves and I'll return leading the pack!
3,003
May 2009
nscalerr
|
Post by Nscalerr 🐺 on Jan 1, 2020 22:41:51 GMT -8
Tested this on my own forum and created a plugin version, so it works with all 6 of my themes.
|
|
inherit
259044
0
Apr 6, 2024 5:45:41 GMT -8
hdd
Happy New Year
132
July 2019
hdd
|
Post by hdd on Jan 2, 2020 1:27:24 GMT -8
Tested this on my own forum and created a plugin version, so it works with all 6 of my themes. Can you please provide the link of your plugin and post it in plugin library.
|
|
inherit
140147
0
Apr 20, 2024 22:11:25 GMT -8
Nscalerr 🐺
Throw me to the wolves and I'll return leading the pack!
3,003
May 2009
nscalerr
|
Post by Nscalerr 🐺 on Jan 2, 2020 1:44:03 GMT -8
This is the plugin version which is open souce, (which means it can be edited. The css for it is in the plugin itself, (In the components section). As far as uploading it to the library - I want to do some testing first. Custom Labels.pbp (510 B)
|
|
inherit
259044
0
Apr 6, 2024 5:45:41 GMT -8
hdd
Happy New Year
132
July 2019
hdd
|
Post by hdd on Jan 2, 2020 1:56:04 GMT -8
This is the plugin version which is open souce, (which means it can be edited. The css for it is in the plugin itself, (In the components section). As far as uploading it to the library - I want to do some testing first. I don't know but this script is not working for message labels.
|
|
inherit
140147
0
Apr 20, 2024 22:11:25 GMT -8
Nscalerr 🐺
Throw me to the wolves and I'll return leading the pack!
3,003
May 2009
nscalerr
|
Post by Nscalerr 🐺 on Jan 2, 2020 1:59:18 GMT -8
Well it works for the thread labels on my forum, but for message labels, it might take a different bit of javascript and/or css. Edit: it is looking like the javascript itself will need to be changed, which means someone else will have to do it. I only know html and css. Maybe Chris or elli will be able to help out.
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,853
December 2005
horace
|
Post by Chris on Jan 3, 2020 4:51:03 GMT -8
BUMP!!! I solved it. var elements = document.getElementsByClassName('ui-label'); for(var i = 0; i < elements.length; i++){ elements[i].style.background = elements[i].style.color; elements[i].style.color = null; } & Add a CSS to stylesheet .ui-label{border-radius:3px; color:white;}
A quick developer console execution of the posted code on a few pages shows it affects both thread and PM labels equally or am I missing some nuance here? If the plugin version of the code added a route lookup (I didn't check the plugin) for threads then simply add additional route checks for PMs. If you are using a modified theme requiring a change in code then the modifications that comes with that theme would have to be made known in order to construct a corresponding change to the code that would account for such modifications.
|
|
inherit
259044
0
Apr 6, 2024 5:45:41 GMT -8
hdd
Happy New Year
132
July 2019
hdd
|
Post by hdd on Jan 3, 2020 6:12:06 GMT -8
ChrisEven I added the script in the conversation list template it is not working. I don't know much about making plugins and js. Can you make one plugin please? Or I make a request in Plugin Request Thread?
|
|
inherit
140147
0
Apr 20, 2024 22:11:25 GMT -8
Nscalerr 🐺
Throw me to the wolves and I'll return leading the pack!
3,003
May 2009
nscalerr
|
Post by Nscalerr 🐺 on Jan 3, 2020 6:42:00 GMT -8
The plugin is just the javascript and the css added to have it function across several themes, (without having it in the Global Footer).
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,853
December 2005
horace
|
Post by Chris on Jan 3, 2020 22:53:45 GMT -8
You'll most likely need to wrap that javascript in a function so you can then delay it to run after the browser is ready to display the page. This way it runs after the labels are created on the PM pages since they get dynamically created when it hits the browser and not simply included in the HTML sent by Proboards like on thread pages.
something along the lines of
<script type="text/javascript"> $(()=>{var elements = document.getElementsByClassName('ui-label'); for(var i = 0; i < elements.length; i++) { elements[i].style.background = elements[i].style.color; elements[i].style.color = null; }}) </script>
|
|