!function(n){var e={};function t(a){if(e[a])return e[a].exports;var l=e[a]={i:a,l:!1,exports:{}};return n[a].call(l.exports,l,l.exports,t),l.l=!0,l.exports}t.m=n,t.c=e,t.d=function(n,e,a){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:a})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var l in n)t.d(a,l,function(e){return n[e]}.bind(null,l));return a},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="/js/",t(t.s=612)}({612:function(n,e,t){"use strict";t.r(e);t(613),t(614),t(615),t(616);window.OCA.Comments=OCA.Comments},613:function(n,e){OCA.Comments||(OCA.Comments={})},614:function(n,e){function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}var a,l;a=Handlebars.template,(l=OCA.Comments.Templates=OCA.Comments.Templates||{}).comment=a({1:function(n,e,t,a,l){return" unread"},3:function(n,e,t,a,l){return" collapsed"},5:function(n,e,t,a,l){return" currentUser"},7:function(n,e,t,a,l){var s;return'data-username="'+n.escapeExpression("function"==typeof(s=null!=(s=t.actorId||(null!=e?e.actorId:e))?s:t.helperMissing)?s.call(null!=e?e:n.nullContext||{},{"name":"actorId","hash":{},"data":l}):s)+'"'},9:function(n,e,t,a,l){return'\t\t\t\n\t\t\t
\n'},11:function(n,e,t,a,l){return'\t\t\n'},"compiler":[7,">= 4.0.0"],"main":function(n,e,a,l,s){var i,o,r=null!=e?e:n.nullContext||{},c=a.helperMissing,m="function",u=n.escapeExpression;return'\n"},"useData":!0}),l.commentsmodifymenu=a({1:function(n,e,a,l,s){var i,o,r=null!=e?e:n.nullContext||{},c=a.helperMissing,m=n.escapeExpression;return'\t\t\n\t\t\t\n\t\t\n"},2:function(n,e,t,a,l){var s;return'\t\t\t\t\t\n'},4:function(n,e,t,a,l){return'\t\t\t\t\t\n'},"compiler":[7,">= 4.0.0"],"main":function(n,e,t,a,l){var s;return"\n"+(null!=(s=t.each.call(null!=e?e:n.nullContext||{},null!=e?e.items:e,{"name":"each","hash":{},"fn":n.program(1,l,0),"inverse":n.noop,"data":l}))?s:"")+"
\n"},"useData":!0}),l.edit_comment=a({1:function(n,e,t,a,l){var s;return'\t\t\t\n'},"compiler":[7,">= 4.0.0"],"main":function(n,e,a,l,s){var i,o,r=null!=e?e:n.nullContext||{},c=a.helperMissing,m="function",u=n.escapeExpression;return"<"+u(t(o=null!=(o=a.tag||(null!=e?e.tag:e))?o:c)===m?o.call(r,{"name":"tag","hash":{},"data":s}):o)+' class="newCommentRow comment" data-id="'+u(t(o=null!=(o=a.id||(null!=e?e.id:e))?o:c)===m?o.call(r,{"name":"id","hash":{},"data":s}):o)+'">\n\t\n\t\t
\n\t\t
'+u(t(o=null!=(o=a.actorDisplayName||(null!=e?e.actorDisplayName:e))?o:c)===m?o.call(r,{"name":"actorDisplayName","hash":{},"data":s}):o)+"
\n"+(null!=(i=a.if.call(r,null!=e?e.isEditMode:e,{"name":"if","hash":{},"fn":n.program(1,s,0),"inverse":n.noop,"data":s}))?i:"")+'\t
\n\t\n'+u(t(o=null!=(o=a.tag||(null!=e?e.tag:e))?o:c)===m?o.call(r,{"name":"tag","hash":{},"data":s}):o)+">\n"},"useData":!0}),l.filesplugin=a({"compiler":[7,">= 4.0.0"],"main":function(n,e,a,l,s){var i,o=null!=e?e:n.nullContext||{},r=a.helperMissing,c=n.escapeExpression;return'\n'},"useData":!0}),l.view=a({"compiler":[7,">= 4.0.0"],"main":function(n,e,a,l,s){var i,o=null!=e?e:n.nullContext||{},r=a.helperMissing,c=n.escapeExpression;return'\n\n\t
'+c("function"===t(i=null!=(i=a.emptyResultLabel||(null!=e?e.emptyResultLabel:e))?i:r)?i.call(o,{"name":"emptyResultLabel","hash":{},"data":s}):i)+'
\n\n\n'},"useData":!0})},615:function(e,a){_.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:function(e){return OCA.Comments.Templates.filesplugin({count:e,countMessage:n("comments","%n unread comment","%n unread comments",e),iconUrl:OC.imagePath("core","actions/comment")})},attach:function(e){var a=this;if(!(this.ignoreLists.indexOf(e.id)>=0)){var l=e._getWebdavProperties;e._getWebdavProperties=function(){var n=l.apply(this,arguments);return n.push(OC.Files.Client.PROPERTY_COMMENTS_UNREAD),n},e.filesClient.addFileInfoParser((function(n){var e={},t=n.propStat[0].properties[OC.Files.Client.PROPERTY_COMMENTS_UNREAD];return _.isUndefined(t)||""===t||(e.commentsUnread=parseInt(t,10)),e})),e.$el.addClass("has-comments");var s=e._createRow;e._createRow=function(n){var e=s.apply(this,arguments);return n.commentsUnread&&e.attr("data-comments-unread",n.commentsUnread),e},e.fileActions.registerAction({name:"Comment",displayName:function(e){if(e&&e.$file){var a=parseInt(e.$file.data("comments-unread"),10);if(a>=0)return n("comments","1 new comment","{unread} new comments",a,{unread:a})}return t("comments","Comment")},mime:"all",order:-140,iconClass:"icon-comment",permissions:OC.PERMISSION_READ,type:OCA.Files.FileActions.TYPE_INLINE,render:function(n,e,t){var l=t.$file.data("comments-unread");if(l){var s=$(a._formatCommentCount(l));return t.$file.find("a.name>span.fileactions").append(s),s}return""},actionHandler:function(n,e){e.$file.find(".action-comment").tooltip("hide"),OCA.Files.Sidebar.setActiveTab("comments"),OCA.Files.Sidebar.open("/"+n)}});var i=e.elementToFile;e.elementToFile=function(n){var e=i.apply(this,arguments),t=n.data("comments-unread");return t&&(e.commentsUnread=t),e}}}},OC.Plugins.register("OCA.Files.FileList",OCA.Comments.FilesPlugin)},616:function(n,e){OCA.Comments.ActivityTabViewPlugin={prepareModelForDisplay:function(n,e,t){if("comments"===n.get("app")&&"comments"===n.get("type")&&"ActivityTabView"===t&&(e.addClass("comment"),n.get("message")&&this._isLong(n.get("message")))){e.addClass("collapsed");var a=$("").addClass("message-overlay");e.find(".activitymessage").after(a),e.on("click",this._onClickCollapsedComment)}},_onClickCollapsedComment:function(n){var e=$(n.target);e.is(".comment")||(e=e.closest(".comment")),e.removeClass("collapsed")},_isLong:function(n){return n.length>250||(n.match(/\n/g)||[]).length>1}},OC.Plugins.register("OCA.Activity.RenderingPlugins",OCA.Comments.ActivityTabViewPlugin)}});
//# sourceMappingURL=comments.js.map