@ -1,21 +1,10 @@
/ * *
/ * *
* searx is free software : you can redistribute it and / or modify
* @ license
* it under the terms of the GNU Affero General Public License as published by
* ( C ) Copyright Contributors to the SearXNG project .
* the Free Software Foundation , either version 3 of the License , or
* ( C ) Copyright Contributors to the searx project ( 2014 - 2021 ) .
* ( at your option ) any later version .
* SPDX - License - Identifier : AGPL - 3.0 - or - later
*
* /
* searx is distributed in the hope that it will be useful ,
window . searxng = ( function ( w , d ) {
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU Affero General Public License for more details .
*
* You should have received a copy of the GNU Affero General Public License
* along with searx . If not , see < http : //www.gnu.org/licenses/ >.
*
* ( C ) 2017 by Alexandre Flament , < alex @ al - f . net >
*
* /
window . searx = ( function ( w , d ) {
'use strict' ;
'use strict' ;
@ -45,9 +34,9 @@ window.searx = (function(w, d) {
}
}
}
}
var searx = window . searx || { } ;
var searx ng = window . searx ng || { } ;
searx . on = function ( obj , eventType , callback , useCapture ) {
searx ng . on = function ( obj , eventType , callback , useCapture ) {
useCapture = useCapture || false ;
useCapture = useCapture || false ;
if ( typeof obj !== 'string' ) {
if ( typeof obj !== 'string' ) {
// obj HTMLElement, HTMLDocument
// obj HTMLElement, HTMLDocument
@ -62,7 +51,7 @@ window.searx = (function(w, d) {
}
}
} ;
} ;
searx . ready = function ( callback ) {
searx ng . ready = function ( callback ) {
if ( document . readyState != 'loading' ) {
if ( document . readyState != 'loading' ) {
callback . call ( w ) ;
callback . call ( w ) ;
} else {
} else {
@ -70,7 +59,7 @@ window.searx = (function(w, d) {
}
}
} ;
} ;
searx . http = function ( method , url ) {
searx ng . http = function ( method , url ) {
var req = new XMLHttpRequest ( ) ,
var req = new XMLHttpRequest ( ) ,
resolve = function ( ) { } ,
resolve = function ( ) { } ,
reject = function ( ) { } ,
reject = function ( ) { } ,
@ -109,8 +98,8 @@ window.searx = (function(w, d) {
return promise ;
return promise ;
} ;
} ;
searx . loadStyle = function ( src ) {
searx ng . loadStyle = function ( src ) {
var path = searx . static _path + src ,
var path = searx ng . static _path + src ,
id = "style_" + src . replace ( '.' , '_' ) ,
id = "style_" + src . replace ( '.' , '_' ) ,
s = d . getElementById ( id ) ;
s = d . getElementById ( id ) ;
if ( s === null ) {
if ( s === null ) {
@ -123,8 +112,8 @@ window.searx = (function(w, d) {
}
}
} ;
} ;
searx . loadScript = function ( src , callback ) {
searx ng . loadScript = function ( src , callback ) {
var path = searx . static _path + src ,
var path = searx ng . static _path + src ,
id = "script_" + src . replace ( '.' , '_' ) ,
id = "script_" + src . replace ( '.' , '_' ) ,
s = d . getElementById ( id ) ;
s = d . getElementById ( id ) ;
if ( s === null ) {
if ( s === null ) {
@ -147,17 +136,17 @@ window.searx = (function(w, d) {
}
}
} ;
} ;
searx . insertBefore = function ( newNode , referenceNode ) {
searx ng . insertBefore = function ( newNode , referenceNode ) {
referenceNode . parentNode . insertBefore ( newNode , referenceNode ) ;
referenceNode . parentNode . insertBefore ( newNode , referenceNode ) ;
} ;
} ;
searx . insertAfter = function ( newNode , referenceNode ) {
searx ng . insertAfter = function ( newNode , referenceNode ) {
referenceNode . parentNode . insertAfter ( newNode , referenceNode . nextSibling ) ;
referenceNode . parentNode . insertAfter ( newNode , referenceNode . nextSibling ) ;
} ;
} ;
searx . on ( '.close' , 'click' , function ( ) {
searx ng . on ( '.close' , 'click' , function ( ) {
this . parentNode . classList . add ( 'invisible' ) ;
this . parentNode . classList . add ( 'invisible' ) ;
} ) ;
} ) ;
return searx ;
return searx ng ;
} ) ( window , document ) ;
} ) ( window , document ) ;