1
2
3
|
/*! For license information please see comments-comments.js.LICENSE.txt */
(()=>{var e,o={4921:(e,n,t)=>{var o=t(19755);OCA.Comments.ActivityTabViewPlugin={prepareModelForDisplay(e,n,t){if("comments"===e.get("app")&&"comments"===e.get("type")&&"ActivityTabView"===t&&(n.addClass("comment"),e.get("message")&&this._isLong(e.get("message")))){n.addClass("collapsed");const e=o("<div>").addClass("message-overlay");n.find(".activitymessage").after(e),n.on("click",this._onClickCollapsedComment)}},_onClickCollapsedComment(e){let n=o(e.target);n.is(".comment")||(n=n.closest(".comment")),n.removeClass("collapsed")},_isLong:e=>e.length>250||(e.match(/\n/g)||[]).length>1},OC.Plugins.register("OCA.Activity.RenderingPlugins",OCA.Comments.ActivityTabViewPlugin)},75387:()=>{OCA.Comments||(OCA.Comments={})},52098:(e,n,t)=>{"use strict";t(75387),t(4543),t(57702),t(4921),window.OCA.Comments=OCA.Comments},57702:(e,o,s)=>{var i=s(64492),r=s(19755);i.extend(OC.Files.Client,{PROPERTY_COMMENTS_UNREAD:"{"+OC.Files.Client.NS_OWNCLOUD+"}comments-unread"}),OCA.Comments=i.extend({},OCA.Comments),OCA.Comments||(OCA.Comments={}),OCA.Comments.FilesPlugin={ignoreLists:["trashbin","files.public"],_formatCommentCount:e=>OCA.Comments.Templates.filesplugin({count:e,countMessage:n("comments","%n unread comment","%n unread comments",e),iconUrl:OC.imagePath("core","actions/comment")}),attach(e){const o=this;if(this.ignoreLists.indexOf(e.id)>=0)return;const s=e._getWebdavProperties;e._getWebdavProperties=function(){const e=s.apply(this,arguments);return e.push(OC.Files.Client.PROPERTY_COMMENTS_UNREAD),e},e.filesClient.addFileInfoParser((function(e){const n={},t=e.propStat[0].properties[OC.Files.Client.PROPERTY_COMMENTS_UNREAD];return i.isUndefined(t)||""===t||(n.commentsUnread=parseInt(t,10)),n})),e.$el.addClass("has-comments");const a=e._createRow;e._createRow=function(e){const n=a.apply(this,arguments);return e.commentsUnread&&n.attr("data-comments-unread",e.commentsUnread),n},e.fileActions.registerAction({name:"Comment",displayName(e){if(e&&e.$file){const t=parseInt(e.$file.data("comments-unread"),10);if(t>=0)return n("comments","1 new comment","{unread} new comments",t,{unread:t})}return t("comments","Comment")},mime:"all",order:-140,iconClass:"icon-comment",permissions:OC.PERMISSION_READ,type:OCA.Files.FileActions.TYPE_INLINE,render(e,n,t){const s=t.$file.data("comments-unread");if(s){const e=r(o._formatCommentCount(s));return t.$file.find("a.name>span.fileactions").append(e),e}return""},actionHandler(e,n){n.$file.find(".action-comment").tooltip("hide"),OCA.Files.Sidebar.setActiveTab("comments"),OCA.Files.Sidebar.open(n.dir+"/"+e)}});const l=e.elementToFile;e.elementToFile=function(e){const n=l.apply(this,arguments),t=e.data("comments-unread");return t&&(n.commentsUnread=t),n}}},OC.Plugins.register("OCA.Files.FileList",OCA.Comments.FilesPlugin)},4543:()=>{var e;e=Handlebars.template,(OCA.Comments.Templates=OCA.Comments.Templates||{}).filesplugin=e({compiler:[8,">= 4.3.0"],main:function(e,n,t,o,s){var i,r=null!=n?n:e.nullContext||{},a=e.hooks.helperMissing,l="function",m=e.escapeExpression,c=e.lookupProperty||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return'<a class="action action-comment permanent" title="'+m(typeof(i=null!=(i=c(t,"countMessage")||(null!=n?c(n,"countMessage"):n))?i:a)===l?i.call(r,{name:"countMessage",hash:{},data:s,loc:{start:{line:1,column:50},end:{line:1,column:66}}}):i)+'" href="#">\n\t<img class="svg" src="'+m(typeof(i=null!=(i=c(t,"iconUrl")||(null!=n?c(n,"iconUrl"):n))?i:a)===l?i.call(r,{name:"iconUrl",hash:{},data:s,loc:{start:{line:2,column:23},end:{line:2,column:34}}}):i)+'"/>\n</a>\n'},useData:!0})}},s={};function i(e){var n=s[e];if(void 0!==n)return n.exports;var t=s[e]={id:e,loaded:!1,exports:{}};return o[e].call(t.exports,t,t.exports,i),t.loaded=!0,t.exports}i.m=o,i.amdD=function(){throw new Error("define cannot be used indirect")},i.amdO={},e=[],i.O=(n,t,o,s)=>{if(!t){var r=1/0;for(c=0;c<e.length;c++){t=e[c][0],o=e[c][1],s=e[c][2];for(var a=!0,l=0;l<t.length;l++)(!1&s||r>=s)&&Object.keys(i.O).every((e=>i.O[e](t[l])))?t.splice(l--,1):(a=!1,s<r&&(r=s));if(a){e.splice(c--,1);var m=o();void 0!==m&&(n=m)}}return n}s=s||0;for(var c=e.length;c>0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[t,o,s]},i.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return i.d(n,{a:n}),n},i.d=(e,n)=>{for(var t in n)i.o(n,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=258,(()=>{var e={258:0};i.O.j=n=>0===e[n];var n=(n,t)=>{var o,s,r=t[0],a=t[1],l=t[2],m=0;if(r.some((n=>0!==e[n]))){for(o in a)i.o(a,o)&&(i.m[o]=a[o]);if(l)var c=l(i)}for(n&&n(t);m<r.length;m++)s=r[m],i.o(e,s)&&e[s]&&e[s][0](),e[r[m]]=0;return i.O(c)},t=self.webpackChunknextcloud=self.webpackChunknextcloud||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})();var r=i.O(void 0,[820],(()=>i(52098)));r=i.O(r)})();
//# sourceMappingURL=comments-comments.js.map?v=79e57196993f2bc9d535
|