1
0

comments-comments.js 4.0 KB

123
  1. /*! For license information please see comments-comments.js.LICENSE.txt */
  2. (()=>{var e={4921:()=>{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=$("<div>").addClass("message-overlay");n.find(".activitymessage").after(e),n.on("click",this._onClickCollapsedComment)}},_onClickCollapsedComment(e){let n=$(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={})},57702:()=>{_.extend(OC.Files.Client,{PROPERTY_COMMENTS_UNREAD:"{"+OC.Files.Client.NS_OWNCLOUD+"}comments-unread"}),OCA.Comments=_.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 s=this;if(this.ignoreLists.indexOf(e.id)>=0)return;const o=e._getWebdavProperties;e._getWebdavProperties=function(){const e=o.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 _.isUndefined(t)||""===t||(n.commentsUnread=parseInt(t,10)),n})),e.$el.addClass("has-comments");const i=e._createRow;e._createRow=function(e){const n=i.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 o=t.$file.data("comments-unread");if(o){const e=$(s._formatCommentCount(o));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 a=e.elementToFile;e.elementToFile=function(e){const n=a.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,s,o){var i,a=null!=n?n:e.nullContext||{},m=e.hooks.helperMissing,l="function",r=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="'+r(typeof(i=null!=(i=c(t,"countMessage")||(null!=n?c(n,"countMessage"):n))?i:m)===l?i.call(a,{name:"countMessage",hash:{},data:o,loc:{start:{line:1,column:50},end:{line:1,column:66}}}):i)+'" href="#">\n\t<img class="svg" src="'+r(typeof(i=null!=(i=c(t,"iconUrl")||(null!=n?c(n,"iconUrl"):n))?i:m)===l?i.call(a,{name:"iconUrl",hash:{},data:o,loc:{start:{line:2,column:23},end:{line:2,column:34}}}):i)+'"/>\n</a>\n'},useData:!0})}},s={};function o(n){var t=s[n];if(void 0!==t)return t.exports;var i=s[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return o.d(n,{a:n}),n},o.d=(e,n)=>{for(var t in n)o.o(n,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},o.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{"use strict";o(75387),o(4543),o(57702),o(4921),window.OCA.Comments=OCA.Comments})()})();
  3. //# sourceMappingURL=comments-comments.js.map?v=87df91093317509ee12b