芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/public_html/cepali/message/amd/build/message_drawer_view_overview_section.min.js
define(["jquery","core/custom_interaction_events","core/notification","core/pending","core/pubsub","core/str","core/templates","core/user_date","core_message/message_repository","core_message/message_drawer_events","core_message/message_drawer_router","core_message/message_drawer_routes","core_message/message_drawer_lazy_load_list","core_message/message_drawer_view_conversation_constants"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o={TOGGLE:'[data-region="toggle"]',CONVERSATION:"[data-conversation-id]",BLOCKED_ICON_CONTAINER:'[data-region="contact-icon-blocked"]',LAST_MESSAGE:'[data-region="last-message"]',LAST_MESSAGE_DATE:'[data-region="last-message-date"]',MUTED_ICON_CONTAINER:'[data-region="muted-icon-container"]',UNREAD_COUNT:'[data-region="unread-count"]',SECTION_TOTAL_COUNT:'[data-region="section-total-count"]',SECTION_TOTAL_COUNT_CONTAINER:'[data-region="section-total-count-container"]',SECTION_UNREAD_COUNT:'[data-region="section-unread-count"]',PLACEHOLDER_CONTAINER:'[data-region="placeholder-container"]'},p={CONVERSATIONS_LIST:"core_message/message_drawer_conversations_list",CONVERSATIONS_LIST_ITEMS_PLACEHOLDER:"core_message/message_drawer_conversations_list_items_placeholder"},q=50,r={},s={},t=!1,u=!1,v=function(a){return m.getRoot(a).hasClass("show")},w=function(a){a.addClass("expanded")},x=function(a){a.removeClass("expanded")},y=function(a,b){var c=a.find(o.SECTION_TOTAL_COUNT_CONTAINER),d=c.find(o.SECTION_TOTAL_COUNT);d.text(b),c.removeClass("hidden"),f.get_string("totalconversations","core_message",b).done(function(a){c.attr("aria-label",a)});var e=b>20?20:b,h=Array.apply(null,Array(e)).map(function(){return!0});g.render(p.CONVERSATIONS_LIST_ITEMS_PLACEHOLDER,{placeholders:h}).then(function(b){var c=a.find(o.PLACEHOLDER_CONTAINER);c.html(b)})["catch"](function(){})},z=function(a,b){var c=a.find(o.SECTION_UNREAD_COUNT);c.text(b),f.get_string("unreadconversations","core_message",b).done(function(a){c.attr("aria-label",a)}),b>0&&c.removeClass("hidden")},A=function(b){var c=function(b){return Object.keys(b).reduce(function(d,e){return a.isArray(b[e])?d[e.toLowerCase()]=b[e].map(c):d[e.toLowerCase()]=b[e],d},{})},d=c(b);return d.messages=d.messages.map(function(a){return a.useridfrom=a.userfrom.id,a}),d},B=function(b,c){var d=b.map(function(b){var d=b.messages.length?b.messages[b.messages.length-1]:null,e={id:b.id,imageurl:b.imageurl,name:b.name,subname:b.subname,unreadcount:b.unreadcount,ismuted:b.ismuted,lastmessagedate:d?d.timecreated:null,sentfromcurrentuser:d?d.useridfrom==c:null,lastmessage:d?a(d.text).text()||d.text:null},f=null;return b.type==n.CONVERSATION_TYPES.SELF?f=b.members[0]:b.type==n.CONVERSATION_TYPES.PRIVATE&&(f=b.members.reduce(function(a,b){return a||b.id==c||(a=b),a},null)),null!==f&&(e.userid=f.id,e.showonlinestatus=f.showonlinestatus,e.isonline=f.isonline,e.isblocked=f.isblocked),b.type==n.CONVERSATION_TYPES.PUBLIC&&(e.lastsendername=b.members.reduce(function(a,b){return!a&&d&&b.id==d.useridfrom&&(a=b.fullname),a},null)),e});return d.forEach(function(a){(new Date).toDateString()==new Date(1e3*a.lastmessagedate).toDateString()&&(a.istoday=!0)}),g.render(p.CONVERSATIONS_LIST,{conversations:d})},C=function(a,b,d){var e=null,f=!0;if(a&&a.length){var g=a.filter(function(a){return a!=n.CONVERSATION_TYPES.SELF});f=a.length!=g.length,e=g[0]}return function(a,g){return i.getConversations(g,e,q+1,d,b,f).then(function(b){var c=b.conversations;return c.length>q?c=c.slice(0,-1):m.setLoadedAll(a,!0),d+=q,c.forEach(function(a){r[a.id]=a}),c})["catch"](c.exception)}},D=function(a){return a.find(o.SECTION_TOTAL_COUNT)},E=function(a){return a.find(o.SECTION_UNREAD_COUNT)},F=function(a){if(t){var b=D(a),c=parseInt(b.text());c+=1,b.text(c)}},G=function(a){if(t){var b=D(a),c=parseInt(b.text());c-=1,b.text(c)}},H=function(a){if(u){var b=E(a),c=parseInt(b.text());c-=1,b.text(c),c<1&&b.addClass("hidden")}},I=function(a,b){return a.find('[data-conversation-id="'+b+'"]')},J=function(a,b){return a.find('[data-user-id="'+b+'"]')},K=function(a){a.find(o.MUTED_ICON_CONTAINER).removeClass("hidden")},L=function(a){a.find(o.MUTED_ICON_CONTAINER).addClass("hidden")},M=function(a){a.find(o.BLOCKED_ICON_CONTAINER).removeClass("hidden")},N=function(a){a.find(o.BLOCKED_ICON_CONTAINER).addClass("hidden")},O=function(a,b,d){var e=a.find(o.CONVERSATION);if(!e.length){var f=m.getRoot(a);m.showContent(f),m.hideEmptyMessage(f)}return r[b.id]=b,B([b],d).then(function(b){var c=m.getContentContainer(a);return c.prepend(b)}).then(function(){return F(a)})["catch"](c.exception)},P=function(a,b){b.remove(),G(a);var c=a.find(o.CONVERSATION);if(!c.length){var d=m.getRoot(a);m.hideContent(d),m.showEmptyMessage(d)}},Q=function(a,b){var c=b.find(o.UNREAD_COUNT);c.text("0"),c.addClass("hidden"),H(a)},R=function(f,g,h,i,n,p){var q=m.getRoot(g),t=function(a){var b=parseInt(a.type,10);return!(i&&i.indexOf(b)<0||n&&!a.isFavourite||!n&&a.isFavourite)},u=g.find(o.TOGGLE);g.css("min-height",u.outerHeight()),g.on("show.bs.collapse",function(){w(g),m.show(q,h,function(a,b,d){return B(b,d).then(function(b){return a.append(b),b})["catch"](c.exception)})}),g.on("hidden.bs.collapse",function(){x(g)}),e.subscribe(j.CONTACT_BLOCKED,function(a){var b=J(g,a);b.length&&M(b)}),e.subscribe(j.CONTACT_UNBLOCKED,function(a){var b=J(g,a);b.length&&N(b)}),e.subscribe(j.CONVERSATION_SET_MUTED,function(a){var b=a.id,c=I(g,b);c.length&&K(c)}),e.subscribe(j.CONVERSATION_UNSET_MUTED,function(a){var b=a.id,c=I(g,b);c.length&&L(c)}),e.subscribe(j.CONVERSATION_NEW_LAST_MESSAGE,function(a){if(t(a)){var b=new d("core_message/message_drawer_view_overview_section:new"),e=a.loggedInUserId,f=a.id,h=I(g,f);if(a=A(a),h.length){var i=m.getContentContainer(g);B([a],e).then(function(b){s[f]&&a.messages[0].timeadded