You are not logged in.
This is a little plugin that extends stm_javascript. You can use it to run JS on specific events or on all events in the admin interface (excluding “plugin”).
Offline
Excellent! Does this mean we could, for instance, add a date-picker to certain custom fields?
TXP Builders – finely-crafted code, design and txp
Offline
You most certainly can :).
Offline
It’s like a plugin for simpler plugins…
Offline
But how to use it? Where to write js code?
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Write your JS in Presentation>JS (stm_javascript) and save it as “default” to have it loaded on every admin page or save it as an event name to have it run on certain pages (see help for a list).
Offline
Jon-Michael, What’s the best way to include javascript libraries such as a jquery add-on (or series thereof)?
For the moment I ‘tricked it’ by closing the open tag, inserting my linked js-file and re-opening the tag:
</script> <link rel="stylesheet" media="screen" type="text/css" href="/js/theme/ui.all.css" /> <script src='/js/jquery-ui-personalized-1.5.3.js' type='text/javascript'></script> <script type="text/javascript">// Adds date-picker to custom-2$(document).ready(function(){ $("#custom-2").datepicker({ dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: '/js/theme/calendar.gif', buttonImageOnly: true }); });
Is there a better way?
Last edited by jakob (2009-02-18 22:53:00)
TXP Builders – finely-crafted code, design and txp
Offline
If you didn’t want HTML in there, you could paste the contents of the library into default, or use getScript:
$.getScript('/js/jquery-ui-personalized-1.5.3.js');
For the CSS, try:
$('head').append('<link .../>');
Offline
Thanks. I didn’t know about those two and that looks altogether neater.
TXP Builders – finely-crafted code, design and txp
Offline