Skip to content

Instantly share code, notes, and snippets.

@hashimotor
Created March 19, 2011 17:21
Show Gist options
  • Save hashimotor/877635 to your computer and use it in GitHub Desktop.
Save hashimotor/877635 to your computer and use it in GitHub Desktop.
Yammer Shirangana Button UI
function hasTsukkomi(messageid){
if(false){
return true;
} else {
return false;
}
}
var u=document.getElementsByClassName("yj-actions");
for(var i=0;i<u.length;i++){
if(hasTsukkomi(u[i].parentNode.parentNode.getAttribute('data-message-id'))) {
d=u[i].parentNode;
var p=document.createElement('p');
p.className="yj-liked-by yj-message-list-item-likes yj-component";
p.innerText='Fed by foo "Shirangana"';
d.appendChild(p);
}
var a=document.createElement('a');
a.href='javascript://';
a.title='hint that this message is none of mybusiness, but i think it is fun'
a.className='yj-shirangana message-action';
a.innerHTML='Shirangana';
var s=document.createElement('span');
s.className='yj-shiran-action-wrapper';
var l=document.createElement('li');
l.className=('yj-message-action-list-item');
l.innerText=" · ";
s.appendChild(a);
l.appendChild(s);
u[i].appendChild(l);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment