{"version":3,"sources":["jkhub_bar.js"],"names":["init_bar","show_headline","duration","MS_PER_HEADLINE","headline","innerHTML","headlines","curHeadline","newsTimeout","_window","clearTimeout","setTimeout","next_headline","prev_headline","length","add_links","parent","children","depth","key","hasOwnProperty","child","prefix","text","barmenu","_document","createElement","appendChild","_typeof","title","href","setAttribute","_title","menu","className","span","links","Groups","Social","Angels of Fire","Dark Jedi Empire","-[DE]-","EFF","Elite Warriors","JAWA","Knights Reborn","oFc","Soul Reapers","Sith Praxeum","Hybrid","Jedi of Freedom","Random","Republic Galaxy","The Exiled Knights","Educational","Terminative 3","Roleplaying","JA Order","Non-English","Saberology","Akademia na Yavin4","Mods","ClanMod","jaMME","JA++","Jedi Betrayal","JK Galaxies","Makermod","Movie Battles II","Opensaber","People","Circa","Darth Arth","therfiles","mrwonko","Resources","JKH Master Server","Mac Modding","Map Forge","Mapping","OpenJK","Server Hosting","Site Hosting","MS_PER_HEADLINE_AFTER_CLICK","document","window","_body","body","bar","gloss","id","inner","logolink","target","logoimg","src","width","height","alt","prevlink","onclick","nextlink","categories","spacer","style","insertBefore","firstChild","Symbol","iterator","obj","constructor"],"mappings":"AAAA,YAEA,SAASA,YAkFR,QAASC,GAAeC,GACvBA,EAAWA,GAAYC,EACvBC,EAASC,UAAYC,EAAWC,GACZ,OAAhBC,GACHC,EAAQC,aAAcF,GAEvBA,EAAcC,EAAQE,WAAYC,EAAeV,GAGlD,QAASW,GAAeX,GACvBK,GAAgBA,EAAc,EAAID,EAAUQ,QAAWR,EAAUQ,OACjEb,EAAeC,GAGhB,QAASU,GAAeV,GACvBK,GAAgBA,EAAc,GAAMD,EAAUQ,OAC9Cb,EAAeC,GAGhB,QAASa,GAAWC,EAAQC,EAAUC,GACrC,IAAK,GAAMC,KAAOF,GACjB,GAAKA,EAASG,eAAgBD,GAA9B,CAGA,GAAME,GAAQJ,EAAUE,GAClBG,EAASJ,EAAQ,EAAI,eAAiB,GACtCK,EAAOD,EAASH,EAEhBK,EAAUC,EA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EAAUC,cAAe,MACxC6E,GAAOC,MAAMP,OAAS,OACtBM,EAAOrE,UAAY,aAEnBoD,EAAMmB,aAAcF,EAAQjB,EAAMoB,YAClCpB,EAAMmB,aAAcjB,EAAKe,GAEzBtG,IA/MD,GAAI2B,SAA4B,kBAAX+E,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,OAAS,eAAkBE","file":"jkhub_bar.min.js","sourcesContent":["// tell JSHint not to warn about not using this function\n/* exported init_bar */\nfunction init_bar() {\n\t// tell JSHint about exports\n\t/* exported headlines, links */\n\tconst headlines = [\n\t\t'Background Competition',\n\t\t'Interview: #nL.Cube',\n\t\t'Interview: Kualan',\n\t\t'Good, Bad, Ugly'\n\t];\n\t\n\tconst links = {\n\t\t\"Groups\": {\n\t\t\t\"Social\": {\n\t\t\t\t\"Angels of Fire\": \"http://aof-clan.com/main.html\",\n\t\t\t\t\"Dark Jedi Empire\": \"http://darkjediempire.ucoz.com\",\n\t\t\t\t\"-[DE]-\": \"http://darkempireofthesith.com/\",\n\t\t\t\t\"EFF\": \"http://www.eff-clan.org\",\n\t\t\t\t\"Elite Warriors\": \"http://elitewarriors.net/index.php\",\n\t\t\t\t\"JAWA\": \"https://thejawaclan.com\",\n\t\t\t\t\"Knights Reborn\": \"http://www.knights-reborn.org\",\n\t\t\t\t\"oFc\": \"http://ofc-clan.net\",\n\t\t\t\t\"Soul Reapers\": \"http://soulreapersjk3.enjin.com\",\n\t \"Sith Praxeum\": \"http://www.sithpraxeum.com\"\n\t\t\t },\n\t\t\t\"Hybrid\": {\n\t\t\t\t\"Jedi of Freedom\": \"http://www.jofacademy.eu\",\n\t\t\t\t\"Random\": \"http://randomclan.freeforums.net\",\n\t\t\t\t\"Republic Galaxy\": \"http://republicgalaxy.forumotion.eu\",\n\t\t\t\t\"The Exiled Knights\": \"http://theexiledknights.com\"\n\t\t\t},\n\t\t\t\"Educational\": {\n\t\t\t\t\"Terminative 3\": \"http://terminative3.netgoo.org\"\n\t\t\t},\n\t\n\t\t\t\"Roleplaying\": {\n\t\t\t\t\"JA Order\": \"http://jao.enjin.com/home\"\n\t\t\t},\n\t\n\t\t\t\"Non-English\": {\n\t\t\t\t\"Saberology\": \"http://saberologyclan.atw.hu\",\n\t\t\t\t\"Akademia na Yavin4\": \"http://www.yavin4.pl\"\n\t\t\t}\n\t\t},\n\t\t\"Mods\": {\n\t\t\t\"ClanMod\": \"https://jkhub.org/forum/123-clanmod/\",\n\t\t\t\"jaMME\": \"https://jkhub.org/forum/75-jedi-academy-moviemakers-edition/\",\n\t\t\t\"JA++\": \"http://japp.jkhub.org\",\n\t\t\t\"Jedi Betrayal\": \"http://jedibetrayal.com\",\n\t\t\t\"JK Galaxies\": \"https://jkhub.org/forum/117-jedi-knight-galaxies/\",\n\t\t\t\"Makermod\": \"https://jkhub.org/forum/111-makermod/\",\n\t\t\t\"Movie Battles II\": \"http://moviebattles.org\",\n\t\t\t\"Opensaber\": \"http://terminative3.netgoo.org/h2-opensaber-modification\"\n\t\t},\n\t\t\"People\": {\n\t\t\t\"Circa\": \"http://circa.im\",\n\t\t\t\"Darth Arth\": \"http://darth-arth.de\",\n\t\t\t\"therfiles\": \"http://therfiles.weebly.com\",\n\t \"mrwonko\" : \"http://mrwonko.de\"\n\t\n\t\t},\n\t\t\"Resources\": {\n\t\t\t\"JKH Master Server\": \"http://my.jacklul.com/jkhubservers/\",\n\t\t\t\"Mac Modding\": \"http://redsaurus.net/makingmacmods\",\n\t\t\t\"Map Forge\": \"http://map-forge.net\",\n\t\t\t\"Mapping\": \"https://jkhub.org/page/mapping.html\",\n\t\t\t\"OpenJK\": \"https://jkhub.org/topic/2220-frequently-asked-questions/\",\n\t\t\t\"Server Hosting\": \"https://jka.io/\",\n\t\t\t\"Site Hosting\": \"https://sitehost.io/\"\n\t\t}\n\t};\n\t// tell JSHint about imports\n\t/* globals links, headlines */\n\tconst MS_PER_HEADLINE = 5000;\n\tconst MS_PER_HEADLINE_AFTER_CLICK = 10000;\n\tconst _document = document;\n\tconst _window = window;\n\tconst _body = _document.body;\n\tlet curHeadline = 0;\n\tlet newsTimeout = null;\n\t\n\tconst headline = _document.createElement( \"span\" );\n\t\n\tfunction show_headline( duration ) {\n\t\tduration = duration || MS_PER_HEADLINE;\n\t\theadline.innerHTML = headlines[ curHeadline ];\n\t\tif( newsTimeout !== null ) {\n\t\t\t_window.clearTimeout( newsTimeout );\n\t\t}\n\t\tnewsTimeout = _window.setTimeout( next_headline, duration );\n\t}\n\n\tfunction prev_headline( duration ) {\n\t\tcurHeadline = ( curHeadline - 1 + headlines.length ) % headlines.length;\n\t\tshow_headline( duration );\n\t}\n\n\tfunction next_headline( duration ) {\n\t\tcurHeadline = ( curHeadline + 1 ) % headlines.length;\n\t\tshow_headline( duration );\n\t}\n\n\tfunction add_links( parent, children, depth ) {\n\t\tfor( const key in children ) {\n\t\t\tif( !children.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst child = children[ key ];\n\t\t\tconst prefix = depth > 0 ? \" \" : \"\";\n\t\t\tconst text = prefix + key;\n\t\t\t\n\t\t\tconst barmenu = _document.createElement( \"li\" );\n\t\t\tparent.appendChild( barmenu );\n\t\t\tif( typeof child !== 'object' ) {\n\t\t\t\tconst title = _document.createElement( \"a\" );\n\t\t\t\tif( child ) {\n\t\t\t\t\ttitle.href = child;\n\t\t\t\t\ttitle.setAttribute( \"target\", \"_blank\" );\n\t\t\t\t} else {\n\t\t\t\t\ttitle.href = \"#\";\n\t\t\t\t}\n\t\t\t\ttitle.innerHTML = text;\n\t\t\t\tbarmenu.appendChild( title );\n\t\t\t} else {\n\t\t\t\tconst title = _document.createElement( \"a\" );\n\t\t\t\ttitle.href = \"#\";\n\t\t\t\ttitle.innerHTML = text;\n\t\t\t\tbarmenu.appendChild( title );\n\t\t\t\n\t\t\t\tconst menu = _document.createElement( \"ul\" );\n\t\t\t\tif( depth === 0 ) {\n\t\t\t\t\tmenu.className = \"jkhub-menu\";\n\t\t\t\t} else {\n\t\t\t\t\tconst span = _document.createElement( 'span' );\n\t\t\t\t\tspan.innerHTML = '»';\n\t\t\t\t\tbarmenu.appendChild( span );\n\t\t\t\t\tmenu.className = \"jkhub-submenu\";\n\t\t\t\t}\n\t\t\t\tbarmenu.appendChild(menu);\n\t\t\t\tadd_links( menu, child, depth + 1);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tconst bar = _document.createElement( \"div\" );\n\tbar.className = \"jkhub-bar\";\n\t{\n\t\tconst gloss = _document.createElement( \"div\" );\n\t\tgloss.id = \"jkhub-gloss\";\n\t\tbar.appendChild( gloss );\n\t\t\n\t\tconst inner = _document.createElement( \"div\" );\n\t\tinner.id = \"jkhub-inner\";\n\t\tbar.appendChild( inner );\n\t\t{\n\t\t\tconst logolink = _document.createElement( \"a\" );\n\t\t\tlogolink.id = \"jkhub-logo\";\n\t\t\tlogolink.href = \"http://jkhub.org\";\n\t\t\tlogolink.title = \"JKHub\";\n\t\t\tlogolink.target = \"_blank\";\n\t\t\tinner.appendChild( logolink );\n\t\t\t{\n\t\t\t\tconst logoimg = _document.createElement( \"img\" );\n\t\t\t\tlogoimg.src = \"https://assets.jkhub.org/bar/barlogo2.png\";\n\t\t\t\tlogoimg.width = \"24\";\n\t\t\t\tlogoimg.height = \"24\";\n\t\t\t\tlogoimg.alt = \"JKHub Logo\";\n\t\t\t\tlogolink.appendChild( logoimg );\n\t\t\t}\n\t\t\theadline.id = \"jkhub-headline\";\n\t\t\tinner.appendChild( headline );\n\t\n\t\t\tconst prevlink = _document.createElement( \"a\" );\n\t\t\tprevlink.id = \"jkhub-prev-headline\";\n\t\t\tprevlink.href = \"#\";\n\t\t\tprevlink.onclick = function() {\n\t\t\t\tprev_headline( MS_PER_HEADLINE_AFTER_CLICK );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t\tprevlink.title = \"Previous Headline\";\n\t\t\tprevlink.innerHTML = \"◄\";\n\t\t\tinner.appendChild( prevlink );\n\t\t\t\n\t\t\tconst nextlink = _document.createElement( \"a\" );\n\t\t\tnextlink.id = \"jkhub-next-headline\";\n\t\t\tnextlink.href = \"#\";\n\t\t\tnextlink.onclick = function() {\n\t\t\t\tnext_headline( MS_PER_HEADLINE_AFTER_CLICK );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t\tnextlink.title = \"Next Headline\";\n\t\t\tnextlink.innerHTML = \"►\";\n\t\t\tinner.appendChild( nextlink );\n\t\t\t\n\t\t\tconst categories = _document.createElement( \"ul\" );\n\t\t\tcategories.className = \"jkhub-categories\";\n\t\t\tinner.appendChild( categories );\n\t\t\tadd_links( categories, links, 0 );\n\t\t}\n\t}\n\t\n\tconst spacer = _document.createElement( \"div\" );\n\tspacer.style.height = \"28px\";\n\tspacer.className = \"bar-spacer\";\n\t\n\t_body.insertBefore( spacer, _body.firstChild );\n\t_body.insertBefore( bar, spacer );\n\t\n\tshow_headline();\n}\n"],"sourceRoot":"/source/"}