Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name # Oxygen Post Types Exclude
- // @description Oxygen Post Type Exclude Select all except PAGE
- // @namespace http://tampermonkey.net/
- // @version 2024-01-20
- // @author Arshad
- // @match https://*/*oxygen_vsb_settings&tab=client_control
- // @grant none
- // ==/UserScript==
- (function () {
- 'use strict';
- // adds a new button
- let buttonAdded = document.createElement('button');
- buttonAdded.textContent = 'Check ! PAGE';
- buttonAdded.classList.add('button-added');
- document.body.appendChild(buttonAdded);
- // Button when clicked, check all the post types except PAGE
- buttonAdded.addEventListener('click', function () {
- let checkBoxes = document.querySelectorAll('[name*="oxygen_vsb_ignore"]');
- if (checkBoxes) {
- checkBoxes.forEach(function (element) {
- if (element.getAttribute('name') !== 'oxygen_vsb_ignore_post_type_page') {
- element.checked = true;
- }
- });
- }
- });
- // Style of the button according to Oxygen styles.
- let styles = document.createElement('style');
- styles.textContent = `
- .button-added {
- position: fixed;
- bottom: 82px;
- right: 32px;
- z-index: 9999;
- background-color: #241a6c;
- color: #fff;
- padding: 12px 16px;
- border: none;
- border-radius: 6px;
- cursor: pointer;
- }
- `;
- // Append the <style> element to the head of the document
- document.head.appendChild(styles);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement