Merge "New hook for filters on Special:Contributions form"
[lhc/web/wiklou.git] / docs / contenthandler.txt
index be3f4a7..5f9a0b0 100644 (file)
@@ -1,5 +1,5 @@
 The ContentHandler facility adds support for arbitrary content types on wiki pages, instead of relying on wikitext
-for everything. It was introduced in MediaWiki 1.20.
+for everything. It was introduced in MediaWiki 1.21.
 
 Each kind of content ("content model") supported by MediaWiki is identified by unique name. The content model determines
 how a page's content is rendered, compared, stored, edited, and so on.
@@ -8,6 +8,7 @@ Built-in content types are:
 
 * wikitext - wikitext, as usual
 * javascript - user provided javascript code
+* json - simple implementation for use by extensions, etc.
 * css - user provided css code
 * text - plain text
 
@@ -18,7 +19,7 @@ ContentHandler::getDefaultModelFor($title) as follows:
 
 * The global setting $wgNamespaceContentModels specifies a content model for the given namespace.
 * The hook ContentHandlerDefaultModelFor may be used to override the page's default model.
-* Pages in NS_MEDIAWIKI and NS_USER default to the CSS or JavaScript model if they end in .js or .css, respectively.
+* Pages in NS_MEDIAWIKI and NS_USER default to the CSS or JavaScript model if they end in .css or .js, respectively.
   Pages in NS_MEDIAWIKI default to the wikitext model otherwise.
 * The hook TitleIsCssOrJsPage may be used to force a page to use the CSS or JavaScript model.
   This is a compatibility feature. The ContentHandlerDefaultModelFor hook should be used instead if possible.
@@ -67,8 +68,8 @@ Content serialization formats are identified using MIME type like strings. The f
 * text/x-wiki - wikitext
 * text/javascript - for js pages
 * text/css - for css pages
-* text/plain - for future use, e.g. with some plain-html messages.
-* text/html - for future use, e.g. with some plain-html messages.
+* text/plain - for future use, e.g. with plain text messages.
+* text/html - for future use, e.g. with plain html messages.
 * application/vnd.php.serialized - for future use with the api and for extensions
 * application/json - for future use with the api, and for use by extensions
 * application/xml - for future use with the api, and for use by extensions
@@ -115,9 +116,9 @@ Besides some functions, some hooks have also been replaced by new versions (see
 These hooks will now trigger a warning when used:
 
 * ArticleAfterFetchContent was replaced by ArticleAfterFetchContentObject
-* ArticleInsertComplete was replaced by ArticleContentInsertComplete
-* ArticleSave was replaced by ArticleContentSave
-* ArticleSaveComplete was replaced by ArticleContentSaveComplete
+* ArticleInsertComplete was replaced by PageContentInsertComplete
+* ArticleSave was replaced by PageContentSave
+* ArticleSaveComplete was replaced by PageContentSaveComplete
 * ArticleViewCustom was replaced by ArticleContentViewCustom (also consider a custom implementation of the view action)
 * EditFilterMerged was replaced by EditFilterMergedContent
 * EditPageGetDiffText was replaced by EditPageGetDiffContent
@@ -131,7 +132,7 @@ Page content is stored in the database using the same mechanism as before. Non-t
 appropriate serialization and deserialization is handled by the Revision class.
 
 Each revision's content model and serialization format is stored in the revision table (resp. in the archive table, if
-the revision was deleted). The page's (current) content model (that is, the conent model of the latest revision) is also
+the revision was deleted). The page's (current) content model (that is, the content model of the latest revision) is also
 stored in the page table.
 
 Note however that the content model and format is only stored if it differs from the page's default, as determined by
@@ -165,7 +166,7 @@ There are some new globals that can be used to control the behavior of the Conte
 
 There are some changes in behavior that might be surprising to users:
 
-* Javascript and CSS pages are no longer parsed as wikitext (though pre-safe transform is still applied). Most
+* Javascript and CSS pages are no longer parsed as wikitext (though pre-save transform is still applied). Most
 importantly, this means that links, including categorization links, contained in the code will not work.
 
 * With $wgContentHandlerUseDB = false, pages can not be moved in a way that would change the
@@ -180,5 +181,5 @@ provided a specialized handler for the edit action. This is true for the API as
 unsuspecting recipient. This will also cause client-side diffs to fail.
 
 * File pages provide their own action overrides that do not combine gracefully with any custom handlers defined by a
-ContentHandler. If for example a File page used a content model with a custom move action, this would be overridden by
-WikiFilePage's move handler.
+ContentHandler. If for example a File page used a content model with a custom revert action, this would be overridden by
+WikiFilePage's handler for the revert action.