new modes
This commit is contained in:
@@ -69,12 +69,6 @@
|
||||
<div id="irc-messages"></div>
|
||||
<div class="irc-input-area">
|
||||
<input type="text" id="irc-input" placeholder="Type a message..." autocomplete="off" maxlength="300" disabled>
|
||||
<span id="irc-char-count" class="char-count">0/300</span>
|
||||
<button id="irc-send" disabled>
|
||||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -88,28 +88,11 @@ const IRC_MAX_MESSAGE_LENGTH = 300;
|
||||
function initIrcListeners() {
|
||||
$('irc-toggle').addEventListener('click', toggleIrcSidebar);
|
||||
$('irc-input').addEventListener('keypress', (e) => e.key === 'Enter' && sendIrcMessage());
|
||||
$('irc-input').addEventListener('input', updateCharCount);
|
||||
$('irc-send').addEventListener('click', sendIrcMessage);
|
||||
$('irc-connect').addEventListener('click', handleIrcConnect);
|
||||
$('irc-disconnect').addEventListener('click', handleIrcDisconnect);
|
||||
$('irc-close').addEventListener('click', toggleIrcSidebar);
|
||||
}
|
||||
|
||||
function updateCharCount() {
|
||||
const input = $('irc-input');
|
||||
const counter = $('irc-char-count');
|
||||
const len = input.value.length;
|
||||
|
||||
counter.textContent = `${len}/${IRC_MAX_MESSAGE_LENGTH}`;
|
||||
counter.classList.remove('warning', 'danger');
|
||||
|
||||
if (len >= IRC_MAX_MESSAGE_LENGTH) {
|
||||
counter.classList.add('danger');
|
||||
} else if (len >= IRC_MAX_MESSAGE_LENGTH * 0.8) {
|
||||
counter.classList.add('warning');
|
||||
}
|
||||
}
|
||||
|
||||
function toggleIrcSidebar() {
|
||||
state.irc.sidebarOpen = !state.irc.sidebarOpen;
|
||||
const ircSidebar = $('irc-sidebar');
|
||||
@@ -171,9 +154,7 @@ function handleIrcDisconnect() {
|
||||
state.irc.unreadCount = 0;
|
||||
updateIrcBadge();
|
||||
|
||||
// Reset char counter
|
||||
$('irc-input').value = '';
|
||||
updateCharCount();
|
||||
|
||||
// Update button visibility
|
||||
updateIrcButtons();
|
||||
@@ -290,7 +271,6 @@ function connectIrc() {
|
||||
updateIrcStatus('disconnected');
|
||||
updateIrcButtons();
|
||||
$('irc-input').disabled = true;
|
||||
$('irc-send').disabled = true;
|
||||
|
||||
// Don't show messages or reconnect if intentional disconnect
|
||||
if (state.irc.intentionalDisconnect) {
|
||||
@@ -533,7 +513,6 @@ function handleIrcMessage(line) {
|
||||
if (joinedChannel.toLowerCase() === IRC_CONFIG.channel.toLowerCase()) {
|
||||
addIrcMessage('system', `Joined ${IRC_CONFIG.channel}`);
|
||||
$('irc-input').disabled = false;
|
||||
$('irc-send').disabled = false;
|
||||
|
||||
// Request channel history if chathistory cap is enabled
|
||||
const hasChathistory = ircv3.enabledCaps.includes('chathistory') || ircv3.enabledCaps.includes('draft/chathistory');
|
||||
@@ -593,7 +572,6 @@ function handleIrcMessage(line) {
|
||||
const kickReason = params[2] || 'No reason';
|
||||
addIrcMessage('system', `Kicked from ${kickChannel}: ${kickReason}`);
|
||||
$('irc-input').disabled = true;
|
||||
$('irc-send').disabled = true;
|
||||
|
||||
// Auto-rejoin after 3 seconds
|
||||
if (kickChannel.toLowerCase() === IRC_CONFIG.channel.toLowerCase()) {
|
||||
@@ -742,5 +720,4 @@ function disconnectIrc() {
|
||||
updateIrcStatus('disconnected');
|
||||
updateIrcButtons();
|
||||
$('irc-input').disabled = true;
|
||||
$('irc-send').disabled = true;
|
||||
}
|
||||
|
||||
BIN
static/sounds/laugh.mp3
Normal file
BIN
static/sounds/laugh.mp3
Normal file
Binary file not shown.
@@ -770,51 +770,6 @@ body {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.irc-input-area button {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
background: var(--acid);
|
||||
color: var(--bg-primary);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.irc-input-area button svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.irc-input-area button:hover:not(:disabled) {
|
||||
background: var(--acid-dim);
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.irc-input-area button:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.char-count {
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
font-size: 0.7rem;
|
||||
color: var(--text-muted);
|
||||
padding: 0 0.5rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.char-count.warning {
|
||||
color: var(--warning);
|
||||
}
|
||||
|
||||
.char-count.danger {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
/* ========== USER SIDEBAR (RIGHT) ========== */
|
||||
#sidebar {
|
||||
width: var(--sidebar-width);
|
||||
|
||||
Reference in New Issue
Block a user