Skip to content

Commit

Permalink
Merge pull request #18 from dgt41/aautocomplete
Browse files Browse the repository at this point in the history
jQuery autocomplete moved to vendor, fetched with grunt
  • Loading branch information
C-Lodder authored Sep 28, 2016
2 parents d61c874 + 8acf381 commit c781cfa
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/com_finder/views/search/tmpl/default_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
if ($this->params->get('show_autosuggest', 1))
{
JHtml::_('script', 'media/jui/js/jquery.autocomplete.min.js', false, false, false, false, true);
JHtml::_('script', 'media/vendor/autocomplete/js/jquery.autocomplete.min.js', false, false, false, false, true);

$script .= "
var suggest = jQuery('#q').autocomplete({
Expand Down
19 changes: 17 additions & 2 deletions dev/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = function(grunt) {
'../media/vendor/punycode/*',
'../media/vendor/codemirror/*',
'../media/vendor/combobox/*',
'../media/vendor/autocomplete/*',
],
expand: true,
options: {
Expand Down Expand Up @@ -68,6 +69,13 @@ module.exports = function(grunt) {
branch : 'master',
directory : 'assets/tmp/jcrop'
}
},
cloneAutojs: {
options: {
repository: 'https://github.com/devbridge/jQuery-Autocomplete',
branch : 'master',
directory : 'assets/tmp/autocomplete'
}
}
},

Expand Down Expand Up @@ -230,6 +238,13 @@ module.exports = function(grunt) {
dest: '../media/vendor/jcrop/js/',
filter: 'isFile'
},
{ // autocomplete
expand: true,
cwd: 'assets/tmp/autocomplete/dist',
src: ['jquery.autocomplete.min.js', 'jquery.autocomplete.js', 'license.txt'],
dest: '../media/vendor/autocomplete/js/',
filter: 'isFile'
},
{ //Font Awesome css files
expand: true,
cwd: 'assets/node_modules/font-awesome/css/',
Expand Down Expand Up @@ -362,7 +377,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-git');

Expand All @@ -373,10 +387,11 @@ module.exports = function(grunt) {
'gitclone:cloneCodemirror',
'gitclone:cloneCombobox',
'gitclone:cloneCropjs',
'gitclone:cloneAutojs',
'concat:someFiles',
'copy:fromSource',
'uglify:allJs',
'cssmin:allCss'
]
);
};
};
1 change: 1 addition & 0 deletions dev/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ possible commands:
- `grunt gitclone:cloneCodemirror`.....fetches latest codemirror to assets/tmp folder
- `grunt gitclone:cloneCombobox`.......fetches latest combobox to assets/tmp folder
- `grunt gitclone:cloneCropjs`.........fetches latest combobox to assets/tmp folder
- `grunt gitclone:cloneAutojs`.........fetches latest autocomplete to assets/tmp folder
- `grunt concat:someFiles`.............concatenates some codemirror files
- `grunt copy:fromSource`..............copy everything to media/vendor/*
- `grunt uglify:allJs`.................minifies various javascripts
Expand Down
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions media/vendor/autocomplete/js/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright 2012 DevBridge and other contributors
http://www.devbridge.com/projects/autocomplete/jquery/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion modules/mod_finder/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
*/
if ($params->get('show_autosuggest', 1))
{
JHtml::_('script', 'media/jui/js/jquery.autocomplete.min.js', false, false, false, false, true);
JHtml::_('script', 'media/vendor/autocomplete/js/jquery.autocomplete.min.js', false, false, false, false, true);

$script .= "
var suggest = jQuery('#mod-finder-searchword" . $module->id . "').autocomplete({
Expand Down

0 comments on commit c781cfa

Please sign in to comment.