# Forums | Mahara Community

Posts: 193

07 November 2012, 11:07 PM

Hi,

When using version 1.4 I added a javascript link that opened an accessibility toolbar at the top of the page - it was developed and hosted at Southampton University and was ideal as it was unobtrusive and only appeared if the user wanted it. Unfortunately after upgrading to 1.5 the link doesn't work - it now displays "bad link" at the start of the code - I've pasted the working orignial version below in quotes, though it might get stripped out.

Can anyone suggest a way to get this working again - ideally as a link on the resources menu as that's where our students expect to see it.

Thanks, Gordon.

Deleted user
Posts: 197

08 November 2012, 6:24 PM

Hi Gordon,

Do you mean that you had put this chunk of Javascript into one of the links and resources boxes which were expecting a plain url?

If yes, then this change is due to a fix for a security bug, as allowing javascript in those boxes is a risk (it can be combined with other as-yet-undiscovered security issues, rogue staff, etc) and the person who maintains the code on the server should be the one who gets to put potentially risky stuff in.

You could still put this chunk of javascript in the theme.

<div class="sidebar-content">
{if $sbdata} <ul id="linksresources"> {foreach from=$sbdata item=item}
<li><a href="{$item.link}">{$item.name}</a></li>
{/foreach}
</ul>
{/if}

</div>

So what you need to do, is change it to this:

<div class="sidebar-content">
{if $sbdata} <ul id="linksresources"> {literal} <li><a href="javascript:(function(){d=document;lf=d.createElement('script');lf.type='text/javascript';lf.id='ToolbarStarter';lf.text='var%20StudyBarNoSandbox=true';d.getElementsByTagName('head')[0].appendChild(lf);jf=d.createElement('script');jf.src='http://access.ecs.soton.ac.uk/ToolBar/channels/toolbar-stable/JTToolbar.user.js';jf.type='text/javascript';jf.id='ToolBar';d.getElementsByTagName('head')[0].appendChild(jf);})();">The Accessibility Link Text</a></li> {/literal} {foreach from=$sbdata item=item}
<li><a href="{$item.link}">{$item.name}</a></li>
{/foreach}
</ul>
{/if}

</div>

Once that's done, it should work. I just tested it and the toolbar appeared.

Thanks,
Melissa.

Posts: 193