diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js index 50a2b6f2c8a67..1ca9723c707ad 100644 --- a/core/src/OC/dialogs.js +++ b/core/src/OC/dialogs.js @@ -534,9 +534,8 @@ const Dialogs = { self.$filePicker.ocdialog({ closeOnEscape: true, - // max-width of 600 - width: 600, - height: 500, + width: '70vw', + height: '60vh', modal: modal, buttons: buttonlist, style: { diff --git a/core/src/jquery/css/jquery.ocdialog.scss b/core/src/jquery/css/jquery.ocdialog.scss index 1911dd29dc48a..a6e8b210ba953 100644 --- a/core/src/jquery/css/jquery.ocdialog.scss +++ b/core/src/jquery/css/jquery.ocdialog.scss @@ -83,7 +83,6 @@ body.theme--dark .oc-dialog-dim { .oc-dialog-content { width: 100%; - max-width: 550px; } .oc-dialog.password-confirmation { diff --git a/dist/core-login.js b/dist/core-login.js index edeb354ef108c..767b11a2461d7 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,o={38450:(e,o,i)=>{"use strict";var a=i(20144),s=i(78595),r=i(19755),l=i.n(r),c=i(79753),d=i(25108);const u={},p=[];var f=i(18181),h=i(64024),m=i(25108);const g={updatableNotification:null,getDefaultNotificationFunction:null,setDefault(t){this.getDefaultNotificationFunction=t},hide(t,e){f.ZP.isFunction(t)&&(e=t,t=void 0),t?(t.each((function(){l()(this)[0].toastify?l()(this)[0].toastify.hideToast():m.error("cannot hide toast because object is not set"),this===this.updatableNotification&&(this.updatableNotification=null)})),e&&e.call(),this.getDefaultNotificationFunction&&this.getDefaultNotificationFunction()):m.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:h.Rl;const n=(0,h.PV)(t,e);return n.toastElement.toastify=n,l()(n.toastElement)},show(t,e){(e=e||{}).timeout=e.timeout?e.timeout:h.Rl;const n=(0,h.PV)(function(t){return t.toString().split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}(t),e);return n.toastElement.toastify=n,l()(n.toastElement)},showUpdate(t){return this.updatableNotification&&this.updatableNotification.hideToast(),this.updatableNotification=(0,h.PV)(t,{timeout:h.Rl}),this.updatableNotification.toastElement.toastify=this.updatableNotification,l()(this.updatableNotification.toastElement)},showTemporary(t,e){(e=e||{}).timeout=e.timeout||h.TN;const n=(0,h.PV)(t,e);return n.toastElement.toastify=n,l()(n.toastElement)},isHidden:()=>!l()("#content").find(".toastify").length},v=f.ZP.throttle((()=>{g.showTemporary(t("core","Connection to server lost"))}),7e3,{trailing:!1});function w(t,e,n){"post"!==t&&"delete"!==t||!Et.PasswordConfirmation.requiresPasswordConfirmation()?(n=n||{},l().ajax({type:t.toUpperCase(),url:(0,c.generateOcsUrl)("apps/provisioning_api/api/v1/config/apps")+e,data:n.data||{},success:n.success,error:n.error})):Et.PasswordConfirmation.requirePasswordConfirmation(_.bind(w,this,t,e,n))}const y=window.oc_appconfig||{},b={getValue:function(t,e,n,o){!function(t,e,n,o){(o=o||{}).data={defaultValue:n},w("get","/"+t+"/"+e,o)}(t,e,n,{success:o})},setValue:function(t,e,n){!function(t,e,n,o){(o=o||{}).data={value:n},w("post","/"+t+"/"+e,o)}(t,e,n)},getApps:function(t){!function(t){w("get","",t)}({success:t})},getKeys:function(t,e){!function(t,e){w("get","/"+t,e)}(t,{success:e})},deleteKey:function(t,e){!function(t,e,n){w("delete","/"+t+"/"+e,void 0)}(t,e)}};var C=i(25108);const P=void 0!==window._oc_appswebroots&&window._oc_appswebroots;var A=i(72316),k=i.n(A),x=i(76591),T=i(25108);const O={create:"POST",update:"PROPPATCH",patch:"PROPPATCH",delete:"DELETE",read:"PROPFIND"};function E(t,e){if(f.ZP.isArray(t))return f.ZP.map(t,(function(t){return E(t,e)}));var n={href:t.href};return f.ZP.each(t.propStat,(function(t){if("HTTP/1.1 200 OK"===t.status)for(var o in t.properties){var i=o;o in e&&(i=e[o]),n[i]=t.properties[o]}})),n.id||(n.id=j(n.href)),n}function j(t){var e=t.indexOf("?");e>0&&(t=t.substr(0,e));var n,o=t.split("/");do{n=o[o.length-1],o.pop()}while(!n&&o.length>0);return n}function L(t){return t>=200&&t<=299}function S(t,e,n,o){return t.propPatch(e.url,function(t,e){var n,o={};for(n in t){var i=e[n],a=t[n];i||(T.warn('No matching DAV property for property "'+n),i=n),(f.ZP.isBoolean(a)||f.ZP.isNumber(a))&&(a=""+a),o[i]=a}return o}(n.changed,e.davProperties),o).then((function(t){L(t.status)?f.ZP.isFunction(e.success)&&e.success(n.toJSON()):f.ZP.isFunction(e.error)&&e.error(t)}))}const N=k().noConflict();Object.assign(N,{davCall:(t,e)=>{var n=new x.dav.Client({baseUrl:t.url,xmlNamespaces:f.ZP.extend({"DAV:":"d","http://owncloud.org/ns":"oc"},t.xmlNamespaces||{})});n.resolveUrl=function(){return t.url};var o=f.ZP.extend({"X-Requested-With":"XMLHttpRequest",requesttoken:OC.requestToken},t.headers);return"PROPFIND"===t.type?function(t,e,n,o){return t.propFind(e.url,f.ZP.values(e.davProperties)||[],e.depth,o).then((function(t){if(L(t.status)){if(f.ZP.isFunction(e.success)){var n=f.ZP.invert(e.davProperties),o=E(t.body,n);e.depth>0&&o.shift(),e.success(o)}}else f.ZP.isFunction(e.error)&&e.error(t)}))}(n,t,0,o):"PROPPATCH"===t.type?S(n,t,e,o):"MKCOL"===t.type?function(t,e,n,o){return t.request(e.type,e.url,o,null).then((function(i){L(i.status)?S(t,e,n,o):f.ZP.isFunction(e.error)&&e.error(i)}))}(n,t,e,o):function(t,e,n,o){return o["Content-Type"]="application/json",t.request(e.type,e.url,o,e.data).then((function(t){if(L(t.status)){if(f.ZP.isFunction(e.success)){if("PUT"===e.type||"POST"===e.type||"MKCOL"===e.type){var o=t.body||n.toJSON(),i=t.xhr.getResponseHeader("Content-Location");return"POST"===e.type&&i&&(o.id=j(i)),void e.success(o)}if(207===t.status){var a=f.ZP.invert(e.davProperties);e.success(E(t.body,a))}else e.success(t.body)}}else f.ZP.isFunction(e.error)&&e.error(t)}))}(n,t,e,o)},davSync:(t=>(e,n,o)=>{var i={type:O[e]||e},a=n instanceof t.Collection;if("update"===e&&(n.hasInnerCollection?i.type="MKCOL":(n.usePUT||n.collection&&n.collection.usePUT)&&(i.type="PUT")),o.url||(i.url=f.ZP.result(n,"url")||function(){throw new Error('A "url" property or function must be specified')}()),null!=o.data||!n||"create"!==e&&"update"!==e&&"patch"!==e||(i.data=JSON.stringify(o.attrs||n.toJSON(o))),"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&&(f.ZP.isFunction(s)?i.davProperties=s.call(n):i.davProperties=s),i.davProperties=f.ZP.extend(i.davProperties||{},o.davProperties),f.ZP.isUndefined(o.depth)&&(o.depth=a?1:0)}var r=o.error;o.error=function(t,e,n){o.textStatus=e,o.errorThrown=n,r&&r.call(o.context,t,e,n)};var l=o.xhr=t.davCall(f.ZP.extend(i,o),n);return n.trigger("request",n,l,o),l})(N)});const I=N;var U=i(65358);const $=window._oc_config||{};var F=i(25108);const R=A.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}))}}),M=A.Collection.extend({model:R}),B=A.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 z({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)}))}}),z=A.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())}}),D=A.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:f.ZP.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(f.ZP.extend({couldNotLoadText:t("core","Could not load your contacts")},e))},contentTemplate:function(e){return this.templates.menu(f.ZP.extend({searchContactsText:t("core","Search contacts …")},e))},contactsTemplate:function(e){return this.templates.list(f.ZP.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 B({collection:t.contacts});n.render(),this.$(".content").html(this.contactsTemplate({contacts:t.contacts,searchTerm:e,contactsAppEnabled:t.contactsAppEnabled,contactsAppURL:Et.generateUrl("/apps/contacts"),canInstallApp:Et.isUserAdmin(),contactsAppMgmtURL:Et.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}}),Z=function(t){this.initialize(t)};Z.prototype={$el:void 0,_view:void 0,_contactsPromise:void 0,initialize:function(t){this.$el=l()(t.el),this._view=new D({el:this.$el}),this._view.on("search",(function(t){this.loadContacts(t)}),this)},_getContacts:function(t){var e=Et.generateUrl("/contactsmenu/contacts");return Promise.resolve(l().ajax(e,{method:"POST",data:{filter:t}}))},loadContacts:function(e){var n=this;return n._contactsPromise||(n._contactsPromise=n._getContacts(e)),f.ZP.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 M(t.contacts),n._view.showContacts(t,e)}),(function(t){n._view.showError(),F.error("There was an error loading your contacts",t)})).then((function(){delete n._contactsPromise})).catch(F.error.bind(this))}};const H=Z,Y=document.getElementsByTagName("head")[0].getAttribute("data-user"),q=document.getElementsByTagName("head")[0].getAttribute("data-user-displayname"),K=void 0!==Y&&Y;var V=i(25108);const G={Search:class{constructor(){V.warn("OCA.Search is deprecated. Please use the unified search API instead")}}},W=t=>"click"===t.type||"keydown"===t.type&&"Enter"===t.key;var J=i(25108);const Q={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,o){this.message(t,e,"alert",Q.OK_BUTTON,n,o)},info:function(t,e,n,o){this.message(t,e,"info",Q.OK_BUTTON,n,o)},confirm:function(t,e,n,o){return this.message(t,e,"notice",Q.YES_NO_BUTTONS,n,o)},confirmDestructive:function(t,e,n,o,i){return this.message(t,e,"none",n,o,void 0===i||i)},confirmHtml:function(t,e,n,o){return this.message(t,e,"notice",Q.YES_NO_BUTTONS,n,o,!0)},prompt:function(e,n,o,i,a,s){return l().when(this._getMessageTemplate()).then((function(r){var c="oc-dialog-"+Q.dialogsCounter+"-content",d="#"+c,u=r.octemplate({dialog_name:c,title:n,message:e,type:"notice"}),p=l()("");p.attr("type",s?"password":"text").attr("id",c+"-input").attr("placeholder",a);var h=l()("