mirror of
https://github.com/znc/znc.git
synced 2026-05-07 22:04:46 +02:00
Webadmin: Add GUI for character encoding
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<? AddRow JSLoop HREF=/modfiles/global/webadmin/webadmin.js ?>
|
||||
<? AddRow CSSLoop HREF=/modfiles/global/webadmin/webadmin.css ?>
|
||||
<? INC Header.tmpl ?>
|
||||
|
||||
<div class="section">
|
||||
@@ -83,7 +84,7 @@
|
||||
<div class="inputlabel">Flood protection:</div>
|
||||
<div class="checkbox">
|
||||
<input type="checkbox" name="floodprotection" id="floodprotection_checkbox"
|
||||
title="You might enable the flood protection. This prevents `excess flood' errors, which occur, when your IRC bot is command flooded or spammed."
|
||||
title="You might enable the flood protection. This prevents `excess flood' errors, which occur, when your IRC bot is command flooded or spammed. After changing this, reconnect ZNC to server."
|
||||
onchange="floodprotection_change();"
|
||||
<? IF FloodProtection ?>checked="checked"<? ENDIF ?> />
|
||||
<label for="floodprotection_checkbox">Enabled</label>
|
||||
@@ -92,7 +93,7 @@
|
||||
<div class="subsection">
|
||||
<div class="inputlabel">Flood protection rate:</div>
|
||||
<input type="number" name="floodrate" min="0.3" step="0.05" id="floodrate"
|
||||
title="The number of seconds per line."
|
||||
title="The number of seconds per line. After changing this, reconnect ZNC to server."
|
||||
<? IF FloodProtection ?> value="<? VAR FloodRate ?>" <? ELSE ?> value="1.00" disabled="disabled" <? ENDIF ?>
|
||||
/> seconds per line
|
||||
</div>
|
||||
@@ -100,7 +101,7 @@
|
||||
<div class="subsection">
|
||||
<div class="inputlabel">Flood protection burst:</div>
|
||||
<input type="number" name="floodburst" min="1" id="floodburst"
|
||||
title="Defines the number of lines, which can be sent immediately."
|
||||
title="Defines the number of lines, which can be sent immediately. After changing this, reconnect ZNC to server."
|
||||
<? IF FloodProtection ?> value="<? VAR FloodBurst ?>" <? ELSE ?> value="4" disabled="disabled" <? ENDIF ?>
|
||||
/> lines can be sent immediately
|
||||
</div>
|
||||
@@ -113,6 +114,13 @@
|
||||
/> seconds
|
||||
</div>
|
||||
<script type="text/javascript">floodprotection_change();</script>
|
||||
|
||||
<div style="clear:both;"></div>
|
||||
<div class="subsection" title="Character encoding used between ZNC and IRC server. After changing this, reconnect ZNC to server.">
|
||||
<div class="inputlabel">Server encoding:</div>
|
||||
<? INC encoding_settings.tmpl ?>
|
||||
</div>
|
||||
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<? AddRow CSSLoop HREF=/modfiles/global/webadmin/webadmin.css ?>
|
||||
<? INC Header.tmpl ?>
|
||||
|
||||
<form action="<? VAR URIPrefix TOP ?><? VAR ModPath TOP ?><? IF Edit ?>edituser<? ELSE ?>adduser<? ENDIF ?>" method="post">
|
||||
@@ -281,6 +282,12 @@
|
||||
<? ENDLOOP ?>
|
||||
</datalist>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
<div class="subsection" title="Character encoding used between IRC client and ZNC. After changing this, reconnect client to ZNC.">
|
||||
<div class="inputlabel">Client encoding:</div>
|
||||
<? INC encoding_settings.tmpl ?>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
<div class="subsection">
|
||||
<div class="inputlabel">Join Tries:</div>
|
||||
<input type="number" name="jointries" value="<? VAR JoinTries ?>" class="third" min="0"
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<div class="encoding-settings">
|
||||
<div>
|
||||
<div class="checkboxandlabel checkbox">
|
||||
<input type="radio" name="encoding_utf" id="encoding_utf_legacy" value="legacy" <? IF EncodingUtf == "legacy" ?>checked="checked"<? ENDIF ?> <? IF EncodingDisabled ?>disabled="disabled"<? ENDIF ?> />
|
||||
<label for="encoding_utf_legacy">Don't ensure any encoding at all (legacy mode, not recommended)</label>
|
||||
</div>
|
||||
<div class="checkboxandlabel checkbox">
|
||||
<input type="radio" name="encoding_utf" id="encoding_utf_send" value="send" <? IF EncodingUtf == "send" ?>checked="checked"<? ENDIF ?> <? IF EncodingDisabled ?>disabled="disabled"<? ENDIF ?> />
|
||||
<label for="encoding_utf_send">Try to parse as UTF-8 and as <span class="encoding-placeholder-big"> <span class="encoding-placeholder"></span> </span>, send as UTF-8</label>
|
||||
</div>
|
||||
<div class="checkboxandlabel checkbox">
|
||||
<input type="radio" name="encoding_utf" id="encoding_utf_receive" value="receive" <? IF EncodingUtf == "receive" ?>checked="checked"<? ENDIF ?> <? IF EncodingDisabled ?>disabled="disabled"<? ENDIF ?> />
|
||||
<label for="encoding_utf_receive">Try to parse as UTF-8 and as <span class="encoding-placeholder-big"> <span class="encoding-placeholder"></span> </span>, send as <span class="encoding-placeholder-big"> <span class="encoding-placeholder"></span > </span></label>
|
||||
</div>
|
||||
<div class="checkboxandlabel checkbox">
|
||||
<input type="radio" name="encoding_utf" id="encoding_utf_simple" value="simple" <? IF EncodingUtf == "simple" ?>checked="checked"<? ENDIF ?> <? IF EncodingDisabled ?>disabled="disabled"<? ENDIF ?> />
|
||||
<label for="encoding_utf_simple">Parse and send as <span class="encoding-placeholder-big"> <span class="encoding-placeholder"></span> </span> only</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="half">
|
||||
<input type="text" name="encoding" value="<? VAR Encoding ?>" list="encoding_list"
|
||||
<? IF EncodingDisabled ?>disabled="disabled"<? ENDIF ?> />
|
||||
<br /><div class="third"><span class="info">E.g. <code>UTF-8</code>, or <code>ISO-8859-1</code></span></div>
|
||||
<script type="text/javascript">
|
||||
function updateEncodingText() {
|
||||
var value = jQuery("input[name=encoding]").val();
|
||||
jQuery(".encoding-placeholder").each(function(index, element) {
|
||||
jQuery(element).text(value);
|
||||
});
|
||||
}
|
||||
jQuery("input[name=encoding]").on("keyup change input", updateEncodingText);
|
||||
updateEncodingText();
|
||||
|
||||
function updateEncodingLegacy() {
|
||||
var disabled = jQuery("input:radio[name=encoding_utf]:checked").val() == "legacy";
|
||||
jQuery("input[name=encoding]").prop("disabled", disabled);
|
||||
}
|
||||
jQuery("input:radio[name=encoding_utf]").change(updateEncodingLegacy);
|
||||
updateEncodingLegacy();
|
||||
</script>
|
||||
<datalist id="encoding_list">
|
||||
<? LOOP EncodingLoop ?>
|
||||
<option value="<? VAR Encoding ?>"/>
|
||||
<? ENDLOOP ?>
|
||||
</datalist>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user