Skip to content

Commit

Permalink
Only enable Quick Tags on legacy posts
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon committed Sep 12, 2023
1 parent 13a0fa4 commit 37fe88b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Extensions/quick_tags.css
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,10 @@
.xkit-interface-control-button.xkit-quick-tags:after {
opacity: 1 !important;
}

.xkit-quick-tags-cp-info {
padding: 0 1em;
font-size: 14px;
line-height: 1.5;
color: rgb(80,80,80);
}
27 changes: 24 additions & 3 deletions Extensions/quick_tags.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//* TITLE Quick Tags **//
//* VERSION 0.6.8 **//
//* VERSION 0.6.9 **//
//* DESCRIPTION Quickly add tags to posts **//
//* DETAILS Allows you to create tag bundles and add tags to posts without leaving the dashboard. **//
//* DEVELOPER New-XKit **//
Expand Down Expand Up @@ -413,8 +413,14 @@ XKit.extensions.quick_tags = new Object({

$posts
.addClass("xkit-quick-tags-done")
.each(function() {
XKit.interface.react.add_control_button($(this), "xkit-quick-tags", "");
.each(async function() {
const $post = $(this);
const post_id = $post.attr("data-id");
const {isBlocksPostFormat} = await XKit.interface.react.post_props(post_id);

if (!isBlocksPostFormat) {
XKit.interface.react.add_control_button($(this), "xkit-quick-tags", "");
}
});

XKit.extensions.quick_tags.processing = false;
Expand Down Expand Up @@ -652,6 +658,21 @@ XKit.extensions.quick_tags = new Object({
$("#xkit-extensions-panel-right").nanoScroller();
$("#xkit-extensions-panel-right").nanoScroller({ scroll: 'top' });

XKit.extensions.quick_tags.infoCpanel(m_div);
},

infoCpanel: function(m_div) {

$('.xkit-quick-tags-cp-info').remove();
$(m_div).prepend(`
<div class="xkit-quick-tags-cp-info">
<p>
This only works on legacy posts. You can migrate to
<a href="https://github.com/AprilSylph/XKit-Rewritten#readme" target="_blank">
XKit Rewritten</a>, but you will have to manually copy over your bundles.
</p>
</div>
`);
},

add_bundle_ui: function() {
Expand Down

0 comments on commit 37fe88b

Please sign in to comment.