forked from Ponysearch/Ponysearch
Merge pull request #566 from dalf/simple-theme-smaller-build
[mod] simple theme: smaller build
This commit is contained in:
commit
ae49b5224c
6 changed files with 8 additions and 8226 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -16,10 +16,8 @@ module.exports = function(grunt) {
|
|||
tasks: [
|
||||
'eslint',
|
||||
'copy',
|
||||
'concat',
|
||||
'uglify',
|
||||
'less:development',
|
||||
'less:production',
|
||||
'less',
|
||||
'image',
|
||||
'svg2png',
|
||||
'svg2jinja'
|
||||
|
@ -81,21 +79,6 @@ module.exports = function(grunt) {
|
|||
]
|
||||
},
|
||||
},
|
||||
concat: {
|
||||
head_and_body: {
|
||||
options: {
|
||||
separator: ';'
|
||||
},
|
||||
files: {
|
||||
'js/searxng.head.js': ['src/js/head/*.js'],
|
||||
'js/searxng.js': [
|
||||
'src/js/main/*.js',
|
||||
'../__common__/js/*.js',
|
||||
'./node_modules/autocomplete-js/dist/autocomplete.js'
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
output: {
|
||||
|
@ -109,21 +92,16 @@ module.exports = function(grunt) {
|
|||
},
|
||||
dist: {
|
||||
files: {
|
||||
'js/searxng.head.min.js': ['js/searxng.head.js'],
|
||||
'js/searxng.min.js': ['js/searxng.js']
|
||||
'js/searxng.head.min.js': ['src/js/head/*.js'],
|
||||
'js/searxng.min.js': [
|
||||
'src/js/main/*.js',
|
||||
'../__common__/js/*.js',
|
||||
'./node_modules/autocomplete-js/dist/autocomplete.js'
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
less: {
|
||||
development: {
|
||||
options: {
|
||||
paths: ["less"],
|
||||
},
|
||||
files: {
|
||||
"css/searxng.css": "src/less/style.less",
|
||||
"css/searxng-rtl.css": "src/less/style-rtl.less"
|
||||
}
|
||||
},
|
||||
production: {
|
||||
options: {
|
||||
paths: ["less"],
|
||||
|
@ -288,7 +266,6 @@ module.exports = function(grunt) {
|
|||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-image');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-contrib-less');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
grunt.loadNpmTasks('grunt-stylelint');
|
||||
|
@ -300,10 +277,8 @@ module.exports = function(grunt) {
|
|||
'eslint',
|
||||
'stylelint',
|
||||
'copy',
|
||||
'concat',
|
||||
'uglify',
|
||||
'less:development',
|
||||
'less:production',
|
||||
'less',
|
||||
'image',
|
||||
'svg2png',
|
||||
'svg2jinja',
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* (C) Copyright Contributors to the SearXNG project.
|
||||
* (C) Copyright Contributors to the searx project (2014 - 2021).
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
/* global DocumentTouch:readonly */
|
||||
(function(w, d) {
|
||||
'use strict';
|
||||
|
||||
// add data- properties
|
||||
var script = d.currentScript || (function() {
|
||||
var scripts = d.getElementsByTagName('script');
|
||||
return scripts[scripts.length - 1];
|
||||
})();
|
||||
|
||||
// try to detect touch screen
|
||||
w.searxng = {
|
||||
touch: (("ontouchstart" in w) || w.DocumentTouch && document instanceof DocumentTouch) || false,
|
||||
method: script.getAttribute('data-method'),
|
||||
autocompleter: script.getAttribute('data-autocompleter') === 'true',
|
||||
search_on_category_select: script.getAttribute('data-search-on-category-select') === 'true',
|
||||
infinite_scroll: script.getAttribute('data-infinite-scroll') === 'true',
|
||||
hotkeys: script.getAttribute('data-hotkeys') === 'true',
|
||||
static_path: script.getAttribute('data-static-path'),
|
||||
translations: JSON.parse(script.getAttribute('data-translations')),
|
||||
theme : {
|
||||
// image that is displayed if load of <img src='...'> failed
|
||||
img_load_error: 'img/img_load_error.svg'
|
||||
}
|
||||
};
|
||||
|
||||
// update the css
|
||||
var hmtlElement = d.getElementsByTagName("html")[0];
|
||||
hmtlElement.classList.remove('no-js');
|
||||
hmtlElement.classList.add('js');
|
||||
if (w.searxng.touch) {
|
||||
hmtlElement.classList.add('touch');
|
||||
}
|
||||
})(window, document);
|
File diff suppressed because it is too large
Load diff
|
@ -2,7 +2,6 @@
|
|||
"devDependencies": {
|
||||
"eslint": "^8.0.1",
|
||||
"grunt": "~1.4.1",
|
||||
"grunt-contrib-concat": "~2.0.0",
|
||||
"grunt-contrib-copy": "^1.0.0",
|
||||
"grunt-contrib-cssmin": "^4.0.0",
|
||||
"grunt-contrib-jshint": "~3.1.1",
|
||||
|
|
Loading…
Reference in a new issue