Add autotext on new annotation

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2026-07-09 08:32:23 -07:00
parent c5b75185cd
commit 39d486633a
2 changed files with 19 additions and 1 deletions

View File

@@ -33,7 +33,8 @@
"MediaWiki\\Extension\\AnatImageViewer\\": "includes/"
},
"Hooks": {
"AlternateEditPreview": "MediaWiki\\Extension\\AnatImageViewer\\AnnotationHooks::onAlternateEditPreview"
"AlternateEditPreview": "MediaWiki\\Extension\\AnatImageViewer\\AnnotationHooks::onAlternateEditPreview",
"EditFormPreloadText": "MediaWiki\\Extension\\AnatImageViewer\\AnnotationHooks::onEditFormPreloadText"
},
"ContentHandlers": {
"annotation": "MediaWiki\\Extension\\AnatImageViewer\\AnnotationHandler"

View File

@@ -23,6 +23,23 @@ class AnnotationHooks {
return true;
}
public static function onEditFormPreloadText( &$text, &$title ) {
if ( $title->getNamespace() === NS_AV_ANNOT ) {
$text = <<<NEWAN
baseImage = ""
[view]
direction = ""
# [annotation.1]
# position =
# leader.1 =
# light = true
NEWAN;
}
return true;
}
/**
* Small helper function to display information on the browser console
*