Przeglądaj źródła

[add][bugfix] display Edited on edited entries
[add][Refs #9] reaction style

B Thibault 8 lat temu
rodzic
commit
6ee3550b85
4 zmienionych plików z 6 dodań i 3 usunięć
  1. 1 0
      cli/resources.js
  2. 1 1
      cli/uiMessage.js
  3. 1 1
      srv/public/slack.min.js
  4. 3 1
      srv/public/style.css

+ 1 - 0
cli/resources.js

@@ -90,6 +90,7 @@ var R = {
             ,authorAvatar: "slackmsg-author-img"
             ,authorMessages: "slackmsg-author-messages"
             ,msg: "slackmsg-msg"
+            ,editedStatus: "edited"
             ,edited: "slackmsg-edited"
 
             ,authorGroup: "slackmsg-authorGroup"

+ 1 - 1
cli/uiMessage.js

@@ -134,7 +134,7 @@ var AbstractUiMessage = (function() {
             updateAttachments(_this, _this.channelId);
             updateReactions(_this, _this.channelId);
             if (_this.edited)
-                _this.dom.classList.add(R.klass.msg.edited);
+                _this.dom.classList.add(R.klass.msg.editedStatus);
             return _this;
         },
 

+ 1 - 1
srv/public/slack.min.js

@@ -76,7 +76,7 @@ if(c){var f=E.a.a[c.u],e="Message";"C"===b.id[0]?e="Channel message":"D"===b.id[
 function Na(a,b,c){var d=new XMLHttpRequest;d.open("POST","api/reaction?room="+a+"&msg="+b+"&reaction="+encodeURIComponent(c),!0);d.send(null)};function U(a,b,c,d){D.call(this,a,b,c,d)}U.prototype=Object.create(D.prototype);U.prototype.constructor=U;U.prototype.b=function(a,b){return!0===a.isMeMessage?new W(this.id,a,b):!0===a.isNotice?new X(this.id,a,b):new Y(this.id,a,b)};
 var Z={s:function(a){a.A=!0;return a},H:function(a){a.c&&a.c.parentElement&&(a.c.remove(),delete a.c);return a},D:function(a){a.c?a.A&&(a.A=!1,a.B()):a.N().B();return a.c},B:function(a){var b=E.a.a[a.u];a.c.h.innerHTML=I.P(a.h);a.c.R.innerHTML=K(a.text);a.c.O.textContent=b?b.name:a.username||"?";for(var b=document.createDocumentFragment(),c=0,d=a.l.length;c<d;c++){var f=a.l[c];f&&(f=db(f,c))&&b.appendChild(f)}a.c.l.textContent="";a.c.l.appendChild(b);b=a.b;c=document.createDocumentFragment();if(a.o)for(var e in a.o){var d=
 b,f=a.id,h=e,g=a.o[e],l=xa(h);if(l){for(var p=document.createElement("li"),k=document.createElement("a"),n=document.createElement("span"),q=document.createElement("span"),u=[],v=0,B=g.length;v<B;v++){var F=E.a.a[g[v]];F&&u.push(F.name)}u.sort();q.textContent=u.join(", ");n.appendChild(l);n.className="emoji-small";k.href="javascript:toggleReaction('"+d+"', '"+f+"', '"+h+"')";k.appendChild(n);k.appendChild(q);p.className="slackmsg-reaction-item";p.appendChild(k);d=p}else console.warn("Reaction id not found: "+
-h),d=null;d&&c.appendChild(d)}a.c.o.textContent="";a.c.o.appendChild(c);a.K&&a.c.classList.add("slackmsg-edited");return a},C:function(a){return a.c.cloneNode(!0)}};function W(a,b,c){x.call(this,b,c);this.b=a;this.c=Z.c;this.A=Z.A}W.prototype=Object.create(y.prototype);m=W.prototype;m.constructor=W;m.s=function(){return Z.s(this)};m.H=function(){return Z.H(this)};m.D=function(){return Z.D(this)};m.N=function(){this.c=bb(this);this.c.classList.add("slackmsg-me_message");return this};m.C=function(){return Z.C(this)};
+h),d=null;d&&c.appendChild(d)}a.c.o.textContent="";a.c.o.appendChild(c);a.K&&a.c.classList.add("edited");return a},C:function(a){return a.c.cloneNode(!0)}};function W(a,b,c){x.call(this,b,c);this.b=a;this.c=Z.c;this.A=Z.A}W.prototype=Object.create(y.prototype);m=W.prototype;m.constructor=W;m.s=function(){return Z.s(this)};m.H=function(){return Z.H(this)};m.D=function(){return Z.D(this)};m.N=function(){this.c=bb(this);this.c.classList.add("slackmsg-me_message");return this};m.C=function(){return Z.C(this)};
 m.B=function(){Z.B(this);return this};m.update=function(a,b){y.prototype.update.call(this,a,b);this.s()};function Y(a,b,c){x.call(this,b,c);this.b=a;this.c=Z.c;this.A=Z.A}Y.prototype=Object.create(x.prototype);m=Y.prototype;m.constructor=Y;m.s=function(){return Z.s(this)};m.H=function(){return Z.H(this)};m.D=function(){return Z.D(this)};m.N=function(){this.c=bb(this);return this};m.C=function(){return Z.C(this)};m.B=function(){Z.B(this);return this};
 m.update=function(a,b){x.prototype.update.call(this,a,b);this.s()};function X(a,b,c){x.call(this,b,c);this.b=a;this.c=Z.c;this.a=null;this.A=Z.A}X.prototype=Object.create(A.prototype);m=X.prototype;m.constructor=X;m.s=function(){return Z.s(this)};m.H=function(){this.a&&this.a.parentElement&&(this.a.remove(),delete this.a);this.c&&delete this.c;return this};m.D=function(){Z.D(this);return this.a};m.C=function(){return this.a.cloneNode(!0)};
 m.N=function(){this.c=bb(this);this.a=document.createElement("span");this.c.classList.add("slackmsg-notice");this.a.className="slackmsg-notice";this.a.textContent=I.V;return this};m.B=function(){Z.B(this);return this};m.update=function(a,b){A.prototype.update.call(this,a,b);this.s()};function ya(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0};

+ 3 - 1
srv/public/style.css

@@ -71,9 +71,11 @@ body { display: flex; margin: 0; padding: 0; font-family: Lato, sans-serif; heig
 .slackmsg-author-name { display: inline; font-weight: bold; }
 .slackmsg-msg { display: block; vertical-align: top; }
 .slackmsg-reactions:empty,.slackmsg-attachments:empty { display: none; }
-.slackmsg-reactions { padding: 0 0 0 40px; margin: 5px 0; }
+.slackmsg-reactions { padding: 0 0 0 24px; margin: 5px 0; list-style: none; }
 .slackmsg-attachments { padding: 0; }
 .slackmsg-content > .slackmsg-edited, .slackmsg-ts, .slackmsg-attachment-footer * { font-size: 0.75em; font-style: italic; }
+.slackmsg-item .slackmsg-edited { display: none; }
+.slackmsg-item.edited .slackmsg-edited { display: block; }
 
 .slackmsg-notice { background: rgba(255, 255, 0, 0.2); }
 .slackmsg-content .slackmsg-notice { display: inline; font-style: italic; margin-right: 15px; }