diff --git a/plugins/unl_theme/js/jquery.ui.autocomplete.html.js b/plugins/unl_theme/js/jquery.ui.autocomplete.html.js new file mode 100644 index 0000000000000000000000000000000000000000..0e77037a7c0f570d97cf1b492f409ef6e7bc9060 --- /dev/null +++ b/plugins/unl_theme/js/jquery.ui.autocomplete.html.js @@ -0,0 +1,52 @@ +/* + * jQuery UI Autocomplete HTML Extension + * + * Copyright 2010, Scott González (http://scottgonzalez.com) + * Dual licensed under the MIT or GPL Version 2 licenses. + * + * http://github.com/scottgonzalez/jquery-ui-extensions + */ +(function(factory) { + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } +}(function(jQuery) { +(function( $ ) { + + var proto = $.ui.autocomplete.prototype, + initSource = proto._initSource; + + function filter( array, term ) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + return $.grep( array, function(value) { + return matcher.test( $( "<div>" ).html( value.label || value.value || value ).text() ); + }); + } + + $.extend( proto, { + _initSource: function() { + if ( this.options.html && $.isArray(this.options.source) ) { + this.source = function( request, response ) { + response( filter( this.options.source, request.term ) ); + }; + } else { + initSource.call( this ); + } + }, + + _renderItem: function( ul, item) { + return $( "<li></li>" ) + .data( "item.autocomplete", item ) + .append( $( "<a></a>" )[ this.options.html ? "html" : "text" ]( item.label ) ) + .appendTo( ul ); + } + }); + +})( jQuery ); +})); \ No newline at end of file diff --git a/plugins/unl_theme/start.php b/plugins/unl_theme/start.php index 958a4887c91d97de7a1318687dc092e49a1b53ee..31308747815652541e1adaa7ab7b5a463ed7b6cf 100755 --- a/plugins/unl_theme/start.php +++ b/plugins/unl_theme/start.php @@ -62,10 +62,12 @@ function unl_theme_init() { _elgg_services()->amdConfig->removePath('languages/en'); _elgg_services()->amdConfig->addPath('languages/en', $base_url.'js/languages'); _elgg_services()->amdConfig->addPath('elgg/reportedcontent', $base_url.'mod/reportedcontent/views/default/elgg/reportedcontent'); + _elgg_services()->amdConfig->addPath('elgg/UserPicker', $base_url.'views/default/elgg/UserPicker'); _elgg_services()->amdConfig->addPath('unl_theme/js', $base_url.'mod/unl_theme/views/default/js/unl_theme/js'); _elgg_services()->amdConfig->addPath('unl_theme/jquery.imgareaselect', $base_url.'mod/unl_theme/js/jquery.imgareaselect'); _elgg_services()->amdConfig->addPath('bootstrap', $base_url.'mod/unl_theme/vendors/bower_components/bootstrap/dist/js/bootstrap'); _elgg_services()->amdConfig->addPath('moment', $base_url.'mod/unl_theme/vendors/bower_components/moment/moment'); + _elgg_services()->amdConfig->addPath('jquery.ui.autocomplete.html', $base_url.'mod/unl_theme/js/jquery.ui.autocomplete.html'); //Tell elgg not to load its own version of require elgg_unregister_js('require');