Skip to content

Instantly share code, notes, and snippets.

@samogot
samogot / search.plugin.js
Last active May 25, 2017 13:36 — forked from megamit/search.plugin.js
Last Update: 1. correct loading messages up and down without extra scrolling. 2. handle end of messages list - stop if nothing was found and cycle retry from begining (end) if something was. 3. search in full message (links, bold, cursive, any other tags except code and mentions if it isn't selected). 4. cool scrolling handle. if message visible…
//META{"name":"searchPlugin"}*//
class searchPlugin{
constructor(){
this.cancelFlag = false;
this.css = "<style class='searchBarPlugin'>"+
"#searchBarInner{"+
"float:right; position:relative; height: 40px; bottom:40px;color:#FFF; padding: 0 4px; border-radius: 4px;"+
'}'+
'.buttonClose{'+
'background: transparent url(https://discordapp.com/assets/14f734d6803726c94b970c3ed80c0864.svg); background-size: cover; transition: opacity .1s easeout; opacity: .5; width:12px; height: 12px; padding: 0'+