Question: I got a script for topic prefix that result as shown in below:
And the code is:
But how can I use background color for every prefixes, that means: for "[Solved]" prefix, it will show green color in background.
Answer: https://devs.forumvi.com/t436-hoi-dap-how-add-background-color-on-topic-prefixes?showpost=p2761
And the code is:
- Code:
var PREFIJOS_TEMAS = [];
PREFIJOS_TEMAS.push("[Tutorial]");
PREFIJOS_TEMAS.push("[Guide]");
PREFIJOS_TEMAS.push("[Help]");
PREFIJOS_TEMAS.push("[Off-Topic]");
PREFIJOS_TEMAS.push("[Games]");
PREFIJOS_TEMAS.push("[Solved]");
PREFIJOS_TEMAS.push("[Progress]");
PREFIJOS_TEMAS.push("[Video]");
PREFIJOS_TEMAS.push("[Audio]");
PREFIJOS_TEMAS.push("[Download]");
$(function () {
if(/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search'))){
var html_options_prefijo = "<select name='prefijos'><option value=''>--Select--</option>";
for(var prefijo in PREFIJOS_TEMAS){
html_options_prefijo += "<option value='" + PREFIJOS_TEMAS[prefijo] + "'>" + PREFIJOS_TEMAS[prefijo] + "</option>";
}
html_options_prefijo += "</select>";
$('input[name="subject"]').before(html_options_prefijo);
$("form[method='post']").submit(function() {
$('input[name="subject"]').val(($('select[name="prefijos"]').val() ? $('select[name="prefijos"]').val() + " " : "") + $('input[name="subject"]').val());
});
}
});
But how can I use background color for every prefixes, that means: for "[Solved]" prefix, it will show green color in background.
Answer: https://devs.forumvi.com/t436-hoi-dap-how-add-background-color-on-topic-prefixes?showpost=p2761