diff --git a/core/src/OCA/index.js b/core/src/OCA/index.js index aefc85bdb72af..f49f0319a9cd8 100644 --- a/core/src/OCA/index.js +++ b/core/src/OCA/index.js @@ -20,16 +20,9 @@ * */ -import Search from './search.js' - /** * Namespace for apps * * @namespace OCA */ -export default { - /** - * @deprecated 20.0.0, will be removed in Nextcloud 22 - */ - Search, -} +export default { } diff --git a/core/src/OCA/search.js b/core/src/OCA/search.js deleted file mode 100644 index f0395c0bcd5c9..0000000000000 --- a/core/src/OCA/search.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @copyright 2020 Christoph Wurst - * - * @author Christoph Wurst - * - * @license AGPL-3.0-or-later - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * 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 this program. If not, see . - * - */ - -export default class Search { - - /** - * @deprecated 20.0.0, will be removed in Nextcloud 22 - */ - constructor() { - OC.debug && console.warn('OCA.Search is deprecated. Please use the unified search API instead') - } - -} diff --git a/dist/core-login.js b/dist/core-login.js index 362441efda268..ec291195bf73b 100644 --- a/dist/core-login.js +++ b/dist/core-login.js @@ -1,3 +1,3 @@ /*! For license information please see core-login.js.LICENSE.txt */ -(()=>{var e,r={65358:(t,e,n)=>{"use strict";function r(){for(var t=arguments.length,e=new Array(t),n=0;n0}));if(r.length<1)return"";var i=r[r.length-1],o="/"===r[0].charAt(0),s="/"===i.charAt(i.length-1),a=r.reduce((function(t,e){return t.concat(e.split("/"))}),[]),l=!o,c=a.reduce((function(t,e){return""===e?t:l?(l=!1,t+e):t+"/"+e}),"");return s?c+"/":c}e.Ec=function(t){return t?t.split("/").map(encodeURIComponent).join("/"):t},e.EZ=function(t){return t.replace(/\\/g,"/").replace(/.*\//,"")},e.XX=function(t){return t.replace(/\\/g,"/").replace(/\/[^\/]*$/,"")},e.RQ=r,e.Mg=function(t,e){var n=(t||"").split("/").filter((function(t){return"."!==t})),i=(e||"").split("/").filter((function(t){return"."!==t}));return(t=r.apply(void 0,n))===(e=r.apply(void 0,i))},n(21249),n(74916),n(23123),n(15306),n(57327),n(85827),n(92222)},99711:(e,r,i)=>{"use strict";var o={};i.r(o),i.d(o,{exclude:()=>oe,extract:()=>Qt,parse:()=>te,parseUrl:()=>ne,pick:()=>ie,stringify:()=>ee,stringifyUrl:()=>re});var s=i(20144),a=i(69183),l=i(59050),c=i(19755),u=i.n(c),d=i(3255),f=i(25108);const h={updatableNotification:null,getDefaultNotificationFunction:null,setDefault(t){this.getDefaultNotificationFunction=t},hide(t,e){l.default.isFunction(t)&&(e=t,t=void 0),t?(t.each((function(){u()(this)[0].toastify?u()(this)[0].toastify.hideToast():f.error("cannot hide toast because object is not set"),this===this.updatableNotification&&(this.updatableNotification=null)})),e&&e.call(),this.getDefaultNotificationFunction&&this.getDefaultNotificationFunction()):f.error("Missing argument $row in OC.Notification.hide() call, caller needs to be adjusted to only dismiss its own notification")},showHtml(t,e){(e=e||{}).isHTML=!0,e.timeout=e.timeout?e.timeout:d.Rl;const n=(0,d.PV)(t,e);return n.toastElement.toastify=n,u()(n.toastElement)},show(t,e){(e=e||{}).timeout=e.timeout?e.timeout:d.Rl;const n=(0,d.PV)(function(t){return t.toString().split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}(t),e);return n.toastElement.toastify=n,u()(n.toastElement)},showUpdate(t){return this.updatableNotification&&this.updatableNotification.hideToast(),this.updatableNotification=(0,d.PV)(t,{timeout:d.Rl}),this.updatableNotification.toastElement.toastify=this.updatableNotification,u()(this.updatableNotification.toastElement)},showTemporary(t,e){(e=e||{}).timeout=e.timeout||d.TN;const n=(0,d.PV)(t,e);return n.toastElement.toastify=n,u()(n.toastElement)},isHidden:()=>!u()("#content").find(".toastify").length},p=l.default.throttle((()=>{h.showTemporary(t("core","Connection to server lost"))}),7e3,{trailing:!1});let m=!1;const g={enableDynamicSlideToggle(){m=!0},showAppSidebar:function(t){(t||u()("#app-sidebar")).removeClass("disappear").show(),u()("#app-content").trigger(new(u().Event)("appresized"))},hideAppSidebar:function(t){(t||u()("#app-sidebar")).hide().addClass("disappear"),u()("#app-content").trigger(new(u().Event)("appresized"))}};var v=i(79753);function y(t,e,n){"post"!==t&&"delete"!==t||!Lt.PasswordConfirmation.requiresPasswordConfirmation()?(n=n||{},u().ajax({type:t.toUpperCase(),url:(0,v.generateOcsUrl)("apps/provisioning_api/api/v1/config/apps")+e,data:n.data||{},success:n.success,error:n.error})):Lt.PasswordConfirmation.requirePasswordConfirmation(_.bind(y,this,t,e,n))}const b=window.oc_appconfig||{},w={getValue:function(t,e,n,r){!function(t,e,n,r){(r=r||{}).data={defaultValue:n},y("get","/"+t+"/"+e,r)}(t,e,n,{success:r})},setValue:function(t,e,n){!function(t,e,n,r){(r=r||{}).data={value:n},y("post","/"+t+"/"+e,r)}(t,e,n)},getApps:function(t){!function(t){y("get","",t)}({success:t})},getKeys:function(t,e){!function(t,e){y("get","/"+t,e)}(t,{success:e})},deleteKey:function(t,e){!function(t,e,n){y("delete","/"+t+"/"+e,void 0)}(t,e)}},A=void 0!==window._oc_appswebroots&&window._oc_appswebroots;var x=i(72316),C=i.n(x),k=i(76591),P=i(25108);const E={create:"POST",update:"PROPPATCH",patch:"PROPPATCH",delete:"DELETE",read:"PROPFIND"};function T(t,e){if(l.default.isArray(t))return l.default.map(t,(function(t){return T(t,e)}));var n={href:t.href};return l.default.each(t.propStat,(function(t){if("HTTP/1.1 200 OK"===t.status)for(var r in t.properties){var i=r;r in e&&(i=e[r]),n[i]=t.properties[r]}})),n.id||(n.id=j(n.href)),n}function j(t){var e=t.indexOf("?");e>0&&(t=t.substr(0,e));var n,r=t.split("/");do{n=r[r.length-1],r.pop()}while(!n&&r.length>0);return n}function O(t){return t>=200&&t<=299}function S(t,e,n,r){return t.propPatch(e.url,function(t,e){var n,r={};for(n in t){var i=e[n],o=t[n];i||(P.warn('No matching DAV property for property "'+n),i=n),(l.default.isBoolean(o)||l.default.isNumber(o))&&(o=""+o),r[i]=o}return r}(n.changed,e.davProperties),r).then((function(t){O(t.status)?l.default.isFunction(e.success)&&e.success(n.toJSON()):l.default.isFunction(e.error)&&e.error(t)}))}const N=C().noConflict();Object.assign(N,{davCall:(t,e)=>{var n=new k.dav.Client({baseUrl:t.url,xmlNamespaces:l.default.extend({"DAV:":"d","http://owncloud.org/ns":"oc"},t.xmlNamespaces||{})});n.resolveUrl=function(){return t.url};var r=l.default.extend({"X-Requested-With":"XMLHttpRequest",requesttoken:OC.requestToken},t.headers);return"PROPFIND"===t.type?function(t,e,n,r){return t.propFind(e.url,l.default.values(e.davProperties)||[],e.depth,r).then((function(t){if(O(t.status)){if(l.default.isFunction(e.success)){var n=l.default.invert(e.davProperties),r=T(t.body,n);e.depth>0&&r.shift(),e.success(r)}}else l.default.isFunction(e.error)&&e.error(t)}))}(n,t,0,r):"PROPPATCH"===t.type?S(n,t,e,r):"MKCOL"===t.type?function(t,e,n,r){return t.request(e.type,e.url,r,null).then((function(i){O(i.status)?S(t,e,n,r):l.default.isFunction(e.error)&&e.error(i)}))}(n,t,e,r):function(t,e,n,r){return r["Content-Type"]="application/json",t.request(e.type,e.url,r,e.data).then((function(t){if(O(t.status)){if(l.default.isFunction(e.success)){if("PUT"===e.type||"POST"===e.type||"MKCOL"===e.type){var r=t.body||n.toJSON(),i=t.xhr.getResponseHeader("Content-Location");return"POST"===e.type&&i&&(r.id=j(i)),void e.success(r)}if(207===t.status){var o=l.default.invert(e.davProperties);e.success(T(t.body,o))}else e.success(t.body)}}else l.default.isFunction(e.error)&&e.error(t)}))}(n,t,e,r)},davSync:(t=>(e,n,r)=>{var i={type:E[e]||e},o=n instanceof t.Collection;if("update"===e&&(n.hasInnerCollection?i.type="MKCOL":(n.usePUT||n.collection&&n.collection.usePUT)&&(i.type="PUT")),r.url||(i.url=l.default.result(n,"url")||function(){throw new Error('A "url" property or function must be specified')}()),null!=r.data||!n||"create"!==e&&"update"!==e&&"patch"!==e||(i.data=JSON.stringify(r.attrs||n.toJSON(r))),"PROPFIND"!==i.type&&(i.processData=!1),"PROPFIND"===i.type||"PROPPATCH"===i.type){var s=n.davProperties;!s&&n.model&&(s=n.model.prototype.davProperties),s&&(l.default.isFunction(s)?i.davProperties=s.call(n):i.davProperties=s),i.davProperties=l.default.extend(i.davProperties||{},r.davProperties),l.default.isUndefined(r.depth)&&(r.depth=o?1:0)}var a=r.error;r.error=function(t,e,n){r.textStatus=e,r.errorThrown=n,a&&a.call(r.context,t,e,n)};var c=r.xhr=t.davCall(l.default.extend(i,r),n);return n.trigger("request",n,c,r),c})(N)});const I=N;var L=i(65358);const F=window._oc_config||{};var R=i(25108);const U=x.Model.extend({defaults:{fullName:"",lastMessage:"",actions:[],hasOneAction:!1,hasTwoActions:!1,hasManyActions:!1},initialize:function(){0===this.get("actions").length?this.set("hasOneAction",!0):1===this.get("actions").length?(this.set("hasTwoActions",!0),this.set("secondAction",this.get("actions")[0])):this.set("hasManyActions",!0);const e=this.get("fullName");this.get("avatar")&&e&&this.set("avatarLabel",t("core","Avatar of {fullName}",{fullName:e}))}}),$=x.Collection.extend({model:U}),M=x.View.extend({_collection:void 0,_subViews:[],tagName:"ul",initialize:function(t){this._collection=t.collection},render:function(){var t=this;return t.$el.html(""),t._subViews=[],t._collection.forEach((function(e){var n=new B({model:e});n.render(),t.$el.append(n.$el),n.on("toggle:actionmenu",t._onChildActionMenuToggle,t),t._subViews.push(n)})),t},_onChildActionMenuToggle:function(t){this._subViews.forEach((function(e){e.trigger("parent:toggle:actionmenu",t)}))}}),B=x.View.extend({className:"contact",tagName:"li",_template:void 0,_model:void 0,_actionMenuShown:!1,events:{"click .icon-more":"_onToggleActionsMenu"},contactTemplate:i(10944),template:function(t){return this.contactTemplate(t)},initialize:function(t){this._model=t.model,this.on("parent:toggle:actionmenu",this._onOtherActionMenuOpened,this)},render:function(){return this.$el.html(this.template({contact:this._model.toJSON()})),this.delegateEvents(),this.$("div.avatar").imageplaceholder(this._model.get("fullName")),this},_onToggleActionsMenu:function(){this._actionMenuShown=!this._actionMenuShown,this._actionMenuShown?this.$(".menu").show():this.$(".menu").hide(),this.trigger("toggle:actionmenu",this.$el)},_onOtherActionMenuOpened:function(t){this.$el.is(t)||(this._actionMenuShown=!1,this.$(".menu").hide())}}),z=x.View.extend({_loadingTemplate:void 0,_errorTemplate:void 0,_contentTemplate:void 0,_contactsTemplate:void 0,_contacts:void 0,_searchTerm:"",events:{"input #contactsmenu-search":"_onSearch"},templates:{loading:i(95386),error:i(20421),menu:i(66115),list:i(34083)},_onSearch:l.default.debounce((function(t){var e=this.$("#contactsmenu-search").val();e!==this._searchTerm&&(this.trigger("search",this.$("#contactsmenu-search").val()),this._searchTerm=e)}),700),loadingTemplate:function(t){return this.templates.loading(t)},errorTemplate:function(e){return this.templates.error(l.default.extend({couldNotLoadText:t("core","Could not load your contacts")},e))},contentTemplate:function(e){return this.templates.menu(l.default.extend({searchContactsText:t("core","Search contacts …")},e))},contactsTemplate:function(e){return this.templates.list(l.default.extend({noContactsFoundText:t("core","No contacts found"),showAllContactsText:t("core","Show all contacts …"),contactsAppMgmtText:t("core","Install the Contacts app")},e))},initialize:function(t){this.options=t},showLoading:function(t){this.render(),this._contacts=void 0,this.$(".content").html(this.loadingTemplate({loadingText:t}))},showError:function(){this.render(),this._contacts=void 0,this.$(".content").html(this.errorTemplate())},showContacts:function(t,e){this._contacts=t.contacts,this.render({contacts:t.contacts});var n=new M({collection:t.contacts});n.render(),this.$(".content").html(this.contactsTemplate({contacts:t.contacts,searchTerm:e,contactsAppEnabled:t.contactsAppEnabled,contactsAppURL:Lt.generateUrl("/apps/contacts"),canInstallApp:Lt.isUserAdmin(),contactsAppMgmtURL:Lt.generateUrl("/settings/apps/social/contacts")})),this.$("#contactsmenu-contacts").html(n.$el)},render:function(t){var e=this.$("#contactsmenu-search").val();return this.$el.html(this.contentTemplate(t)),this.$("#contactsmenu-search").val(e),this.$("#contactsmenu-search").focus(),this}}),D=function(t){this.initialize(t)};D.prototype={$el:void 0,_view:void 0,_contactsPromise:void 0,initialize:function(t){this.$el=u()(t.el),this._view=new z({el:this.$el}),this._view.on("search",(function(t){this.loadContacts(t)}),this)},_getContacts:function(t){var e=Lt.generateUrl("/contactsmenu/contacts");return Promise.resolve(u().ajax(e,{method:"POST",data:{filter:t}}))},loadContacts:function(e){var n=this;return n._contactsPromise||(n._contactsPromise=n._getContacts(e)),l.default.isUndefined(e)||""===e?n._view.showLoading(t("core","Loading your contacts …")):n._view.showLoading(t("core","Looking for {term} …",{term:e})),n._contactsPromise.then((function(t){t.contacts=new $(t.contacts),n._view.showContacts(t,e)}),(function(t){n._view.showError(),R.error("There was an error loading your contacts",t)})).then((function(){delete n._contactsPromise})).catch(R.error.bind(this))}};const H=D,q=document.getElementsByTagName("head")[0].getAttribute("data-user"),Y=document.getElementsByTagName("head")[0].getAttribute("data-user-displayname"),V=void 0!==q&&q;var K=i(25108);const Z={Search:class{constructor(){OC.debug&&K.warn("OCA.Search is deprecated. Please use the unified search API instead")}}},G=t=>"click"===t.type||"keydown"===t.type&&"Enter"===t.key;var W=i(25108);const J={YES_NO_BUTTONS:70,OK_BUTTONS:71,FILEPICKER_TYPE_CHOOSE:1,FILEPICKER_TYPE_MOVE:2,FILEPICKER_TYPE_COPY:3,FILEPICKER_TYPE_COPY_MOVE:4,FILEPICKER_TYPE_CUSTOM:5,dialogsCounter:0,alert:function(t,e,n,r){this.message(t,e,"alert",J.OK_BUTTON,n,r)},info:function(t,e,n,r){this.message(t,e,"info",J.OK_BUTTON,n,r)},confirm:function(t,e,n,r){return this.message(t,e,"notice",J.YES_NO_BUTTONS,n,r)},confirmDestructive:function(t,e,n,r,i){return this.message(t,e,"none",n,r,void 0===i||i)},confirmHtml:function(t,e,n,r){return this.message(t,e,"notice",J.YES_NO_BUTTONS,n,r,!0)},prompt:function(e,n,r,i,o,s){return u().when(this._getMessageTemplate()).then((function(a){var c="oc-dialog-"+J.dialogsCounter+"-content",d="#"+c,f=a.octemplate({dialog_name:c,title:n,message:e,type:"notice"}),h=u()("");h.attr("type",s?"password":"text").attr("id",c+"-input").attr("placeholder",o);var p=u()("