/* The MIT License (MIT) Copyright (c) 2013-2014 Zimny Lech Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies off the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // DESCRIPTION: CyTube Plus - JavaScript and CSS library for CyTube channels enhancements // CURRENT VERSION: 4.5 // DATE OF MODIFICATION: 2014-08-29 // PROJECT URL: https://github.com/zimny-lech/CyTube-Plus ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // INSTALLATION NOTES: // 0. Choose simple or custom installation (simple one has ready-to-use library with limited functionality). // SIMPLE INSTALLATION: use 'https://dl.dropboxusercontent.com/s/2uks4pif8mx2qab/main-ready.js' as default URL // go to -> 3. // CUSTOM INSTALLATION: go to -> 1. // 1. Configure this library according to your wishes (see configuration sections below). // 2. Save customized library to your file hosting (e.g. Dropbox) or to your own server. // WARNING! You must be able to access .js file directly (browser's URL must contain .js extension, not .php etc.). // WARNING FOR DROPBOX USERS! Always use 'dl.dropboxusercontent.com' URL instead of 'www.dropbox.com' URL. // 3. Enter your JS file location into 'External Javascript' field in 'Channel Settings' modal window. // 4. Enter library CSS file location into 'External CSS' field in 'Channel Settings' modal window. // NOTE: use default 'https://dl.dropboxusercontent.com/s/180y5d6mvlu8kd8/main.css' URL, // or copy it to your own location. // 5. Congratulations, your have just installed CyTube Plus! // Need detailed options explanations? Go to https://github.com/zimny-lech/CyTube-Plus/wiki/FAQ // Problems? Something doesn't work? Go to https://github.com/zimny-lech/CyTube-Plus/wiki/Troubleshooting ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONFIGURE BELOW BEFORE INSTALLING IF YOU WANT TO CUSTOMIZE THIS LIBRARY ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* ----- STARTING CONFIGURATION - USER INTERFACE (UI) ----- */ // CONFIGURATION NOTES: // In this section you can immediately enable and disable each option (set '1' to enable, '0' to disable) // Every option marked as [&] requires additional configuration (see other sections below) // WARNING! apostrophe sign (') in all text/html values must be prepend with "\" sign (e.g. "don\'t") // FILTERS INSTALLATION: open 'Channel Settings' modal window, go to 'Edit' -> 'Chat Filters', // click 'Prepare fonts filters' button, and import // If you need more explanations, go to https://github.com/zimny-lech/CyTube-Plus/wiki/FAQ UI_DefaultSynchtube = 1; // default old Synchtube layout (player and playlist on the left) UI_Favicon = 0; // [&] channel favicon UI_MiniLogo = 0; // [&] small channel logo/avatar in the top navbar UI_ChannelName =0; // [&] channel custom brand name UI_HeaderDropMenu = 0; // [&] additional header dropdown menu UI_RemoveLayoutMenu = 0; // removing 'Layout' menu from the header UI_MOTDAutoLogo = 0; // [&] big channel logo inserted into MOTD UI_MOTDTabs = 0; // [&] switchable MOTD tabs application for homepage-like channel header UI_MOTDDelete = 0; // deleting previous MOTD after accepting/loading script UI_RulesBtn = 0; // [&] button displaying channel rules UI_AttentionBar = 0; // [&] imageboard-style attention bar (requires external application) UI_ChannelAnnouncement = 0; // [&] additional custom channel announcement UI_FullTitleBar = 0; // full-width video title bar UI_ProgressBar = 1; // YouTube/Dailymotion progress bar // [ REQUIRE: UI_FullTitleBar enabled ] UI_TitleIcon = 1; // [&] full-width title bar icon // [ REQUIRE: UI_FullTitleBar enabled ] UI_TitleBarDescription = 1; // [&] custom title bar description (default "Currently Playing:") UI_JoinText = 1; // [&] chat message after user joining UI_LeaveText = 1; // [&] chat message after user leaving UI_UserCommands = 1; // [&] additional commands in the chat window UI_UserMarks = 0; // [&] special signs/avatars before every message for defined users UI_Squavatars = 0; // automatic squavatars (2-colored square avatars) before every message // [ REQUIRE: UI_UserMarks enabled ] UI_UsernameMark = 1; // [&] custom mark after username (default ":") UI_MessagesSuffix = 0; // [&] text added to random chat messages UI_CustomPingSound = 1; // [&] custom sound for chat notifications UI_SoundFilters = 0; // [&] chat sounds played after sending certain words UI_ChatSpeak = 0; // text speaking after '!say' and '!mow' commands (english and polish) UI_IndependentEmotes = 0; // [&] additional settings-independent emotes UI_IndependentFilters = 1; // [&] additional settings-independent filters UI_FontsBtn = 0; // button displaying box with clickable chat fonts // [ REQUIRE: INSTALLATION (see above) ] UI_UnicodeChars = 0; // [&] additional buttons in the fonts panel with unicode characters // [ REQUIRE: UI_FontsBtn enabled ] UI_EmotesBtn = 0; // button displaying box with clickable chat emotes UI_GroupEmotes = 1; // [&] emotes panel pagination, display limited number of emotes at one time // [ REQUIRE: UI_EmotesBtn enabled ] UI_CommandsBtn = 0; // button displaying modal window with chat commands help UI_ModPanel = 0; // [&] panel with messages and help for moderators UI_CustomCaptions = 0; // [&] custom captions for add, refresh, voteskip buttons, and welcome text UI_PlayerOptions = 0; // [&] additional player options UI_TransformationBtns = 1; // player transformation buttons UI_ChannelDatabase = 1; // [&] box with embed additional media database UI_ChannelGalleries = 0; // [&] box with embed galleries UI_DisplayModeSel = 1; // selector with player display modes UI_ChannelTheme = 1; // [&] additional default channel theme UI_EmbeddingMedia = 1; // [&] possibility to embedding (displaying) images and .webm videos on the chat UI_MediaControls = 1; // embedded video preloaded controls // [ REQUIRE: UI_EmbeddingMedia enabled ] UI_QuickCommandsBtns = 1; // buttons with '/clear' and '/afk' functions UI_VolumeBtns = 1; // additional volume buttons for YouTube player UI_EmptyCornerBackground = 0; // [&] random background image for empty playlist row corner UI_ExtendedGetURLs = 1; // extended 'Get URLs' function UI_DefaultNonTemp = 1; // default unchecking "Add as temporary" checkbox after loading for registered users UI_CustomFooter = 0; // [&] custom channel footer UI_CustomRightFooter = 0; // [&] right-sided footer box UI_UserStatistics = 1; // displaying in the footer user visits number and current online time UI_ExternalScript = 0; // [&] additional external script file UI_ChannelCache = 1; // caching script emotes, additional media database and default gallery ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* ----- DETAILED BASIC CONFIGURATION ----- */ // NOTES: // a) values for 'MOTDAutoLogo_Mode': 1 = first logo; 2 = random logo; 3 = logo rotation; 7 = weekdays logos // b) in 'SoundFilters_Array' use .ogg or .wav files, some browsers has problems with embedded .mp3 // c) in 'ModPanel_Array' item leave empty first (username) field to make a message to all moderators // d) in 'EmbeddingMedia_Images' and 'EmbeddingMedia_Videos' you can define acceptable file extensions // use CSS syntax: e.g. 'a[href$=""]' defines acceptable end of an URL (file extension) // you can also define URL fragments: 'a[href*=""]', or add excluding clause: '.not(\'a[href*=""]\'), etc. /* -- single variables -- */ Favicon_URL = 'https://dl.dropboxusercontent.com/s/xgefazzyhs8xncp/icon.png'; MiniLogo_URL = 'https://dl.dropboxusercontent.com/s/xgefazzyhs8xncp/icon.png'; ChannelName_Caption = 'CyTube Plus'; HeaderDropMenu_Title = 'Synch'; MOTDAutoLogo_Mode = 1; MOTDAutoLogo_Interval = 20; RulesBtn_Caption = 'Read Channel Rules'; AttentionBar_URL = ''; ChannelAnnouncement_Title = 'Administration Message'; TitleIcon_URL = 'https://dl.dropboxusercontent.com/s/xgefazzyhs8xncp/icon.png'; TitleBarDescription_Caption = 'Now Playing:'; JoinText_Message = 'joined'; LeaveText_Message = 'left'; UsernameMark_Char = '>'; MessagesSuffix_Text = '~xD'; MessagesSuffix_Percentage = 10; CustomPingSound_URL = 'https://dl.dropboxusercontent.com/s/0qtsttblgmkewnv/beep.wav'; PlayerHiding_URL = 'https://dl.dropboxusercontent.com/s/xz2o99scw5i7aai/stop.png'; GroupEmotes_Number = 100; ExternalScript_URL = ''; /* -- arrays -- */ HeaderDropMenu_Array = [ ['CyTube Servers', ''], ['Calzoneman CyTube', 'http://cytu.be/'], ['6irc Synchtube', 'http://synchtube.6irc.net/'], ['CyTube Stuff', ''], ['Source code', 'https://github.com/calzoneman/sync'], ['FAQ', 'https://github.com/calzoneman/sync/wiki/Beginner%27s-Guide-and-FAQ'], ['IRC', 'http://webchat.6irc.net/?channels=chat,synchtube'], ['CyTube Plus', 'https://github.com/zimny-lech/CyTube-Plus'], ]; MOTDAutoLogo_Array = [ 'https://dl.dropboxusercontent.com/s/7mrz85gl29eiiks/logo.png', ]; MOTDTabs_Array = [ ['Home', 'Welcome to our channel!'], ['Playlist', 'Playlist tab.

We watched this, that and this.'], ['Schedule', 'Schedule:

'], ['Contact', 'Contact:

Email - ...
Skype - ...'], ]; RandomQuotes_Array = [ 'I like the Pope dancing', 'No quotes today', 'O rly?', 'People have the right to be stupid. You abuse that privilege', 'Don\'t play stupid with me', 'Roses are red violets are blue, God made me pretty, what happened to you?', 'Please don\'t interrupt me while I\'m ignoring you', 'Are you always this stupid, or are you making a special effort today?', 'I like you. You remind me of when I was young and stupid.', 'Go and buy me a beer', 'The door of this channel is always open for you... so feel free to leave!', ]; AskAnswers_Array = [ '100% for sure', 'definitely yes', 'yes', 'probably', 'not any chance', 'definitely no', 'a little chance', 'no', '50/50', 'fairy is tired and will not answer', 'I refuse to answer', ]; Memes_Array = [ '>', 'fb', 'omfg', 'u mad', ]; UserMarks_Array = { 'ZimnyLech': '', 'calzoneman': '♠', } SoundFilters_Array = { 'habemus': 'https://dl.dropboxusercontent.com/s/3w1jahgffowjltz/hp.ogg', 'lol': 'https://dl.dropboxusercontent.com/s/9aqa1buu3phvpss/laugh.ogg', } ModPanel_Array = [ ['', 'Welcome to the moderators panel. You can find here messages, news and help for all channel moderators, edited by script admin.'], ['', 'To temporary insert to the playlist any website instead of media files, click "Embed a custom frame" button in the playlist controls section. Then paste example code to the textarea: <iframe src="URL_of_your_page"></iframe>, and add.'], ]; CustomCaptions_Array = { 'add': 'Add here', 'refresh': 'Refresh player', 'voteskip': 'Voteskip', 'welcome': 'Hi', } UnicodeChars_Array = [ '★', '☆', '▲', '▼', '♥', '♪', '♿', '⚒', '♕', '✉', '☏', '♠', '→', '☑', '☒', '✡', '☪', '✝', '☭', '☯', 'Ⓐ', '☕', '♨', '¥', '©', '∞', ]; ChannelGalleries_Array = [ ['Anime pictures', 'http://imgur.com/a/SjwJb/embed'], ['Historical photos', 'http://imgur.com/a/vnwC2/embed'], ]; /* -- HTML/CSS -- */ MOTDTabs_CSS = { 'padding': '20px', 'color': 'white', 'background-color': 'black', } RulesBtn_HTML = '
  1. You want to write on the chat? Enter temporary nickname into Guest Login input and click enter.
  2. You want to register a nick? Click Account -> Profile on the top of the channel, and fill the registration form. You don\'t need an email to register.
  3. Do not spam.
  4. You want to have this application on your own channel? Go to https://github.com/zimny-lech/CyTube-Plus.
'; ChannelAnnouncement_HTML = ''; EmbeddingMedia_Images = 'a[href$=".jpg"], a[href$=".jpg:large"], a[href$=".jpeg"], a[href$=".JPG"], a[href$=".png"], a[href$=".tiff"], a[href$=".gif"]'; EmbeddingMedia_Videos = 'a[href$=".webm"]'; CustomFooter_HTML = 'This is custom footer.'; CustomRightFooter_HTML = ''; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* ----- THEMES CONFIGURATION ----- */ // NOTES: // a) TopUserLogo item has 3 attributes: name, URL, maximum height. // Those images can be selected by user in Layout Configuration panel, and will be displayed on the channel top. ChannelThemeURL = 'https://ourfore.st/css/themes/fore.st.css'; ThemesCSS = [ ['forest', 'https://ourfore.st/css/themes/fore.st.css'], ['forestTest', 'http://10.0.2.15/css/themes/fore.st.css'], ['Plus Red', 'https://dl.dropboxusercontent.com/s/th8i1sj332wi0x9/plusred.css'], ['Celadon', 'https://dl.dropboxusercontent.com/s/iwarwhhph1ti2ek/celadon.css'], ]; TopUserLogo = [ ['cytube plus', 'https://dl.dropboxusercontent.com/s/7mrz85gl29eiiks/logo.png', 90], ['cosmos', 'https://dl.dropboxusercontent.com/s/v6dx49yqk5e3i2d/cosmos.jpg', 200], ['disco ball', 'https://dl.dropboxusercontent.com/s/ahpfm25pglc8j01/disco.jpg', 162], ['japanese landscape', 'https://dl.dropboxusercontent.com/s/llylt832evxrp6e/japan.jpg', 200], ['korean collage', 'https://dl.dropboxusercontent.com/s/qud9adhs183dq30/korea.jpg', 160], ]; EmptyCornerBackground = [ 'https://dl.dropboxusercontent.com/s/xa32t6jh68lor6p/kirino.png', 'https://dl.dropboxusercontent.com/s/xbz6j5vjqs34ihm/kobato0.png', 'https://dl.dropboxusercontent.com/s/sj67s6u5vwe6i7s/kuroneko.png', 'https://dl.dropboxusercontent.com/s/y9nnwvbrcbjm0fm/tsukiko.png', 'https://dl.dropboxusercontent.com/s/7bigihfi4ho0d29/moetan.png', 'https://dl.dropboxusercontent.com/s/0cg72kjsnt4p63g/azuki.png', 'https://dl.dropboxusercontent.com/s/va28xkaoz1co3ah/sakura.png', ]; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* ----- INDEPENDENT EMOTES AND FILTERS CONFIGURATION ----- */ // NOTES ABOUT INDEPENDENT EMOTES: // Every item has 4 attributes, respectively: chat code, image URL, image width, image height. // Warning: due to conflict with RegExp, do not use square brackets or use proper "\\[" and "\\]" codes. IndependentEmotes = [ [':awesome:', 'https://dl.dropboxusercontent.com/s/gz1k8oto90n16v6/awesome.png', 35, 35], [':love:', 'https://dl.dropboxusercontent.com/s/fr9131zgnai0kix/heart.png', 35, 35], ]; // NOTES AND DEFAULT FILTERS EXAMPLES: // If you use regular expression, you must put it between // signs with /g flag to change all occurences // a) [mq]text[/mq] - fast scrolling text // b) [mq0]text[/mq0] - slow scrolling text // c) [imgur]suok1xr.jpg[/imgur] - imgur picture // d) [drop]7mrz85gl29eiiks/logo.png[/drop] - dropbox picture // e) [minus/i5]ig0qs6fvWvgBu.jpg[/minus] - minus.com picture // f) [vi/b]1r8ih4t1.vichan.png[/vi] - vichan /b/ imageboard picture (you can use other boards too) IndependentFilters=[ { before:/\[mq\](.*?)\[\/mq\]/g, after:'$1' }, { before:/\[mq0\](.*?)\[\/(mq0|mq)\]/g, after:'$1' }, { before:/\[imgur\](.*?)\[\/(i|imgur)\]/g, after:'' }, { before:/\[drop\](.*?)\[\/(d|drop)\]/g, after:'' + '' }, { before:/\[minus\/(.*?)\](.*?)\[\/(m|minus)\]/g, after:'' + '' }, { before:/\[vi\/(.*?)\](.*?)\[\/(v|vi)\]/g, after:'' + '' }, ]; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* ----- MEDIA DATABASE CONFIGURATION ----- */ // NOTES: // Leave empty URL field to create category button. // WARNING! Use ChannelDatabase_URL only if you want to use external database file, it overwrites database below. // If so, copy and configure 'https://raw.github.com/zimny-lech/CyTube-Plus/master/external-db.js' file. ChannelDatabase=[ ['', 'Japanese'], ['http://www.youtube.com/watch?v=Q3y-80HBM6Q', 'An Cafe - Smile Ichiban Ii Onna'], ['http://www.youtube.com/watch?v=nDqaTXqCN-Q', 'Babymetal - Ijime, Dame, Zettai'], ['http://www.youtube.com/watch?v=aNlkiymcT1Q', 'Hinoi Team - Ike Ike'], ['http://www.youtube.com/watch?v=JbQYK0mwLss', 'Morning Musume - Onna Ni Sachi Are'], ['http://www.youtube.com/watch?v=VZKMaFR2mtU', 'Perfume - Fake It'], ['http://www.youtube.com/watch?v=OYEHfWb1b4M', 'Shoko Nakagawa - Yuzurenai Negai'], ['http://www.youtube.com/watch?v=jvhI576M6so', 'Yuu Kikkawa - Bokarisuto?'], ['', 'Korean'], ['http://www.youtube.com/watch?v=M-XXJJFZcXg', '4Minute - Heart To Heart (jap.)'], ['http://www.youtube.com/watch?v=HchHZkkBOoE', 'As One - Catch Me Up'], ['http://www.youtube.com/watch?v=UVeTI4v24M0', 'C-REAL - No No No No No'], ['http://www.youtube.com/watch?v=04FdisNU3vw', 'Girl\'s Day - Oh! My God'], ['http://www.youtube.com/watch?v=ysnUHXksic8', 'NS Yoon-G - Reason To Become A Witch'], ['http://www.youtube.com/watch?v=mZUZdGCyLmw', 'Orange Caramel - Bangkok City'], ['http://www.youtube.com/watch?v=r-MXLmNnarQ', 'TINY-G - Minimanimo'], ['', 'Chinese'], ['http://www.youtube.com/watch?v=Bi0tjyVfHOg', 'Amber Ann - Lian Ai Yingyuan Tuan'], ['http://www.youtube.com/watch?v=dsU0Vu6aJhw', 'By2 - Love You Love You'], ['http://www.youtube.com/watch?v=ovPhJim1EUc', 'Momo - One Hundred Girlfriends '], ['http://www.youtube.com/watch?v=lxa2KqERBZE', 'S.H.E. - Shero'], ['http://www.youtube.com/watch?v=jd2-Nf86jvA', 'Weather Girls - Koi No Tenki Yohou'], ['', 'Anime songs'], ['http://www.youtube.com/watch?v=fJ_DH7jzoxQ', 'Ai No Tenshi (Perfect Blue)'], ['http://www.youtube.com/watch?v=ZNu_NV5PEM8', 'Chu☆ - Miko Miko Naasu - Ai No Teema'], ['http://www.youtube.com/watch?v=l65_QPNZ_k8', 'Hommarju feat. MAKI - Yamato Nadeshiko Education (Seitokai Yakuindomo OP)'], ['http://www.youtube.com/watch?v=dQbaJquz_jo', 'Kayo Sakata - Shoujo Q (Pani Poni Dash! OP)'], ['http://www.youtube.com/watch?v=nLSFxQijz6U', 'Kotoko - Princess Bride'], ['http://www.youtube.com/watch?v=QK-37CnYTpg', 'Princess Party Camelia OP'], ['http://www.youtube.com/watch?v=jehMXrY1q5I', 'Yui Makino - Yume No Tsubasa'], ]; ChannelDatabase_URL='https://ourfore.st/bumps.js'; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* ----- END OF CONFIGURATION, DO NOT CHANGE ANYTHING BELOW ----- */ /* ----- Initial channel options ----- */ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // reload script after unexpected re-connection or script URL change var LOADED = (typeof LOADED==="undefined") ? false : true; LOADED ? location.reload() : ''; /* ----- getting and setting channel options ----- */ if (UI_DefaultSynchtube=="1") { defplayer="left"; defuserlist="right"; defqueue="left"; } else { defplayer="right"; defuserlist="left"; defqueue="right"; } var DEFTHEME = (UI_ChannelTheme=="1" && ChannelThemeURL!="") ? ChannelThemeURL : "/css/themes/slate.css"; var USERCONFIG = { "player":getOrDefault(CHANNEL.name+"_player", defplayer), "userlist":getOrDefault(CHANNEL.name+"_userlist", defuserlist), "queue":getOrDefault(CHANNEL.name+"_queue", defqueue), "qsize":getOrDefault(CHANNEL.name+"_qsize", "wide"), "main":getOrDefault(CHANNEL.name+"_main", "top"), "motd":getOrDefault(CHANNEL.name+"_motd", "top"), "logo":getOrDefault(CHANNEL.name+"_logo", "no"), "logourl":getOrDefault(CHANNEL.name+"_logourl", ""), "logoht":getOrDefault(CHANNEL.name+"_logoht", 250), "header":getOrDefault(CHANNEL.name+"_header", "detached"), "css":getOrDefault(CHANNEL.name+"_css", "no"), "csscode":getOrDefault(CHANNEL.name+"_csscode", ""), "modhash":getOrDefault(CHANNEL.name+"_modhash", ""), } var USERTHEME = getOrDefault(CHANNEL.name+"_theme", DEFTHEME); var FLUID = getOrDefault(CHANNEL.name+"_fluid", true); var LAYOUTBOX = getOrDefault(CHANNEL.name+"_layoutbox", true); var SOUNDSLVL = getOrDefault(CHANNEL.name+"_soundslvl", 3); var EMBEDIMG = getOrDefault(CHANNEL.name+"_embedimg", true); var EMBEDVID = getOrDefault(CHANNEL.name+"_embedvid", true); var AUTOVID = getOrDefault(CHANNEL.name+"_autovid", true); var USERVISITS = getOrDefault(CHANNEL.name+"_visits", 0); var DEFDESCR = true; // standard item description in the player header var NOPLAYER = false; // removed player in silent mode var CHATFUNC = false; // admin chat functions panel visibility var COMMAND = false; // aditional command occuring in the chat message var VOICES = false; // chat sounds not disabled by user var EMOTES = false; // emotes have been loaded into emotes panel var CLEARING = false; // auto clearing messages window var ANTIAFK = false; // enabled anti-AFK function var SOUNDSPANEL = false; // chat sounds panel visibility var PINNED = false; // playlist pinned to player var FULLPL = false; // expanded playlist view var MINIMIZED = false; // minimized layout var CHANDB = false; // channel database has been loaded var GALLERY = false; // channel galleries have been loaded var GALLVIS = false; // channel galleries have been viewed by user var ALTERCHATFORMAT = false; // using altered 'formatChatMessage' built-in function var PREVTIME = 0; // previous read of a current item time for the progress bar var LASTADD = 0; // timestamp of the last adding random item from the channel database var USERONLINE = 0; // user minutes online var BGCHANGE = 0; // number of background changes for the easter egg function var MUTEDVOICES = new Array(); // list of users with muted chat sounds by user var CHATSTAT = {"n":0, "l":0, "m":[]}; // array with user messages statistics var ADDEDLINKS = new Array(); // array of links added from channel database by user var HASH = ''; // simple hash for comparing if the new messages have appeared in the mod panel WEBKIT="webkitRequestAnimationFrame" in window; SOUNDSVALUES=new Array(0, 0.1, 0.2, 0.4, 0.7, 1); SPEAKLINK='http://webanywhere.cs.washington.edu/cgi-bin/espeak/getsound.pl'; IMBA=new Audio("https://dl.dropboxusercontent.com/s/xdnpynq643ziq9o/inba.ogg"); CHATSOUND.volume=0.6; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* ----- Global functions ----- */ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // toggle elements visibility function toggleDiv(div) { $(div).css('display')=="none" ? $(div).show() : $(div).hide(); } // refresh player function refreshPlayer() { PLAYER.type=""; PLAYER.id=""; socket.emit("playerReady"); } // add link to playlist function addToPlaylist(link, stand) { parsed=parseMediaLink(link); parsed["id"]!=null ? socket.emit("queue", {id:parsed["id"], pos:stand, type:parsed["type"]}) : ''; } // get text content from inner HTML function getText(html) { div=document.createElement("div"); div.innerHTML=html; return div.textContent||div.innerText; } // create modal window function createModal(title) { hidePlayer(); outer = $('