-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
102 lines (91 loc) · 3.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/extend.js"></script>
<script type="text/javascript" src="censorlist.js"></script>
<script type="text/javascript">
var disallowedChars = [];
var disallowedShiftChars = [51, 53];
$(document).ready(function() {
$('#nameInput').on('keydown', function(e) {
if ((e.shiftKey && disallowedShiftChars.indexOf(e.keyCode) != -1) || disallowedChars.indexOf(e.keyCode) != -1) {
e.preventDefault();
}
});
$('#nameInput').on('input', function(e) {
nameCheck();
});
});
var nameCheck = function() {
var censored = false;
var name = $('#nameInput').val();
var censoredName = name;
var censoredList = [];
if (name.length > 0) {
for (var i = 0; i < censorList.length; i++) {
var itemIndices = name.indicesOf(censorList[i].toLowerCase())
if (itemIndices.length >= 1) {
for (var x = 0; x < itemIndices.length; x++) {
censoredName = censoredName.replaceChars('*', itemIndices[x], censorList[i].length);
}
censored = true;
censoredList.push(censorList[i]);
}
}
if (censored) {
$('#outputMessage').css('color', 'red');
$('#outputMessage').html('Your name is censored:');
$('#outputName').html(censoredName);
$('#outputReason').html('For the following words: <br />' + censoredList.join('<br />'));
} else {
$('#outputMessage').css('color', 'green');
$('#outputMessage').html('Your name is not censored:');
$('#outputName').html(censoredName);
$('#outputReason').html('');
}
} else {
$('#outputMessage').html('');
$('#outputName').html('');
$('#outputReason').html('');
}
};
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-76635308-1', 'auto');
ga('send', 'pageview');
</script>
<html>
<head>
<title>Dark Souls 3 Name Check</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="css/stylesheet.css">
</head>
<body>
<div id="header_wrap" class="outer">
<header class="inner">
<h1 id="project_title">Dark Souls 3 Name Censor Checker</h1>
<h2 id="project_tagline"></h2>
</header>
</div>
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner" style="text-align: center">
<div>It appears that Dark Souls 3 is currently doing a case sensitive check for words, meaning you can bypass the filter by adding an uppercase letter to your name.</div>
<br/>
<div>Just start typing...</div>
<input type="text" id="nameInput" maxlength="16" class="form-control"/>
<div id="outputContent">
<p id="outputMessage"></p>
<p id="outputName"></p>
<p id="outputReason"></p>
</div>
</section>
</div>
<div id="footer_wrap" class="outer">
<footer class="inner" style="text-align: center">
<a href="https://github.com/omgftw/DarkSouls3CensorCheck">View Source Code on GitHub</a>
</footer>
</div>
</body>
</html>