I need to be able to add some javascript globally to the Admin section of my site, and i have been using the cp_css_js extension for this which has sort of worked. The thing is that it's super buggy ( running the js-code twice on some pages for instance, and don't get me started on the way you "add" the actual code ).
I have googled for the better part of this day for a nicer way to do this, without luck, but i feel there should be something like wordpress' enqueue_script
-function. The only way i have been sort of successful is creating my own plugin, and using the cp->load_package_js()
in my mcp.* file, but that only runs when i'm on the actual plugin-page, not globally across the Admin-area.
Does anybody know of a nice way to do this?
Thank you,
/Anders