SMF Development > Fixed or Bogus Bugs
Themes\default\Admin.template.php - template_show_settings() / toggleBBCDisabled
N. N.:
Ah, I see. You mean it becomes obvious they are disabled (greyed out), not just unchecked... yes. It makes sense to have this behavior, a visual indicator of what the user just did.
Thank you!
I will look into it.
Arantor:
Well, yeah, it does make it more intuitive (and the reason I'm investigating it is to do the same in SimpleDesk's ACP), but not only that, it's a regression since the code worked before in 1.1.x.
If it is unchecking things, that's another issue I would classify as a bug since it's not supposed to uncheck anything as far as I can tell.
emanuele:
That one is still valid too.
Spuds:
I never noticed it even did that in 1.x :D
Looks like two things are needed .....
1) The form settings in MangePosts.php need to be updated so the checkbox at least calls the javascript
--- Code: (find) --- array('check', 'enableBBC'),
--- End code ---
--- Code: (replace) --- array('check', 'enableBBC', 0, 'onchange' => 'toggleBBCDisabled(!this.checked);'),
--- End code ---
2) The javascript needs to be updated, looks like someone started at some point but its not compatible with the form that gets generated. So as a talking point, in Admin.template.php
--- Code: (find) --- echo '
function toggleBBCDisabled(section, disable)
{
for (var i = 0; i < document.forms.bbcForm.length; i++)
{
if (typeof(document.forms.bbcForm[i].name) == "undefined" || (document.forms.bbcForm[i].name.substr(0, 11) != "enabledTags") || (document.forms.bbcForm[i].name.indexOf(section) != 11))
continue;
document.forms.bbcForm[i].disabled = disable;
}
document.getElementById("bbc_" + section + "_select_all").disabled = disable;
}';
--- End code ---
--- Code: (replace) --- echo '
function toggleBBCDisabled(disable)
{
var bbcboxes = document.getElementById("disabledBBC");
for (var i = 0; i < bbcboxes.elements.length; i++)
{
var formElement = bbcboxes.elements[i];
console.debug(formElement.name.substr(0, 23));
if (typeof(formElement.name) == "undefined" || (formElement.name.substr(0, 23) != "disabledBBC_enabledTags"))
continue;
document.getElementById(formElement.id).disabled = disable;
}
document.getElementById("select_all").disabled = disable;
}';
--- End code ---
emanuele:
I think the "section" was intended to allow have more than one bbc-like box in the same page (I sort of used it in one of my mods), but then the idea was not fully developed.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version