diff --git a/CHANGELOG.md b/CHANGELOG.md index fc4ab48a..6baa572b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog * now requires PHP 5.4.0+ +* adds search * lots of code cleanup and refactorings * changes API * fixes some styles in IE10 @@ -8,6 +9,7 @@ * fixes preview bottom bar for small screen widths * use wide links in tree view * updates build process +* updates `lodash` to 3.8.0 (adds debounce) * updates h5bp styles to 5.1.0 * updates `normalize.css` to 3.0.3 * removes `Moment.js` diff --git a/src/_h5ai/client/css/inc/ext/search.less b/src/_h5ai/client/css/inc/ext/search.less new file mode 100644 index 00000000..d74b626d --- /dev/null +++ b/src/_h5ai/client/css/inc/ext/search.less @@ -0,0 +1,23 @@ +#search { + + input { + display: none; + border: none; + font-family: @font-family; + font-weight: lighter; + font-size: 16px; + color: @col-text; + background: transparent; + outline: 0; + width: 160px; + padding: 0 12px 0 4px; + line-height: 48px; + vertical-align: top; + } + + &.active { + input { + display: inline-block; + } + } +} diff --git a/src/_h5ai/client/images/ui/search.svg b/src/_h5ai/client/images/ui/search.svg new file mode 100644 index 00000000..d6d4c78b --- /dev/null +++ b/src/_h5ai/client/images/ui/search.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/_h5ai/client/js/inc/ext/l10n.js b/src/_h5ai/client/js/inc/ext/l10n.js index 663f2532..f727a861 100644 --- a/src/_h5ai/client/js/inc/ext/l10n.js +++ b/src/_h5ai/client/js/inc/ext/l10n.js @@ -128,7 +128,7 @@ modulejs.define('ext/l10n', ['_', '$', 'core/event', 'core/format', 'core/langs' initLangSelector(langs); } - event.sub('location.changed', function () { + event.sub('view.changed', function () { localize(langs, settings.lang, settings.useBrowserLang); }); diff --git a/src/_h5ai/client/js/inc/ext/preview-aud.js b/src/_h5ai/client/js/inc/ext/preview-aud.js index 359a6ada..eef81ba5 100644 --- a/src/_h5ai/client/js/inc/ext/preview-aud.js +++ b/src/_h5ai/client/js/inc/ext/preview-aud.js @@ -98,12 +98,7 @@ modulejs.define('ext/preview-audio', ['_', '$', 'core/event', 'core/format', 'co } } - function onLocationChanged(item) { - - _.each(item.content, initItem); - } - - function onLocationRefreshed(item, added) { + function onViewChanged(added) { _.each(added, initItem); } @@ -114,8 +109,7 @@ modulejs.define('ext/preview-audio', ['_', '$', 'core/event', 'core/format', 'co return; } - event.sub('location.changed', onLocationChanged); - event.sub('location.refreshed', onLocationRefreshed); + event.sub('view.changed', onViewChanged); } diff --git a/src/_h5ai/client/js/inc/ext/preview-img.js b/src/_h5ai/client/js/inc/ext/preview-img.js index a13cbbef..a07f91f4 100644 --- a/src/_h5ai/client/js/inc/ext/preview-img.js +++ b/src/_h5ai/client/js/inc/ext/preview-img.js @@ -135,12 +135,7 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/event', 'core/server', 'core } } - function onLocationChanged(item) { - - _.each(item.content, initItem); - } - - function onLocationRefreshed(item, added) { + function onViewChanged(added) { _.each(added, initItem); } @@ -151,8 +146,7 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/event', 'core/server', 'core return; } - event.sub('location.changed', onLocationChanged); - event.sub('location.refreshed', onLocationRefreshed); + event.sub('view.changed', onViewChanged); } diff --git a/src/_h5ai/client/js/inc/ext/preview-txt.js b/src/_h5ai/client/js/inc/ext/preview-txt.js index d3d58638..b59a85dd 100644 --- a/src/_h5ai/client/js/inc/ext/preview-txt.js +++ b/src/_h5ai/client/js/inc/ext/preview-txt.js @@ -114,12 +114,7 @@ modulejs.define('ext/preview-txt', ['_', '$', 'marked', 'prism', 'core/event', ' } } - function onLocationChanged(item) { - - _.each(item.content, initItem); - } - - function onLocationRefreshed(item, added) { + function onViewChanged(added) { _.each(added, initItem); } @@ -130,8 +125,7 @@ modulejs.define('ext/preview-txt', ['_', '$', 'marked', 'prism', 'core/event', ' return; } - event.sub('location.changed', onLocationChanged); - event.sub('location.refreshed', onLocationRefreshed); + event.sub('view.changed', onViewChanged); } diff --git a/src/_h5ai/client/js/inc/ext/preview-vid.js b/src/_h5ai/client/js/inc/ext/preview-vid.js index 0b4b759b..53ae8397 100644 --- a/src/_h5ai/client/js/inc/ext/preview-vid.js +++ b/src/_h5ai/client/js/inc/ext/preview-vid.js @@ -99,12 +99,7 @@ modulejs.define('ext/preview-vid', ['_', '$', 'core/event', 'core/settings', 'ex } } - function onLocationChanged(item) { - - _.each(item.content, initItem); - } - - function onLocationRefreshed(item, added) { + function onViewChanged(added) { _.each(added, initItem); } @@ -115,8 +110,7 @@ modulejs.define('ext/preview-vid', ['_', '$', 'core/event', 'core/settings', 'ex return; } - event.sub('location.changed', onLocationChanged); - event.sub('location.refreshed', onLocationRefreshed); + event.sub('view.changed', onViewChanged); } diff --git a/src/_h5ai/client/js/inc/ext/search.js b/src/_h5ai/client/js/inc/ext/search.js new file mode 100644 index 00000000..7475aa56 --- /dev/null +++ b/src/_h5ai/client/js/inc/ext/search.js @@ -0,0 +1,111 @@ +modulejs.define('ext/search', ['_', '$', 'core/event', 'core/location', 'core/resource', 'core/server', 'core/settings', 'model/item', 'view/view'], function (_, $, event, location, resource, server, allsettings, Item, view) { + + var settings = _.extend({ + enabled: false + }, allsettings.search); + var template = + ''; + var inputIsVisible = false; + var prevPattern = ''; + var $search; + var $input; + + + function search(pattern) { + + pattern = pattern || ''; + if (pattern === prevPattern) { + return; + } + prevPattern = pattern; + + if (!pattern) { + view.setLocation(); + return; + } + + server.request({ + action: 'get', + search: { + href: location.getAbsHref(), + pattern: pattern + } + }, function (response) { + + var items = _.map(response.search, function (e) { + + return Item.get(e); + }); + view.setItems('search', items); + }); + } + + function escapeRegExp(sequence) { + + return sequence.replace(/[\-\[\]{}()*+?.,\\$\^|#\s]/g, '\\$&'); + } + + function parseInput(sequence) { + + if (sequence.substr(0, 3) === 're:') { + return sequence.substr(3); + } + + return escapeRegExp(sequence); + + // sequence = $.map($.trim(sequence).split(/\s+/), function (part) { + + // return _.map(part.split(''), function (character) { + + // return escapeRegExp(character); + // }).join('.*?'); + // }).join('|'); + + // return sequence; + } + + function update() { + + if (inputIsVisible) { + $search.addClass('active'); + $input.focus(); + search(parseInput($input.val())); + } else { + search(); + $search.removeClass('active'); + } + } + + function toggle() { + + inputIsVisible = !inputIsVisible; + update(); + } + + function reset() { + + inputIsVisible = false; + $input.val(''); + update(); + } + + function init() { + + if (!settings.enabled) { + return; + } + + $search = $(template).appendTo('#toolbar'); + $input = $search.find('input'); + + $search.on('click', 'img', toggle); + $input.on('keyup', _.debounce(update, 500, {trailing: true})); + event.sub('location.changed', reset); + } + + + init(); +}); diff --git a/src/_h5ai/client/js/inc/ext/select.js b/src/_h5ai/client/js/inc/ext/select.js index 538bb7a7..10aaa2b4 100644 --- a/src/_h5ai/client/js/inc/ext/select.js +++ b/src/_h5ai/client/js/inc/ext/select.js @@ -160,15 +160,7 @@ modulejs.define('ext/select', ['_', '$', 'core/event', 'core/resource', 'core/se } } - function onLocationChanged(item) { - - if (settings.checkboxes) { - _.each(item.content, initItem); - } - publish(); - } - - function onLocationRefreshed(item, added, removed) { + function onViewChanged(added, removed) { var selectionChanged = false; @@ -194,8 +186,7 @@ modulejs.define('ext/select', ['_', '$', 'core/event', 'core/resource', 'core/se return; } - event.sub('location.changed', onLocationChanged); - event.sub('location.refreshed', onLocationRefreshed); + event.sub('view.changed', onViewChanged); if (settings.clickndrag) { $selectionRect.hide().appendTo('body'); diff --git a/src/_h5ai/client/js/inc/ext/sort.js b/src/_h5ai/client/js/inc/ext/sort.js index 78e2a2d7..b0facbd9 100644 --- a/src/_h5ai/client/js/inc/ext/sort.js +++ b/src/_h5ai/client/js/inc/ext/sort.js @@ -148,8 +148,7 @@ modulejs.define('ext/sort', ['_', '$', 'core/event', 'core/resource', 'core/sett ev.preventDefault(); }); - event.sub('location.changed', onContentChanged); - event.sub('location.refreshed', onContentChanged); + event.sub('view.changed', onContentChanged); } diff --git a/src/_h5ai/client/js/inc/ext/thumbnails.js b/src/_h5ai/client/js/inc/ext/thumbnails.js index 6cbd6897..14518f02 100644 --- a/src/_h5ai/client/js/inc/ext/thumbnails.js +++ b/src/_h5ai/client/js/inc/ext/thumbnails.js @@ -99,27 +99,21 @@ modulejs.define('ext/thumbnails', ['_', 'core/event', 'core/server', 'core/setti } } - function onLocationChanged(item) { + function onViewChanged(added) { setTimeout(function () { - handleItems(item.content); + handleItems(added); }, settings.delay); } - function onLocationRefreshed(item, added) { - - handleItems(added); - } - function init() { if (!settings.enabled) { return; } - event.sub('location.changed', onLocationChanged); - event.sub('location.refreshed', onLocationRefreshed); + event.sub('view.changed', onViewChanged); } diff --git a/src/_h5ai/client/js/inc/view/view.js b/src/_h5ai/client/js/inc/view/view.js index 03c1b11f..409db2d5 100644 --- a/src/_h5ai/client/js/inc/view/view.js +++ b/src/_h5ai/client/js/inc/view/view.js @@ -84,51 +84,77 @@ modulejs.define('view/view', ['_', '$', 'core/event', 'core/format', 'core/locat event.pub('item.mouseleave', item); } - function onLocationChanged(item) { + function setItems(context, items) { + + var removed = _.map($items.find('.item'), function (item) { + + return $(item).data('item'); + }); $items.find('.item').remove(); - if (item.parent && !settings.hideParentFolder) { - $items.append(createHtml(item.parent)); - } + _.each(items, function (e) { - _.each(item.content, function (e) { - - if (!(e.isFolder() && settings.hideFolders)) { - $items.append(createHtml(e)); - } + $items.append(createHtml(e)); }); - if (item.isEmpty()) { - $empty.show(); - } else { - $empty.hide(); - } - + $empty.hide(); content.$el.scrollLeft(0).scrollTop(0); + event.pub('view.changed', items, removed); } - function onLocationRefreshed(item, added, removed) { + function changeItems(context, add, remove) { - _.each(added, function (item) { + _.each(add, function (item) { - if (!(item.isFolder() && settings.hideFolders)) { - createHtml(item).hide().appendTo($items).fadeIn(400); - } + createHtml(item).hide().appendTo($items).fadeIn(400); }); - _.each(removed, function (item) { + _.each(remove, function (item) { item.$view.fadeOut(400, function () { item.$view.remove(); }); }); - if (item.isEmpty()) { - setTimeout(function () { $empty.show(); }, 400); - } else { - $empty.hide(); + $empty.hide(); + event.pub('view.changed', add, remove); + } + + function onLocationChanged(item) { + + if (!item) { + item = location.getItem(); } + + var items = []; + + if (item.parent && !settings.hideParentFolder) { + items.push(item.parent); + } + + _.each(item.content, function (item) { + + if (!(item.isFolder() && settings.hideFolders)) { + items.push(item); + } + }); + + setItems('location.changed', items); + } + + function onLocationRefreshed(item, added, removed) { + + var add = []; + + _.each(added, function (item) { + + if (!(item.isFolder() && settings.hideFolders)) { + add.push(item); + } + }); + + changeItems('location.refreshed', add, removed); } function init() { @@ -151,6 +177,9 @@ modulejs.define('view/view', ['_', '$', 'core/event', 'core/format', 'core/locat return { $el: $view, - $items: $items + $items: $items, + setItems: setItems, + changeItems: changeItems, + setLocation: onLocationChanged }; }); diff --git a/src/_h5ai/client/js/lib/lodash-custom-3.6.0.min.js b/src/_h5ai/client/js/lib/lodash-custom-3.6.0.min.js deleted file mode 100644 index 8d6d078c..00000000 --- a/src/_h5ai/client/js/lib/lodash-custom-3.6.0.min.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * lodash 3.6.0 (Custom Build) lodash.com/license | Underscore.js 1.8.2 underscorejs.org/LICENSE - * Build: `lodash exports="global" include="compact,contains,difference,each,extend,filter,indexOf,intersection,isFunction,isNumber,isString,keys,map,pluck,sortBy,values,without"` - */ -;(function(){function n(n,r,t){if(r!==r){n:{for(r=n.length,t+=-1;++te||!u||typeof t=="undefined"&&o){t=1;break n}if(tf(t,i,0)&&u.push(i);return u}function g(n,r){var t=[];return ht(n,function(n,e,u){r(n,e,u)&&t.push(n)}),t}function v(n,r,t){for(var u=-1,o=n.length,c=-1,f=[];++ue?ut(u+e,0):e;else if(e){if(e=0,u=r?r.length:e,typeof t!="number"||t!==t||u>at){u=tr,e=u(t);for(var o=0,c=r?r.length:0,f=e!==e,a=typeof e=="undefined";o>>1;r[o]t?ut(u+t,0):t||0,typeof n=="string"||!jt(n)&&J(n)?t>>1,it=nt?nt.BYTES_PER_ELEMENT:0,lt=Math.pow(2,53)-1,st={};st[br]=$r.Float32Array,st[dr]=$r.Float64Array,st[mr]=$r.Int8Array,st[jr]=$r.Int16Array,st[Ar]=$r.Int32Array,st[wr]=$r.Uint8Array,st[xr]=$r.Uint8ClampedArray,st[Er]=$r.Uint16Array,st[Or]=$r.Uint32Array;var pt={};pt[fr]=pt[ir]=pt[pr]={constructor:true,toLocaleString:true,toString:true,valueOf:true},pt[ar]=pt[gr]={constructor:true,toString:true,valueOf:true},pt[lr]=pt[sr]=pt[hr]={constructor:true,toString:true},pt[yr]={constructor:true},a(Mr,function(n){for(var r in pt)if(Yr.call(pt,r)){var t=pt[r]; -t[n]=Yr.call(t,n)}});var yt=u.support={};!function(n){var r=function(){this.x=1},t={0:1,length:1},e=[];r.prototype={valueOf:1,y:1};for(var u in new r)e.push(u);yt.argsTag=qr.call(arguments)==cr,yt.enumErrorProps=Kr.call(Lr,"message")||Kr.call(Lr,"name"),yt.enumPrototypes=Kr.call(r,"prototype"),yt.funcDecomp=/\bthis\b/.test(function(){return this}),yt.funcNames=typeof Function.name=="string",yt.nonEnumStrings=!Kr.call("x",0),yt.nonEnumShadows=!/valueOf/.test(e),yt.spliceObjects=(Xr.call(t,0,1),!t[0]),yt.unindexedChars="xx"!="x"[0]+Object("x")[0]; -try{yt.nonEnumArgs=!Kr.call(arguments,1)}catch(o){yt.nonEnumArgs=true}}(0,0);var ht=function(n,r){return function(t,e){var u=t?t.length:0;if(!$(u))return n(t,e);for(var o=r?u:-1,c=L(t);(r?o--:++ot||null==e)return e;var u=r[t-2],o=r[t-1],c=r[3];for(3(p?c(p,a):o(s,a,0))){for(t=e;--t;){var y=u[t];if(0>(y?c(y,a):o(r[t],a,0)))continue n}p&&p.push(a),s.push(a)}return s},u.keys=xt,u.keysIn=Q,u.map=Y,u.matches=er,u.pluck=function(n,r){return Y(n,x(r))},u.restParam=q,u.sortBy=function(n,r,e){if(null==n)return[];var u=-1,o=n.length,c=$(o)?Array(o):[];return e&&R(n,r,e)&&(r=null),r=M(r,e,3),ht(n,function(n,t,e){c[++u]={a:r(n,t,e),b:u,c:n} -}),E(c,t)},u.values=X,u.without=dt,u.collect=Y,u.each=mt,u.extend=wt,u.iteratee=nr,u.select=W,u.escapeRegExp=Z,u.identity=tr,u.includes=V,u.indexOf=D,u.isArguments=z,u.isArray=jt,u.isFunction=At,u.isNative=H,u.isNumber=function(n){return typeof n=="number"||e(n)&&qr.call(n)==pr},u.isObject=G,u.isString=J,u.isTypedArray=K,u.contains=V,u.include=V,u.VERSION="3.6.0",$r._=u}).call(this); \ No newline at end of file diff --git a/src/_h5ai/client/js/lib/lodash-custom-3.8.0.min.js b/src/_h5ai/client/js/lib/lodash-custom-3.8.0.min.js new file mode 100644 index 00000000..bb92da3f --- /dev/null +++ b/src/_h5ai/client/js/lib/lodash-custom-3.8.0.min.js @@ -0,0 +1,50 @@ +/** + * @license + * lodash 3.8.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * Build: `lodash exports="global" include="compact,contains,debounce,difference,each,extend,filter,indexOf,intersection,isFunction,isNumber,isString,keys,map,pluck,sortBy,values,without"` + */ +;(function(){function n(n,r,t){if(r!==r){n:{for(r=n.length,t+=-1;++te||!u||t===sn&&o){t=1;break n}if(tc(t,f,0)&&u.push(f);return u}function v(n,r){var t=[];return _r(n,function(n,e,u){r(n,e,u)&&t.push(n)}),t}function b(n,r,t){for(var e=-1,o=n.length,c=-1,a=[];++ea&&(a=-a>l?0:l+a),i=i===sn||i>l?l:+i||0,0>i&&(i+=l),l=a>i?0:i-a>>>0,a>>>=0,i=Array(l);++fe?jr(u+e,0):e;else if(e){if(e=0,u=r?r.length:e,typeof t!="number"||t!==t||u>Or){u=an,e=u(t);for(var o=0,c=r?r.length:0,a=e!==e,i=e===sn;o>>1;r[o]t?jr(u+t,0):t||0,typeof n=="string"||!Dr(n)&&nn(n)?t>>1,Er=yr?yr.BYTES_PER_ELEMENT:0,Sr=Math.pow(2,53)-1,Tr={};Tr[On]=Hn.Float32Array,Tr[En]=Hn.Float64Array,Tr[Sn]=Hn.Int8Array, +Tr[Tn]=Hn.Int16Array,Tr[kn]=Hn.Int32Array,Tr[In]=Hn.Uint8Array,Tr[Pn]=Hn.Uint8ClampedArray,Tr[_n]=Hn.Uint16Array,Tr[Mn]=Hn.Uint32Array;var kr={};kr[yn]=kr[vn]=kr[jn]={constructor:true,toLocaleString:true,toString:true,valueOf:true},kr[gn]=kr[An]={constructor:true,toString:true,valueOf:true},kr[bn]=kr[mn]=kr[dn]={constructor:true,toString:true},kr[wn]={constructor:true},f(Ln,function(n){for(var r in kr)if(rr.call(kr,r)){var t=kr[r];t[n]=rr.call(t,n)}});var Ir=o.support={};!function(n){function r(){this.x=n}var t=arguments,e={ +0:n,length:n},u=[];r.prototype={valueOf:n,y:n};for(var o in new r)u.push(o);Ir.argsTag=tr.call(t)==hn,Ir.enumErrorProps=lr.call(Qn,"message")||lr.call(Qn,"name"),Ir.enumPrototypes=lr.call(r,"prototype"),Ir.funcDecomp=/\bthis\b/.test(function(){return this}),Ir.funcNames=typeof Function.name=="string",Ir.nonEnumStrings=!lr.call("x",0),Ir.nonEnumShadows=!/valueOf/.test(u),Ir.spliceObjects=(pr.call(e,0,1),!e[0]),Ir.unindexedChars="xx"!="x"[0]+Object("x")[0];try{Ir.nonEnumArgs=!lr.call(t,1)}catch(c){ +Ir.nonEnumArgs=true}}(1,0);var Pr=gr||function(n,r){return null==r?n:p(r,$r(r),p(r,Vr(r),n))},_r=function(n,r){return function(t,e){var u=t?Ur(t):0;if(!L(u))return n(t,e);for(var o=r?u:-1,c=V(t);(r?o--:++ou?null:o,u=1);++e=t||t>r?(a&&clearTimeout(a),t=p,a=s=p=sn,t&&(h=Cr(),i=n.apply(l,c),s||a||(c=l=null))):s=setTimeout(e,t)}function u(){s&&clearTimeout(s),a=s=p=sn,(g||y!==r)&&(h=Cr(),i=n.apply(l,c),s||a||(c=l=null))}function o(){if(c=arguments,f=Cr(),l=this,p=g&&(s||!v),false===y)var t=v&&!s;else{a||v||(h=f);var o=y-(f-h),b=0>=o||o>y;b?(a&&(a=clearTimeout(a)),h=f,i=n.apply(l,c)):a||(a=setTimeout(u,o))}return b&&s?s=clearTimeout(s):s||r===y||(s=setTimeout(e,r)),t&&(b=true,i=n.apply(l,c)), +!b||s||a||(c=l=null),i}var c,a,i,f,l,s,p,h=0,y=false,g=true;if(typeof n!="function")throw new TypeError(pn);if(r=0>r?0:+r||0,true===t)var v=true,g=false;else X(t)&&(v=t.leading,y="maxWait"in t&&jr(+t.maxWait||0,r),g="trailing"in t?t.trailing:g);return o.cancel=function(){s&&clearTimeout(s),a&&clearTimeout(a),a=s=p=sn},o},o.difference=Nr,o.filter=G,o.forEach=Br,o.intersection=function(){for(var r=[],t=-1,e=arguments.length,u=[],o=F(),c=o==n,i=[];++te)return i;var c=r[0],l=-1,s=c?c.length:0,p=u[0];n:for(;++l(p?a(p,f):o(i,f,0))){for(t=e;--t;){var h=u[t];if(0>(h?a(h,f):o(r[t],f,0)))continue n}p&&p.push(f),i.push(f)}return i},o.keys=Vr,o.keysIn=tn,o.map=J,o.matches=fn,o.pluck=function(n,r){return J(n,ln(r))},o.property=ln,o.restParam=K,o.sortBy=function(n,r,t){if(null==n)return[];t&&C(n,r,t)&&(r=null);var u=-1;return r=M(r,t),n=d(n,function(n,t,e){return{a:r(n,t,e),b:++u,c:n}}),S(n,e)},o.values=en,o.without=Rr,o.collect=J, +o.each=Br,o.extend=Wr,o.iteratee=on,o.select=G,o.escapeRegExp=un,o.identity=an,o.includes=H,o.indexOf=q,o.isArguments=Q,o.isArray=Dr,o.isFunction=Lr,o.isNative=Z,o.isNumber=function(n){return typeof n=="number"||u(n)&&tr.call(n)==jn},o.isObject=X,o.isString=nn,o.isTypedArray=rn,o.last=z,o.now=Cr,o.contains=H,o.include=H,o.VERSION="3.8.0",Hn._=o}).call(this); \ No newline at end of file diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json index 284cb6ea..f694778a 100644 --- a/src/_h5ai/conf/options.json +++ b/src/_h5ai/conf/options.json @@ -261,6 +261,19 @@ Options "types": ["vid-avi", "vid-flv", "vid-mkv", "vid-mov", "vid-mp4", "vid-mpg", "vid-webm"] }, + /* + Allow searching files and folders. + Will check entries for right order of characters, i.e. + "ab" matches "ab", "axb", "xaxbx" but not "ba". + Space separated sequences get OR-ed. + + Searches will be treated as JavaScript regular expressions + if you prefix them with "re:". + */ + "search": { + "enabled": true + }, + /* Make entries selectable. At the moment only needed for packaged download. diff --git a/src/_h5ai/server/php/inc/core/class-util.php b/src/_h5ai/server/php/inc/core/class-util.php index a4216e36..98057c21 100644 --- a/src/_h5ai/server/php/inc/core/class-util.php +++ b/src/_h5ai/server/php/inc/core/class-util.php @@ -9,7 +9,7 @@ class Util { const ERR_DISABLED = "ERR_DISABLED"; const ERR_UNSUPPORTED = "ERR_UNSUPPORTED"; const NO_DEFAULT = "NO_*@+#?!_DEFAULT"; - const RE_DELIMITER = "|"; + const RE_DELIMITER = "@"; public static function normalize_path($path, $trailing_slash = false) {