Added Jets.js v0.14.1 (#56)

This commit is contained in:
nobody 2020-07-10 20:46:03 +02:00
parent ee16b75e52
commit ad5d9b45e5
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
5 changed files with 23 additions and 0 deletions

View File

@ -233,6 +233,7 @@ var mappings = {
'font-awesome/{version}/js/': resources.fontawesome5JS,
'jeditable.js/{version}/jquery.jeditable.min.js': resources.jeditableJS,
'jeditable.js/{version}/jeditable.min.js': resources.jeditableJS,
'jets/{version}/jets.': resources.jetsJS,
'jquery/{version}/jquery.': resources.jQuery,
'jquery/{version}/jquery.min.': resources.jQuery,
'jquery.devbridge-autocomplete/{version}/jquery.autocomplete.min.js': resources.jQueryAjaxAutoComplete,

View File

@ -314,6 +314,11 @@ var resources = {
'path': 'resources/jquery-jeditable/{version}/jquery.jeditable.min.jsm',
'type': 'application/javascript'
},
// Jets.js
'jetsJS': {
'path': 'resources/jets/{version}/jets.min.jsm',
'type': 'application/javascript'
},
// jQuery Ajax AutoComplete
'jQueryAjaxAutoComplete': {
'path': 'resources/jquery.devbridge-autocomplete/1.4.10/jquery.autocomplete.min.jsm',

View File

@ -383,6 +383,8 @@ helpers.setLastVersion = function (type, version) {
return '5.13.1';
} else if (type.includes('/hls.js/')) {
return '0.13.2';
} else if (type.includes('/jets/0.')) {
return '0.14.1';
} else if (type.includes('/jquery/1.')) {
if (helpers.compareVersion('1.7.1', requestVersion)) return '1.7.1'; // <= v1.7.1
else if (helpers.compareVersion('1.8.3', requestVersion)) return '1.8.3'; // > 1.7.1 to <= 1.8.3
@ -536,6 +538,7 @@ helpers.compareVersion = function (v1, v2) {
};
const ListOfFiles = {
'jets.min.jsm': 'Jets.js',
'materialize.min.jsm': 'Materialize (JS)',
'materialize.min.css': 'Materialize (CSS)',
'slick.min.jsm': 'slick (JS)',

View File

@ -30,6 +30,7 @@
<li>Implemented: Different styles for extension icons (<a href="https://codeberg.org/nobody/LocalCDN/issues/52">#52</a>)</li>
<li>Fixed: Bootstrap JS v4.4.1 (<a href="https://codeberg.org/nobody/LocalCDN/issues/54">#54</a>)</li>
<li>Implemented: Collapsible changelog for previous versions(reported by email)</li>
<li>Added: Jets.js v0.14.1 (<a href="https://codeberg.org/nobody/LocalCDN/issues/56">#56</a>)</li>
</ul>
<div class="topic-label">
Generate rule sets for uBlock or uMatrix

View File

@ -0,0 +1,13 @@
/*! Jets.js - v0.14.1 - 2018-06-22
* http://NeXTs.github.com/Jets.js/
* Copyright (c) 2015 Denis Lukov; Licensed MIT */
;(function(d,c){"undefined"!=typeof module?module.exports=c():"function"==typeof define&&"object"==typeof define.amd?define(c):d.Jets=c()})(this,function(){function d(c){if(!(this instanceof d))return new d(c);var a=this,b={searchSelector:"*AND",hideBy:"display:none",diacriticsMap:{}};a.options={};"columns addImportant searchSelector hideBy manualContentHandling callSearchManually searchInSpecificColumn diacriticsMap didSearch invert".split(" ").forEach(function(f){a.options[f]=c[f]||b[f]});if(1<this.options.searchSelector.length){var g=
a.options.searchSelector.trim();a.options.searchSelector=g.substr(0,1);a.options.searchSelectorMode=g.substr(1).toUpperCase()}a.content_tag=document.querySelectorAll(c.contentTag);if(!a.content_tag)throw Error("Error! Could not find contentTag element");a.content_param=c.contentTag;a.search_tag=document.querySelector(c.searchTag);if(!a.search_tag&&!a.options.callSearchManually)throw Error('Error! Provide one of search methods: searchTag or callSearchManually and call .search("phrase") manually');
var e=a.search_tag&&a.search_tag.value||"";a.search=function(b,c){e!=(e=a.options.callSearchManually&&"undefined"!=typeof b?b:a.search_tag?a.search_tag.value:"")&&(0,a._applyCSS(e,c),a.options.didSearch&&a.options.didSearch(e))};a._onSearch=function(b){if("keydown"==b.type)return setTimeout(a.search,0);a.search()};a.destroy=function(){a.options.callSearchManually||a._processEventListeners("remove");a._destroy()};a.options.callSearchManually||a._processEventListeners("add");a._addStyleTag();a._setJets();
a._applyCSS(e)}d.prototype={constructor:d,_processEventListeners:function(c){["input","keydown","change"].forEach(function(a){this.search_tag[c+"EventListener"](a,this._onSearch)}.bind(this))},_applyCSS:function(c,a){for(var b=this.options,g=this.replaceDiacritics(c.trim().toLowerCase().replace(/\s\s+/g," ")).replace(/\\/g,"\\\\"),e=b.searchSelectorMode?g.split(" ").filter(function(a,b,c){return c.indexOf(a)==b}):[g],f="AND"==b.searchSelectorMode,h=Array(e.length),d=0,k=e.length;d<k;d++)h[d]=(f?this.content_param+
">":"")+(b.invert?"":":not(")+"[data-jets"+("undefined"!=typeof a?"-col-"+a:"")+b.searchSelector+'="'+e[d]+'"]'+(b.invert?"":")");e=b.hideBy.split(";").filter(Boolean).map(function(a){return a+(b.addImportant?"!important":"")});f=(f?"":this.content_param+">")+h.join(f?",":"")+"{"+e.join(";")+"}";this.styleTag.innerHTML=g.length?f:""},_addStyleTag:function(){this.styleTag=document.createElement("style");document.head.appendChild(this.styleTag)},_getText:function(c){return c&&(c.textContent||c.innerText)||
""},_sanitize:function(c){return this.replaceDiacritics(c).trim().replace(/\s+/g," ").toLowerCase()},_getContentTags:function(c){return Array.prototype.slice.call(this.content_tag).reduce(function(a,b){return a.concat(Array.prototype.slice.call(b.querySelectorAll(c||":scope > *")))},[])},_handleSpecificColumns:function(c,a){var b=this;b.options.searchInSpecificColumn&&Array.prototype.slice.call(c.children).map(function(g,e){if(!b.options.columns||!b.options.columns.length||-1!=b.options.columns.indexOf(e))c[(a||
"remove")+"Attribute"]("data-jets-col-"+e,a&&b._sanitize(b._getText(g)))})},_setJets:function(c,a){for(var b=this,g=b._getContentTags(a?"":c),e,f=0,d;d=g[f];f++)if(!d.hasAttribute("data-jets")||a)e=this.options.manualContentHandling?this.options.manualContentHandling(d):b.options.columns&&b.options.columns.length?b.options.columns.map(function(a){return b._getText(d.children[a])}).join(" "):b._getText(d),d.setAttribute("data-jets",b._sanitize(e)),b._handleSpecificColumns(d,"set")},replaceDiacritics:function(c){var a=
this.options.diacriticsMap,b;for(b in a)if(a.hasOwnProperty(b))for(var d=0,e=a[b].length;d<e;d++)c=c.replace(new RegExp(a[b][d],"g"),b);return c},update:function(c){this._setJets(":scope > :not([data-jets])",c)},_destroy:function(){this.styleTag.parentNode&&document.head.removeChild(this.styleTag);for(var c=this._getContentTags(),a=0,b;b=c[a];a++)b.removeAttribute("data-jets"),this._handleSpecificColumns(b)}};(function(c,a){try{c.querySelector(":scope body")}catch(b){["querySelector","querySelectorAll"].forEach(function(b){var d=
a[b];a[b]=function(a){if(/(^|,)\s*:scope/.test(a)){var e=this.getAttribute("id");this.id="ID_"+Date.now();a=a.replace(/((^|,)\s*):scope/g,"$1#"+this.getAttribute("id"));a=c[b](a);this.id=e;return a}return d.call(this,a)}})}})(window.document,Element.prototype);return d});