Posts

Showing posts with the label CustomEvent

Javascript Event Oriented Programming example on SPSocialFeed

SPSocialFeed is the sharepoint microblog, where you can post your thoughts and reply on yourself and other. We wanted to add some functionalities for every reply and post added, so i used the new  "MutationObserver" and "CustomEvent"  new API's in ES6 to create an event-full way to implement solution // batman is the man in-charge catching the bad guys in the night. // so now he catches the good events in the feed let batman = ( function (){ let config = { childList : true }; let batman = class batman{ constructor(){ this .v = "2.0.0" ; //register call to batCave fn. to _spBodyOnLoadFunctionNames, the SP onready _spBodyOnLoadFunctionNames.push( 'batman.batCave' ); } batCave(){ let feed = document.getElementById( 'ms-feedthreadsdiv' ); //childNodes can be any type of nodes, like text node. children is only HTML...