Don't extend the js/elgg view. This is frowned upon now.
When developing for 1.9 you should define your JS as an AMD module in a .js view (not .php) and use elgg_require_js to load it.
See the guide for more information: http://learn.elgg.org/en/1.x/guides/javascript.html
Also, you should register the vendor as an AMD module as well:
elgg_define_js("jquery.wookmark", array(
"src" => "/mod/pin_theme/vendors/js/jquery.wookmark.min.js",
));
Then in your JS you can just require it:
// views/default/js/pin_theme.js
define(function(require) {
var $ = require("jquery"); require("jquery.wookmark");
$(function() { /* doc ready behavior */ });
});
If you want to load your JS on every page, just do:
elgg_require_js('pin_theme');
Worked like a charm. Thanks for the guiding.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.