All pastes #1592507 Raw Edit

add custom JS to StatusNet

public php v1 · immutable
#1592507 ·published 2009-10-04 14:44 UTC
rendered paste body
// This function can have any namefunction AddMyScript($action){    // $action->script('path') puts in a script link    // I recommend putting custom code in the local directory    // like this    $action->script(common_path('local/something.js'));    // Otherwise you can add the full path, even server    // $action->script('/full/path/to/script.js');    // return true means all is well    return true;}// This is how you hook the 'EndShowScripts' event to run// your custom function, 'AddMyScript'.Event::addHandler('EndShowScripts', 'AddMyScript');