diff --git a/core/src/OC/contactsmenu.js b/core/src/OC/contactsmenu.js index f5a6f782db0d4..61fe3b495060c 100644 --- a/core/src/OC/contactsmenu.js +++ b/core/src/OC/contactsmenu.js @@ -294,7 +294,7 @@ const ContactsMenuView = View.extend({ contentTemplate: function(data) { return this.templates.menu( _.extend({ - searchContactsText: t('core', 'Search contacts …') + searchContactsLabel: t('core', 'Search contacts'), }, data) ) }, diff --git a/core/src/OC/contactsmenu/menu.handlebars b/core/src/OC/contactsmenu/menu.handlebars index 7d7697e780caa..89135c23d3747 100644 --- a/core/src/OC/contactsmenu/menu.handlebars +++ b/core/src/OC/contactsmenu/menu.handlebars @@ -1,4 +1,4 @@ - - + +
diff --git a/core/src/views/ContactsMenu.vue b/core/src/views/ContactsMenu.vue index 5d0347855589b..03ea5a08e794d 100644 --- a/core/src/views/ContactsMenu.vue +++ b/core/src/views/ContactsMenu.vue @@ -71,7 +71,7 @@ export default { #contactsmenu-menu { /* show 2.5 to 4.5 entries depending on the screen height */ height: calc(100vh - 50px * 3); - max-height: calc(50px * 6 + 2px); + max-height: calc(50px * 6 + 2px + 26px); min-height: calc(50px * 3.5); width: 350px; @@ -85,6 +85,12 @@ export default { } } + label[for="contactsmenu-search"] { + font-weight: bold; + font-size: 19px; + margin-left: 22px; + } + #contactsmenu-search { width: calc(100% - 16px); margin: 8px; diff --git a/dist/core-login.js b/dist/core-login.js index db9e62dc51c3a..f53360c68580b 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 */ -!function(){var e,r,i,o={65358:function(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),a="/"===i.charAt(i.length-1),s=r.reduce((function(t,e){return t.concat(e.split("/"))}),[]),u=!o,l=s.reduce((function(t,e){return""===e?t:u?(u=!1,t+e):t+"/"+e}),"");return a?l+"/":l}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)},59329:function(e,r,i){"use strict";var o={};i.r(o),i.d(o,{exclude:function(){return Xt},extract:function(){return Kt},parse:function(){return Zt},parseUrl:function(){return Yt},pick:function(){return Jt},stringify:function(){return Gt},stringifyUrl:function(){return Wt}});var a=i(20144),s=i(69183),u=i(59050),l=i(19755),c=i.n(l),f=i(64024),d=i(25108),p={updatableNotification:null,getDefaultNotificationFunction:null,setDefault:function(t){this.getDefaultNotificationFunction=t},hide:function(t,e){u.default.isFunction(t)&&(e=t,t=void 0),t?(t.each((function(){c()(this)[0].toastify?c()(this)[0].toastify.hideToast():d.error("cannot hide toast because object is not set"),this===this.updatableNotification&&(this.updatableNotification=null)})),e&&e.call(),this.getDefaultNotificationFunction&&this.getDefaultNotificationFunction()):d.error("Missing argument $row in OC.Notification.hide() call, caller needs to be adjusted to only dismiss its own notification")},showHtml:function(t,e){(e=e||{}).isHTML=!0,e.timeout=e.timeout?e.timeout:f.Rl;var n=(0,f.PV)(t,e);return n.toastElement.toastify=n,c()(n.toastElement)},show:function(t,e){(e=e||{}).timeout=e.timeout?e.timeout:f.Rl;var n=(0,f.PV)(function(t){return t.toString().split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}(t),e);return n.toastElement.toastify=n,c()(n.toastElement)},showUpdate:function(t){return this.updatableNotification&&this.updatableNotification.hideToast(),this.updatableNotification=(0,f.PV)(t,{timeout:f.Rl}),this.updatableNotification.toastElement.toastify=this.updatableNotification,c()(this.updatableNotification.toastElement)},showTemporary:function(t,e){(e=e||{}).timeout=e.timeout||f.TN;var n=(0,f.PV)(t,e);return n.toastElement.toastify=n,c()(n.toastElement)},isHidden:function(){return!c()("#content").find(".toastify").length}},h=u.default.throttle((function(){p.showTemporary(t("core","Connection to server lost"))}),7e3,{trailing:!1}),m={enableDynamicSlideToggle:function(){},showAppSidebar:function(t){(t||c()("#app-sidebar")).removeClass("disappear").show(),c()("#app-content").trigger(new(c().Event)("appresized"))},hideAppSidebar:function(t){(t||c()("#app-sidebar")).hide().addClass("disappear"),c()("#app-content").trigger(new(c().Event)("appresized"))}},g=i(79753);function v(t,e,n){"post"!==t&&"delete"!==t||!jt.PasswordConfirmation.requiresPasswordConfirmation()?(n=n||{},c().ajax({type:t.toUpperCase(),url:(0,g.generateOcsUrl)("apps/provisioning_api/api/v1/config/apps")+e,data:n.data||{},success:n.success,error:n.error})):jt.PasswordConfirmation.requirePasswordConfirmation(_.bind(v,this,t,e,n))}var y=window.oc_appconfig||{},b={getValue:function(t,e,n,r){!function(t,e,n,r){(r=r||{}).data={defaultValue:n},v("get","/"+t+"/"+e,r)}(t,e,n,{success:r})},setValue:function(t,e,n){!function(t,e,n,r){(r=r||{}).data={value:n},v("post","/"+t+"/"+e,r)}(t,e,n)},getApps:function(t){!function(t){v("get","",t)}({success:t})},getKeys:function(t,e){!function(t,e){v("get","/"+t,e)}(t,{success:e})},deleteKey:function(t,e){!function(t,e,n){v("delete","/"+t+"/"+e,void 0)}(t,e)}},w=void 0!==window._oc_appswebroots&&window._oc_appswebroots,x=i(72316),A=i.n(x),C=i(76591),k=i(25108),P={create:"POST",update:"PROPPATCH",patch:"PROPPATCH",delete:"DELETE",read:"PROPFIND"};function E(t,e){if(u.default.isArray(t))return u.default.map(t,(function(t){return E(t,e)}));var n={href:t.href};return u.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 N(t){return t>=200&&t<=299}function O(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||(k.warn('No matching DAV property for property "'+n),i=n),(u.default.isBoolean(o)||u.default.isNumber(o))&&(o=""+o),r[i]=o}return r}(n.changed,e.davProperties),r).then((function(t){N(t.status)?u.default.isFunction(e.success)&&e.success(n.toJSON()):u.default.isFunction(e.error)&&e.error(t)}))}var T=A().noConflict();Object.assign(T,{davCall:function(t,e){var n=new C.dav.Client({baseUrl:t.url,xmlNamespaces:u.default.extend({"DAV:":"d","http://owncloud.org/ns":"oc"},t.xmlNamespaces||{})});n.resolveUrl=function(){return t.url};var r=u.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,u.default.values(e.davProperties)||[],e.depth,r).then((function(t){if(N(t.status)){if(u.default.isFunction(e.success)){var n=u.default.invert(e.davProperties),r=E(t.body,n);e.depth>0&&r.shift(),e.success(r)}}else u.default.isFunction(e.error)&&e.error(t)}))}(n,t,0,r):"PROPPATCH"===t.type?O(n,t,e,r):"MKCOL"===t.type?function(t,e,n,r){return t.request(e.type,e.url,r,null).then((function(i){N(i.status)?O(t,e,n,r):u.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(N(t.status)){if(u.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=u.default.invert(e.davProperties);e.success(E(t.body,o))}else e.success(t.body)}}else u.default.isFunction(e.error)&&e.error(t)}))}(n,t,e,r)},davSync:function(t){return function(e,n,r){var i={type:P[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=u.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 a=n.davProperties;!a&&n.model&&(a=n.model.prototype.davProperties),a&&(u.default.isFunction(a)?i.davProperties=a.call(n):i.davProperties=a),i.davProperties=u.default.extend(i.davProperties||{},r.davProperties),u.default.isUndefined(r.depth)&&(r.depth=o?1:0)}var s=r.error;r.error=function(t,e,n){r.textStatus=e,r.errorThrown=n,s&&s.call(r.context,t,e,n)};var l=r.xhr=t.davCall(u.default.extend(i,r),n);return n.trigger("request",n,l,r),l}}(T)});var S=T,L=i(65358),I=window._oc_config||{},R=i(25108),F=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);var e=this.get("fullName");this.get("avatar")&&e&&this.set("avatarLabel",t("core","Avatar of {fullName}",{fullName:e}))}}),U=x.Collection.extend({model:F}),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())}}),D=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:u.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(u.default.extend({couldNotLoadText:t("core","Could not load your contacts")},e))},contentTemplate:function(e){return this.templates.menu(u.default.extend({searchContactsText:t("core","Search contacts …")},e))},contactsTemplate:function(e){return this.templates.list(u.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:jt.generateUrl("/apps/contacts"),canInstallApp:jt.isUserAdmin(),contactsAppMgmtURL:jt.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}}),$=function(t){this.initialize(t)};$.prototype={$el:void 0,_view:void 0,_contactsPromise:void 0,initialize:function(t){this.$el=c()(t.el),this._view=new D({el:this.$el}),this._view.on("search",(function(t){this.loadContacts(t)}),this)},_getContacts:function(t){var e=jt.generateUrl("/contactsmenu/contacts");return Promise.resolve(c().ajax(e,{method:"POST",data:{filter:t}}))},loadContacts:function(e){var n=this;return n._contactsPromise||(n._contactsPromise=n._getContacts(e)),u.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 U(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))}};var z=$,q=document.getElementsByTagName("head")[0].getAttribute("data-user"),H=document.getElementsByTagName("head")[0].getAttribute("data-user-displayname"),V=void 0!==q&&q,K=i(96384),Z=i(59546),G=i(62520);function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}var W={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",W.OK_BUTTON,n,r)},info:function(t,e,n,r){this.message(t,e,"info",W.OK_BUTTON,n,r)},confirm:function(t,e,n,r){return this.message(t,e,"notice",W.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",W.YES_NO_BUTTONS,n,r,!0)},prompt:function(e,n,r,i,o,a){return c().when(this._getMessageTemplate()).then((function(s){var l="oc-dialog-"+W.dialogsCounter+"-content",f="#"+l,d=s.octemplate({dialog_name:l,title:n,message:e,type:"notice"}),p=c()("");p.attr("type",a?"password":"text").attr("id",l+"-input").attr("placeholder",o);var h=c()("