mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 06:30:07 +01:00
add colour to tags
colourful
This commit is contained in:
parent
30c247ece5
commit
53dfe712fe
1 changed files with 2 additions and 18 deletions
|
@ -23,16 +23,8 @@ function setupTagsInput() {
|
||||||
searchMinChars: 1,
|
searchMinChars: 1,
|
||||||
searchOn: 'text',
|
searchOn: 'text',
|
||||||
selectable: true,
|
selectable: true,
|
||||||
tagClass: 'is-rounded',
|
tagClass: 'is-info',
|
||||||
trim: true,
|
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();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,15 +238,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
||||||
<div class="columns is-desktop is-centered">
|
<div class="columns is-desktop is-centered">
|
||||||
<?php
|
<?php
|
||||||
$tags = $paste['tags'];
|
$tags = $paste['tags'];
|
||||||
if (count($tags) != 0) {
|
echo tagsToHtml($tags);
|
||||||
foreach ($tags as $tag) {
|
|
||||||
$tagName = ucfirst(pp_html_escape($tag['name']));
|
|
||||||
echo '<a href="/archive?q=' . $tagName . '"><span class="tag is-info">' . $tagName . '</span></a>';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo ' <span class="tag is-warning">No tags</span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
Loading…
Add table
Reference in a new issue