diff --git a/js/boardlist-alias.js b/js/boardlist-alias.js index 2324e803..bed405f4 100644 --- a/js/boardlist-alias.js +++ b/js/boardlist-alias.js @@ -7,6 +7,7 @@ if (window.Options && Options.get_tab('general')) { + ("") + ("") + ("") + + ("") + ""); } @@ -40,9 +41,15 @@ $('.boardlist-hideunderboards').on('change', function(){ localStorage[setting] = $(this).children('input').is(':checked'); location.reload(); }); +$('.boardlist-megaq').on('change', function(){ + var setting = $(this).attr('id'); + + localStorage[setting] = $(this).children('input').is(':checked'); + location.reload(); +}); if (!localStorage.boardlisttinyalias) { - localStorage.boardlistshortalias = 'false'; + localStorage.boardlisttinyalias = 'false'; } if (!localStorage.boardlistlegacyalias) { localStorage.boardlistlegacyalias = 'false'; @@ -56,16 +63,20 @@ if (!localStorage.boardlisthideoverboards) { if (!localStorage.boardlisthideunderboards) { localStorage.boardlisthideunderboards = 'false'; } +if (!localStorage.megaq) { + localStorage.megaq = 'false'; +} function getSetting(key) { return (localStorage[key] == 'true'); } if (getSetting('boardlisttinyalias')) $('#boardlisttinyalias>input').prop('checked', 'checked'); -if (getSetting('boardlistlegacyalias')) $('#boardlistshortalias>input').prop('checked', 'checked'); +if (getSetting('boardlistlegacyalias')) $('#boardlistslegacyalias>input').prop('checked', 'checked'); if (getSetting('boardlistunicodealias')) $('#boardlistunicodealias>input').prop('checked', 'checked'); if (getSetting('boardlisthideoverboards')) $('#boardlisthideoverboards>input').prop('checked', 'checked'); if (getSetting('boardlisthideunderboards')) $('#boardlisthideunderboards>input').prop('checked', 'checked'); +if (getSetting('boardlistmegaq')) $('#boardlistmegaq>input').prop('checked', 'checked'); function initBoardListAlias() { @@ -89,10 +100,15 @@ function initBoardListAlias() { $(this).find('a').each(function() { var board = $(this).html(); var menuitemname = board; + if (getSetting("boardlistmegaq")) { + if (board === "mega"){ + $(this).attr("href", "https://lainchan.org/megaq/index.html"); + } + } - var tinyalias = {"$$$" : "$", "rules" : "law" , "faq" : "?" , "news" : "n" , "diy" : "Δ", "sec" : "s", "tech" : "Ω", "inter" : 'i', "lit" : "l", "music" : "mu" , "vis" : "v" , "hum" : "h", "drg" : "d" , "zzz" : "z" , "layer" : "ddt" ,"cult" : "c" , "psy" : "p", "mega" : "me" , "random" : "ra", "radio" : "rad", "stream" : "mov"}; + var tinyalias = {"$$$" : "$", "rules" : "law" , "faq" : "?" , "news" : "n" , "diy" : "Δ", "sec" : "s", "tech" : "Ω", "inter" : 'i', "lit" : "l", "music" : "mu" , "vis" : "v" , "hum" : "h", "drg" : "d" , "zzz" : "z" , "layer" : "ddt" ,"cult" : "c" , "psy" : "p", "mega" : "me" , "random" : "ra", "radio" : "rad", "stream" : "mov", "cal" : "ca"}; var legacyalias = { "Δ" : "diy", "Ω" : "tech", "drug" : "drg", "hum" : "feels"}; - var unicodealias = {"$$$": "💸", "rules" : "⚖️" , "faq" : "⁉️" , "news" : "📰" , "diy" : "🔧" , "Δ" : "🔧", "sec" : "🔒", "tech" : "💻", "Ω" : "💻", "inter" : "🎮", "lit" : "✍️", "music" : "🎼" , "vis" : "🎨" , "hum" : "👥", "drg" : "💊" , "drug" : "💊" , "zzz" : "💤" , "layer" : "㊙️" ,"cult" : "🎭" , "psy" : "🎆", "mega" : "📣" , "random" : "🎲", "radio" : "📻", "stream" : "📺", "zine" : "📓", "irc" : "📝", "q" : "❓", "r" : "🎲"}; + var unicodealias = {"$$$": "💸", "rules" : "⚖️" , "faq" : "⁉️" , "news" : "📰" , "diy" : "🔧" , "Δ" : "🔧", "sec" : "🔒", "tech" : "💻", "Ω" : "💻", "inter" : "🎮", "lit" : "✍️", "music" : "🎼" , "vis" : "🎨" , "hum" : "👥", "drg" : "💊" , "drug" : "💊" , "zzz" : "💤" , "layer" : "㊙️" ,"cult" : "🎭" , "psy" : "🎆", "mega" : "📣" , "random" : "🎲", "radio" : "📻", "stream" : "📺", "zine" : "📓", "irc" : "📝", "q" : "❓", "r" : "🎲", "cal" : "📅"}; if (getSetting("boardlisttinyalias")) { if (board in tinyalias){