2 次代碼提交 fcba509fa4 ... a055688af5

作者 SHA1 備註 提交日期
  nufnuf a055688af5 Merge https://notabug.org/nufnuf/ircabot2 1 年之前
  nufnuf a0562cf110 del 1 年之前
共有 10 個文件被更改,包括 0 次插入706 次删除
  1. 二進制
      html/custom_img_example.png
  2. 二進制
      html/favicon.ico
  3. 0 62
      html/main.html
  4. 二進制
      html/newmessage.mp3
  5. 0 163
      html/realtimechat_js
  6. 0 457
      html/style.css
  7. 0 8
      html/svg/a-left.svg
  8. 0 8
      html/svg/a-right.svg
  9. 0 8
      html/svg/airplane.svg
  10. 0 0
      html/svg/arrows.svg

二進制
html/custom_img_example.png


二進制
html/favicon.ico


+ 0 - 62
html/main.html

@@ -1,62 +0,0 @@
-<!-- Create dynamic HTML in C++ code like the master in {{RENDERING_TIMER}}ms -->
-
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <link rel="stylesheet" type="text/css" href="/style.css">
-    <title>{{PAGE_TITLE}}</title>
-</head>
-<body>
-    <div class="wrapper">
-        <div class="left_menu">
-            <div class="left_menu__wrapper">
-{{SERVERS_SECTION}}
-            </div>
-            <a href="https://notabug.org/acetone/ircabot" target="_blank" class="left_menu__footer">IRCaBot {{VERSION}}<br>GPLv3 &copy; acetone, {{COPYRIGHT_YEAR}}</a>
-        </div>
-        <div class="main">
-            <div class="main_header">
-                <div class="main_header__title">
-                    <span title="{{CHANNEL_TOPIC}}">{{MAIN_HEADER}}</span>
-                    <a href="{{REALTIME_LINK}}" title="{{AIRPLAIN_TITLE}}" class="main_header__title_airplaine"></a>
-{{ADDITIONAL_BUTTON}}
-                </div>
-                <div class="main_header__search">
-                    <form class="main_header__search_form" method="get">
-                        <div class="main_header__search_block">
-                            <input class="main_header__search_input" type="search" name="toSearch" placeholder="{{SEARCH_PLACEHOLDER}}">
-                            <div class="main_header__search_button">
-                                <input class="main_header__search_button__img" type="submit" value="">
-                            </div>
-                        </div>
-                        <div class="main_header__search_checkbox">
-                            <input id="main_header__search_checkbox__button" type="checkbox" name="isRegexp">
-                            <label style="cursor: pointer;" for="main_header__search_checkbox__button">
-                                Regular expression
-                            </label>
-                        </div>
-                    </form>
-                </div>
-            </div>
-            <div class="main_middle">
-                <div class="main_middle__path">
-                    {{MIDDLE_PATH}}
-                </div>
-                <div class="main_middle__online">
-                    <input id="menu__toggle" type="checkbox"/>
-                    <label style="cursor: pointer;" for="menu__toggle">
-                        Online: {{ONLINE}}
-                    </label>
-                    <div class="main_middle__online_list">
-{{ONLINE_LIST}}
-                    </div>
-                </div>
-            </div> <!-- main_middle -->
-            <div class="main_payload">
-{{PAYLOAD_BLOCK}}
-            </div>
-        </div>
-    </div>
-</body>
-</html>

二進制
html/newmessage.mp3


+ 0 - 163
html/realtimechat_js

@@ -1,163 +0,0 @@
-let objPath = document.getElementById("path");
-let objPayload = document.getElementById("payload");
-let objCurrentServerStatus = document.getElementById("serverStatus");
-let objOnlineCounter = document.getElementById("online");
-let objOnlineList = document.getElementById("onlineList");
-let objMusicanotes = document.getElementById("musicanotes");
-
-let lastMessageId = document.getElementById("LMId").innerText;
-let reqIsFailed = false;
-let firstLoadingWithDisconnectedServer = false;
-let unreadedCount = 0;
-let soundEnabled = false;
-
-const ajaxUrl = document.getElementById("ajaxPath").innerText;
-const originalTitle = document.title;
-const audio = new Audio('/newmessage.mp3');
-const HTML_SERVER_ONLINE_MARKER = "✅";
-const HTML_SERVER_OFFLINE_MARKER = "❌";
-
-function sound() {
-    if (!soundEnabled) {
-        soundEnabled = true;
-        objMusicanotes.style.opacity = "1";
-        objMusicanotes.title = "Sound notifications enabled";
-    } else {
-        soundEnabled = false;
-        objMusicanotes.style.opacity = ".3";
-        objMusicanotes.title = "Sound notifications disabled";
-    }
-}
-
-function appendMessage(nick /* if == "***", then system message */, message)
-{
-    let messageObject = document.createElement("div");
-    messageObject.setAttribute("class", "main_payload__chat");
-    const date = new Date;
-    messageObject.setAttribute("title", date.toLocaleString());
-
-    let nicknameContainer = document.createElement("div");
-    nicknameContainer.setAttribute("class", "main_payload__chat_username");
-    if (nick === "***") {
-        nicknameContainer.setAttribute("style", "color: white; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;");
-        nicknameContainer.innerText = "IRCaBot";
-    } else {
-        nicknameContainer.innerText = nick;
-        nicknameContainer.setAttribute("style", "color: #1b4af5");
-        if (document.hidden) {
-            unreadedCount++;
-            document.title = '(' + unreadedCount + ') ' + originalTitle;
-            if (soundEnabled) {
-                audio.play();
-            }
-        }
-    }
-
-    let textContainer = document.createElement("div");
-    textContainer.setAttribute("class", "main_payload__chat_mail");
-    textContainer.innerHTML = message;
-
-    messageObject.appendChild(nicknameContainer);
-    messageObject.appendChild(textContainer);
-    objPayload.appendChild(messageObject);
-    objPayload.scrollBy(0,1000);
-}
-
-function changeOnlineList(nicksArray)
-{
-    objOnlineList.innerHTML = "";
-    nicksArray.forEach(function(nick) {
-        let nickObject = document.createElement("div");
-        nickObject.setAttribute("class", "main_middle__online_point");
-        nickObject.innerText = nick;
-        objOnlineList.appendChild(nickObject);
-    });
-}
-
-function toAJAX()
-{
-    loop();
-    let xhttp = new XMLHttpRequest();
-    xhttp.onload = function() {
-        if (reqIsFailed) {
-            reqIsFailed = false;
-            objPath.removeAttribute("style");
-        }
-        const answer = JSON.parse(xhttp.responseText);
-        if (firstLoadingWithDisconnectedServer && answer.serverStatus) {
-            firstLoadingWithDisconnectedServer = false;
-            appendMessage("***", "<b>Connected to the server</b>. New messages will appear below!");
-            objPath.removeAttribute("style");
-        }
-        if (!answer.status) {
-            appendMessage("***", answer.message);
-            return;
-        }
-        if (answer.serverStatusChanged) {
-            if (answer.serverStatus) {
-                objPath.removeAttribute("style");
-                objCurrentServerStatus.innerText = HTML_SERVER_ONLINE_MARKER;
-            } else {
-                objPath.setAttribute("style", "color: red");
-                objCurrentServerStatus.innerText = HTML_SERVER_OFFLINE_MARKER;
-            }
-        }
-        if (answer.onlineUsersChanged) {
-            const onlineInfo = answer.online;
-            objOnlineCounter.innerText = onlineInfo.count;
-            changeOnlineList(onlineInfo.list);
-        }
-        if (answer.LMIdChanged) {
-            lastMessageId = answer.LMId;
-            let msgArray = answer.newMessages;
-            msgArray.forEach(function(singleMsg) {
-                appendMessage(singleMsg.user, singleMsg.text);
-            });
-        }
-        setTimeout(toAJAX, 2000); // 2 sec
-    }
-    xhttp.onerror = function() {
-        if (!reqIsFailed) {
-            reqIsFailed = true;
-            objPath.setAttribute("style", "color: red");
-        }
-        setTimeout(toAJAX, 1000); // 1 sec
-    }
-
-    let currentServerStatus = objCurrentServerStatus.innerText === HTML_SERVER_ONLINE_MARKER;
-    xhttp.open("GET", "/ajax/"+ajaxUrl+"?onlineCounter="+objOnlineCounter.innerText+"&messageId="+lastMessageId+"&serverStatus="+currentServerStatus);
-    xhttp.send();
-}
-
-function loop()
-{
-    if (!document.hidden && unreadedCount>0) {
-        unreadedCount = 0;
-        document.title = originalTitle;
-    }
-    let dots = objPath.innerText;
-    if (dots === "...") {
-        dots = ""
-    } else {
-        dots += ".";
-    }
-    objPath.innerText = dots;
-}
-
-function main()
-{
-    sound();
-    objPayload.scrollBy(0,100000);
-    let objHr = document.getElementById("hr");
-    if (objCurrentServerStatus.innerText === HTML_SERVER_OFFLINE_MARKER) {
-        firstLoadingWithDisconnectedServer = true;
-        objPath.setAttribute("style", "color: red");
-        hr.innerHTML = "Now the logger is disconnected from the server, so there will be no new messages.";
-    } else {
-        hr.innerHTML = "<b>New messages will appear below<b>";
-    }
-
-    toAJAX();
-}
-
-main();

+ 0 - 457
html/style.css

@@ -1,457 +0,0 @@
-body {
-    margin: 0;
-    padding: 0;
-    width: 100%;
-    height: 100vh;
-    font-family: monospace;
-}
-
-.wrapper {
-    height: 90%;
-    padding: 2% 7%;
-    display: flex;
-    flex-direction: row;
-}
-
-.left_menu {
-    display: flex;
-    flex-direction: column;
-    flex: 15%;
-}
-
-.left_menu__wrapper {
-    flex: 93%;
-    overflow: auto;
-    scrollbar-width: thin;
-    scrollbar-color: #6493bc #b6c7d6;
-    margin-bottom: 10%;
-}
-
-.left_menu__item {
-    width: 97%;
-    margin-bottom: 5%;
-    border: 2px solid #b6c7d6;
-}
-
-.left_menu__mainitem {
-    width: 97%;
-    padding-left: 2px;
-    margin-bottom: 5%;
-    opacity: .5;
-}
-
-.left_menu__mainitem:hover {
-    opacity: .8;
-}
-
-.left_menu__item_title {
-    padding: 2% 0 0 2%;
-    margin-bottom: 3%;
-}
-
-.left_menu__item_title_name {
-    font-size: 20px;
-    font-weight: bold;
-    color: #6493bc;
-    text-decoration: none;
-}
-
-.left_menu__item_rooms {
-    margin-bottom: 5%;
-}
-
-.left_menu__item_link {
-    display: block;
-    padding-left: 7%;
-    text-decoration: none;
-    color: #2f444c;
-    font-size: 18px;
-    margin-bottom: 1%;
-}
-
-.left_menu__item_link:hover {
-    text-decoration: 1.5px underline;
-}
-
-.left_menu__item_link__selected {
-    display: block;
-    padding-left: 2%;
-    text-decoration: none;
-    color: #2f444c;
-    font-size: 18px;
-    background: #b6c7d6;
-    margin: 0 5% 1% 5%;
-}
-
-.left_menu__footer {
-    display: flex;
-    flex: 3%;
-    font-size: 14px;
-    color: #6493bc;
-    text-decoration: none;
-}
-
-.main {
-    flex: 68%;
-    display: flex;
-    flex-direction: column;
-    margin-left: 2%;
-}
-
-.main_header {
-    flex: 5%;
-    display: flex;
-    flex-direction: row;
-}
-
-.main_header__title {
-    color: #2f444c;
-    font-size: 34px;
-    display: flex;
-    flex: 69%;
-    font-weight: bold;
-    flex-flow: row nowrap;
-    align-items: center;
-}
-
-.main_header__title_airplaine {
-    background-image: url(/svg/airplane.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    width: 6%;
-    height: 50%;
-    border: none;
-    opacity: .5;
-    margin-left: 1.5%;
-}
-
-.main_header__title_airplaine:hover {
-    opacity: 1;
-}
-
-.main_header__title_arrows {
-    background-image: url(/svg/arrows.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    width: 6%;
-    height: 50%;
-    border: none;
-    opacity: .5;
-    margin-left: 1%;
-}
-
-.main_header__title_arrows:hover {
-    opacity: 1;
-}
-
-.main_header__title_notify {
-    background-image: url(/svg/notification.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    width: 6%;
-    height: 50%;
-    border: none;
-    opacity: .3;
-    cursor: pointer;
-    margin-left: 1%;
-}
-
-.main_header__search {
-    flex: 30%;
-}
-
-.main_header__search_form {
-    width: 100%;
-    height: 70%;
-    display: flex;
-    flex-direction: column;
-}
-
-.main_header__search_block {
-    flex: 90%;
-    width: 100%;
-    display: flex;
-    flex-direction: row;
-}
-
-.main_header__search_input {
-    width: 80%;
-    height: 100%;
-    border: 2px solid #b6c7d6;
-    font-size: 18px;
-    font-family: monospace;
-    color: #2f444c;
-}
-
-.main_header__search_button {
-    width: 20%;
-    margin-left: 2%;
-    height: 87%;
-    border: 2px solid #b6c7d6;
-}
-
-.main_header__search_button__img {
-    background: url(/svg/magnifier.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    background-size: contain;
-    width: 95%;
-    height: 95%;
-    border: none;
-}
-
-.main_header__search_button:hover {
-    background: #b6c7d6;
-    border: 2px solid #6493bc;
-}
-
-.main_header__search_checkbox {
-    color: #6493bc;
-    display: flex;
-    flex-flow: row nowrap;
-    align-items: center;
-    justify-content: flex-start;
-}
-
-.main_middle {
-    flex: 3%;
-    display: flex;
-    align-items: flex-end;
-    flex-direction: row;
-    font-size: 20px;
-    font-weight: bold;
-}
-
-.main_middle__path {
-    display: flex;
-    color: #6493bc;
-    flex: 77.5%;
-}
-
-.main_middle__path_aright {
-    background-image: url(/svg/a-right.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    width: 3%;
-    opacity: .5;
-    margin: 0 1% 0 1%;
-}
-
-.main_middle__path_aright:hover {
-    opacity: 1;
-}
-
-.main_middle__path_aright_f {
-    background-image: url(/svg/a-right.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    width: 3%;
-    opacity: .3;
-    margin: 0 1% 0 1%;
-}
-
-.main_middle__path_aleft {
-    background-image: url(/svg/a-left.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    width: 3%;
-    opacity: .5;
-    margin-left: 1%;
-}
-
-.main_middle__path_aleft:hover {
-    opacity: 1;
-}
-
-.main_middle__path_aleft_f {
-    background-image: url(/svg/a-left.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    width: 3%;
-    opacity: .3;
-    margin-left: 1%;
-}
-
-.main_middle__online {
-    color: #b6c7d6;
-    flex: 21.5%;
-    text-align: end;
-}
-
-.main_middle__online_list {
-    display: block;
-    position: fixed;
-    visibility: hidden;
-    width: 14.25%;
-    height: 80%;
-    z-index: 2;
-    color: white;
-    overflow-y: auto;
-    overflow-x: hidden;
-}
-
-.main_middle__online_point {
-    display: flex;
-    width: 98%;
-    padding: 1%;
-    background: #6493bc;
-    cursor: default;
-}
-
-#menu__toggle:checked ~ .main_middle__online_list {
-    visibility: visible;
-}
-
-#menu__toggle {
-    display: none;
-}
-
-.main_payload {
-    flex: 91%;
-    border: 2px solid #b6c7d6;
-    display: flex;
-    flex-direction: column;
-    overflow: auto;
-    scrollbar-width: auto;
-    scrollbar-color: #6493bc #b6c7d6;
-}
-
-.main_payload__block {
-    display: flex;
-    width: 95%;
-    height: 4%;
-    margin: 0.5% 0 0 2.5%;
-    text-decoration: none;
-}
-
-.main_payload__block:hover {
-    background: #b6c7d6;
-}
-
-.main_payload__block_folder {
-    flex: 5%;
-    background-image: url(/svg/folder.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    background-size: contain;
-}
-
-.main_payload__block_message {
-    flex: 5%;
-    background-image: url(/svg/message.svg);
-    background-repeat: no-repeat;
-    background-position: center;
-    background-size: contain;
-}
-
-.main_payload__block_text {
-    flex: 93%;
-    font-size: 20px;
-    display: flex;
-    align-items: center;
-    color: #2f444c;
-}
-
-.main_payload__chat {
-    display: flex;
-    flex-direction: row;
-    width: 95%;
-    margin: 1% 0 0 2.5%;
-    font-size: 18px;
-}
-
-.main_payload__chat_username {
-    text-decoration: none;
-    flex: 10%;
-    margin-right: 1%;
-    font-weight: bold;
-}
-
-.main_payload__chat_username:hover {
-    background-color: #d4d4d4;
-}
-
-.main_payload__chat_mail {
-    flex: 89%;
-    color: #2f444c;
-    word-wrap: break-word;
-}
-
-.main_payload__error {
-    width: 95%;
-    font-size: 20px;
-    text-align: center;
-    margin: 2% 2% 0 2%;
-}
-
-.main_payload__about {
-    width: 95%;
-    font-size: 20px;
-    margin: 2% 2% 0 2%;
-}
-
-@media screen and (max-width: 950px) {
-    .wrapper {
-        padding: 1% 2%;
-    }
-
-    .main_middle__path {
-        flex: 67.5%;
-    }
-
-    .main_middle__online {
-        flex: 31.5%;
-    }
-
-    .main_middle__online_list {
-        width: 23%;
-    }
-
-    .main_header__search_input {
-        font-size: 14px;
-    }
-
-    .left_menu__footer {
-        font-size: 12px;
-    }
-
-    .main_middle__path_aright {
-        width: 5%;
-    }
-
-    .main_middle__path_aleft {
-        width: 5%;
-    }
-
-    .main_middle__path_aright_f {
-        width: 5%;
-    }
-
-    .main_middle__path_aleft_f {
-        width: 5%;
-    }
-}
-
-@media screen and (max-width: 1200px) {
-    .main_header__title_airplaine {
-        width: 8%;
-    }
-}
-
-@media screen and (max-height: 950px) {
-    .main_payload__block_text {
-        font-size: 18px;
-    }
-}
-
-@media screen and (max-height: 750px) {
-    .main_payload__block_text {
-        font-size: 16px;
-    }
-}
-
-@media screen and (max-height: 600px) {
-    .main_payload__block_text {
-        font-size: 14px;
-    }
-}

+ 0 - 8
html/svg/a-left.svg

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#6493BC;}
-</style>
-<polygon class="st0" points="256.3,512 256.3,362.8 512,362.8 512,149.7 256.3,149.7 256.3,0.5 0.5,256.3 "/>
-</svg>

+ 0 - 8
html/svg/a-right.svg

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#6493BC;}
-</style>
-<polygon class="st0" points="512,256.3 256.3,0.5 256.3,149.7 0.5,149.7 0.5,362.8 256.3,362.8 256.3,512 "/>
-</svg>

+ 0 - 8
html/svg/airplane.svg

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#6493BC;}
-</style>
-<polygon class="st0" points="161.3,287.2 161.3,445 288.4,350.3 415.5,508.1 510.8,3.2 2.4,255.7 "/>
-</svg>

+ 0 - 0
html/svg/arrows.svg


部分文件因文件數量過多而無法顯示