mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 14:40:09 +01:00
Fixed paste view page
Tags now appear in tag input box.
This commit is contained in:
parent
7d47cc619e
commit
faab356e32
1 changed files with 53 additions and 28 deletions
|
@ -2,20 +2,45 @@
|
||||||
<link rel="stylesheet" href="theme/bulma/css/bulma-tagsinput.min.css"/>
|
<link rel="stylesheet" href="theme/bulma/css/bulma-tagsinput.min.css"/>
|
||||||
<script src="theme/bulma/js/bulma-tagsinput.min.js"></script>
|
<script src="theme/bulma/js/bulma-tagsinput.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
function setupTagsInput() {
|
||||||
BulmaTagsInput.attach();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
|
||||||
const tagsInput = document.getElementById('tags-with-source');
|
const tagsInput = document.getElementById('tags-with-source');
|
||||||
new BulmaTagsInput(tagsInput, {
|
new BulmaTagsInput(tagsInput, {
|
||||||
autocomplete: {
|
allowDuplicates: false,
|
||||||
<!-- Json to be completed -->
|
caseSensitive: false,
|
||||||
source: "",
|
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-rounded',
|
||||||
|
trim: true,
|
||||||
|
source: async function (value) {
|
||||||
|
// Value equal input value
|
||||||
|
// We can then use it to request data from external API
|
||||||
|
return await fetch("/api/tags_autocomplete.php?tag=" + encodeURIComponent(value))
|
||||||
|
.then(function (response) {
|
||||||
|
return response.json();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, false);
|
}
|
||||||
|
|
||||||
|
if (document.readyState !== 'loading') {
|
||||||
|
setupTagsInput();
|
||||||
|
} else {
|
||||||
|
document.addEventListener('DOMContentLoaded', setupTagsInput);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
function openreport() {
|
function openreport() {
|
||||||
|
@ -234,7 +259,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<?php if (isset($error)) {
|
<?php if (isset($error)) {
|
||||||
echo '<p class="help is-danger subtitle is-6">' . $error . '</p>';
|
echo '<div class="notification is-danger"><i class="fa fa-exclamation-circle" aria-hidden=" true"></i><p>' . $error . '</p></div>';
|
||||||
} else {
|
} else {
|
||||||
if ($paste['code'] != "pastedown") {
|
if ($paste['code'] != "pastedown") {
|
||||||
echo '
|
echo '
|
||||||
|
@ -283,8 +308,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<!-- Paste Panel -->
|
<!-- Paste Panel -->
|
||||||
<hr>
|
<hr>
|
||||||
<h1 class="title is-6 mx-1"><?php echo $lang['modpaste']; ?>
|
<h1 class="title is-6 mx-1"><?php echo $lang['modpaste']; ?></h1>
|
||||||
<h1>
|
|
||||||
<form class="form-horizontal" name="mainForm" action="index.php" method="POST">
|
<form class="form-horizontal" name="mainForm" action="index.php" method="POST">
|
||||||
<nav class="level">
|
<nav class="level">
|
||||||
<div class="level-left">
|
<div class="level-left">
|
||||||
|
@ -292,8 +316,8 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
||||||
<div class="level-item is-pulled-left mx-1">
|
<div class="level-item is-pulled-left mx-1">
|
||||||
<p class="control has-icons-left">
|
<p class="control has-icons-left">
|
||||||
<input type="text" class="input" name="title"
|
<input type="text" class="input" name="title"
|
||||||
placeholder="<?php echo $lang['pastetitle']; ?>"
|
placeholder="<?= $paste['title'] ?>"
|
||||||
value="<?php echo($p_title); ?>">
|
value="<?= $paste['title'] ?>">
|
||||||
<span class="icon is-small is-left">
|
<span class="icon is-small is-left">
|
||||||
<i class="fa fa-font"></i></a>
|
<i class="fa fa-font"></i></a>
|
||||||
</span>
|
</span>
|
||||||
|
@ -343,24 +367,24 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
||||||
<p id="charNum"><b>File Size: </b><span style="color: green;">1000/1000Kb</span></p>
|
<p id="charNum"><b>File Size: </b><span style="color: green;">1000/1000Kb</span></p>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class='rows'>
|
|
||||||
<div class='row is-full'>
|
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label">Tags</label>
|
<label class="label">Tags</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input id="tags-with-source" name="tags" class="input"
|
<input id="tags-with-source" name="tags" class="input"
|
||||||
data-max-tags="10" data-max-chars="40" type="text"
|
value="<?php
|
||||||
data-item-text="name" data-case-sensitive="false"
|
$inputtags = $paste['tags'];
|
||||||
placeholder="10 Tags Maximum"
|
foreach ($inputtags as $tag) {
|
||||||
value="<?php echo pp_html_encode(join(',', $paste['tags'])); ?>">
|
$tagsName = ucfirst(pp_html_escape($tag['name']));
|
||||||
</div>
|
echo ','.$tagsName.'';
|
||||||
</div>
|
}?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav class="level">
|
<nav class="level">
|
||||||
<div class="level-left">
|
<div class="level-left">
|
||||||
<div class="level-item is-pulled-left mr-1">
|
<div class="level-item is-pulled-left mr-1">
|
||||||
|
@ -448,7 +472,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
||||||
<?php echo $lang['encrypt']; ?>
|
<?php echo $lang['encrypt']; ?>
|
||||||
</label>
|
</label>
|
||||||
<?php
|
<?php
|
||||||
if ($current_user && ($current_user['id'] === $paste['user_id'])) {
|
if ($current_user->user_id == $paste['user_id']) {
|
||||||
?>
|
?>
|
||||||
<input class="button is-info" type="submit" name="edit" id="edit"
|
<input class="button is-info" type="submit" name="edit" id="edit"
|
||||||
value="<?php echo $lang['editpaste']; ?>"/>
|
value="<?php echo $lang['editpaste']; ?>"/>
|
||||||
|
@ -468,11 +492,12 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php require_once('theme/' . $default_theme . '/sidebar.php'); ?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue