Skip to content

Commit

Permalink
رفع مشکل ایموجی در نام کانفیگ
Browse files Browse the repository at this point in the history
  • Loading branch information
ircfspace committed Mar 7, 2024
1 parent 6fa641d commit 3ca37c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ function cleanUrl(url) {
return randomizeCase(finalUrl);
}

function removeEmoji(remarks) {
return remarks.replace(/[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/gu, '').replace(/\s+/g, ' ')
}

function generateJson() {
return new Promise((resolve, reject) => {
let protocol = $('#protocol').val();
Expand Down Expand Up @@ -367,6 +371,7 @@ function generateJson() {
if ( remarks === "") {
remarks = "IRCF Fragment";
}
remarks = removeEmoji(remarks);
if ( uuid === '' || sni === ''|| port === '' ) {
alert('فرم را تکمیل نمایید.');
return false;
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ <h4 class="modal-title dirLeft">QRCode</h4>
<script src="./assets/js/jquery.min.js"></script>
<script src="./assets/js/bootstrap.min.js"></script>
<script src="./assets/js/lang.js?v1.13.8"></script>
<script src="./assets/js/script.js?v1.14.1"></script>
<script src="./assets/js/script.js?v1.14.2"></script>
</footer>
</div>
</div>
Expand Down

0 comments on commit 3ca37c9

Please sign in to comment.