Commit before bed

This commit is contained in:
Floorb 2021-08-23 02:58:45 -04:00
parent 90d68d0193
commit 8781ebc3b2
2 changed files with 28 additions and 63 deletions

View file

@ -32,7 +32,7 @@ $start = $time;
</title> </title>
<meta name="description" content="<?= pp_html_escape($global_site_info['description']) ?>"/> <meta name="description" content="<?= pp_html_escape($global_site_info['description']) ?>"/>
<meta name="keywords" content="<?= pp_html_escape($global_site_info['keywords']) ?>"/> <meta name="keywords" content="<?= pp_html_escape($global_site_info['keywords']) ?>"/>
<link rel="shortcut icon" href="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/img/favicon.ico"> <link rel="shortcut icon" href="//<?= $baseurl ?>/theme/bulma/img/favicon.ico">
<link href="//<?= $baseurl ?>/theme/bulma/css/paste.css" rel="stylesheet"/> <link href="//<?= $baseurl ?>/theme/bulma/css/paste.css" rel="stylesheet"/>
<link href="//<?= $baseurl ?>/theme/bulma/css/table-responsive.css" rel="stylesheet"/> <link href="//<?= $baseurl ?>/theme/bulma/css/table-responsive.css" rel="stylesheet"/>
<link href="//<?= $baseurl ?>/theme/bulma/css/table-row-orders.css" rel="stylesheet"/> <link href="//<?= $baseurl ?>/theme/bulma/css/table-row-orders.css" rel="stylesheet"/>
@ -41,7 +41,7 @@ $start = $time;
<script src="//<?= $baseurl ?>/theme/bulma/js/paste.js"></script> <script src="//<?= $baseurl ?>/theme/bulma/js/paste.js"></script>
<script src="//<?= $baseurl ?>/theme/bulma/js/modal-fx.min.js"></script> <script src="//<?= $baseurl ?>/theme/bulma/js/modal-fx.min.js"></script>
<script src="//<?= $baseurl ?>/theme/bulma/js/datatables.min.js"></script> <script src="//<?= $baseurl ?>/theme/bulma/js/datatables.min.js"></script>
<script src=//<?= $baseurl ?>/theme/bulma/js/table-responsive.js"></script> <script src="//<?= $baseurl ?>/theme/bulma/js/table-responsive.js"></script>
<script src="//<?= $baseurl ?>/theme/bulma/js/table-reorder.js"></script> <script src="//<?= $baseurl ?>/theme/bulma/js/table-reorder.js"></script>
</head> </head>
@ -50,12 +50,12 @@ $start = $time;
<div class="container"> <div class="container">
<div class="navbar-brand"> <div class="navbar-brand">
<a style="font-size: 24px;" <a style="font-size: 24px;"
href="<?php echo '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); ?>" href="<?= paste_protocol() . pp_html_escape($baseurl) ?>"
class="navbar-item mx-1"><?php echo $site_name; ?></a> class="navbar-item mx-1"><?= pp_html_escape($site_name); ?></a>
<div class="theme-switch-wrapper"> <div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox"> <label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox"/> <input type="checkbox" id="checkbox"/>
<div class="slider round"></div> <span class="slider round"></span>
</label> </label>
</div> </div>
<div id="navbarBurger" class="navbar-burger burger" data-target="navMenuDocumentation"> <div id="navbarBurger" class="navbar-burger burger" data-target="navMenuDocumentation">
@ -227,20 +227,20 @@ $start = $time;
<section class="modal-card-body"> <section class="modal-card-body">
<form method="POST" action="../login.php?register"> <form method="POST" action="../login.php?register">
<div class="field"> <div class="field">
<label class="label"><?php echo $lang['username']; ?></label> <label class="label"><?= $lang['username']; ?></label>
<div class="control has-icons-left has-icons-right"> <div class="control has-icons-left has-icons-right">
<input type="text" class="input" name="username" <input type="text" class="input" name="username"
placeholder="<?php echo $lang['username']; ?>"> placeholder="<?= $lang['username']; ?>">
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fas fa-user"></i> <i class="fas fa-user"></i>
</span> </span>
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label class="label"><?php echo $lang['newpwd']; ?></label> <label class="label"><?= $lang['newpwd']; ?></label>
<div class="control has-icons-left has-icons-right"> <div class="control has-icons-left has-icons-right">
<input type="password" class="input" name="password" <input type="password" class="input" name="password"
placeholder="<?php echo $lang['newpwd']; ?>"> placeholder="<?= $lang['newpwd']; ?>">
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fas fa-key"></i> <i class="fas fa-key"></i>
</span> </span>
@ -255,16 +255,15 @@ $start = $time;
</div> </div>
<div class="field"> <div class="field">
<div class="notification"> <div class="notification">
<span class="tags are-large"><?php echo '<img src="' . $_SESSION['captcha']['image_src'] . '" alt="CAPTCHA" class="imagever">'; ?></span> <span class="tags are-large"><?= '<img src="' . $_SESSION['captcha']['image_src'] . '" alt="CAPTCHA" class="imagever">'; ?></span>
<input type="text" class="input" name="scode" value="" <input type="text" class="input" name="scode" value=""
placeholder="<?php echo $lang['entercode']; ?>"> placeholder="<?= $lang['entercode']; ?>">
<p class="is-size-6 has-text-grey-light has-text-left mt-2">and press <p class="is-size-6 has-text-grey-light has-text-left mt-2">and press
"Enter"</p> "Enter"</p>
</div> </div>
</div> </div>
</div> </div>
<input class="button is-link is-fullwidth my-4" type="submit" name="signup" value="Register" <input class="button is-link is-fullwidth my-4" type="submit" name="signup" />
value="<?php echo md5($date . $ip); ?>">
<div class="field"> <div class="field">
<p style="float:left;">By signing up you agree to our <a href="page/privacy">Privacy policy </a> <p style="float:left;">By signing up you agree to our <a href="page/privacy">Privacy policy </a>
and <a href="page/rules">Site rules</a>. This site may contain material not sutible for and <a href="page/rules">Site rules</a>. This site may contain material not sutible for
@ -276,15 +275,9 @@ $start = $time;
</div> </div>
</div> </div>
<!-- Main page content begin -->
<!--
CONTENT HERE!
-->
<?php require_once(__DIR__ . '/' . $page_template . '.php'); ?> <?php require_once(__DIR__ . '/' . $page_template . '.php'); ?>
<!-- Main page content end -->
<footer class="footer has-background-white" style="border-top: 1px solid #ebeaeb"> <footer class="footer has-background-white" style="border-top: 1px solid #ebeaeb">
<div class="container"> <div class="container">

View file

@ -1,36 +1,8 @@
<link rel="stylesheet" href="theme/bulma/css/bulma-tagsinput.min.css"/> <link rel="stylesheet" href="theme/bulma/css/bulma-tagsinput.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="theme/bulma/js/bulma-tagsinput.min.js"></script>
<script src="/js/tag_input.js"></script> <script src="/js/tag_input.js"></script>
<script> <script>
function setupTagsInput() { function setupTagsInput() {
new TagsInput(document.getElementById('tags-with-source')).attach();
const tagsInput = document.getElementById('tags-with-source');
new TagsInput(tagsInput).attach();
/*new BulmaTagsInput(tagsInput, {
allowDuplicates: false,
caseSensitive: false,
clearSelectionOnTyping: false,
closeDropdownOnItemSelect: true,
delimiter: ',',
freeInput: true,
highlightDuplicate: true,
highlightMatchesString: true,
itemText: 'name',
maxTags: 10,
maxChars: 40,
minChars: 1,
noResultsLabel: 'No results found',
placeholder: '10 Tags Maximum"',
removable: true,
searchMinChars: 1,
searchOn: 'text',
selectable: true,
tagClass: 'is-info',
trim: true,
});*/
} }
if (document.readyState !== 'loading') { if (document.readyState !== 'loading') {
@ -403,21 +375,21 @@
function countChars(obj) { function countChars(obj) {
// True limit // True limit
var maxLength = 1000000; const maxLength = 1000000;
var strLength = obj.value.length; const strLength = obj.value.length;
var charRemain = (maxLength - strLength); const charRemain = (maxLength - strLength);
var char2kb = charRemain / 1000; const char2kb = charRemain / 1000;
var charDisplay = roundToTwo(char2kb); const charDisplay = roundToTwo(char2kb);
// Grace limit // Grace limit
var gracelimit = 11480; const gracelimit = 11480;
var newstrLength = obj.value.length - 1000000; const newstrLength = obj.value.length - 1000000;
var graceRemain = (gracelimit - newstrLength); const graceRemain = (gracelimit - newstrLength);
var grace2kb = graceRemain / 1000; const grace2kb = graceRemain / 1000;
var graceDisplay = roundToTwo(grace2kb); const graceDisplay = roundToTwo(grace2kb);
if (graceRemain < 0) { if (graceRemain < 0) {
document.getElementById("charNum").innerHTML = '<b>File Size: </b><span style="color: red;">File Size limit reached</span>'; document.getElementById("charNum").innerHTML = '<b>File Size: </b><span style="color: red;">File Size limit reached</span>';
} else if ((charRemain < 0)) { } else if (charRemain < 0) {
document.getElementById("charNum").innerHTML = '<b>File Size: </b><span style="color: orange;">' + graceDisplay + '/24Kb Grace Limit</span>'; document.getElementById("charNum").innerHTML = '<b>File Size: </b><span style="color: orange;">' + graceDisplay + '/24Kb Grace Limit</span>';
} else { } else {
document.getElementById("charNum").innerHTML = '<b>File Size: </b><span style="color: green;">' + charDisplay + '/1000Kb</span>'; document.getElementById("charNum").innerHTML = '<b>File Size: </b><span style="color: green;">' + charDisplay + '/1000Kb</span>';