21 $title->inNamespace( NS_MEDIAWIKI ) &&
23 $title->getText() ==
'Visualeditor-cite-tool-definition.json' ||
24 $title->getText() ==
'Cite-tool-definition.json'
42 $resourceModules =
$resourceLoader->getConfig()->get(
'ResourceModules' );
45 isset( $resourceModules[
'ext.visualEditor.mediawiki' ] ) ||
48 $testModules[
'qunit'][
'ext.cite.visualEditor.test'] = [
50 'modules/ve-cite/tests/ve.dm.citeExample.js',
51 'modules/ve-cite/tests/ve.dm.Converter.test.js',
52 'modules/ve-cite/tests/ve.dm.InternalList.test.js',
53 'modules/ve-cite/tests/ve.dm.Transaction.test.js',
54 'modules/ve-cite/tests/ve.ui.DiffElement.test.js',
55 'modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js',
58 'ext.cite.visualEditor',
59 'ext.visualEditor.test'
61 'localBasePath' => dirname( __DIR__ ),
62 'remoteExtPath' =>
'Cite',
74 if ( ! class_exists(
'VisualEditorHooks' ) ) {
78 $dir = dirname( __DIR__ ) . DIRECTORY_SEPARATOR;
81 'localBasePath' => $dir .
'modules',
82 'remoteExtPath' =>
'Cite/modules',
84 "ve-cite/ve.dm.MWReferenceModel.js",
85 "ve-cite/ve.dm.MWReferencesListNode.js",
86 "ve-cite/ve.dm.MWReferenceNode.js",
87 "ve-cite/ve.ce.MWReferencesListNode.js",
88 "ve-cite/ve.ce.MWReferenceNode.js",
89 "ve-cite/ve.ui.MWReferencesListCommand.js"
92 "ve-cite/ve.ce.MWReferencesListNode.css",
93 "ve-cite/ve.ce.MWReferenceNode.css"
96 "ext.visualEditor.mwcore"
99 "cite-ve-referenceslist-isempty",
100 "cite-ve-referenceslist-isempty-default",
101 "cite-ve-referenceslist-missingref",
102 "cite-ve-referenceslist-missingref-in-list",
103 "cite-ve-referenceslist-missingreflist",
104 "visualeditor-internal-list-diff-default-group-name-mwreference",
105 "visualeditor-internal-list-diff-group-name-mwreference"
114 [
"class" =>
"CiteDataModule" ] );
117 'localBasePath' => $dir .
'modules',
118 'remoteExtPath' =>
'Cite/modules',
119 "class" =>
"ResourceLoaderImageModule",
120 "selectorWithoutVariant" =>
".oo-ui-icon-{name}",
121 "selectorWithVariant" =>
".oo-ui-image-{variant}.oo-ui-icon-{name}",
129 "file" =>
"ve-cite/icons/ref-cite-book.svg"
131 "ref-cite-journal" => [
133 "ltr" =>
"ve-cite/icons/ref-cite-journal-ltr.svg",
134 "rtl" =>
"ve-cite/icons/ref-cite-journal-rtl.svg"
139 "ltr" =>
"ve-cite/icons/ref-cite-news-ltr.svg",
140 "rtl" =>
"ve-cite/icons/ref-cite-news-rtl.svg"
144 "file" =>
"ve-cite/icons/ref-cite-web.svg"
148 "ltr" =>
"ve-cite/icons/reference-ltr.svg",
149 "rtl" =>
"ve-cite/icons/reference-rtl.svg"
152 "reference-existing" => [
154 "ltr" =>
"ve-cite/icons/reference-existing-ltr.svg",
155 "rtl" =>
"ve-cite/icons/reference-existing-rtl.svg"
160 "ltr" =>
"ve-cite/icons/references-ltr.svg",
161 "rtl" =>
"ve-cite/icons/references-rtl.svg"
168 'localBasePath' => $dir .
'modules',
169 'remoteExtPath' =>
'Cite/modules',
171 "ve-cite/ve.ui.MWReferenceGroupInputWidget.js",
172 "ve-cite/ve.ui.MWReferenceSearchWidget.js",
173 "ve-cite/ve.ui.MWReferenceResultWidget.js",
174 "ve-cite/ve.ui.MWUseExistingReferenceCommand.js",
175 "ve-cite/ve.ui.MWCitationDialog.js",
176 "ve-cite/ve.ui.MWReferencesListDialog.js",
177 "ve-cite/ve.ui.MWReferenceDialog.js",
178 "ve-cite/ve.ui.MWReferenceDialogTool.js",
179 "ve-cite/ve.ui.MWCitationDialogTool.js",
180 "ve-cite/ve.ui.MWReferenceContextItem.js",
181 "ve-cite/ve.ui.MWReferencesListContextItem.js",
182 "ve-cite/ve.ui.MWCitationContextItem.js",
183 "ve-cite/ve.ui.MWCitationAction.js",
184 "ve-cite/ve.ui.MWReference.init.js"
187 "ve-cite/ve.ui.MWReferenceContextItem.css",
188 "ve-cite/ve.ui.MWReferenceGroupInputWidget.css",
189 "ve-cite/ve.ui.MWReferenceResultWidget.css",
190 "ve-cite/ve.ui.MWReferenceSearchWidget.css"
193 "oojs-ui.styles.icons-alerts",
194 "oojs-ui.styles.icons-editing-citation",
195 "oojs-ui.styles.icons-interactions",
196 "ext.cite.visualEditor.core",
197 "ext.cite.visualEditor.data",
198 "ext.cite.visualEditor.icons",
201 "ext.visualEditor.mwtransclusion",
202 "ext.visualEditor.mediawiki"
205 "cite-ve-changedesc-ref-group-both",
206 "cite-ve-changedesc-ref-group-from",
207 "cite-ve-changedesc-ref-group-to",
208 "cite-ve-changedesc-reflist-group-both",
209 "cite-ve-changedesc-reflist-group-from",
210 "cite-ve-changedesc-reflist-group-to",
211 "cite-ve-changedesc-reflist-item-id",
212 "cite-ve-changedesc-reflist-responsive-set",
213 "cite-ve-changedesc-reflist-responsive-unset",
214 "cite-ve-dialog-reference-editing-reused",
215 "cite-ve-dialog-reference-options-group-label",
216 "cite-ve-dialog-reference-options-group-placeholder",
217 "cite-ve-dialog-reference-options-name-label",
218 "cite-ve-dialog-reference-options-responsive-label",
219 "cite-ve-dialog-reference-options-section",
220 "cite-ve-dialog-reference-placeholder",
221 "cite-ve-dialog-reference-title",
222 "cite-ve-dialog-reference-useexisting-full-label",
223 "cite-ve-dialog-reference-useexisting-label",
224 "cite-ve-dialog-reference-useexisting-tool",
225 "cite-ve-dialog-referenceslist-contextitem-description-general",
226 "cite-ve-dialog-referenceslist-contextitem-description-named",
227 "cite-ve-dialog-referenceslist-title",
228 "cite-ve-dialogbutton-citation-educationpopup-title",
229 "cite-ve-dialogbutton-citation-educationpopup-text",
230 "cite-ve-dialogbutton-reference-full-label",
231 "cite-ve-dialogbutton-reference-tooltip",
232 "cite-ve-dialogbutton-reference-title",
233 "cite-ve-dialogbutton-referenceslist-tooltip",
234 "cite-ve-reference-input-placeholder",
235 "cite-ve-toolbar-group-label",
236 "cite-ve-othergroup-item"
253 global $wgCiteStoreReferencesData, $wgCiteCacheRawReferencesOnParse;
254 if ( !$wgCiteStoreReferencesData ) {
258 if ( $refData ===
null ) {
261 if ( $wgCiteCacheRawReferencesOnParse ) {
263 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
269 $ppValue = FormatJson::encode( $refData,
false, FormatJson::ALL_OK );
271 $ppValue = gzencode( $ppValue, 9 );
274 foreach ( $ppValues as $num => $ppValue ) {
275 $key =
'references-' . intval( $num + 1 );
289 global $wgCiteStoreReferencesData, $wgCiteCacheRawReferencesOnParse;
290 if ( !$wgCiteStoreReferencesData || $wgCiteCacheRawReferencesOnParse ) {
294 if ( method_exists(
$linksUpdate,
'getAddedProperties' )
295 && method_exists(
$linksUpdate,
'getRemovedProperties' )
299 if ( !isset( $addedProps[
'references-1'] )
300 && !isset( $removedProps[
'references-1'] )
305 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
309 $cache->delete( $key, WANObjectCache::MAX_COMMIT_DELAY );
317 $config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig(
'cite' );
318 $vars[
'wgCiteVisualEditorOtherGroup'] = $config->get(
'CiteVisualEditorOtherGroup' );
319 $vars[
'wgCiteResponsiveReferences'] = $config->get(
'CiteResponsiveReferences' );
331 $config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig(
'cite' );
332 $data[
'citeresponsivereferences'] = $config->get(
'CiteResponsiveReferences' );
static onContentHandlerDefaultModelFor(Title $title, &$model)
Convert the content model of a message that is actually JSON to JSON.
static onResourceLoaderGetConfigVars(array &$vars)
Adds extra variables to the global config.
static onResourceLoaderRegisterModules(ResourceLoader $resourceLoader)
Conditionally register resource loader modules that depends on the VisualEditor MediaWiki extension.
static onLinksUpdateComplete(LinksUpdate $linksUpdate)
Callback for LinksUpdateComplete hook If $wgCiteCacheRawReferencesOnParse is set to false,...
static onLinksUpdate(LinksUpdate $linksUpdate)
Callback for LinksUpdate hook Post-output processing of references property, for proper db storage De...
static onAPIQuerySiteInfoGeneralInfo(ApiQuerySiteInfo $api, array &$data)
Hook: APIQuerySiteInfoGeneralInfo.
static onResourceLoaderTestModules(array &$testModules, ResourceLoader $resourceLoader)
Conditionally register the unit testing module for the ext.cite.visualEditor module only if that modu...
const EXT_DATA_KEY
Key used for storage in parser output's ExtensionData and ObjectCache.
const MAX_STORAGE_LENGTH
Maximum storage capacity for pp_value field of page_props table.
const CACHE_DURATION_ONPARSE
Cache duration set when parsing a page with references.
Class the manages updates of *_link tables as well as similar extension-managed tables.
Dynamic JavaScript and CSS resource loading system.
Represents a title within MediaWiki.
static configuration should be added through ResourceLoaderGetConfigVars instead & $vars
either a unescaped string or a HtmlArmor object after in associative array form externallinks $linksUpdate
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext such as when responding to a resource loader request or generating HTML output & $resourceLoader
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))