Advertisement
Guest User

TWF Shoutbox Erweiterung

a guest
May 5th, 2015
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const SHOUTBOX_HIDE_ENTRY_MODE = 0;
  2. const IGNORED_USERS = [
  3.   'Sarah'
  4. ];
  5.  
  6. function IsUserIgnored(e){for(var t=0;t<IGNORED_USERS.length;t++)if(IGNORED_USERS[t]==e)return!0;return!1}function initializeShoutboxAddon(){Shoutbox.prototype.insertEntries=function(e,t){t=!1;var n=$(this.shoutboxID+"Content");if(n){var s=e.keys();if(!(s.length>0))return;for(var i=0;i<s.length;i++){var r=s[i],o=e.get(r),a=IsUserIgnored(o.username);if(!(a&&0==SHOUTBOX_HIDE_ENTRY_MODE||$(this.shoutboxID+"Entry"+r))){var h=new Element("span").addClassName("light").update("["+o.time+"]"),l=new Element("p",{id:this.shoutboxID+"Entry"+r}).hide().insert(h);if(1==o.isDeletable){var E=new Element("img",{src:this.options.imgDeleteEntrySrc,alt:""}),u=new Element("a",{title:this.options.langDeleteEntry}).observe("click",function(e,t){confirm(this.options.langDeleteEntrySure)&&this.deleteEntry(e),t.stop()}.bind(this,r)).insert(E);l.insert(" ").insert(u)}if(l.insert(" "),0!=o.userID){var d=new Element("a",{href:"index.php?page=User&userID="+o.userID+SID_ARG_2ND}).insert(o.username);l.insert(d)}else l.insert(o.username);if(a&&1==SHOUTBOX_HIDE_ENTRY_MODE){var f=this.shoutboxID+"Entry"+r+"_showMessage",D=this.shoutboxID+"Entry"+r+"_hidden";l.insert(": ");var I=new Element("a",{id:f}).observe("click",function(e){$(this.shoutboxID+"Entry"+e+"_showMessage").hide(),$(this.shoutboxID+"Entry"+e+"_hidden").show()}.bind(this,r)).insert("[show message]");l.insert(I),l.insert('<span id="'+D+'" style="display:none">'+o.message+"</span>")}else l.insert(": "+o.message);n.insert("ASC"==this.options.entrySortOrder?{bottom:l}:{top:l});var c=$(this.shoutboxID+"Entry"+r);c&&(t?new Effect.Parallel([new Effect.BlindDown(c),new Effect.Appear(c)],{duration:.3}):c.show()),this.lastEntryID=r}}t?new PeriodicalExecuter(function(e){this.focusLastEntry(),e.stop()}.bind(this),.3):this.focusLastEntry()}}}setTimeout(initializeShoutboxAddon,5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement