Add autotext on new annotation
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user