diff --git a/Extensions/quick_tags.css b/Extensions/quick_tags.css index 6a434f822..ff930e0fe 100644 --- a/Extensions/quick_tags.css +++ b/Extensions/quick_tags.css @@ -238,3 +238,14 @@ .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); +} + +.xkit-quick-tags-cp-info button { + margin: 0 0 .75em 0; +} diff --git a/Extensions/quick_tags.js b/Extensions/quick_tags.js index f157df17a..87c210a63 100644 --- a/Extensions/quick_tags.js +++ b/Extensions/quick_tags.js @@ -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 **// @@ -652,6 +652,59 @@ 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(` +
+

+ The XKit Rewritten extension includes a new version of this script. It fixes post formatting becoming broken when tags are added and adds a quick tag button to the post editor! +

+

+ To migrate easily, install XKit Rewritten and enable its Quick Tags feature in your browser toolbar, then refresh this page and press this button to copy your tag bundles: +

+ +
+ `); + + $('#xkit-quick-tags-cp-export').on('click', async function() { + if (!XKit.extensions.quick_tags.tag_array.length) { + XKit.window.show( + 'Nothing to Copy', + "You don't have any tag bundles to copy!", + 'error', + '
OK
', + ); + return; + } + + this.setAttribute('disabled', ''); + this.classList.add('disabled'); + + let succeeded = false; + + window.addEventListener('xkit-quick-tags-migration-success', () => { succeeded = true; }, { once: true }); + window.dispatchEvent(new CustomEvent('xkit-quick-tags-migration', { detail: JSON.stringify(XKit.extensions.quick_tags.tag_array) })); + + setTimeout(() => { + this.removeAttribute('disabled'); + this.classList.remove('disabled'); + + if (succeeded) { + XKit.extensions.xkit_preferences.close(); + } else { + XKit.window.show( + 'Failure', + 'Make sure you have installed XKit Rewritten v0.23.5 or later, have refreshed the page, and have enabled Quick Tags.', + 'error', + '
OK
', + ); + } + }, 500); + }); }, add_bundle_ui: function() {