| Anonymous | Login | 05-20-2013 08:30 AM | ![]() |
| My View | View Issues |
| View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0004990 | SMF 2.0 | Javascript | public | 2012-06-26 10:41 | 2013-04-02 13:50 | ||||||
| Reporter | Akyhne | ||||||||||
| Priority | normal | Severity | major | Reproducibility | always | ||||||
| Status | new | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Summary | 0004990: Backgrounds for BBC buttons not showing when theme's name contains a space | ||||||||||
| Description | When creating/editing a topic where there's a space in the name of the theme, you will get some Javascript errors saying that bbc_bg.gif could not be created. In the GenericControls.template.php, this one will fail (#218): sButtonBackgroundImage: ', JavaScriptEscape($settings['images_url'] . '/bbc/bbc_bg.gif'), ' | ||||||||||
| Steps To Reproduce | Create a duplicate of the Default theme, naming it with a space in the name: "My Theme". Create a new topic and the bbc_bg.gif & bbc_hoverbg.gif will not turn up. | ||||||||||
| Additional Information | I can't find any other reason why the bbc_bg.gif & bbc_hoverbg.gif will not show up. In my theme, I eventually renamed my theme to use an underscore, then the problem dissapeared. So I resume it's because of the space in my custom theme. Javascript isn't my strongest side! | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Notes |
|
|
(0014772) akabugeyes (SMF Friend) 2013-03-10 20:42 |
I imagine this is happening because CSS probably doesn't take kindly to having spaces inside the urls. I was able to fix this by replacing an empty space here with '%20': This in editor.js: if (oButtonImg.bHover && oButtonImg.bIsActive && 'sActiveButtonBackgroundImageHover' in this.opt) sNewURL = 'url(' + this.opt.sActiveButtonBackgroundImageHover + ')'; else if (!oButtonImg.bHover && oButtonImg.bIsActive && 'sActiveButtonBackgroundImage' in this.opt) sNewURL = 'url(' + this.opt.sActiveButtonBackgroundImage + ')'; else if (oButtonImg.bHover && 'sButtonBackgroundImageHover' in this.opt) sNewURL = 'url(' + this.opt.sButtonBackgroundImageHover + ')'; else if ('sButtonBackgroundImage' in this.opt) sNewURL = 'url(' + this.opt.sButtonBackgroundImage + ')'; Becomes: if (oButtonImg.bHover && oButtonImg.bIsActive && 'sActiveButtonBackgroundImageHover' in this.opt) sNewURL = 'url(' + this.opt.sActiveButtonBackgroundImageHover.replace(' ', '%20') + ')'; else if (!oButtonImg.bHover && oButtonImg.bIsActive && 'sActiveButtonBackgroundImage' in this.opt) sNewURL = 'url(' + this.opt.sActiveButtonBackgroundImage.replace(' ', '%20') + ')'; else if (oButtonImg.bHover && 'sButtonBackgroundImageHover' in this.opt) sNewURL = 'url(' + this.opt.sButtonBackgroundImageHover.replace(' ', '%20') + ')'; else if ('sButtonBackgroundImage' in this.opt) sNewURL = 'url(' + this.opt.sButtonBackgroundImage.replace(' ', '%20') + ')'; Note there are much nicer ways this code be done but this is a rough idea of what fixes the problem. |





