Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/store/wp-content/plugins/code-snippets/js/manage/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/store/wp-content/plugins/code-snippets/js/manage/priority.ts
import { Snippet } from '../types/Snippet'
import { updateSnippet } from './requests'

/**
 * Update the priority of a snippet
 */
export const updateSnippetPriority = (element: HTMLInputElement) => {
	const row = element.parentElement?.parentElement
	const snippet: Partial<Snippet> = { priority: parseFloat(element.value) }
	if (row) {
		updateSnippet('priority', row, snippet)
	} else {
		console.error('Could not update snippet information.', snippet, row)
	}
}


export const handleSnippetPriorityChanges = () => {
	for (const field of document.getElementsByClassName('snippet-priority') as HTMLCollectionOf<HTMLInputElement>) {
		field.addEventListener('input', () => updateSnippetPriority(field))
		field.disabled = false
	}
}

Hry