declare function require ( arg ) ; import { Intent } from "./common" ; let redditLogo = chrome . extension . getURL ( "images/reddit-icon.png" ) ; let malLogo = chrome . extension . getURL ( "images/mal-icon.png" ) ; let kitsuLogo = chrome . extension . getURL ( "images/kitsu-icon.png" ) ; param { string } animeName returns export default function utilityBar ( animeName ) { let template = require ( "html-loader!../templates/utilityBar.html" ) ; let bar = $ ( template ) ; let reddit = bar . find ( "#nac__utility-bar__reddit" ) ; let mal = bar . find ( "#nac__utility-bar__mal" ) ; let kitsu = bar . find ( "#nac__utility-bar__kitsu" ) ; reddit . find ( "img" ) . attr ( "src" , redditLogo ) ; mal . find ( "img" ) . attr ( "src" , malLogo ) ; kitsu . find ( "img" ) . attr ( "src" , kitsuLogo ) ; reddit . on ( "click" , ( ) => { let episode = $ ( "#servers" ) . find ( ".episodes > li > a.active" ) . data ( "base" ) ; chrome . runtime . sendMessage ( { episode , intent : Intent . Reddit_Discussion , animeName , } ) ; } ) ; mal . on ( "click" , ( ) => { chrome . runtime . sendMessage ( { intent : Intent . Find_In_Mal , animeName , } ) ; } ) ; kitsu . on ( "click" , ( ) => { chrome . runtime . sendMessage ( { intent : Intent . Find_In_Kitsu , animeName , } ) ; } ) ; return bar ; }