aboutsummaryrefslogtreecommitdiff
path: root/js/shaarli.min.js
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-08-28 12:21:29 +0200
committerneodarz <neodarz@neodarz.net>2019-08-28 12:21:29 +0200
commite1e025823c6e868e59cde9ecc8fa495ee45de7bc (patch)
treeae3450c92daec3b99059a569510a24d6ab6753a6 /js/shaarli.min.js
parent03588331342e2a401ae4a8617f6225325d099fa7 (diff)
downloadshaarli_ascii-master.tar.xz
shaarli_ascii-master.zip
Update theme to current shaarli versionHEAD0.11master0.11
Diffstat (limited to '')
-rw-r--r--js/shaarli.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/js/shaarli.min.js b/js/shaarli.min.js
new file mode 100644
index 0000000..9f3b9ba
--- /dev/null
+++ b/js/shaarli.min.js
@@ -0,0 +1 @@
+(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=4)})([,,,,function(a,b,c){c(5),c(7),c(8),c(9),a.exports=c(10)},function(a,b,c){'use strict';function d(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function e(a,b,c){for(var d=function(b){return''!==c[b]&&-1!==a.getAttribute(b).indexOf(c[b])};a;){if(a.tagName.toLowerCase()===b&&Object.keys(c).find(d))return a;a=a.parentElement}return null}function f(){var a=new XMLHttpRequest;a.open('GET','?do=token'),a.onload=function(){var b=document.getElementById('token');b.setAttribute('value',a.responseText)},a.send()}function g(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],c=new s.default(s.default.$(a));c.filter=function(a,b){return s.default.FILTER_CONTAINS(a,b.match(/[^ ]*$/)[0])},c.replace=function(a){var b=c.input.value.match(/^.+ \s*|/)[0];c.input.value=''+b+a+' '},c.item=function(a,b){return s.default.ITEM(a,b.match(/[^ ]*$/)[0])};var d=/(\w+) /g,e=void 0;return c.data=function(a,b){for(;e=d.exec(b);)if(a===e[1])return'';return a},c.minChars=1,b.length&&(c.list=b),c}function h(a,b,c){if(0===c.length){var e=document.querySelectorAll(a);[].concat(d(e)).forEach(function(a){c.push(g(a,b))})}else c.map(function(a){return a.list=b,a});return c}function i(a){return a.replace(/[\u00A0-\u9999<>&]/gim,function(a){return'&#'+a.charCodeAt(0)+';'})}function j(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,e=!0;null==c&&(c=!1),[].concat(d(a)).forEach(function(a){a.getAttribute('data-continent')===b?(a.className='',!0===c&&!0==e&&(a.setAttribute('selected','selected'),e=!1)):a.className='hidden'})}function k(a,b){var c=a.parentNode;return null==c||c.classList.contains(b)?c:k(c,b)}function l(){[].concat(d(document.getElementById('shaarli-menu').querySelectorAll('.menu-transform'))).forEach(function(a){a.classList.toggle('pure-menu-horizontal')})}function m(a){a.classList.contains('open')?setTimeout(l,500):l(),a.classList.toggle('open'),document.getElementById('menu-toggle').classList.toggle('x')}function n(a){a.classList.contains('open')&&m(a)}function o(a,b,c){a.classList.contains('fa-chevron-up')?(a.title=document.getElementById('translation-expand').innerHTML,null!=b&&(b.style.display='none'),null!=c&&(c.style.display='none')):(a.title=document.getElementById('translation-fold').innerHTML,null!=b&&(b.style.display='block'),null!=c&&(c.style.display='block')),a.classList.toggle('fa-chevron-down'),a.classList.toggle('fa-chevron-up')}function p(a,b){a.className=a.className.replace(new RegExp('(?:^|\\s)'+b+'(?:\\s|$)'),' ')}function q(a){function b(){var b=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop;a.style.height='auto',a.style.height=a.scrollHeight+10+'px',window.scrollTo(0,b)}function c(){window.setTimeout(b,0)}var d=function(a,b,c){a.addEventListener(b,c,!1)};d(a,'change',b),d(a,'cut',c),d(a,'paste',c),d(a,'drop',c),d(a,'keydown',c),b()}var r=c(6),s=function(a){return a&&a.__esModule?a:{default:a}}(r);(function(){var a=document.getElementById('shaarli-menu'),b='onorientationchange'in window?'orientationchange':'resize',c=document.getElementById('menu-toggle');null!=c&&c.addEventListener('click',function(){return m(a)}),window.addEventListener(b,function(){return n(a)});var l=document.getElementsByClassName('fold-all'),r=document.getElementsByClassName('fold-button');[].concat(d(r)).forEach(function(a){var b=null,c=null,d=k(a,'linklist-item');null!=d&&(b=d.querySelector('.linklist-item-description'),c=d.querySelector('.linklist-item-thumbnail'),(null!=b||null!=c)&&(a.style.display='inline')),a.addEventListener('click',function(a){a.preventDefault(),o(a.target,b,c)})}),null!=l&&[].forEach.call(l,function(a){a.addEventListener('click',function(b){b.preventDefault();var c=-1===a.firstElementChild.getAttribute('class').indexOf('down')?'up':'down';[].forEach.call(r,function(a){if(!(a.firstElementChild.classList.contains('fa-chevron-up')&&'down'==c||a.firstElementChild.classList.contains('fa-chevron-down')&&'up'==c)){var b=null,d=null,e=k(a,'linklist-item');null!=e&&(b=e.querySelector('.linklist-item-description'),d=e.querySelector('.linklist-item-thumbnail'),(null!=b||null!=d)&&(a.style.display='inline')),o(a.firstElementChild,b,d)}}),a.firstElementChild.classList.toggle('fa-chevron-down'),a.firstElementChild.classList.toggle('fa-chevron-up'),a.title='down'==c?document.getElementById('translation-fold-all').innerHTML:document.getElementById('translation-expand-all').innerHTML})});var s=document.querySelectorAll('.confirm-delete');[].concat(d(s)).forEach(function(a){a.addEventListener('click',function(a){confirm(document.getElementById('translation-delete-link').innerHTML)||a.preventDefault()})});var t=document.querySelectorAll('.pure-alert-close');[].concat(d(t)).forEach(function(a){a.addEventListener('click',function(a){var b=k(a.target,'pure-alert-closable');b.style.display='none'})});var u=document.getElementById('new-version-dismiss'),v=document.querySelector('.new-version-message');null!=v&&null!=localStorage.getItem('newVersionDismiss')&&parseInt(localStorage.getItem('newVersionDismiss'),10)+604800000>new Date().getTime()&&(v.style.display='none'),null!=u&&u.addEventListener('click',function(){localStorage.setItem('newVersionDismiss',new Date().getTime().toString())});var w=document.getElementsByName('returnurl');null!=w&&(w.value=window.location.href);var x=document.querySelectorAll('.autofocus'),y=!1;[].forEach.call(x,function(a){''!==a.value||y||(a.focus(),y=!0)});var z=document.getElementsByClassName('subheader-opener');if(null!=z&&[].concat(d(z)).forEach(function(a){a.addEventListener('click',function(b){b.preventDefault();var c=a.getAttribute('data-open-id'),e=document.getElementById(c);null!=e&&([].concat(d(document.getElementsByClassName('subheader-form'))).forEach(function(a){a!==e&&p(a,'open')}),e.classList.toggle('open'))})}),''!==location.hash){var A=document.getElementById(location.hash.substr(1));if(null!=A){var B=A.clientHeight;window.scroll(0,window.scrollY-B),A.style.paddingTop='0'}}var C=document.getElementById('lf_description');null!=C&&(q(C),C.addEventListener('keydown',function(a){a.ctrlKey&&13===a.keyCode&&document.getElementById('button-save-edit').click()}));var D=document.querySelectorAll('.bookmarklet-link'),E=document.getElementById('bookmarklet-alert');[].forEach.call(D,function(a){a.addEventListener('click',function(a){a.preventDefault(),alert(E.value)})});var F=document.getElementById('continent'),G=document.getElementById('city');null!=F&&null!=G&&(F.addEventListener('change',function(){j(G,F.options[F.selectedIndex].value,!0)}),j(G,F.options[F.selectedIndex].value,!1));var H=document.querySelectorAll('.link-checkbox'),I=document.getElementById('actions');[].concat(d(H)).forEach(function(a){a.style.display='inline-block',a.addEventListener('change',function(){var a=document.querySelectorAll('.link-checkbox:checked'),b=[].concat(d(a)).length;0===b&&I.classList.contains('open')?I.classList.toggle('open'):0<b&&!I.classList.contains('open')&&I.classList.toggle('open')})});var J=document.getElementById('actions-delete'),K=document.getElementById('token');null!=J&&null!=K&&J.addEventListener('click',function(a){a.preventDefault();var b=[],c=document.querySelectorAll('.link-checkbox:checked');[].concat(d(c)).forEach(function(a){b.push({id:a.value,title:document.querySelector('.linklist-item[data-id="'+a.value+'"] .linklist-link').innerHTML})});var e='Are you sure you want to delete '+b.length+' links?\n';e+='This action is IRREVERSIBLE!\n\nTitles:\n';var f=[];b.forEach(function(a){e+=' - '+a.title+'\n',f.push(a.id)}),window.confirm(e)&&(window.location='?delete_link&lf_linkdate='+f.join('+')+'&token='+K.value)});var L=document.querySelectorAll('.actions-change-visibility');null!=L&&null!=K&&[].concat(d(L)).forEach(function(a){a.addEventListener('click',function(a){a.preventDefault();var b=a.target.getAttribute('data-visibility'),c=[],e=document.querySelectorAll('.link-checkbox:checked');[].concat(d(e)).forEach(function(a){c.push({id:a.value,title:document.querySelector('.linklist-item[data-id="'+a.value+'"] .linklist-link').innerHTML})});var f=c.map(function(a){return a.id});window.location='?change_visibility&token='+K.value+'&newVisibility='+b+'&ids='+f.join('+')})});var M=document.querySelectorAll('.select-all-button');[].concat(d(M)).forEach(function(a){a.addEventListener('click',function(b){b.preventDefault();var c=a.classList.contains('filter-off');[].concat(d(M)).forEach(function(a){a.classList.toggle('filter-off'),a.classList.toggle('filter-on')}),[].concat(d(H)).forEach(function(a){a.checked=c,a.dispatchEvent(new Event('change'))})})});var N=document.querySelector('input[name="taglist"]'),O=N?N.value.split(' '):[],P=[],Q=document.querySelectorAll('.rename-tag');[].concat(d(Q)).forEach(function(a){a.addEventListener('click',function(a){a.preventDefault();var b=e(a.target,'div',{class:'tag-list-item'}),c=b.querySelector('.rename-tag-form');c.style.display='none'===c.style.display||''===c.style.display?'block':'none',b.querySelector('input').focus()})});var R=document.querySelectorAll('.validate-rename-tag');[].concat(d(R)).forEach(function(a){a.addEventListener('click',function(a){a.preventDefault();var b=e(a.target,'div',{class:'tag-list-item'}),c=b.querySelector('.rename-tag-input'),d=c.value.replace('/"/g','\\"');if(''!==d.trim()){var g=document.getElementById('token').value,j=b.getAttribute('data-tag'),k=new XMLHttpRequest;k.open('POST','?do=changetag'),k.setRequestHeader('Content-Type','application/x-www-form-urlencoded'),k.onload=function(){200===k.status?(b.setAttribute('data-tag',d),c.setAttribute('name',d),c.setAttribute('value',d),e(c,'div',{class:'rename-tag-form'}).style.display='none',b.querySelector('a.tag-link').innerHTML=i(d),b.querySelector('a.tag-link').setAttribute('href','?searchtags='+encodeURIComponent(d)),b.querySelector('a.rename-tag').setAttribute('href','?do=changetag&fromtag='+encodeURIComponent(d)),O=O.map(function(a){return a===j?d:a}),P=h('.rename-tag-input',O,P)):(alert('An error occurred. Return code: '+k.status),location.reload())},k.send('renametag=1&fromtag='+encodeURIComponent(j)+'&totag='+encodeURIComponent(d)+'&token='+g),f()}})});var S=document.querySelectorAll('.rename-tag-input');[].concat(d(S)).forEach(function(a){a.addEventListener('keypress',function(a){13===a.keyCode&&e(a.target,'div',{class:'tag-list-item'}).querySelector('.validate-rename-tag').click()})});var T=document.querySelectorAll('.delete-tag');[].concat(d(T)).forEach(function(a){a.style.display='inline',a.addEventListener('click',function(a){a.preventDefault();var b=e(a.target,'div',{class:'tag-list-item'}),c=b.getAttribute('data-tag'),d=document.getElementById('token').value;if(confirm('Are you sure you want to delete the tag "'+c+'"?')){var g=new XMLHttpRequest;g.open('POST','?do=changetag'),g.setRequestHeader('Content-Type','application/x-www-form-urlencoded'),g.onload=function(){b.remove()},g.send(encodeURI('deletetag=1&fromtag='+c+'&token='+d)),f(),O=O.filter(function(a){return a!==c}),P=h('.rename-tag-input',O,P)}})});var U=document.querySelectorAll('input[data-multiple]');[].concat(d(U)).forEach(function(a){P.push(g(a))})})()},function(a){(function(){function b(a){var b=Array.isArray(a)?{label:a[0],value:a[1]}:'object'==typeof a&&'label'in a&&'value'in a?a:{label:a,value:a};this.label=b.label||b.value,this.value=b.value}function c(a,b,c){for(var d in b){var e=b[d],f=a.input.getAttribute('data-'+d.toLowerCase());a[d]='number'==typeof e?parseInt(f):!1===e?null!==f:e instanceof Function?null:f,a[d]||0===a[d]||(a[d]=d in c?c[d]:e)}}function d(a,b){return'string'==typeof a?(b||document).querySelector(a):a||null}function e(a,b){return h.call((b||document).querySelectorAll(a))}function f(){e('input.awesomplete').forEach(function(a){new g(a)})}var g=function(a,b){var e=this;g.count=(g.count||0)+1,this.count=g.count,this.isOpened=!1,this.input=d(a),this.input.setAttribute('autocomplete','off'),this.input.setAttribute('aria-owns','awesomplete_list_'+this.count),this.input.setAttribute('role','combobox'),this.options=b=b||{},c(this,{minChars:2,maxItems:10,autoFirst:!1,data:g.DATA,filter:g.FILTER_CONTAINS,sort:!1!==b.sort&&g.SORT_BYLENGTH,container:g.CONTAINER,item:g.ITEM,replace:g.REPLACE,tabSelect:!1},b),this.index=-1,this.container=this.container(a),this.ul=d.create('ul',{hidden:'hidden',role:'listbox',id:'awesomplete_list_'+this.count,inside:this.container}),this.status=d.create('span',{className:'visually-hidden',role:'status',"aria-live":'assertive',"aria-atomic":!0,inside:this.container,textContent:0==this.minChars?'Begin typing for results.':'Type '+this.minChars+' or more characters for results.'}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:'blur'}),keydown:function(a){var b=a.keyCode;e.opened&&(13===b&&e.selected?(a.preventDefault(),e.select()):9===b&&e.selected&&e.tabSelect?e.select():27===b?e.close({reason:'esc'}):(38===b||40===b)&&(a.preventDefault(),e[38===b?'previous':'next']()))}},form:{submit:this.close.bind(this,{reason:'submit'})},ul:{mousedown:function(a){a.preventDefault()},click:function(a){var b=a.target;if(b!==this){for(;b&&!/li/i.test(b.nodeName);)b=b.parentNode;b&&0===a.button&&(a.preventDefault(),e.select(b,a.target))}}}},d.bind(this.input,this._events.input),d.bind(this.input.form,this._events.form),d.bind(this.ul,this._events.ul),this.input.hasAttribute('list')?(this.list='#'+this.input.getAttribute('list'),this.input.removeAttribute('list')):this.list=this.input.getAttribute('data-list')||b.list||[],g.all.push(this)};g.prototype={set list(a){if(Array.isArray(a))this._list=a;else if('string'==typeof a&&-1<a.indexOf(','))this._list=a.split(/\s*,\s*/);else if(a=d(a),a&&a.children){var b=[];h.apply(a.children).forEach(function(a){if(!a.disabled){var c=a.textContent.trim(),d=a.value||c,e=a.label||c;''!==d&&b.push({label:e,value:d})}}),this._list=b}document.activeElement===this.input&&this.evaluate()},get selected(){return-1<this.index},get opened(){return this.isOpened},close:function(a){this.opened&&(this.ul.setAttribute('hidden',''),this.isOpened=!1,this.index=-1,this.status.setAttribute('hidden',''),d.fire(this.input,'awesomplete-close',a||{}))},open:function(){this.ul.removeAttribute('hidden'),this.isOpened=!0,this.status.removeAttribute('hidden'),this.autoFirst&&-1===this.index&&this.goto(0),d.fire(this.input,'awesomplete-open')},destroy:function(){if(d.unbind(this.input,this._events.input),d.unbind(this.input.form,this._events.form),!this.options.container){var a=this.container.parentNode;a.insertBefore(this.input,this.container),a.removeChild(this.container)}this.input.removeAttribute('autocomplete'),this.input.removeAttribute('aria-autocomplete');var b=g.all.indexOf(this);-1!==b&&g.all.splice(b,1)},next:function(){var a=this.ul.children.length;this.goto(this.index<a-1?this.index+1:a?0:-1)},previous:function(){var a=this.ul.children.length,b=this.index-1;this.goto(this.selected&&-1!=b?b:a-1)},goto:function(a){var b=this.ul.children;this.selected&&b[this.index].setAttribute('aria-selected','false'),this.index=a,-1<a&&0<b.length&&(b[a].setAttribute('aria-selected','true'),this.status.textContent=b[a].textContent+', list item '+(a+1)+' of '+b.length,this.input.setAttribute('aria-activedescendant',this.ul.id+'_item_'+this.index),this.ul.scrollTop=b[a].offsetTop-this.ul.clientHeight+b[a].clientHeight,d.fire(this.input,'awesomplete-highlight',{text:this.suggestions[this.index]}))},select:function(a,b){if(a?this.index=d.siblingIndex(a):a=this.ul.children[this.index],a){var c=this.suggestions[this.index],e=d.fire(this.input,'awesomplete-select',{text:c,origin:b||a});e&&(this.replace(c),this.close({reason:'select'}),d.fire(this.input,'awesomplete-selectcomplete',{text:c}))}},evaluate:function(){var a=this,c=this.input.value;c.length>=this.minChars&&this._list&&0<this._list.length?(this.index=-1,this.ul.innerHTML='',this.suggestions=this._list.map(function(d){return new b(a.data(d,c))}).filter(function(b){return a.filter(b,c)}),!1!==this.sort&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(b,d){a.ul.appendChild(a.item(b,c,d))}),0===this.ul.children.length?(this.status.textContent='No results found',this.close({reason:'nomatches'})):(this.open(),this.status.textContent=this.ul.children.length+' results found')):(this.close({reason:'nomatches'}),this.status.textContent='No results found')}},g.all=[],g.FILTER_CONTAINS=function(a,b){return RegExp(d.regExpEscape(b.trim()),'i').test(a)},g.FILTER_STARTSWITH=function(a,b){return RegExp('^'+d.regExpEscape(b.trim()),'i').test(a)},g.SORT_BYLENGTH=function(c,a){return c.length===a.length?c<a?-1:1:c.length-a.length},g.CONTAINER=function(a){return d.create('div',{className:'awesomplete',around:a})},g.ITEM=function(a,b,c){var e=''===b.trim()?a:a.replace(RegExp(d.regExpEscape(b.trim()),'gi'),'<mark>$&</mark>');return d.create('li',{innerHTML:e,"aria-selected":'false',id:'awesomplete_list_'+this.count+'_item_'+c})},g.REPLACE=function(a){this.input.value=a.value},g.DATA=function(a){return a},Object.defineProperty(b.prototype=Object.create(String.prototype),'length',{get:function(){return this.label.length}}),b.prototype.toString=b.prototype.valueOf=function(){return''+this.label};var h=Array.prototype.slice;return d.create=function(a,b){var c=document.createElement(a);for(var e in b){var f=b[e];if('inside'==e)d(f).appendChild(c);else if('around'==e){var g=d(f);g.parentNode.insertBefore(c,g),c.appendChild(g),null!=g.getAttribute('autofocus')&&g.focus()}else e in c?c[e]=f:c.setAttribute(e,f)}return c},d.bind=function(a,b){if(a)for(var c in b){var d=b[c];c.split(/\s+/).forEach(function(b){a.addEventListener(b,d)})}},d.unbind=function(a,b){if(a)for(var c in b){var d=b[c];c.split(/\s+/).forEach(function(b){a.removeEventListener(b,d)})}},d.fire=function(a,b,c){var d=document.createEvent('HTMLEvents');for(var e in d.initEvent(b,!0,!0),c)d[e]=c[e];return a.dispatchEvent(d)},d.regExpEscape=function(a){return a.replace(/[-\\^$*+?.()|[\]{}]/g,'\\$&')},d.siblingIndex=function(a){for(var b=0;a=a.previousElementSibling;b++);return b},'undefined'!=typeof self&&(self.Awesomplete=g),'undefined'!=typeof Document&&('loading'===document.readyState?document.addEventListener('DOMContentLoaded',f):f()),g.$=d,g.$$=e,'object'==typeof a&&a.exports&&(a.exports=g),g})()},function(){},function(a){a.exports='tpl/default/img/../img/apple-touch-icon.png'},function(a){a.exports='tpl/default/img/../img/favicon.png'},function(a){a.exports='tpl/default/img/../img/sad_star.png'}]); \ No newline at end of file